« first day (2652 days earlier)      last day (1362 days later) » 

12:00 AM
RELOAD! There are 6884 unanswered questions (89.8313% answered)
Deleted my answer. Of course this should be on code review instead. — Ted Lyngmo 26 secs ago
 
12:15 AM
@TedLyngmo your answer has merit. It picked off a legit bug in the program that should be addressed before code review. — user4581301 7 secs ago
 
12:54 AM
If the code is complete, works, and you just want a review of it, it should be on our sister site Code Review. This site is primarily for fixing broken code. — Carcigenicate 47 secs ago
This question is better placed at codereview.stackexchange.comMichael Butscher 32 secs ago
 
1:38 AM
0
Q: Ngrx effects in angular application

najjewel@Effect() createQuiz$: Observable<Action> = this.actions$.pipe( ofType<quizAction.CreateQuiz>(quizAction.CREATE_QUIZ), switchMap((action) => { return this.quizService.createQuiz(action.payload) .pipe( map(() => { return new quizAction.CreateQuizComplete...

 
1:54 AM
Where would I ask this for code review? — Jonathan 59 secs ago
 
2:12 AM
0
Q: Seeking project wide input rather than modification of individual pieces of code

a pDoes Code Review allow for posting (or linking to) entire projects? I'm not sure if this helps at all, but in my case, I am not looking for generic input, but rather I have a specific question about how to improve an aspect of my program. Coming from Stack Overflow, I know about the concept of a ...

 
2:52 AM
0
Q: Can it be shorter?: DNA Sequence Analyzer from CS50 written in Python

StarThis is my first time requesting a code review. This is code I wrote in Python to create a DNA sequence analyzer. This is for the Harvard CS50 course. I was really hoping to get some constructive criticism on this code I finished for the DNA problem in Problem Set 6. This code passed all tests an...

 
 
2 hours later…
4:26 AM
Monking
@Feeds Probably a duplicate of something, will handle that once I'm close to a real computer.
 
4:58 AM
Maye be better suited to codereview.stackexchange.comalaniwi 32 secs ago
 
Ben Popper on August 07, 2020
Supine software is the new normal.
 
 
1 hour later…
6:11 AM
0
Q: Simple food inventory manager in Python

Khushraj RathodI've made a simple food inventory manager in Python Please tell me what can be improved GitHub import os import pickle import time remaining_ingredients = {} dishes = [] class Dish: name = "" required_ingredients = {} def __init__(self, name: str, required_ingredients: dict): ...

 
7:06 AM
Monking
 
7:54 AM
M nk ng
 
 
1 hour later…
9:05 AM
0
Q: A linked list using C++

d4rk4ng31LinkedList.h #pragma once class LinkedList { int size = 1; struct Node { int ivar = 0; Node* next = nullptr; }; Node* rootNode = new Node(); Node* createNode(int ivar); auto getSize() const { return size; } public: LinkedList() = delete; LinkedList...

 
 
1 hour later…
10:16 AM
Mörning
 
Hi Heidi, I can get connected with Gerrit from command line but just failed to connect from Jenkins, do you have any idea?: "ssh -i /var/lib/jenkins/.ssh/id_rsa -p 29418 admin@192.168.94.100 **** Welcome to Gerrit Code Review **** Hi admin, you have successfully connected over SSH." — yunfei 29 secs ago
 
10:44 AM
0
Q: Pls analyze my first code! (~100 lines) (simple hangman game)

filip augustoThat's not really an specific question about an specific problem, but I'd like to know how to improve this code, because I think that the main_func is just too big and I can not split it into other functions or classes. Also I want to know if I can or should use classes to make it cleaner. It's a...

 
I've already raised a VLQ on this answer a week ago, should I try NAA next?
It's basically an alternative implementation, not a review.
 
@Mast Did it get declined a week ago or more recently?
 
Welcome to Stack Overflow! You may be misunderstanding what we do here. To learn more about this community, please start with the tour and read How to Ask and its linked resources. If you're having a specific problem in your code, please describe the problem. If you're just looking for feedback on working code you've written, you might try Code Review, though check their Help Center first. — David 51 secs ago
 
@Peilonrayz It wasn't declined, it timed out.
See timeline.
Unrelated, someone is trying to pull a sneaky in the tag. Remind me to fix that up later regardless of the outcome of that suggested edit. It needs improvement, but that Tutswiki links is blatant self-promotion.
Most of the content of that edit is shamelessly stolen from SO by the way.
 
10:59 AM
@Mast I don't think I can see it in the timeline - as you can't see other people's flags. I can see 2 reviews, some comments and an edit
IDK if mods let it time out then they'll probably just decline it / let it timeout again
 
@Peilonrayz Well, I raised a flag and I only see one review.
 
Can you not see the review you completed?
 
@Peilonrayz That's when I flagged it.
That's an FP review.
Review time = flag time.
 
Hmm, I think a VTD could put it back in the queue? I don't think we have any other 20ks to delete it tho
 
I don't have the rep to VTD, but that would probably do it.
For all I care it first gets a mod-banner for a week, but we can't leave it be like this.
 
11:34 AM
> You cannot declare a variable or value as constant in Python. Just don't change it.
stackoverflow.com/a/2682752 this is hilarious
 
@anki How so?
 
 
1 hour later…
12:46 PM
@Peilonrayz errr.. read comments to get some hints maybe ?
 
@anki Right...
 
For people coming from languages with const & particularly those who got bitten by modifying wrong number, the advice is funny at most.
It won't be in cpp core guidelines if it was a light topic.
 
Just put the variable in SHOUTCASE and don't touch it.
I've never had problems with variables not being const in Python.
If you're not supposed to touch it, make it SHOUT and you'll be unlikely to touch it.
 
1 million times people came looking for it.
@Mast we do that for macros only.
 
Python macros?
 
12:51 PM
nah, C.
 
I wasn't talking about C.
 
I know
 
@anki Doesn't mean it's good. My terrible LaTeX question has 1/4 mil views...
 
@Peilonrayz yes that's correct. It means that it's what people who learnt C/C++/Java first expect when they want an immutable in python.
 
1:08 PM
@Peilonrayz Mat killed it.
The answer.
 
Ah, nice
 
possible answer invalidation by Peter Csala on question by John Steed: codereview.stackexchange.com/posts/247278/revisions
 
1:31 PM
 
0
Q: Getting around gsl/span's restriction on temporaries

whn#include <gsl/span> namespace gsl{ template<typename T> class TempSpan{ public: T value; explicit TempSpan(T&& t) : value(t){}; operator gsl::span<typename T::value_type>() { return value; } private: }; template<typename T> ...

0
Q: JavaFX clone of Snake game

a pI am using Java 14 and JavaFX 14. My game uses an anonymous instance of the AnimationTimer class as the game loop. The basic UI for the start screen uses FXML, but all of the UI elements in the actual game Scene were added programmatically. The game board is stored as both a GridPane and as a 2D ...

 
2:28 PM
0
Q: Need some advice on coding style/design

ZangdarI need some insight about coding style in a general way. I have two different versions of the same code with very minor differences, and we do not necessarily agree on what is the most readable, maintainable, and testable and also feel simpler to understand and get in. I understand that there's n...

 
Ryan Donovan on August 07, 2020
August 2020 Welcome to ISSUE #33 of the Overflow! In the age of GPT-3, this newsletter is still written and curated by the Stack Overflow team and Cassidy Williams at Netlify. And if it wasn’t, how would you know? Read on to learn about our Series E fundraise, a React component for rendering guitar chords,…
 
2:43 PM
@Feeds Accelerate? Without it, they'd be dead by the end of next year.
 
-1
Q: Writing python without a C accent

Ray ButterworthI'm having trouble writing python without a heavy C accent (I wrote C for decades). I understand the python language fairly well (or know how to recognize what I don't know and how to look it up). And I've reached the stage where what I've written feels wrong. But I still don't seem to think in n...

 
3:17 PM
0
Q: learning OOP, and having troubles in some places

MatteyFor learning purposes, I have written a small calculator app on Python, tkinter. I want to check if my design is on best practices for OOP, And seek advice on Nested functions For easy readability, I have only included the Addition functionality, same logic can be applied to Subtract, Multiply et...

 
Monking
@Mast rejected - I see the self-promotion but decided to go with the copying reason
 
Monking
 
@SᴀᴍOnᴇᴌᴀ Both were valid close reasons, nothing wrong with that.
 
@Mast I flagged it as NAA - Mathieu Guindon♦ deleted it
 
I know.
 
3:22 PM
oh right... just coming online officially
I've been checking the transcript when I get up to feed the cats
 
No worries :-)
 
4:07 PM
0
Q: Golang Error handeling by a generic interface

coditoriI was wondering why we people don't use a generic interface instead of error type. You can see this pattern a lot in the Golang community: func Division(a int, b int) (int, error) { if b == 0 { return 0, errors.New("divided by zero error") } return a / b, nil } error is not l...

 
Normally if your code works and you want comments, you put your code on the code review site: Code Reviewmarkspace 17 secs ago
I’m voting to close this question because should be moved to Code Review. — markspace 50 secs ago
Thanks for the great reply. I agree with the risk of a suppression explosion, but I think it is manageable. Our company prevents merges without a code review, and we already fail suppressions that don't have good reasons. As for GC, that seems to line up with the Error Prone approach I mentioned. I assume the memory pressure impact will not be an issue for us. My hope is also that more often we'll just re-write things instead of using that approach though. I agree completely that unit testing is another approach but it seems to rely more on coder/reviewer skill/diligence... — Paul Nogas 14 secs ago
 
4:32 PM
-1
Q: Creating Python dictionary from csv with lists as values

Euan_MitchellI have a large .csv file of coordinates similar to this: I am trying to loop through it to create a dictionary where each unique value for "Index" is a key, and the corresponding value is a list of lat,long tuples (i.e., {1: [(lat,long),(lat,long)], 2 : [(lat,long),(lat,long)],} etc.). I can par...

 
4:46 PM
if code is working then it is not place for you question but you should ask on CodeReviewfuras 18 secs ago
If the code works and you're looking for advice on how to design it better, Code Review is a better place to ask. But see codereview.meta.stackexchange.com/questions/5777/… for advice first. — Barmar 12 secs ago
You can ask here instead: codereview.stackexchange.comm4n0 57 secs ago
 
5:22 PM
0
Q: Add comma/and between string array in java

Aryai get an array of authors from json response and i have to display authors name in TextView(android) in proper format like =>Viraj, Chetan and George R. R. Martin my code work fine, but it's a mess.... public class SeprateAuthors { public static void main(String[] args) { String[] authors0 = {"a

0
Q: Testing the primality of a number

parvbool is_prime(int num) { if(num == 0 || num == 1 || (num != 2 && num % 2 == 0) return false; int sq = sqrt(num); for(int i = 3; i <= sq; ++i, ++i) if(num % i == 0) return false; return true; } We only need to check upto square ro...

 
5:45 PM
sorry you have to do a code review ... thanks a lot, i'll give it a try with maxBuffer: Infinity . Anyways, I realize that I should ignore huge files by default if i want to protect against possible memory issues. — gui3 just now
 
6:08 PM
@CaptainObvious Does not compile (unmatched parentheses
 
2
Q: Transforming UCI-move into bitboard, chess

Jay OsayiI want to transform a UCI-move into bitboard. for example a2a3 -> 32768, 8388608 I need to assign [7,6,...,0] to [a,b,...,h] so that for each letter i have the assigned number(n) to calculate 2^n Which I can then left shift by the value in uci[1] or uci[3] *8 depending on start- or endfield. This...

 
@CaptainObvious @Zeta there are more problems than that, it's also missing any context.
 
6:30 PM
possible answer invalidation by parv on question by parv: codereview.stackexchange.com/posts/247616/revisions
 
6:45 PM
possible answer invalidation by Star on question by Star: codereview.stackexchange.com/posts/247596/revisions
possible answer invalidation by pacmaninbw, parv on question by parv: codereview.stackexchange.com/posts/247616/revisions
 
@Duga Rolled back, and the only allowable edit was made.
 
7:26 PM
0
Q: Expect script that tests if a passwordless connection is setup

harleypigI have written a simple expect script to tell me if a passwordless connection is set up. There is no 'expect' tag, so I hope using a 'shell' tag is acceptable. I would appreciate any feedback. #!/usr/bin/expect -f if {[llength $argv] < 2} { puts "usage: test-nopass user server" exit 1 } set...

 
7:41 PM
 
0
Q: Python version of Clean Code book example

revliscanoI started reading Robert Martin's Clean Code. I'm trying to "translate" all his examples into Python, so I can understand them better since my domain on Python is greater than on Java. Please take a look at the following: Java original code of the book public class GuessStatisticsMessage { pr...

0
Q: Reverse character order of substrings delineated by white space chars

amalgamateThe Challenge: Given a string, return a string where each word is reversed individually without changing its position. Thoughts and questions: Perhaps I was cheating the spirit of the challenge by using string builder? What do you think? Complexity? Would the complexity be? I feel like it is O(n)...

 
8:27 PM
@ecm: I think so. We do allow questions about performance optimization of existing code; asking about size optimization seems reasonable. The title is silly, though; the answer is going to be specific to code-golfing base-10 printing of an integer, not .com files in general. (Since it's too small for a self-extracting packer to pay off.) It's not a good fit for codegolf.SE. Questions about improving working code can sometimes also fit on codereview.SE; it might be a better fit there than here. (long-form answers that point out separate improvements to separate parts work well there.) — Peter Cordes 22 secs ago
 
8:42 PM
2
Q: Check if an inputted string is in the right format for a valid rgb color

JonasIt is a practice from the site edabit.com and you have to check if the input is valid. That is the original task: Given an RGB(A) CSS color, determine whether its format is valid or not. Create a function that takes a string (e.g. "rgb(0, 0, 0)") and return True if it's format is correct, otherw...

 
9:24 PM
For sure you don't need things like == True... This is more suited for codereview.stackexchange.comIdos 46 secs ago
 
If Eric drops in, I got a good feeling about him. Please don't scare 'em away.
 
what if he doesn't drop in? what kinda feeling might you have about him?
 
@Mast I had a similar feeling about them :)
 
0
Q: Heaviest Stone algorithm time complexity

myTest532 myTest532I implemented the heaviest stone algorithm, but I am not sure about its time complexity. I'm doing sort which is O(nlogn), but it' inside a while loop. Problem: We have a collection of stones, each stone has a positive integer weight. Each turn, we choose the two heaviest stones and smash them to...

0
Q: .NET Core WEB API Tic-Tac-Toe Can it be improved?

Victor GazzinelliI'm looking forward to increment a code-interview challange I was given a few weeks past. Since the code has some dependencies and became quite large, I will let it be posted on Github in this link https://github.com/VictorGazzinelli/TicTacToeWebAPI I'm not too much of a software engineer myse...

 
@SᴀᴍOnᴇᴌᴀ We'll cross that bridge when we come to it.
But we almost desperately need new, enthusiastic reviewers.
 
9:33 PM
@CaptainObvious <ebonics>Oh no you di-int put a link to GH in a code block</ebonics>
 
@SᴀᴍOnᴇᴌᴀ With 2 empty lines to match, otherwise you don't hit the required 3-line minimum.
Which, you know, should tell you something.
 
@SᴀᴍOnᴇᴌᴀ What is ebonics?
 
@Mast for some values of "should"
 
@Peilonrayz I think it's ebony-phonics, African-English if you must.
That right? @Sᴀᴍ
 
9:40 PM
Thanks
 
Where cake turns into caejek
 
10:21 PM
0
Q: Arduino code to control 30LED neopixel clock with IR color and brightness changing

trainmaster247This code is designed for my 30led neopixel clock, the reason for not using the ds3231 library is due to the fact that I use codebender to download programs to my arduino, I wanted some critique on things that could be improved and any glaring problems that should be fixed. Thanks! /*This cod...

 
I was just thinking yesterday: September will be here soon.... so likely more homework "code review" requests...
 
Greaaaat.
Just what we need.
 
10:38 PM
@SᴀᴍOnᴇᴌᴀ But it's always September
2
 
Sep 11 '19 at 16:28, by Sᴀᴍ Onᴇᴌᴀ
@Malachi ♫ "Wake me up, when September ends"
 
0
Q: Putting millions of items in a QTreeView

PatrickI have a list of 2,888,991 channel objects. Each object has a name and a sample rate. I am trying to put them into a QTreeView. Each channel name is split on ':' '-' and '_'. If the name is H1:IOP-LSC0_DCU_ID and the sample rate is 16.0 then it should go into the tree as: H1 IOP LSC0 ...

posted on August 07, 2020 by david

I did some image-processing on multi-frame TIFF images from a 12-bit camera and would like to save the output. However, the PIL documentation does not list a 12-bit mode for fromarray(). How does PIL handle bit depth and how can I ensure that the saved TIFF images will have the same dynamic range as the original ones? Example code: import os import numpy as np import matplotlib.

 
11:16 PM
Welcome to the 2nd monitor @EricChen. If there's anything we can help you out with just shout :)
 
Welcome.
@CaptainObvious My brain is having weekend, but we can safely tag that C++ as well, right?
 
I would assume so. But I don't know C or C++
 
I know both and I'm fairly sure the code posted is sauced-up C++.
 
I’m voting to close this question because it is asking for peer review to improve working code, which is why the Code Review site was created. This site is for specific questions related to programming (code) or use of programmers tools, and Can you help me optimize this code? is not a specific question. — Ken White 54 secs ago
 
If I were to add a tag I'd add it and a comment. Someone should be able to catch if there is a mistake and if you comment then the author won't catch the flack
 
11:26 PM
If there'd be more description added (see our FAQ on asking questions), sure, I think we could make this work on CR. — Mast 35 secs ago
 
@Peilonrayz Yea, I'm not sure what adding the tag is going to accomplish though. Arduino is kind-of specific, if people are really interested in that they should follow the bloody tag.
 
I don't know a word for someone that knows nothing on a subject. However from my {incompetent} perspective I don't really see how it'd be much different to using a library. Is it like a different language?
 
Think of it as a layer on top of it.
So there's C++, and there's Arduino, which is basically C++ with extra built-ins.
 
Like JSX / TypeScript more than CoffeeScript?
 
A bit like saying you built something with numpy. The Python is implied.
@Peilonrayz I know 0/3.
But, you know, only a bit. Since you can easily cut-out the numpy but in Arduino it's all very integrated together.
But it's absolutely possible to run raw C++ on them.
 
11:32 PM
Damn. This'll make things harder to communicate. Because I'm sure you wouldn't say the same to numpy and Python (the Python tag isn't needed)
 
probably more like Android and Java, but without the incompatible binaries
 
@Vogel612 While I don't know much about Android, that could well be right.
 
the basic syntax used to be the same (now that java has modules it's a bit more complicated)
 
I wrote an Android app once, but I don't know what the difference is
 
Arduino does have a tendency to screw you over more than C++ does, so it's a bit finicky all.
 
11:34 PM
different VMs, one is google the other is oracle, Java has actually evolved by now
 
52
A: C++ vs. The Arduino Language?

Peter BloomfieldIn theory... There isn't really an Arduino language as such. It's really just C++ with some domain-specific libraries. These add on various features, such as functions you can call to control the hardware. If you didn't have those functions, you'd need to fiddle directly with special registers to...

> In theory... There isn't really an Arduino language as such. It's really just C++ with some domain-specific libraries.
So, technically, we'd have to tag-em-all with C++.
In theory.
 
something about hierarchical tags
 
Sometimes I desire them, but I can imagine how much pain would be caused by adding them.
 
@Vogel612 My brain is still having weekend, could you phrase that more explicitly?
 
I'd assume C++ > arduino like Python > Python-3.x
 
11:38 PM
@Peilonrayz codidact seems to be working fine with them, not sure how scalable and maintainable it is, though.
 
Ask them a year from now.
 
@Vogel612 Condidact is also small. I'm imagining SO with them.
They also haven't had time to 'brew' or should I say be abused to high heaven
 
@Peilonrayz though with the moderator team they have I think they're gonna manage
 
I believe they're capable people. I guess only time will tell
 
You need more than just capable people to build and maintain something like that.
What they have will go a long way though.
 

« first day (2652 days earlier)      last day (1362 days later) »