Skip to main content

New answers tagged

3 votes

Guess a Number Game

Observations: PEP 8 suggests using snake case for function names. A name like GuessNum is appropriate for a class, but a function should be something like ...
Chris's user avatar
  • 6,126
2 votes

E-car-sharing problem with charging between the bookings

Comments Remove all commented-out code to reduce clutter. Here are some examples: ...
toolic's user avatar
  • 16.4k
1 vote

Optimizing DataFrame iteration when generating large hierarchical text files

Long story short, use more Pandas and use fewer lists and classes. Whereas - given the current number of blocks and registries - representing the subframes as separate objects isn't a big deal, it isn'...
Reinderien's user avatar
  • 71.2k
1 vote

Optimizing DataFrame iteration when generating large hierarchical text files

consistent naming There is almost nothing to the Block class, yet we wind up with this: ...
J_H's user avatar
  • 43.3k
1 vote

Optimizing DataFrame iteration when generating large hierarchical text files

Here are some minor coding style suggestions. Simpler When I run the code, I see output like: Time take to write sped (in seconds): 0.9321348667144775 You could ...
toolic's user avatar
  • 16.4k
4 votes

Jump point search in Java for faster pathfinding in grid mazes

To handle diagonal moves that cross walls, you need to relax the corner-blocking logic in both the jumper and the neighbour finder. Right now, your ...
gdoura mohamed's user avatar
4 votes

SIFT Keypoint Detection for Image in C++

About get_potential_keypoint template function This function uses nested #pragma omp parallel for loops. All threads created by ...
JimmyHu's user avatar
  • 7,575
0 votes

Calculate the median value of combining two sorted lists

Let's break the merging of two lists out into a function. And for fun, let's have the function return an iterator rather than eagerly working on both lists. ...
Chris's user avatar
  • 6,126

Top 50 recent answers are included