The Win32 API has a so-called 'high performance counter' (QueryPerformanceCounter() and friends) but often it is neither precise enough nor reliable enough, do to high jitter.
The low resolution is no surprise since the value is often derived by shifting off the 10 low bits of the CPU's time st...
I'm trying to create a canvas project inspired by this gif where colors of an image are averaged and animated.
Thus far I have all of the functionality working but it only performs well with a large cell size, meaning using fewer fillRects.
Is there any way to chain these fillRects together an...
I recently finished the Build a Personal Portfolio Webpage project for
Free Code Camp, here, I would be very grateful if anyone would be willing to offer any advice on the design of the website or on HTML, SCSS, or jQuery coding practices.
I don't want to seem ungrateful in any way, but would it be possible to have a choice between a Code Review mug and the Code Review Rubber Duck?
I just see myself using a mug more than a rubber duck, and I don't have kids to give it to.
I am trying to implement some sorting algorithm in C++. The first step alone forced me to implement an array view type and some strange new iterator type.
And I'll need to implement some hybrid bastard between a list and a tree for the second part.
Although if you're interested, take a look at the highest voted Q&As for inspiration / see how they're crafted
I would suggest janos' work, Joseph the Dreamer's work, Eric Lippert's work for that; they're all usually structured differently, but high-quality nonetheless
@someFolk The best questions usually have a title that describes what the code does in a few words, then include a good plain English explanation of what the code is for (and context, e.g. the "how" and "why", if applicable), then of course the code
I am making a quiz game for my school project. The language I'm using is Python 2.7.10, however, when testing what I have done so far, I get the error "Invalid syntax" and marks the "or' in the code, check the code below and inform me of any errors I have made in the code. And the invalid syntax ...
@someFolk usually people start with a description of what the code is doing, why some design decisions were taken, what concerns they have, followed by the code itself, usually each code file in its own code block (topped with a short description of the code file's purpose) - icing on the cake is a catchy title that roughly describes what problem your code is solving
oh wow
q2 = raw_input ("What era of time did Leonardo Da Vinci live in?: ")
if q2 == "C": or q2 == "c"
print "You must have played Assassin's Creed 2"
The system is well enough designed that mods should only need to intervene in exceptional cases, IMHO (not complaining or anything, you mods are great :)
I recently finished the build a personal portfolio webpage project for
a free Code Camp, here, I would be very grateful if anyone would be willing to offer any advice on the design of the website or on HTML, SCSS, or JavaScript coding practices.
(function($) {
$(document).ready(function() ...
@Vogel612 Not sure... a lot of the technical details probably wouldn't be very interesting, for example. Perhaps we could be better about mentioning that graduations occurred at least, though.
I have the following code to test whether the binary tree is the Binary Search Tree. However, it gives a false negative. I can not find a mistake in my code. Could anybody help me spot it?
public boolean isBST(BinaryNode node){
if(node==null) return true;
if(node.left!=null && node.left...
I'm afraid this question does not match what this site is about. Code Review is about improving existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our help center for more information. — Quill9 secs ago
What have you tried? Are there errors with the example code snippet you have pasted? Have you read the docs for either of the crates you have used? Stack Overflow isn't a code-writing service. If your code works but you wish to improve it, then Code Review might be a better location for your question. What about other questions about splitting a vector into parts for parallel processing; how does this question differ? — Shepmaster49 secs ago
This question is intended to be the counterpart of: Checklist for how to write a good Code Review question
Getting started with CodeReview:
New users often seem to have problems to understand, what exactly is expected from a CR-Answer. Many come from Stackoverflow, others maybe from Programmer...
There are all kinds of problems that can be pointed out in a code review. Good answers point out
Genuine bugs
Security holes
Misconceptions
Inefficiencies in the algorithm
Inefficiencies in expression
Poor use of data structures
Violations of accepted programming practices
Advice to understand...
@Phrancis So write it vanilla at first and see if it makes it easier when it becomes big?
I have written the below script for use in Python 2.7.x. In essence, I want the script to access a folder contained within the directory the script is and then add all files contained within to a list. I'm then looking to open these files using the csv module and process each line for now.
My sc...
Although for something like a rhythm game I would expect a MIDI or other such data format (where tempo and rhythm elements are just data points in the file) rather than audio
This question is a follow-up of this one; where I present a software to plan and manage drone races. I might come with a new question about the SQL part in a few days as well.
Since then, on top of the changes in documentation that I made in my own answer, I included the gettext module and chang...
> More than 30 answers posted to this question – Community♦ 4 mins ago More than 10 answers posted to this question in the past 7 days – Community♦ 7 hours ago
This program is some classes that enable precise ant simulation inspired by SimAnt. It doesn't do it off the batch; there must be code that instructs the ants to follow scent tiles in particular and react to the food.
Since this program has multiple files, it must be shown in GitHub.
(sidenote:...
The question above is an abstract example of a common problem I encounter in legacy code, or more accurately, problems resulting from previous attempts at solving this problem.
I can think of at least one .NET framework method that is intended to address this problem, like the Enumerable.OfType<T>...
This program is some classes that enable precise ant simulation inspired by SimAnt. It doesn't do it off the batch; there must be code that instructs the ants to follow scent tiles in particular and react to the food.
Since this program has multiple files, it must be shown in GitHub.
(sidenote:...
although, it could be improved by adding a bit of description of what each file is meant to accomplish, and more importantly what concerns you have about the code (although "interested in any & all feedback" is implied in all CR questions)
In the community box at the moment is a link to a Stack Overflow Developer Survey, however viewing this box on sites other than Stack Overflow, it uses the site's icon instead.
The cause is on the favicon icon div:
Instead of a class of favicon-<sitename>, it should be favicon-stackoverflow.
Much needed feature request...especially for the job seekers. Scenario, you've applied for a job via the jobs link on SO. You wait..and wait..and wait..and wait..and continue waiting. You search for this same job and the UI presents you with this:
The mail icon simply signifies that you've ...
How to define an object which holds repatative information has been something on my mind for quite a while, so hoping that someone can inform me on how this should be done (what's generally accepted, strongly typed, efficient, complaint with some styling, etc). I'm using Javascript here, but woul...
@EBrown If you want to simplify it, I would suggest giving yourself limits on edge cases, saying "I don't care for emails with xyz characters" that aren't normal
I am having users which are admins for one or many Store entities. With Spring Security I am already checking if a user is logged in, but of course, this does not prevent a user to send me some requests with wrong IDs.
For example: A user has a store that has some items with IDs 1, 2, 3. But the...
What you have here is a computed property.
Swift properties can either be computed or stored. We can observe value changes in our stored properties by using didSet and willSet but here we still have a stored property.
In your case, since you have overridden set and get*, you don't have a store...
"accepted best practice" and "other improvements" can easily fall into the category of opinion. I don't think it's useful to try making the case that Code Review answers don't contain a large amount of opinion.
Whether or not a particular piece of code conforms to accepted best practice could be fact. The best practice in itself could very easily be opinion.
I'm reading through the example of the Strategy Pattern on Wikipedia:
https://en.wikipedia.org/wiki/Strategy_pattern#C.23
In this example there's an ICalculate interface, which is implemented by each kind of class that can do a calculation.
Next there's a CalculateClient which can also do a c...
When should a answer be "accepted" since in Code Review it is a opinion review, and not a fact-based answer that points to a problem in a code (or something like that), and any opinion can be good enough?
For example, user A says a opinion and user B says another in their reviews. But which one ...
@Gustavo6046 Probably since there are already a lot of questions about which answer you should accept. A downvote can indicate as much as 'OP did not perform any research'.