« first day (2972 days earlier)      last day (1038 days later) » 

12:02 AM
REFRESH! There are 7636 unanswered questions (89.4281 answered)
 
12:40 AM
0
Q: I'm too lazy for memoization (Fibonacci algorithm, arithmetical approach)

Takeshi KosugiIf A + B = C, then A = C - B, right? Well, Fib(n) = Fib(n-1) + Fib(n-2) therefore Fib(n-1) = Fib(n) - Fib(n-2), so class Program { static void Main(string[] args) { int n = System.Int32.Parse(Console.ReadLine()); long prevFibo = 0; long nextFibo = 1; for (i...

 
 
3 hours later…
3:57 AM
Monking
 
0
Q: How can I make this C code to simply open, write to, and close a file less verbose?

user244080All this does is safely and reliably opens, writes to, and closes the file. Yet there are so many gotos and the code is quite verbose. I am not even sure that all of what I am doing is necessary. int WriteConfig(void) { FILE *ConfigFile; RetryOpen: if (!(ConfigFile = fopen(Config, "w"))) ...

 
 
1 hour later…
6:03 AM
0
Q: python - Selenium Stackoverflow Room Bot

TheodoreI made a bot that chats in rooms you manually put in. The only problem is that it can't operate commands correctly, I had a few working methods. But it had to have 'NO USE FOUND' in the terminal using the while True method. I'm trying to make a fully working command system that doesn't spam the t...

 
6:30 AM
if you want to improve code quantity, maybe you need code review,codereview.stackexchange.comleaf_yakitori 46 secs ago
 
6:53 AM
0
Q: how can i make the bot resend a message every time i restarting the project

lali cronshiwhen i do process.exit() and i start the discord bot project again will send a selected message in the selected channel and delete the old message witch created before i exit from the project with ready event if needed client.on("ready",()=>{ //code }) ```

 
7:34 AM
Since you already have a working code, consider to ask for a codereview. — Sinatr 51 secs ago
 
0
Q: Why is reducing the number of arguments best practice

MyDaftQuestionsI am a little confused about not passing in too many arguments. As I believe this is language agnostic, I've used pseudo code. For example MyFunction(param1, param2, param3, param4, param5, param6, param7, param8) appears to be not ideal. One issue with this is how hard it is to test. And this i...

0
Q: Spotify logger for tracks played

Bruno VermeulenI want to share a little app I made that logs tracks I play on Spotify (running in the background on my DigitalOcean droplet server). It uses Spotipy, a lightweight Python library for the Spotify Web API. With Spotipy you get full access to all of the music data provided by the Spotify platform. ...

 
8:13 AM
Monking
 
8:39 AM
@leaf_yakitori, Code Review is the place for improving code quality (which often means a reduction in quantity). I don't think there's an SE site to increase code quantity - that's not usually a desirable objective in itself! — Toby Speight 30 secs ago
Welcome to Stack Overflow, Brian! Before you post at Code Review, make sure to read A guide to Code Review for Stack Overflow users, as some things are done differently over there - e.g. question titles should simply say what the code does, as the question is always, "How can I improve this?". Be sure that the code works correctly; include your unit tests if possible. You'll likely get some suggestions on making it more efficient, easier to read, and better tested. — Toby Speight 40 secs ago
No @Sinatr, broken code is not ready for review until it's fixed. — Toby Speight 1 min ago
 
8:57 AM
1
Q: Python: determine whether one string can be obtained by changing one character in the middle of another string

Xeнεi ΞэnвϵςThis script solves a simple problem: Input two strings differ one character or zero characters in length, return true if the following conditions are met: 1, They must start with same character and end with same character. 2, One string can be obtained by changing one character or zero characters...

0
Q: Use of dataclass when scraping with Requests

SatiThis is a follow-up of my last question over here. Following @Reinderien's suggestion in that previous post, I've managed to furnish my web-scraper code as follows: fudan.py from dataclasses import dataclass, asdict from itertools import count from typing import Dict, Iterable, Tuple, List from ...

 
9:07 AM
There is also the Code Review sister site, although probably off topic there too: codereview.stackexchange.comCasper 48 secs ago
The code review site is intended for relatively small, self-contained segments of code; not reviewing an entire project including the git commits. — Tom Lord 52 secs ago
 
9:41 AM
@Lundin "This is subjective though" Kind of agree. "Best practice" answers often has a little "opinion-based" smell. And this topic for sure do. I once worked for a company where "the SW boss" insisted on use of a single include-file containing include of all other headers files (I hated it, btw) and I worked for another company where any unnecessary include would cause the code review to fail and prevent code commit (also a bit annoying). So I've seen both extremes. I prefer to avoid unnecessary include without being pedantic about it. That said I don't agree with your .... — 4386427 1 min ago
@crayxt, I've overlooked the output, sorry. If method is working as intended, then codereview should be the right thing to do if you want to improve it. — Sinatr 12 secs ago
 
 
1 hour later…
11:02 AM
0
Q: Parsing log file and returning timestamp ordered output

dm90Problem statement: I have the following access log, get the count by timestamp and sort the count based on timestamp. And write it into the CSV file. access.log: 172.16.0.3 - - [25/Sep/2002:14:04:19 +0200] "GET /api/endpoint HTTP/1.1" 401 80500 "domain" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv...

 
11:33 AM
Questions on improving code that is working should be asked on codereview.stackexchange.com However, the first thing I notice is that you have put everything into a single struct. At the very least you should have a model that is seperate to your view. Probably also a game engine that contains the game logic and which manipulates the model. The view is bound to the model. — Paulw11 29 secs ago
 
12:18 PM
I’m voting to close this question because such optimization questions belong on Code Review. — Scott Hunter 16 secs ago
Please ask on codereview.stackexchange.com for optimisation questions. — evolutionxbox 13 secs ago
I’m voting to close this question because this question belong to code review - stackexchangedecpk 12 secs ago
@decpk Code review is for working code, they've clearly indicated a bug and are asking how to add features — Nick 41 secs ago
 
Monking
 
Monking
 
12:38 PM
 
0
Q: How to convert SQL query that groups on multiple columns and return records of latest date for the grouping

scotttI have the following SQL View that I wish to convert to linq to use in my c# .NET code, but have not been successful. I can't manage to get the inner joined select .. from..groupby.. on section right. Both Lambda and query expression solution would be greatly appreciated. The SQL query groups the...

 
@TobySpeight Why did you vote to close this question? I don't see the problem but I don't know Java.
What I do see is a question from someone that doesn't know English very well.
 
@pacmaninbw I agree with you pacmaninbw looks like a fine question to me
 
I see no problems
Question should stay open, works as expected according to OP. Good enough for me since none of the VTC'ers left comments.
 
@pacmaninbw Probably because I couldn't make sense of the title. I'm sure I could withdraw my vote if somebody who understands the problem space better could edit to improve the description.
 
12:54 PM
@TobySpeight The code is just a standard JSON <-> Object library.
And the question is about error handling (notice how the list is a null in the example)
 
I edited the title, hopefully it is more understandable.
 
@pacmaninbw Yes, VTC retracted.
 
Thank you!
Commented added about this discussion for others in the VTC queue.
 
0
Q: Structure and readability of the code in swift ios

Cluadia HeddaFor a job in company I had to do a code assignment. My assignment performs all the required tasks needed to be done. But after one month the company provided me a feedback and said that we have reviewed your exercise, very sorry for the delay. Unfortunately, while working, the structure and reada...

0
Q: The students reward list

Ductor MasterThe code needs to make the list of the students. Correct the names if it's needed and add a new students. And the teacher can give them the stars like the reward. I did it, but my code looks like a trash-code. Also the stars, if the teacher added the star for someone - it can't take it back. I ne...

 
1:37 PM
This might be better suited on Code ReviewEyeslandic 47 secs ago
Those are not arrays, those are Python lists, and Python lists are notoriously (relatively) slow when using for loops. Either way I feel like this question is better suited for codereview.stackexchange.com. — jfaccioni 48 secs ago
 
2:03 PM
Teresa Dietrich on June 23, 2021
We’re thrilled to be launching this new product with Google Cloud and Go.
 
Please look at Code Review's help center before posting, though. They would probably like some context for this method, so this question wouldn't fly there as is. — user 9 secs ago
@jfaccioni You're probably right about the lists making it slow, but I don't think this belongs on Code Review, since the OP isn't asking about how to improve their code's performance; they're asking about why there's a difference in performance. — user 34 secs ago
 
2:20 PM
0
Q: One data object instead of array of objects - why is it slower?

kucuI'm currently writing a game of life with small extra features but I ran into a problem - in my first try i decided to use simple list of Cell objects: class Cell: def __init__(self, x, y, is_alive): self.is_alive = is_alive self.x = x self.y = y self.will_be_a...

 
Great.
 
2:45 PM
0
Q: Find the last complete week of data in MySQL

Martin BurchAssuming a table with at least 1 record per day, I would like to find the last complete week of data, where there's at least 1 record for each of the 7 days. This is so I can use this year-week in a WHERE clause to limit a query to records within or before the last complete week of data, that is,...

 
2:57 PM
@Duga nvm I should've gone through the help center myself
 
Monking
 
3:49 PM
Monking
 
0
Q: requests vs selenium vs scrapy

SatiThis is a follow-up of my question over here. I have been working on my web-scraping techniques by trying out different approaches and rewriting code for a handful of online databases. I've recently seen for myself that requests is definitely way more efficient than selenium, as demonstrated by t...

0
Q: Find circles for `f(z, c) = z ^ 2 + c` of length 6 in rational numbers

outoftimeI've found pretty simple problem on Numberphiles channel: suppose we have a recursive function $$ \begin{equation} \begin{split} f_0 &= Z ^ 2+ C \\ f_i &= f_{i-1}^2 + C \; | \; i = 1 \dots \end{split} \end{equation} $$ What values of \$ Z \$ and \$ C \$ should be \$ |\{ f_i | \; i=0..5\}| = 6 \...

 
4:19 PM
If you don't get a big response here, you could try moving this question over to [[Code Review]]. — user1717828 just now
 
0
Q: Improvements to logger and how to correctly use it

MathieuI am working on a project, neurodecode, which uses a logger based on the logging library. As I am not very familiar with logging, I don't know how to further improve this aspect of the project. The project is constructed as: neurodecode |_ __init__.py |_ logger.py |_ folder1 |_ script1.py ...

0
Q: Simple scripting language (interpreter) in C

ArianKGI made simple scripting language (interpreter) in C and now, I want to make my code better. Here is my code: #include <stdio.h> #include <stdlib.h> #include <string.h> #define TRUE (1 == 1) #define FALSE (1 == 0) #define FUNCTION_NAME_COUNT 2 #define FUNCTION_ARG_FUNCTION_NAME_COUNT 1 #define M...

 
4:48 PM
The fact that mgetl cannot read from stdin is a bug that will be fixed in the upcoming release of Scilab (6.1.1) : codereview.scilab.org/#/c/21778/2, thanks for reporting. — Stéphane Mottelet 35 secs ago
 
5:38 PM
0
Q: python script to download files

Chandsample = [{'Code':'0060301'}, {'Code':'864791'}] pdfDict = [{'Code':'0060301', 'DocumentNumber':'12345', 'PdfUrl':'www.facebook.com'}, {'Code':'78549', 'DocumentNumber':'789654', 'PdfUrl':'www.spacex.com'}] if pdfDict and pdfDict is not None: if self.DownloadAllDocument: ...

 
5:57 PM
possible answer invalidation by dm90 on question by dm90: codereview.stackexchange.com/posts/263360/revisions
possible answer invalidation by dm90 on question by dm90: codereview.stackexchange.com/posts/263360/revisions
 
0
Q: Calculate minimum buy/sell amount that exchange will allow the order to be placed based on current price

phwtI have created calculateMinimumAmount to calculate the minimum buy/sell amount that exchange will allow the spot order to be placed based on the current price. The exchange I used (FTT) does not limit the minimum order amount by value (like Binance needed at least 10 USD per order) but by a token...

 
6:15 PM
It seems that your code currently works, and you are looking to improve it. Generally these questions are too opinionated for this site, but you might find better luck at CodeReview.SE. Remember to read their requirements as they are a bit more strict than this site. — Paul Roub 53 secs ago
 
 
1 hour later…
7:37 PM
This is probably a better question for: codereview.stackexchange.comdisinfor 35 secs ago
 
7:54 PM
@Duga Rollbacked
 
8:48 PM
 
0
Q: GraphQl query is not giving result Flutter

Cluadia HeddaI am using https://api.spacex.land/graphql/. When I write query in https://api.spacex.land/graphql/ editor then I am getting result. My query is : query launches { launches(find: { mission_name: "Thaicom 6", }) { details mission_name } } And it gives me following result: { "data": ...

 
9:13 PM
@RMunroe Someone has a problem with geography.
 
0
Q: A TicTacToe command line game in c++

ZED_118So I've just started teaching myself C++ a few weeks ago and I've decided to work on an implementation of Tic Tac Toe, using the command line. The program allows a human to play against a bot, which simply selects a random location on the board. I'm requesting a review because I'm not sure about ...

 
9:52 PM
You seem to be asking for a code review across two languages. "Faithful" is first be a functional definition -- you demonstrated that they produce isomorphic output. What do you get when you trace the results of each call? — Prune 28 secs ago
 
@RMunroe might be opening another can of worms here.... I know the Portland here in OR was named after Portland, ME - decided by a coin-toss (the other man was from Boston, MA)
@CaptainObvious ಠ_ಠ config/syntax issue?
 
@SᴀᴍOnᴇᴌᴀ I was confused why you were talking about config. On a second reading I see now. Yeah, seems the code works fine, but "flutter" doesn't.
Seems off-topic either way, I'll 🔨 now
 
10:12 PM
@Peilonrayz 🆒
 
10:28 PM
This isn't Code Review. — Barmar 10 secs ago
 
@RMunroe There is a thing about how people in Des Moines, WA pronounce one the 's', unlike the way the one in IA is pronounced facebook.com/Pronouncing-the-S-in-Des-Moines-WA-250617308101
maybe they should just convert it to English and call it Monks
 
10:45 PM
No need to bring Code Review into your squabble. Thanks. — Peilonrayz 52 secs ago
 
 
1 hour later…
11:47 PM
@M.M when suggesting users post on CR it would be great if there was also a suggestion like "Please read the relevant help center pages like 'What topics can I ask about here?' and 'How do I ask a good question?". In the current form the code above would likely be closed as off-topic because it is missing context. — Sᴀᴍ Onᴇᴌᴀ 13 secs ago
 

« first day (2972 days earlier)      last day (1038 days later) »