« first day (3439 days earlier)      last day (570 days later) » 

12:05 AM
REFRESH! There are 8028 unanswered questions (89.4981 answered)
 
0
Q: Trying to find an idiomatic Rust way of calling a series of functions and early out'ing on failure of one

WaterI would like to condense down a bunch of function calls that occur sequentially, and need to early out so they don't waste more computation later on. I've been able to get it down to the following, but I am wondering if there's a cleaner way of doing this or not. Here is an MCVE: pub struct MyStr...

 
 
1 hour later…
1:18 AM
and using magic numbers like 48, 49, 50 would make you fail any code reviews. Use '0', '2'... instead. As said, this snippet has so many flaws — phuclv 50 secs ago
 
 
6 hours later…
7:32 AM
0
Q: Feedback on my 2D snake game

blaoiI made a Snake game in Rust using the SDL2 bindings. The source code is available here: https://gitlab.com/boreec/snake It mainly consists of three files: main.rs extern crate sdl2; mod view; mod game_logic; use crate::view::*; use crate::game_logic::*; use sdl2::event::Event; use sdl2::keyboa...

 
7:58 AM
0
Q: Process to continuously delete resources

AAB07I have created a function that creates a multiprocessing.Process to continuously delete "resources" (instances from a certain class) from my application. When I kill one of these resources, it gets re-created again soon after, so at all times I am supposed to have a certain number of resources. T...

 
 
1 hour later…
9:11 AM
If your code is working and you don't have a specific problem to solve (beyond it being "slow"), it sounds like this would be more suitable for CodeReviewasongtoruin 6 secs ago
 
0
Q: How to set types based on a different field in tpyescript?

LikepineappleI have this working code but I'm using the any type for the data field in the update function. How to improve that part? Is there any way to set the type of the data field conditionally based on the value of the type field? Is using one function to run all the updates a good practice or would it ...

 
9:26 AM
If your code works as is, codereview.stackexchange.com might be more helpful. — Simon Brahan 15 secs ago
 
9:47 AM
I’m voting to close this question because it contains functioning code that only needs optimisation, and is therefore better suited on CodeReview: codereview.stackexchange.comTerry 11 secs ago
 
10:34 AM
0
Q: How to clean up this code by using for, forEach or map()?

Rocky AmarThis is my first question here at stackOverFlow. https://www.techiesys.in/websites/surya/shop-single.html Please check the demo here. The codes are working fine, I know I did the worst coding. I will put the code snippet here. const changeItem1 = document.getElementById("changeitem1"); const...

 
That sounds like something that is better suited for the code review stack exchange, but my first tip would be to think about what happens if response.json() is False-ish (so your if test doesn't trigger). I'm also not sure what the json.dump call is doing here. — MatsLindh 16 secs ago
 
 
1 hour later…
11:39 AM
Codereview stackexchange might be better for this type of question rather than StackOverflow. Also when asking the question, add the code relating to the question so that people can help you. — Thamognya 59 secs ago
 
 
2 hours later…
1:29 PM
Can someone look at this answer and tell me if it is OK? I think it is basically a thank you.
 
1:47 PM
I can try to do this, but I don't think it passes code review :-D — Chexpir 53 secs ago
@Thamognya This is a perfectly good place to ask about how to do a specific task with a program whether it is finalized or not. Codereview is more for review of algorithms in finalized programs or functions with respect to their programming style, not how to "beautify" it. The Delphi IDE (as most other IDE's) include functionality to standardize formatting of code. — Tom Brunberg 31 secs ago
 
2:08 PM
Eira May on October 03, 2022
Do we work better when we outsource our memory to other tools?
 
2:27 PM
0
Q: Django, filtering on reverse foreign key

M3RSWe have Projects, which can each have many Entries. We want a report where we see the completion_date of the newest Entry associated with a given Project. However, we only want to consider Projects that have Entries after "2022-1-15". Is this the best we can do or is there a more compact way to a...

-1
Q: Refactoring method with to many arguments

Chaban33I have this API endpoint that gets some parameters and creates contacts in the database and returns payers code that is autogenerated. The problem I see is that api_create_partner takes too many arguments, and probably it will get more and more with time. So my question is what is the best and cl...

0
Q: HSTS and htaccess

CoralieHello to everyone here, Also .... I read some hours of topic here about HSTS and I will to do it with my website. My website is : https://www.organizalpha.com Can you help me ? I think i did some mistake because its said its doesn't work right now ... # Début en-têtes de sécurité Header always se...

 
3:07 PM
Monking
 
3:18 PM
0
Q: Canadian and US postal code problem in Java using subclasses

firsttimerprogrammerI am currently struggling so bad in understanding Java and how to implement the codes. I have to implement two subclasses for Canadian and US postal code in Java. For Canadian Postal code, a valid postal postal code has the rule: positions at 0,2,5 are letters. Positions at 1,4,6 are digits. Posi...

 
@pacmaninbw If you think it's a poor answer, write a comment as to why. Maybe leave a vote.
 
3:44 PM
0
Q: AVL Tree Balanced

Bodea Iulianplease help me with this code, it is written correctly, but I want to modify it, I mean when I do the scrolling for the left node, I don't want to make changes to the tree, I mean when I reach the 2nd while, namely in node.Right != currentNode the root node, the tree is modified, and I don't want...

 
3:57 PM
Monking
 
4:21 PM
@Mast Done
 
4:36 PM
0
Q: Creating object in JS that is passed into IHttpHandler

JeffersonI am working on a web page where I am creating a JS object using {} and []. This object is passed into a handler My logic Is to build the object is JS and then pass it into the Handler to be Deserialize and then saved into the db. function saveLongAnswerText() { console.log('%c saveLongAnswer...

0
Q: PDFcomp: A pdf comprimer easy script

NFVblogI developed this script in dead time to be able to compress the pdfs that they send me to university and also to be able to send scans to the various institutions that require formats that do not weigh more than 2Mb. github link: https://github.com/NF02/pdfcomp #!/bin/sh #- Function -# command_ex...

 
5:28 PM
0
Q: Factory method doesn't meet the DRY principle

nopI'm using Proto.Actor and I have an actor which acts as a proxy and forwards the messages to the appropriate exchange just because each exchange has different subscription methods, different parameters are passed, etc. Anyway, that's not important. I made a factory method which looks like below. ...

 
6:04 PM
Given the presence of a non-existent xlCalculateManual identifier here, I'd also warmly recommend adding Option Explicit at the top of all your modules, and addressing any compile-time errors it causes. Also consider having your code reviewed by Rubberduck inspections, as it'll flag these kinds of things for you at design-time. — Mathieu Guindon 36 secs ago
 
6:59 PM
What have you tried already? Start with trying to solve the problem using any algorithm, however inefficient, then start trying to improve it and ask for further help on codereview.stackexchange.comLuke 34 secs ago
 
 
2 hours later…
9:21 PM
0
Q: Blackjack written in python utilizing Object Oriented Programming (looking for criticism)

Infinite GraspThis is my first post, and I was actually going to post this on Stackoverflow when I was rather suggested posting the code here, as it may be better suited. Here is the github repository, if that is allowed here, as it seems easy to receive suggestions. BlackJack I am looking for criticism as eve...

 
10:08 PM
possible answer invalidation by Richard Neumann on question by nop: codereview.stackexchange.com/posts/280176/revisions
 
@Duga RN is OP of answer; and it was just a code fence space issue
 
0
Q: Simple NoSQL querying: the most performant method of querying paginated data with MongoDB

user8758206This topic is all about what is more performant. I am new to MongoDB & NoSQL and this may be obvious to some, but I am trying to figure out the most efficient way of making my back-end allow the front-end to fetch paginated data that combines two fields. I essentially want to know whether plan A ...

 
possible answer invalidation by Richard Neumann on question by nop: codereview.stackexchange.com/posts/280176/revisions
 
11:13 PM
possible answer invalidation by coder on question by coder: codereview.stackexchange.com/posts/280037/revisions
possible answer invalidation by coder on question by coder: codereview.stackexchange.com/posts/280037/revisions
 

« first day (3439 days earlier)      last day (570 days later) »