2022 Developer Survey is open! Take survey.

Hot answers tagged

4 votes
Accepted

Split string by last occurence of character within a range

You can use the index and range operators instead of SubString calls ...
user avatar
  • 5,525
3 votes

Generic splitting in Haskell

I agree with the previous poster that behavior of split is unexpected and should be changed, but instead of talking about that, I will add a few style suggestions. My first suggestion is to put your ...
user avatar
  • 155
2 votes
Accepted

Text splitter using Regular Expressions in Python

Include spaces after commas. It's a virtually costless habit and it helps with code readability and editability. Constants are typically named with uppercase. Your program begins with several ...
user avatar
  • 9,585
2 votes
Accepted

Split large strings into parts by last index of character and by max length

since your method is for requests payloads, you need to use memory-friendly approaches. I don't know how often the method would be called, and how much requests at average your application would ...
user avatar
  • 4,503
2 votes

Excessive space C++ string

Good first attempt: BUT Your implementation is O(n²). ...
user avatar
  • 91.5k
1 vote
Accepted

Integer array to string

result is not zero-terminated. You should allocate one byte more. To my taste, there are too many allocations. Compute the required size, and allocating once. You ...
user avatar
  • 53.1k
1 vote
Accepted

OAuth implementation for Puredata

Almost certainly, Coverity is simply looking for all uses of strcat, strcpy, sprintf, etc., ...
user avatar
1 vote

Find the 'n' most frequent words in a text, aka word frequency

Comments are inline in /// ...
user avatar
  • 121

Only top scored, non community-wiki answers of a minimum length are eligible