« first day (2902 days earlier)      last day (1098 days later) » 

12:01 AM
RELOAD! There are 7507 unanswered questions (89.4758% answered)
 
12:57 AM
0
Q: Fibonacci generator python implementation

MalemnaI wrote this code for a fibonacci sequence generator, can anyone tell me whether my code is designed well if not, why? Thank you import logging def fibonacci_calc(current_val, current_pos=0, max_seq_length=5, sequence_list=[]): try: if(current_pos != 0 and len(sequence_list) == 0): ...

 
1:27 AM
0
Q: Pairwise summation in Haskell, take two

Pierre AbbatHere's my second try at pairwise summation in Haskell: pairwiseSum :: (Num a) => [a] -> a pairwiseSum [] = 0 pairwiseSum [x] = x pairwiseSum x = pairwiseSum (sumPairs x) sumPairs :: (Num a) => [a] -> [a] sumPairs [] = [] sumPairs [x] = [x] sumPairs (x:y:xs) = ((x + y) : sumPairs xs) I ran both ...

 
1:47 AM
In the function you are iterating for x in df['Name1']. This will loop over every value in the Name1 column of the data frame. I think you should post your question on Code Review Stack Exchange which is more geared toward helping new programmers learn to program and write better code. — augurar 33 secs ago
This question is better suited to Code Review Stack Exchange. — augurar 7 secs ago
I did not know about code review stack exchange. Thanks for letting me know. Unfortunately, I am still not understanding how to consider the difference. Should I replace df['Name1'] with diff? — Val 45 secs ago
 
 
2 hours later…
3:41 AM
Monking
 
-1
Q: Math Code not working

AndreyI am currently new to Python and am trying it out by making a code that's going to ask you different questions which are math related. This is how it's supposed to work : At first, you are asked to choose a level of the questions you're going to be asked. It's either easy, medium, or hard. Then, ...

 
4:18 AM
@CaptainObvious Not ready for review then.
 
 
2 hours later…
6:10 AM
@PeterDuniho . . . I agree about the reasoning why this question is closed. I also think that it would be better to put questions that ask for opinions and alternative ways to implement working code on Code Review Stack Exchange. — Bart Hofland 46 secs ago
 
6:34 AM
0
Q: Scanning multiple strings in one line to a pointers array in C

Coder48I'm trying to write a code for a function that takes an empty array of pointers and its length n. And scans n strings of max length of MAX_LEN (a defined constant) until a new line is given by the user. The strings are separated by one space. int scan_strings(char * words[], int n) { char cur...

 
 
1 hour later…
7:44 AM
If your code is working, then your question is more properly asked on CodeReview.StackExchangeDavid C. Rankin 18 secs ago
Please post your question at the StackExchange CodeReview site. — ivan.ukr 12 secs ago
 
8:01 AM
Read up on the concepts on CodeReview site. You might have to adapt your post. They will have something similar to what we have here How to Ask. For here I join the close-votes as "opinion based", to reflect the impression that the adapted question could be asked on CodeReview. — Yunnosch 54 secs ago
 
8:19 AM
0
Q: Implementation of the trigonometric functions for real time application

SteveI have been developing a real time application in C and I need to calculate sine and cosine of a given angle in radians. In respect to the fact that the application is a real time application the functions from the standard library are not suitable for my purposes due to the fact that there is no...

0
Q: Deduplicate << operator implementation on inheritance

Richard NeumannI have the following working code: person.h #ifndef PERSON_H #define PERSON_H #include <iostream> #include <string> class Person { private: std::string firstName; std::string middleName; std::string lastName; public: Person() = default; Person (std::string pFirstName, std::...

 
possible answer invalidation by raf on question by raf: codereview.stackexchange.com/posts/259468/revisions
 
8:32 AM
@Julia5049 If you have some code ... and it is not working, include in your question here, and tell us where it breaks (see minimal reproducible example). If your code is working, read the help on codereview.stackexchange.com and consider asking for a review of your code there. — GhostCat 56 secs ago
 
9:13 AM
0
Q: Implementation of the basic matrix operations for embedded application in C++

L3sekI have been developing a control software in C++ and for implementation of the control algorithms I need basic matrix operations like addition, subtraction, multiplication and multiplication by scalar. Due to the fact that the application is the real time application I need to avoid the dynamic m...

 
If your code works then this is the wrong forum, try your luck here. Also provide input and generated output. — Definitely not Rafal 59 secs ago
 
9:54 AM
What is the actual question? For code reviews see codereview.stackexchange.comJonasH 21 secs ago
Thanks @augurar - do I need to transfer the question over to 'Code Review' Stack Exchange is that even possible? I hope the useful answers above and below will not be lost. — Badger 52 secs ago
 
10:56 AM
0
Q: Reducing repetition for same methods implemented for different types

Przemyslaw WilkI'll start by saying that I just started learning Go coming from Python (and some basic on Java), so I am trying to understand how to write Go code in more idiomatic way and not in a Python way. Any feedback on that would be appreciated! About the exercise: In this exercise I need to implement ke...

0
Q: Rust: Invoking function stored in struct without copying

captain-inquisitiveHow can I invoke a function stored in a struct? I have a struct which wraps a function that requires two parameters. The code fails compilation with cannot move out of self.state which is behind a shared reference Things I've tried The error gets resolved if I set S: Copy but I'm trying to avo...

 
(1) I believe your question is too big, too ambiguous in a sense. (2) The description of the r tag even suggests "Please provide minimal and reproducible example(s) along with the desired output", and it does not appear that you've attempted to reduce the problem. Perhaps this question is a better fit for Code Review, where working and complex problems are more appropriate? — r2evans 24 secs ago
I’m voting to close this question because it is not about programming as defined in the help center but about code review. — desertnaut 49 secs ago
 
11:25 AM
0
Q: Functional Programming Style in Javascript Picking a Random Item from an Array

Melvin IdemaI'm trying to understand the Functional Programming Paradigm (or style) implemented with Javascript. There are a few things I have difficulties with. The naming conventions, and dependency injections. I would be super happy if you could help me out with these two problems. const items = ['🐶', '�...

 
11:47 AM
0
Q: Is there a way to make this php code better or simpler?

GassI'm using Laravel and this PHP method is in a controller. It's the back-end for a edit profile page. The user can change the profile picture, reset the password, the username, and so on. I'm new in PHP and would like to know if there is a better or simple way to code this. public function update(...

 
12:20 PM
0
Q: Can I refactor my code anymore?

ChandlerI have written one method; however I feel I can refactor it even more but not sure what Can someone help me here? public static PaymentOptions GetPaymentOptions_NonGBCulture(TestConfigurationCDO testConfiguration, int siteId) { var paymentOptions = default(PaymentOptions); ...

 
12:44 PM
0
Q: stable producer/consumer threads in python

RaubsaugerI have implemented a producer/consumer functionality using threads in a given framework and I'm pretty sure I did not cover all possible scenarios. I made a small reproducible version. Lines ending with # simulate the functionality of the framework. In the original code the total number of produc...

 
 
1 hour later…
2:07 PM
Ryan Donovan on April 14, 2021
The jumping off point for exploring quantum computing is to understand that while many of the principles are counterintuitive, the classical universe we know and love is but a mere shadow of the quantum fabric of reality. To get a feel for that fundamental difference we will walk through an example that helps to illustrate the power of quantum computation.
 
 
1 hour later…
3:35 PM
0
Q: How does a moderator or a relative of a moderator inform the community if they are incapacitated?

pacmaninbwI consider it necessary that a moderator log into code review at least once a day to perform moderation tags such as handling flags. If the moderator goes on vacation I assume they notify the other moderators before they do so that someone can take up the slack. How can the community be notified ...

 
Monking
 
Monking @skiwi
 
On to day number X with projects where you're ten goals behind before starting or that are plain impossible... sigh
 
3:55 PM
If your code works, and you want a review of all aspects of the code (including "efficiency", performance, etc.), check the help center to see if your question is on topic on Code Review. — Heretic Monkey 31 secs ago
 
4:18 PM
0
Q: Avoid mixing promises and await/async

user3378165On the following function I have promises ans await/async and I think it might be confusing but not sure how can I change that, any advise? export async function fetchFilesAsImages(filesUrls, onProgress) { return ( await Promise.all( filesUrls.map(async file => { const data = ...

0
Q: Math Code isn't working

AndreyI am currently new to Python and am trying it out by making a code that's going to ask you different questions which are math related. This is how it's supposed to work : At first, you are asked to choose a level of the questions you're going to be asked. It's either easy, medium, or hard. Then, ...

 
@CaptainObvious deja vu though code is altered so not technically a duplicate
 
4:38 PM
Formatting hasn't improved much either.
 
@Peilonrayz Thank you the edit to the title made the question more appropriate.
 
@pacmaninbw Wanna clean up obsolete comments?
Oh and np btw
 
Sure!
@Peilonrayz What obsolete comments? ;)
 
@pacmaninbw I'm not sure it's grammatically correct though @Peilonrayz
I think it's missing a 'be' somewhere.
Or a 'stay'
'get'
 
@pacmaninbw Indeed
@Mast Ah, darn it just out of the grace period! D:
 
4:46 PM
Shrug.
Pobody's nerfect.
6
 
You are entirely correct tho Mast, I have change the question to include "be"
 
LOL!
 
Keep trying.
Again.
Now there's only a d missing, much better.
I'm terribly, terribly sorry.
 
Ah I give up, I hate the word "question" I mistype it all the darn time D:<
 
Hi and Welcome to SO. SO is for specific coding issues such as debugging help. Its not a reveiw for code plattform. Try Code Review instead: codereview.stackexchange.comtacoshy 7 secs ago
 
4:56 PM
That's ok.
@pacmaninbw I'm fine with answering your meta question, but shouldn't it be on MSE instead?
 
@Mast Posting it there now.
0
Q: What is the procedure for notifying the moderator team when a moderator can't perform their responsibilities?

pacmaninbwHow does a moderator or their family inform the rest of the communities moderators or the community manager when they are unable to perform their duties or service their responsibilities? While the moderator position is an unpaid position there is the same need to keep the community informed that...

Should I delete the question from Code Review Meta?
 
I think so
Cross-site dupes are discouraged IIRC, but can be fine at times
 
@SᴀᴍOnᴇᴌᴀ Thanks for the edit.
 
@pacmaninbw NP
thanks for accepting it
 
That complex huh?
 
5:11 PM
~slaps knee~
 
@SᴀᴍOnᴇᴌᴀ Needs 2 more VTC.
 
Try the Code Reviews Stack exchange. — JDługosz 54 secs ago
 
@SᴀᴍOnᴇᴌᴀ Hammered. IMO whitespace is not enough to not be a dupe. Neither is changing variable names (which didn't happen). Basically I don't think allowing skirting the rules on "technically not the same" is good for CR.
 
5:31 PM
@Peilonrayz yes - it appears that the text above the code is identical
thanks everybody
 
0
Q: C++ Generic Callback class with removable listeners by unique id

fede. devI'm quite new to the STL. Does this make sense? Is there a better way of removing the listeners instead of using shared_ptr while keeping the code short and simple? Is there something in the STL to replace this? Class: template<class ... Arguments> class Callback { using Function = std::function

1
Q: Finding distance between vectors of matrices

Levon AvetisyanSo here is the problem: Given 2D numpy arrays 'a' and 'b' of sizes n×m and k×m respectively and one natural number 'p'. You need to find the distance(Euclidean) of the rows of the matrices 'a' and 'b'. Fill the results in the k×n matrix. Calculate the distance with the following formula $$ ...

 
@pacmaninbw FWIW the responses you got were very SE culture. I don't think your concern of medical emergency but not dead has been answered wrt CR culture. If your family member has an account with 15/20 rep on CR your family member can 1. flag and say you're away. 2. comment in chat you're away. (Like with Phrancis) 3. If they have access to your account, message in chat you're away. (Like with Phrancis) 4. the replies you got on Meta
 
@Peilonrayz True to a big extent, one answer does mention a broken leg.
 
5:55 PM
A broken leg is a quite different from ceasing to be.
On CR, any road you can think of will get the job done.
 
Really thanks, i doesn't knew that bash has arrrays too. Sorry and thanks for all. And I will keep in mind your link to Code Review page, that i don't know about that page. Best regards! — ruben_tey 59 secs ago
I think your question would be more on topic on codereview.stackexchange.com You should try posting there. — Justin 29 secs ago
 
6:40 PM
0
Q: Can I refactor my code any more?

ChandlerI have created one class - and it has 3 methods in it - I tried refactoring code considering all the factors; however I am not sure if there is more room for improvement in my code or not So seek help to review my code and suggest me any means of improvement; so that I can improve more and do cod...

 
7:05 PM
0
Q: Passing data between middleware in Express.js

ostojanI wrote a middleware for user authentication and I wanted to pass some data between authentication and request handler. What I thought would be a nice solution is to add that data into request body that then will be passed and process by handler. Here is how it looks like: import { NextFunction, ...

 
7:30 PM
I’m voting to close this question because Code Review is a more appropriate place. But see codereview.meta.stackexchange.com/questions/5777/… first. — Barmar 57 secs ago
 
7:52 PM
@Peilonrayz 5. Break a couple of rules and post it as a question on the main site with a 1-rep account. We'll figure out how to solve the solution from there, explicit writing rights can be provided to chat. We're talking about an extreme case here. Getting the message across (and perhaps more importantly, knowing up front the message will get across) is a bit more important than bureaucracy. @pacmaninbw
 
0
Q: Breaking a line segment into two where it encounters a rectangle

Ryan PeschelI have developed a function that takes a list of line segments and a rectangle that breaks the line segment into two where it encounters the rectangle. Here is a picture demonstration of what it does: And here is a full demo code representation here: var ctx = document.querySelector("canvas"...

 
If you want to run for moderator, run for moderator. We'll help you with a contingency plan if that's what you require. No problem.
 
@Mast Oh nice a 1 rep solution. I agree better than silence from not having rep
 
When I suggested moving the question to MSE, I didn't realize it was going to be this personal.
 
@Mast The second answer was somewhat less than understanding about just how often accidental death can occur.
 
8:00 PM
@pacmaninbw Yes.
I've carried too many people to their graves (some literally) to presume any human can tell when another human will likely pass away.
They keep beating the odds, both positively and negatively.
 
Sorry for your losses. I have literally carried some people to their graves as well.
When my father died my mother was supposed to be the one to check that the correct body was in the coffin. I had to end up doing that because mom was late to the funeral.
 
user435118
@Mast cc @Peilonrayz @pacmaninbw Another solution which I have personally used in the past is to put what message you want to pass on into a site like pastebin.com (from experience I know that unfortunately the rate limiting system isn't a big fan of new accounts/IP's posting long bits of text as a suggested edit), get a link and then post a short message saying who you are and a link in a suggested edit in a mods post.
 
user435118
Even if the mod isn't online and reviewers ignore it the mod will still get a notification and can take relevant action.
 
Oh nice, another 1rep solution
 
Not sure about code review, since this seems to be a design review question, not a code review question. Maybe Computer Science. In any case, it looks fine to me, except for the header guard at the top. Defining a generic word like hash, and replacing it with nothing, will almost certainly drive your users crazy. Use something that won't cause trouble, like HASH_Huser3386109 35 secs ago
 
9:00 PM
@CaptainObvious it sounds like this OP didn't read the links I included in my auto-comment:
Thank you Sam. I don't get it.. isn't this site purpose supposed to be for reviewing code as the url states? .. The title of the questions describes exactly what I wish.. For someone to review the code and make some recommendations or suggestions for improvement.. — Gass 1 hour ago
Hopefully they will read and understand my response:
Yes the purpose of the site is reviewing code. However, as I mentioned before, the standard is for the title to describe what the code does. The majority of posts on this site are about improving code so if we all had titles about code review then it would be difficult to distinguish between them. I changed the title accordingly. Feel free to edit and give it a different title if there is something more appropriate to describe what the code does. — Sᴀᴍ Onᴇᴌᴀ 4 mins ago
 
@SᴀᴍOnᴇᴌᴀ FWIW I've had similar before. I now just edit the title, because explaining is more time consuming than just editing.
 
0
Q: PHP Form with reCAPTCHA v2

Dejan SamardzijaI managed to make a very simple contact form. I used PHP for server-side validation and reCAPTCHA v2. You can access the form at the following link: https://test.dexsolutions.digital/index.php And this is the code: index.php <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>...

0
Q: Collision detection for Entities in a Tile Based object oriented game

G0ngB0ngich habe zur Zeit mein erstes großes, richtiges Projekt angefangen. Mein Ziel ist es Pokémon der ersten Generation zu programmieren. Ich habe mich stark an einem YouTube Tutorial orientiert (https://www.youtube.com/watch?v=dEKs-3GhVKQ&list=PLah6faXAgguMnTBs3JnEJY0shAc18XYQZ), habe bisher auch all...

 
9:17 PM
@Peilonrayz Yes I've started doing that as well
 
@SᴀᴍOnᴇᴌᴀ @Peilonrayz When you do that make sure you leave a comment explaining why and that they are responsible next time.
 
@pacmaninbw Interesting. I'm unsure of the benefits for one-post users. But I can appreciate changing my ways, so I post those comments for users who have posted more than one post.
 
9:34 PM
0
Q: Speeding up my Python code for reading from Excel, performing geospatial analysis and writing to Excel files

alauddinI have written a Python snippet that reads lat and long stored in an Excel file. Converts them to a point which is then used to perform multiple geospatial analysis including buffer, intersection, and searching within a shapefile's attribute table (finding count of a specific attribute occurrence...

 
@pacmaninbw An idea just popped into my head. What do you think of using the edit's "edit summary" rather than a comment?
 
@Peilonrayz I do both
e.g. Rev 2 of that post I updated earlier
 
Sorry, my brain's a bit fried today; I'm currently not seeing reasons to do both. Why do you do both?
 
The auto-comment (which I could add as a mac keyboard shortcut) and browser form field history suggestion make it easy
 
@Peilonrayz Leaving a comment will definitely ping the user, and will make others aware if they make the same error.
 
9:50 PM
some users might not notice the revision commeent
while they would receive a ping about the update, they might just skip to the changed section
 
Interesting. Thank you both. I think I'll definitely try to change edit summaries to include a short 'title autocomment'. And I think I'll post comments for users with 2+ posts.
 
10:19 PM
@CaptainObvious I left a comment asking the OP to post in English
It sounds like it might not be ready for review?
> habe bisher auch alles ohne Probleme verstanden und eine Menge gelernt. Allerdings habe ich nun das Problem das ich meine Entity collision einfach nicht hinbekomme
Does that translate to "...However, I now have the problem that I just can't get my entity collision right"?
 
0
Q: Make a method that uses Expression<Func<T>> for filtering and sorting more flexible

craigI have a method in a service that performs a Linq-to-SQL query: public async Task<IEnumerable<Incident>> GetIncidentsAsync<TOrderBy>( Expression<Func<Incident, bool>> whereExpression, Expression<Func<Incident, TOrderBy>> orderByExpression ) { return await ( from i in _context...

 
@SᴀᴍOnᴇᴌᴀ OP converted to English :)
 
10:49 PM
@SᴀᴍOnᴇᴌᴀ IDK if you got pung by the OP's replies, so; ping
 
@Peilonrayz yes I did
 
Ah, then I am sorry for the double ping D:
 
no worries
I'm still suspicious that the code doesn't work as intended - the linked java file has the method (that is embedded in the post) commented out
And this:
The code is running correctly for a not tile based movement. — G0ngB0ng 19 mins ago
 
@SᴀᴍOnᴇᴌᴀ I think you're right
 
so given "The problem is that this code is written for normal movement. However my game is using tile based movement, like the original Pokemon does." It seems it isn't working as expected
@Peilonrayz I VTC'd
Thanks for commenting
 
11:03 PM
No problem ^^
 
0
Q: C string parser criticism

DagarI have written a program to parse a string depending on the string the user provides. Any advise/criticism is appreciated. #include <stdlib.h> #include <stdio.h> #include <string.h> #include <stdint.h> #define DEFAULT_SIZE 10 #define RESIZE_MULTI 2 /*compares value to see if it exists in parse....

0
Q: OpenGL mesh class and derived primitive class

Christian IvicevicIntroduction After finishing most of the tutorials on https://learnopengl.com/ I started to encapsulate code in their respective classes and started to write a mesh class and a polygon class as my first primitive geometry object to figure out the structure of my code. There are a few questions ab...

 
11:44 PM
If you want to have already working code reviewed for improvements ask at SE Code Review please! — πάντα ῥεῖ 25 secs ago
 

« first day (2902 days earlier)      last day (1098 days later) »