Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

New answers tagged

2 votes

Rust program to print citations in Chicago author-date style

Nice project! From previous experience writing citation formatting in Rust (just a small side project) I would advise you to not try to follow the standards to the letter, that is just a extreme pile ...
user avatar
  • 31
0 votes

Add 'ing' or 'ly' suffix to a string

It's all good but how about this method ...
user avatar
  • 1
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
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

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
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,535
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,615
0 votes

Modify a string by identifying a substring, and replace it and the characters following it with a newly computed substring

Create a function that does the replacing It is good practice to create a function for what you are doing. A function will have a name that describes what it is doing, and it clearly defines the input ...
user avatar
  • 32.6k
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

Top 50 recent answers are included