« first day (2766 days earlier)      last day (55 days later) » 

12:00 AM
RELOAD! There are 7135 unanswered questions (89.7289% answered)
 
 
2 hours later…
2:01 AM
0
Q: Get signal name from signal number

QwarkI am trying to get a signal name to print when getting a signal number. I actually have : char* getsig(int sig){ switch (sig) { case SIGKILL: return "SIGKILL"; case SIGSTOP: return "SIGSTOP"; case SIGTERM: return "SIGTERM"; case SIGTRAP: ret...

 
2:50 AM
0
Q: Class definition for shared_ptr and weak_ptr C++

Angelic DemonicSo I'm learning to implement my own shared_ptr and weak_ptr in c++, anyone can go through the class definition with the properties and method that I need to have for those 2? Thanks a lot. template<class T> class Shared_ptr { private: * T = nullptr; T* refcounts = nullptr public: //Don't know w...

 
3:15 AM
0
Q: Adding, removing, and changing user names and passwords in .htpasswd with PHP

tonySome code I wrote to add, remove, and change user names and passwords in .htpasswd with PHP: function adduser($user, $pass) { try { $htpasswd = '.htpasswd'; //$hash = '{SHA}'.crypt($pass, base64_encode($pass)); $hash = crypt_apr1_md5($pass); //APR1-MD5 $co...

 
 
3 hours later…
5:46 AM
0
Q: Detecting cycle in directed graph using DFS

sjsBelow is my code for solution to the Course Schedule problem from Leet Code (problem 207) https://leetcode.com/problems/course-schedule/ However there is one case which I'm not sure how to solve. The case if you start from a sink in the graph. In that case my code says there is a cycle when the...

 
Questions about how to improve code that already works belong on codereview.stackexchange.com instead of StackOverflow. — Nate Eldredge 18 secs ago
 
6:11 AM
0
Q: Printing colourful text to terminal

Ch3steRI used ANSI escape code for printing colorful text to the terminal. Directory Tree: I named it cerminal :p as in colorful terminal. cerminal/ ├── __init__.py ├── util.py ├── colors.py Code __init__.py from cerminal.colors import BackgroundColor, FontColor, FontStyle from cerminal.utils im...

 
 
3 hours later…
8:42 AM
@Vogel612 Naturally. I think I saw a post about that once on MSE.
 
9:30 AM
0
Q: Can be made faster? "Count all subnumbers of a number which are divisible by a given "prime" number."

Mohammad Ali NematollahiAssume we are given a number and a prime number, say number and p, respectively. I want to count all subnumbers of number which are divisible by p. Here's my code: number = input() p = int(input()) print([int(number[i : j]) % p for i in range(len(number)) for j in range(i + 1, len(number) + 1)].c...

 
9:45 AM
possible answer invalidation by FatalSleep on question by FatalSleep: codereview.stackexchange.com/posts/252730/revisions
This question will be more appropriate on codereview then here. — Titus 25 secs ago
 
0
Q: Readability vs. maintainability: nested functions

Teodor CiuraruWhat are the pros and cons of each option, considering long-term implications (increasing the number of functions / parameters, other developers taking over, etc.)? Option 1: removes the need to pass foo and bar to each method, but will create nested functions that are hard to follow. const myFun...

 
10:20 AM
0
Q: Python number generation

lokalookIm learning python from cs106. Please reviews my code for khan sole academy, I think my code not efficient. Please add critique and advice for beginner like me. Thanks import random MIN_NUM = 10 MAX_NUM = 99 row = 0 def main(): """ Pre Condition: Generate random number. Additional nu...

 
@Mast I do hope that answered your question, but I can't tell from that reply ...
 
10:35 AM
0
Q: Readability vs. maintainability: nested functions

Teodor CiuraruWhat are the pros and cons of each option, considering long-term implications (increasing the number of functions / parameters, other developers taking over, etc.)? Option 1: removes the need to pass foo and bar to each method, but will create nested functions that are hard to follow. const myFun...

Is this considered hypothetical ? ☝
I think it falls under "generic best practices". foo, bar, function1, function2, myFunction
But im not sure
 
10:49 AM
@AryanParekh if you think it falls into that category, you should vote (or flag) accordingly
 
11:03 AM
@Titus codereview sent me back by not posting concrete examples and I can't reveal my codebase at the moment. — Teodor Ciuraru 29 secs ago
 
11:35 AM
0
Q: How to make arm assembly code optimal and clear

hitomi laylaThe following is a program I wrote for an assignment. It runs with no problems. It removes "the" if found as a word in a string. I am posting to ask of ways to make the code better. The reason is my friend showed me his code and it was much shorter and much more clearer than mine (is he smarter t...

 
12:00 PM
0
Q: How to Copy Firebases' Data to another Firebase

bigjeon33I am a student studying Android Studio. I want to implement the "cart" functionality using Firebase. After searching for an item with the primary key value in the previously saved Firebase, I want to copy the item's data to another Firebase. The existing saved Firebase is default, and the referen...

 
 
1 hour later…
1:09 PM
Monking
 
 
1 hour later…
2:24 PM
Monking
 
Monking
@Vogel612 Yea, well, yes. It does.
There's a 3k+ user on CR that has a boatload more on SO with a ban till next year for voting irregularities that also has multiple vote reversals on CR this month. All looks a bit suspicious, that's all.
 
mumble mumble flag? mumble
 
Naturally.
 
thanks for the heads up :)
 
2:39 PM
Np
 
3:18 PM
Possibly a question for codereview? — hd1 40 secs ago
 
4:09 PM
0
Q: Message handler

bw_devThe code bellow is code of "Hello" message handler. It works, but I really don't like as it looks. The "hello" protocol contains three messages: client -> server: diffie-hellman client public parameters server -> client: diffie-hellman server public parameters client -> server: used data Could ...

0
Q: Is it okay to use interfaces on tests?

FukkaI have created a test, also the interfaces to be implemented for each test case based on user's role because I think it would make it easier to understand what the test case will and should do, also forces each test that has similar requirements to have consistent method naming. I want to make su...

 
 
2 hours later…
6:16 PM
0
Q: Mutating input List method argument to add new item

Vinayak DornalaI really don't like the idea of method (especially public) mutating state of input argument. I been thinking to see what will be the better way of achieving this without violatation. I wrote a sample code to compare two ways of updating list (There are other ways of doing this and I am interested...

 
 
1 hour later…
7:44 PM
Wouldn't this be better suited for codereview.stackexchange.com? — Uwe Keim 10 secs ago
 
8:23 PM
0
Q: Merging values into an object

balexandreI created an algorithm that helps me merging a payload into a given fixed object, in other words this payload const requestPayload = { "customer_email": "me@domain.com", "customer_name": "unit test", "customer_firstname": "unit", "customer_lastname": "test", "customer_phone": "...

 
9:14 PM
0
Q: How to make my code with for/if loop more efficient in R

KateMy code is structured so that I create an ellipse through my first three points of data. Then I go through each next row, and if the point falls outside the ellipse, I record the minimum distance between the point and ellipse. These points have datetime associated with it so I can only keep point...

 
 
2 hours later…
11:40 PM
possible answer invalidation by Vinayak Dornala on question by Vinayak Dornala: codereview.stackexchange.com/posts/252831/revisions
 

« first day (2766 days earlier)      last day (55 days later) »