Skip to main content

New answers tagged

9 votes
Accepted

Reed-Solomon LFSR encoder

I'm interested if the code below could be further enhanced for out of order execution Maybe. One thing I noticed is that the output of a vgf2p8affineqb (medium ...
user555045's user avatar
  • 12.4k
1 vote

Primality test in Python

A commentary on the style of smallestr and control flow. ...
Chris's user avatar
  • 4,564
3 votes

Dijkstra's algorithm for non-uniform undirected hypergraphs: Take II - bidirectional Dijkstra's algorithm with excellent performance

Always document your generic parameters. Since all methods in the class take the same parameters, it might be easier to document them if the methods were instance methods instead of static. You have ...
TorbenPutkonen's user avatar
2 votes

Convert WKT representations of geometries into GeoJson

Coordinates - are doubles. So regexp is a little more complicated. ...
Aleks McFly's user avatar
8 votes

BRESort - Bitwise Relationship Extraction - Intelligent Adaptive Sorting Engine for 32/64-bit & Floating-Point Data

Naming A consistent prefix is useful, yet code makes public ...
chux's user avatar
  • 36.4k
9 votes

BRESort - Bitwise Relationship Extraction - Intelligent Adaptive Sorting Engine for 32/64-bit & Floating-Point Data

I advise against having an interface start out as elaborate as in bresort_research.h - imagine having to keep everything backwards compatible. I see a lot of code repeating - a maintenance nightmare ...
greybeard's user avatar
  • 7,691
4 votes

My BRESort adaptive sorting engine in C

Compiler warnings Code performs about 10 casual signed to/from unsigned conversions. Consider enabling more compiler warnings to identify. Array sizing As an alternative for ...
chux's user avatar
  • 36.4k
4 votes

My BRESort adaptive sorting engine in C

In addition to the previous answers, here are some other minor suggestions. Documentation There are a lot of helpful comments. It would be good to explain what "BRE" stands for, if it is an ...
toolic's user avatar
  • 15.8k
6 votes

My BRESort adaptive sorting engine in C

I think overall readability OK. There is an ambiguity in the documentation in the header: Minimal memory overhead (256 bytes) - does this mean maximal overhead is ...
greybeard's user avatar
  • 7,691
8 votes

My BRESort adaptive sorting engine in C

Without seeing all of the code, based only on what I can see, I'm not a fan of the 0, 1, and ...
Chris's user avatar
  • 4,564
1 vote

Snake game in pygame with varying velocity

Imports The import lines should precede all executable code; move the init call: ...
toolic's user avatar
  • 15.8k
4 votes

Histogram of Image using std::map in C++

This if/else is unnecessary: ...
screwnut's user avatar
  • 339
3 votes

Image Stitching using SIFT Keypoint Descriptor in C++

G. Sliepen has provided a good general overview; I'm focusing on find_raw_matches here. There are two major issues with it: Lowe's ratio test is only reliable ...
Mark's user avatar
  • 531
3 votes

Prime factorization for integers with up to 9-digit long prime factors

I would look up the pollard-rho algorithm. It doesn’t involve any higher mathematics, so you can implement it yourself. If a number n has a prime factor p, that prime factor can be found in about sqrt(...
gnasher729's user avatar
  • 2,970
4 votes

Project Euler #909: L-Expressions I

Analyze looking for intelligence One answer already mentioned that your approach is basically brute force. This is due to simply iterating through all. Looking at the possible steps: A(u) → u+1 Z(u)(...
Joop Eggen's user avatar
  • 4,656
7 votes

Find the smallest semiprime satisfying a bunch of conditions

To do this a lot faster: You want to know whether say nine numbers are all primes. The obvious way of checking this is to test if the first number is prime, if it is prime then check the second number ...
gnasher729's user avatar
  • 2,970
3 votes

Project Euler #909: L-Expressions I

I don't spend a lot of time on Code Review, but I noticed this question in HNQ and let it stew in the background for a month or so before I found a solution. This answer isn't a review of the code in ...
phoog's user avatar
  • 296
6 votes
Accepted

Image Stitching using SIFT Keypoint Descriptor in C++

Congratulations on getting this far; doing image stitching is far from trivial! The next step to make it looking truly professional is a more sophisticated blending algorithm for the overlapping ...
G. Sliepen's user avatar
  • 69.3k
5 votes

Find the smallest semiprime satisfying a bunch of conditions

repr repr_a = str(a) I found repr_a a confusing name for this, given that we didn't call ...
J_H's user avatar
  • 42.2k
7 votes

Find the smallest semiprime satisfying a bunch of conditions

As you only use isprime and factorint from sympy it would clean up your code to just import ...
Chris's user avatar
  • 4,564
7 votes

Find the smallest semiprime satisfying a bunch of conditions

any other feedback is welcome too Here are some general coding style recommendations. Documentation The PEP 8 style guide recommends adding a docstring at the top of the code to describe its purpose. ...
toolic's user avatar
  • 15.8k
2 votes

Allowing a user to draw their own avatar in Turtle

Documentation The PEP 8 style guide recommends adding docstrings for functions and at the top of the code. For example, summarize the purpose of the code: ...
toolic's user avatar
  • 15.8k

Top 50 recent answers are included