« first day (2814 days earlier)      last day (87 days later) » 

12:00 AM
RELOAD! There are 7267 unanswered questions (89.6386% answered)
Q: Here is my beta Deck of Cards written in c++11. Are there any improvements that could be made?

Off_grid_coderI created a deck of cards that I used in a BlackJack game. I stripped out my black jack logic and left just the Deck, card and minimum dealer. The deck class is there, because I want to create additional decks such as pinnacle or skip-bo. I that about using an Enum class for card objects or a swi...

12:21 AM
This is probably a better question for codereview.stackexchange.com. My opinion is that the advice you're trying to follow is misguided, or at least not useful for all programming paradigms. For strict OO programming, removing parameters is important; for strict functional programming, there's no way to do anything without parameters. You should use as many parameters as are necessary to do what you need to, and no more than that. — Green Cloak Guy 1 min ago
Stack overflow is for asking questions about specific problems. General optimizations might better fit in the code review stack exchange. codereview.stackexchange.comDapperDuck 31 secs ago
12:32 AM
Q: How can I reduce the number of parameters in this function?

Matt BellI've been reading Clean Code by Robert C. Martin (Uncle Bob) which states that functions should have as few parameters as possible. Ideally zero. The book suggests that three or more parameters is too many for a function. I am now trying to implement this practice into my own code and I'm trying ...

1:23 AM
Q: A Bspline module for AMO. Plus: what about lambdas in modern fortran?

Luca ArgentiHere is a (reduced version of) a module for Bsplines, which I have used multiple times for my work on atomic and molecular physics. I wrote it more than a decade ago, with the occasional tweak, and I think it would benefit from a review. It is a bit long, but it is quite useful: it can compute ar...

2:13 AM
Q: Python Turtle Race with winner output

Sammyso I am still pretty new to Python and got an assignment, where i have to make a "turtle race" with the turtle module. I need to implement a winner and an output of the Winner plus a restart function. I just can't figure out a way to output the winner, even with research i am simply stuck. from t...

Q: syntax error? Im literally copying it at this point

June Burgess#I am having a syntax error in the colon after the 'if another roll line' #If I copy-paste the code it works but when I type it out it won't. import random print("Welcome to dice roller") min_value = 1 max_value = 20 roll = True while roll: print(random.randint(min_value, max_value)) another_roll...

2 hours later…
3:54 AM
Q: Terminal Calculator/Parser Inspired by gcalccmd

cupricMy program takes input from the user in two ways: By passing input as an argument whilst calling the command By taking any number of inputs after calling the command The program is a terminal calculator that recognizes parentheses, operators, and errors as soon as you pass an expression. If you...

2 hours later…
5:40 AM
Since this is working code you want to improve, I think this is best suited for codereview.stackexchange.comcostaparas 1 min ago
3 hours later…
8:13 AM
@AkshaySehgal Thanks for the feedback, I will post it on the Code Review section instead — Jasper Tan 20 secs ago
8:31 AM
Q: LSTM Model for Univariate Time-Series Forecast

Jasper TanHi I am practicing on how to create an LSTM model on a univariate series using this dataset from Kaggle: https://www.kaggle.com/sumanthvrao/daily-climate-time-series-data My issue is that I am unable to get an accurate prediction of the temperature and my loss seems to be going all over the place...

Q: Implementation of xavier initialisation correct?

Yugenswitchso I've been struggling with a vanishing gradient problem in my neural net for a couple of days now. I decided to implement an xavier initialisation method and the results are pretty amazing. My problem so far has been that as soon as I introduce more than 1 hidden layer, I seem to experience my ...

8:57 AM
No, I do actually want to throw away my work and create brand new commits. (Not keep my work and commit bits of it.) They might include things done differently from the final commit, taking a different path to get there - e.g. to help tell a clean "story" to a code reviewer. Since reset moves the branch pointer I can't see how reset-mixed achieves this? Maybe steps would help. — Luke Usherwood 7 secs ago
9:21 AM
Q: Haskell: Implementing the data type LExpR as an instance of show

SLPI am trying to implement the data type LExpr as an instance of show. data LExpr = Var String | App LExpr LExpr | Lam String LExpr This is my code: instance Show LExpr where showsPrec d (Var str) = showString' str showsPrec d (App e1 e2) ...

10:10 AM
@AkshaySehgal "code working properly" does not mean "bug-free"; it means "it produces the desired results", which here is clearly not the case. Unsurprisingly, the question was not well-received when reposted at CR. — desertnaut 57 secs ago
10:22 AM
And IMHO this question is more suited for Code Review SEJHBonarius 46 secs ago
11:02 AM
Q: FizzBuzz Optimisation | Modulus vs Decrement Operator Performance

Desmond RhodesThis is not the typical debate in FizzBuzz code about how to handle repeated if statement. I believe that it is a matter of personal preference. I am here to ask about the choice of repeated mathematical operation. Usually the solution to a FizzBuzz code is to use the modulus operator on every it...

11:18 AM
There is a subsectrion on stackexchange for code review. SO is for programming problems. If it works, it's good enough for SO. — cfrick 37 secs ago
11:57 AM
Here is an example of exactly the same type of question, well recieved on CR. codereview.stackexchange.com/questions/253582/…Akshay Sehgal 5 secs ago
@AkshaySehgal then the CR Meta post When are Machine Learning questions on-topic? would suggest that it is not on-topic there. — desertnaut 1 min ago
What happens if you call alphabet_position with a string containing accented letters, such as à ? If you want suggestions on how to improve your code, see codereview.stackexchange.com. — Luke Woodward 40 secs ago
@Mast, Code Reviews in the machine learning domain DO involve methods to help the models learn better. I believe that would apply to Stack Exchange CR as well. That's the reason why they are included here as well — Akshay Sehgal 52 secs ago
@AkshaySehgal As a regular there, I can tell you from experience that it simply doesn't work well on the site unless it's an exemplary written question. An ML question that states "I am really curious as to what is wrong with my code" will go over like a lead balloon. Please do not suggest Code Review as an alternative site if it's a bad move. — Mast 1 min ago
possible answer invalidation by fortran on question by fortran: codereview.stackexchange.com/posts/20896/revisions
12:17 PM
Q: Python Turtle Race Restart Function

SammyI just got done with my first Turtle Race and still had one assignment left, a restart function. I just cant get it to work as i want. The goal is, an output of a question: Restart? y or n, and that'll restart the race() function and start a completly new race. I am really in need of your guys' h...

I do understand it's subjective, but being in the field for about 9 years now. I can tell you that reviewing the learning capability of a model is a MAJOR aspect of the Code reviews that I have done over the years and is a standard industry practice. Without it we are only asking "make my model production ready" — Akshay Sehgal 1 min ago
12:30 PM
@Lurch sigh
@SᴀᴍOnᴇᴌᴀ ^ It's still ongoing.
Thanks for kicking it off hours ago, but apparently it's not really going anywhere yet.
@Lurch Holy necro...
Not even invalidating.
Hi @Mast, thanks for this great discussion! I see your points and understand where you are coming from. Let me add my thoughts as part of a question at the right forum (the original post about CR in ML). Do check. codereview.meta.stackexchange.com/questions/8781/…Akshay Sehgal 15 secs ago
12:48 PM
Remind me I have to improve the phrasing of this old meta answer, apparently it's unclear to some people.
oh i'm sorry i'm totally new on asking questions on stack overflow, i didn't know that i must ask questions like this in code review. thank you for telling me that. — kjh1918 22 secs ago
@Mast Quantifying can be a problem.
1:38 PM
1 hour later…
2:39 PM
@pacmaninbw Is there a suggestion in there?
Not sure, let me think on it.
Q: Making code faster. BITWISE OR operator

the_illuminated2003Problem: Given an array A of N integers, you will be asked Q queries. Each query consists of two integers L and R. For each query, find whether bitwise OR of all the array elements between indices L and R is even or odd. My approach: Accept the array of N integers. For any query (Qi) scan the arr...

3:40 PM
Q: What is the correct way to structure react application in my case?

eugenedrvnkWhen I asked this question on stackoverflow, I was told to ask here. It is related to the folder structure in the react application. I have next folders: /src - /components - /hooks - /layouts - /store/ - /views And now I'm creating some Modal functionality and I have "ModalProvider"...

Q: Making std::optional a monad via SFINAE

EnlicoTo practice with SFINAE, template meta programming, functional programming and monads in C++, I decided to try writing a skinny version of the two functions (monadic binding and return) that make std::optional a monad. Here's the result: #include <optional> #include <utility> #include <vector> t...

@CaptainObvious No code.
3:57 PM
@lawrence-witt There is no code in the question and that makes the question off-topic for code review. — pacmaninbw 38 secs ago
4:36 PM
4:46 PM
Good almost afternoon!
@Edward You can see my shell scripts and CMake files in all their ugliness now.
Q: Portable Build System for Virtual Machine with Editor and Unit Tests

pacmaninbwI am automating the building and unit testing of a personal project using shell scripts , CMake and make on the latest version of Fedora Linux. I have also tested building on the latest version of Ubuntu. I had to decrease the minimum CMake version on Ubuntu to make it work. Parts of the unit tes...

@pacmaninbw I'll do a brutal review. :)
Go for it!
5:38 PM
Shredding in progress...
6:14 PM
Q: Snake in React TypeScript

L292092This is a really simple standard snake game written in React. I've included my custom React components and hooks. Most of the game logic is hidden behind an API written in plain procedural TypeScript, and the React part of my app is for handling rendering and game logic that involves state. Snake...

6:32 PM
Shredding complete!
6:49 PM
any possibilities that the MySQL UPDATE the table with wrong data...only if you give it the wrong data. You need to do some serious testing and code reviewing. If what you're saying is genuinely not the result of a human problem (which is still quite likely) then you have a very fundamental and serious bug, if the code is capable of recording the wrong user as having added a record (especially as it seems to be doing so inconsistently, from what you say). I'd still say though that there's just as good a chance, if not more chance, that this is actually human error or human malice.... — ADyson 1 min ago
7:38 PM
Hey, given the recent @Duga @Lurch thing should we have a sort of agreed upon bot (software) infrastructure. I'm thinking of writing a simple CR bot, and I don't want to make it a PITA for anyone else to set-up, if a problem arises and I'm MIA. I'm quite a noob in IaC, containers and VMs, so my concern may be misplaced. I'm thinking it's probably better to ask now, when I have nothing setup, then later. @Edward @Mast
@Peilonrayz Sounds interesting. What function do you have in mind for your bot?
@Edward At first something simple like tagging Python questions correctly codereview.stackexchange.com/questions/tagged/…
@Edward Shredding is indeed complete. You might have ignored the previous questions on the unit testing. The unit tests exercise all of the functions in the code under test including static functions, so the original code is included by the unit test. Each unit test is intended to be either a stand alone project or provide code to the overall unit test.
Altering the directory structure is not something I want to do.
@pacmaninbw Fair enough. I just forked the project and started to poke around.
If I do a pull request, are there any features/changes that would be particularly welcome, or would you rather just work on it yourself?
Sometimes that's my preference, so no offense would be taken either way.
Be my guest..
7:45 PM
Nice job on the documentation, BTW! It's infrequent that one sees projects at this stage of development that actually have any docs at all.
@Edward Do I need to add you to any access lists?
@pacmaninbw No, I was thinking I would just create a branch with a change and submit a pull request via github.
It automatically shows up on your end and you can either accept, reject or ignore. :)
That works
@Edward I've created a new branch called Before_Build_Code_Review, any changes to merge should be against that branch.
OK, good to know.
Hmm. The only branches I see are Before_First_Code_Review and Before_Parser_Unit_Test_Review.
Q: Filter object properties by key in ES6

PravinLet's say I have an object: var item= { date1: {enabled: false, label: "Date1 Label"}, date2: {enabled: false, label: "Date2 Label"}, date3: {enabled: true, label: "Date2 Label"}, } Like this I have textbox and dropdown. I want to create html input , dropdown based on e...

7:57 PM
Do you see master also?
Yes, that too.
Those are the three visible here.
Hmm. Are you looking at it in a browser or in github desktop?
Command-line git
git branch -a
I'm having that problem as well. I created the branch using the web site interface.
Peculiar. I see it when I use the browser on your project, but not in the forked project.
Maybe because it's identical with the existing master? I don't know. I don't use the web gui much.
8:11 PM
It's no longer identical to the existing master. Refresh the shell you're in and do the git branch -a command again.
I added the code review question to the master.
Really wanted to add it to the branch but that failed for some reason.
Ah, just did git pull upstream and got 'em all.
8:29 PM
CMake and shell don't seem to draw a lot of attention.
They tend to be hard to review
Partly it's relatively new, and partly because non-trivial questions tend to be long.
Yes, non-trivial questions do tend to be long. I unfortunately only ask non-trivial questions.
I'm sure you've noticed that newbie questions tend to be much easier to review.
Non-trivial questions make me think.
And thinking is hard. :)
8:36 PM
It's why I avoid it wherever possible.
Rolling on the floor.
Say, what have you got in mind for the editor portion of your VM?
Possibly QT or Curses, I was originally thinking line editor in terminal.
Perhaps integrate vim.
It really only needs to be a simple text editor.
I am working on a project which runs via plain text scripts. I'm looking into what would be required to use a web front-end for it.
I really don't want to write an editor for it.
8:49 PM
Q: Simple Parallel Sorting

MORTALi had made a simple parallel sorting for my personal games. it did well so far, but i would like to get some advises about how to improve it further or perhaps there are an alternative methods for better sorting data. #include <iostream> #include <iomanip> #include <functional> #include <vector> ...

@Edward I did web development for 4 years while trying to start my own business. If I never see another line of jQuery or JavaScript it will be too soon.
Amen, brother!
That's why I'm hoping to find a web-based editor I can use rather than writing one.
9:15 PM
possible answer invalidation by Jamal on question by redjordan: codereview.stackexchange.com/posts/253486/revisions
10:09 PM
@Lurch The ``` bug has just gotten worse. Now we can't fix it by adding a newline at the end of the question
possible answer invalidation by Peilonrayz on question by redjordan: codereview.stackexchange.com/posts/253486/revisions
10:36 PM
@Peilonrayz Seems like it doesn't exist. IDK what I did then...
11:33 PM
I see you updated the snippet. thanks for the suggestions! I posted a complete imlemention for code review here codereview.stackexchange.com/questions/254810/…. could you take a look if you have time? — Joji 18 secs ago
11:49 PM
Q: Implementation of a ticket queue system in JavaScript

JojiI got this question during an interview. The question itself was very open-ended - it asked me to implement a ticket queue system, where by default it would have 3 different queues to holder tickets that are of severity 1, severity 2, and severity 3 respectively. It should have functionalities li...


« first day (2814 days earlier)      last day (87 days later) »