« first day (3383 days earlier)      last day (620 days later) » 

12:04 AM
REFRESH! There are 8116 unanswered questions (89.3393 answered)
 
 
2 hours later…
1:45 AM
0
Q: BaseController with Generic Entity and Model

John Louie Dela CruzI created a controller with generic TEntity and TModel so that i will not have to repeat commun actions like save/delete for each entity. I just want to ask if this is a good or a bad practice? public class BaseController<TEntity, TModel> : Controller where TEntity : BaseEntity wh...

 
2:18 AM
This question would be better asked at codereview.stackexchange.com — smac89 21 secs ago
 
 
1 hour later…
3:27 AM
You've got the right idea, thinking that code repetition is bad. Code Review StackExchange is probably a better place for the question, though. — saxbophone 37 secs ago
 
4:03 AM
Monking
 
4:44 AM
Thank you folks, this is really helpful! will post on 'Code Review' next time :) — jdonca 13 secs ago
 
 
1 hour later…
6:09 AM
 
6:32 AM
@mattfreake my question was "how to IMPLEMENT lambda with class". Where I am asking for readable and fast code? Where I am asking for implementation with function? Where I am asking for judgement and code review? I am straightforward asking for implementation, while you trying to be as much SO meme as possible by posting unrelated answers and comments. — Max Smirnov 41 secs ago
 
 
1 hour later…
7:37 AM
Questions about reviewing running code is betetr asked at Code ReviewJens 33 secs ago
 
 
1 hour later…
8:52 AM
0
Q: Checking if dictionary keys are being entered

GruffCheetah628Is there a more efficient way to check if what the user has entered (“food_ordered”) is on the “order_menu” without having to use “food_keys” or “food_names”? order_menu = {("C", "Chips (Scoops)") : 2.80, ("F", "Fish (Battered)") : 2.90, ("Fc", "Fish (Crumbed)") : 4.90, ("Fib", "Filet (Battered)"...

 
9:17 AM
0
Q: Is there any bad code implementation inside this code?

MrDoufyIs there any bad code implementation inside this code? From what I have analyzed, I guess it might trigger local file inclusion vulnerability. public void upload(HttpServletRequest request) throws ServletException { MultipartHttpServletRequest mRequest = (MultipartHttpServletRequest) request;...

 
10:01 AM
This might be more appropriate for codereview.stackexchange.comtmdavison 44 secs ago
 
10:28 AM
If you don't have concrete, specific questions, this is more suited to codereview.stackexchange.com. — Chayim Friedman 16 secs ago
 
11:22 AM
0
Q: Creating combinations from arrays in Rust

PaulEliazI'm working on a project, one of my first coding projects, and it requires creating combinations from an array of 59 u8 elements. Not all combinations, I filter a lot of them out (the ones that have less then 2 u8s and the ones which have a sum greater than 21), but still enough for my computer t...

 
12:12 PM
0
Q: Efficient approach to minimally pad a tensor

CMouseI'm trying to pad a tensor of some shape such that the total memory used by the tensor is always a multiple of 512 E.g. Tensor shape 16x1x1x4 of type SI32 (Multiply by 4 to get total size) The total elements are 16x4x1x1 = 64 Total Memory required 64x**4** = 256 (Not multiple of 512) Padded shape...

 
If you don't have a specific question about this code and are simply looking for a code review, consider codereview.stackexchange.comDrew Dormann 39 secs ago
 
12:37 PM
0
Q: Sum numbers digit by digit

Eugene YarmashThe problem goes like this: Given two one-dimensional arrays, for example a = (3, 4, 5) and b = (5, 6, 9), write a function that sums the arrays bit by bit, i.e. producing c = (9, 1, 4). Do not use any high-level functions such as join() or split(). 345 + 569 --- 914 My solution: def sum_arr(a...

 
1:27 PM
0
Q: SQL/SQLite - copy subtree in SQL and decouple SQL from business logic code

PChemGuyScope and motivation This question continues a series of posts about SQLite as a backend for a personal information management (PIM) application. Previously, I asked about SQLite/ADO API and backend abstraction patterns within the VBA environment. Here, I focus on two SQL aspects. On the one hand...

 
2:14 PM
If this is working code, you should instead ask the question on codereview.stackexchange.comjaco0646 24 secs ago
 
3:08 PM
0
Q: General security issue regarding endsWith() function validation for file extension

MrDoufyIs there any bad code implementation inside this code? From what I have analyzed, I guess it might trigger local file inclusion vulnerability. The endsWith() function can be bypass by adding a NULL character(I guess). If it can be bypass that easily, how to ammend this code to be more secure? Not...

 
Monking
@CaptainObvious Hardly any code there, even after the edits.
 
3:33 PM
@CaptainObvious food ordering will most likely go hot
 
With that many answers in 6h, yea, probably.
Throw in another answer and a couple of votes and you've guaranteed it.
 
3:47 PM
Hi! This sounds like it might be a better fit for codereview.stackexchange.com (but please check their posting guidelines first). — IMSoP 24 secs ago
@IMSoP This would not make for a good question on Code Review for multiple reasons. Not enough information about the database being shown and way too much of the code is missing. If this is just a design-review, we don't do those. — Mast 29 secs ago
 
@Duga question removed on SO - hopefully they saw Mast's comment and aren't posting it now
 
Monking
 
4:03 PM
@CaptainObvious repost of off-topic question mentioned earlier
 
 
2 hours later…
6:03 PM
-1
Q: Avoid code repetition | If-Else Statement

Felipe DouradoMy program is working properly but I'm unconfortable with code repetition. for m in proventos: if(m.data.month != currentDate.month or lastRecord == m.id): dataFormatada = f'{currentDate.strftime("%y")}-{currentDate.strftime("%b")}' if(lastRecord == m.id): ...

 
@CaptainObvious Anyone speaking Portugese who wouldn't mind giving that a proper title?
 
6:35 PM
@SᴀᴍOnᴇᴌᴀ @Mast HNQ an hour ago.
 
@pacmaninbw yep - I seen it
 
6:53 PM
0
Q: .Net Core 6.0 : Entity Framework - Either Or / Neither Nor / Both in Where clause

Mugil KarthikeyanI am building a .Net Core 6.0 application that uses Entity Framework. I have situation where I need to apply the filter(Where clause) based on two properties (eg: Guid? skillType, string skillName). These properties may or may not have values, means that Neither of the property will have value E...

 
 
1 hour later…
8:18 PM
SO is not a right place to ask for CodeReview (there is separate SE site for that) nor to ask for opinions (there is no place on SE network for that). If you are not interested in clarifying your post (by making some constructive edit to it) consider deleting instead. Definitely avoid unrelated comments like "nice talk" . — Alexei Levenkov 39 secs ago
 
8:41 PM
Guest Post on August 08, 2022
Can you control what you’ve already set free?
 
8:59 PM
0
Q: C++ Python Wrapper - Is this worth continuing as a small portfolio project?

user3605767I'm wondering if the following Python wrapper for C++ I'm developing is worth expanding upon and including in my portfolio. If so, I plan to add more parameter options and return types. The problem is, that I don't know if my current path is any good. Is my current implementation too amateur? I'm...

 
9:32 PM
possible answer invalidation by Peilonrayz on question by GruffCheetah628: codereview.stackexchange.com/posts/278684/revisions
 
@Duga its okay - backticks @ end of post
 
possible answer invalidation by Peilonrayz on question by GruffCheetah628: codereview.stackexchange.com/posts/278684/revisions
 
 
2 hours later…
11:18 PM
The overarching advice that I have for you is that you should not be creating multiple regexes for a single attribute. The . in your patterns seems to be misunderstood. If you'd like to have your working technique reviewed more carefully, I recommend posting your script on Code Review. — mickmackusa 32 secs ago
 

« first day (3383 days earlier)      last day (620 days later) »