« first day (2911 days earlier)      last day (51 days later) » 

12:01 AM
RELOAD! There are 7530 unanswered questions (89.4612% answered)
 
12:43 AM
0
Q: Avoid database insertion when another query fails

CelsomTrindadeBefore starting, I'd like to say I'm not an advanced user on PHP, I'm still learning. I'm working on an application where I have a class to handle all database operations and I'm trying to simplify this process and catch errors in a better way. For example, when I want to insert a new user I need...

 
@Zeta How's the new version?
 
1:14 AM
Thanks @loremipsum. The first of three questions is a "right-way" question indeed, but question 2 and 3 are more "how do you make this work properly?" so hopefully I can get some answers here. I'll check out Code Review. — vmallet 13 secs ago
 
1:47 AM
You may want to consider moving your question to CodeReview. — Daniel 35 secs ago
 
1:58 AM
If you have working code that you want peer reviewed for improvements, you should ask on Code Review instead - it was created specifically for that purpose. — Ken White 34 secs ago
 
2:18 AM
0
Q: Disk usage reporting script performing poorly with lots of files

Ashley HI am running a PowerShell script that gets show disk usage for drives into html reports. While this works quite well it has a problem on some file servers with a massive amount of files. It can sometimes take up to 1 day in a worst case scenario which obviously isn't ideal. I'm wondering if there...

 
 
2 hours later…
4:02 AM
Monking
 
4:12 AM
@CaptainObvious That's a bit of a grey area. Left a comment. Opinions?
 
5:05 AM
0
Q: How to write a 4 player odd/even dice game in python

Sanduwara B MuthumaldeniyaEach player rolls four dice, For each odd number rolled the number is subtracted from their total, For each even number rolled the number is added to their total, Even numbered dice can be rerolled (once) if the player wants to try to get a higher score. The highest total wins The program should...

 
5:43 AM
@CaptainObvious no code no glory
 
Monking
@Mast Reviewable. Poly::new may still be missing, but everything's there to review poly_poly_sweep.
 
Good.
 
6:33 AM
 
 
2 hours later…
8:09 AM
have you heard of switch-case statements? Either way, this is rather a code review question — Stultuske 16 secs ago
@Stultuske The Code Review site won't accept it though, the code is hypothetical and that never goes over well. — Mast 6 secs ago
 
 
1 hour later…
9:26 AM
0
Q: Remove \n newline from a list of string dumped from github used for a Italian stopwords vocabulary

Andrea CiufoI have a set of Italian words in a txt file hosted on GitHub. I use it as stopwords vocabulary for futher NLP tasks. When I dump from GitHub it returns me, obviously, also \n Better or more efficient way to replace the special character compared with my working code? :) import urllib.request sto...

 
 
2 hours later…
11:26 AM
0
Q: How do I draw lines in a grid using a mouse?

Jakub MitregaI need advice on how to make an event and draw mouse lines in the grid. Somehow I can't do it so I can draw straight lines in a grid. But I still have a grid, I don't know how to fix a drawing error. I am adding my Javascript code below. My mouse drawing event doesn't work, it doesn't draw me at ...

 
@CaptainObvious Code not working.
 
12:18 PM
@CaptainObvious Closed.
 
12:34 PM
@Donald.McLean Greetings user.
 
Greetings, Programs.
I've made some progress on the Person of Interest inspired game. Though, being an old man, I can't remember who else in this group was a big PoI fan.
 
My boss told me to watch it because he said I was similar to one of the characters
2
 
1:05 PM
0
Q: Top-Down Dungeon RPG

ZeldaI'm making a top-down dungeon minigame where you are a knight and can attack zombies by swinging a sword. So far I haven't implemented collision, player rect(), enemy rect(), a game over screen, or the player sword animation, but all the code I have so far is working well, even though the main lo...

 
1:32 PM
I did a search. It was @SimonForsberg
@DerKommissar Interesting - which character? It was really the characters that made the show so good. SF and near SF TV used to get random dregs for actors that it was refreshing to see something that was well written, well acted, and had quality production.
 
2:26 PM
possible answer invalidation by Zelda on question by Zelda: codereview.stackexchange.com/posts/259900/revisions
You probably should ask such a question on codereview.stackexchange.comDevolus 11 secs ago
 
@Duga rolled back
 
2:42 PM
@Donald.McLean Me
 
0
Q: Variable Size Memory Allocator in C, merge free contiguous blocks

NoobCoderI'm trying to write a good implementation for a variable size allocator in C as part as an assignment. The user will allocate a big memory chunk using malloc and will ask us to manage this chunk. So this is the struct that we all accepted on, and must be used: /***************************** Struc...

 
But Simon even more so
 
Kaz
@Donald.McLean I recall quite enjoying it. For the budget they had, it was really good.
 
2:59 PM
@Donald.McLean I have no idea, I'll ask him.
 
@DerKommissar Which one?
 
@Mast See the message above yours lol
 
Ah, I'm on mobile and chat only works half there...
 
Gotcha, I'll try to ask in standup today
 
3:15 PM
Des Darilek on April 23, 2021
Here’s where the Community platform is going this quarter. Spoiler: We’re taking on a lot of big projects.
 
Monking
@CaptainObvious Those zombies look happy :)
 
@SᴀᴍOnᴇᴌᴀ Brains!
 
 
3:31 PM
-1
Q: Blackjack design C++

MorMordochI am preparing for a coding interview, and alongside the Data Structure questions, I want to work on my OOP/OOD capabilities. I saw this design question on "Cracking the coding interview" book, and I want to implement it in a broader way. I want to create a superclass "CardGame", which all the ca...

 
3:46 PM
"You still can't walk into someone's house without being invited!" "What/ Oh, I see your confusion. No, this vaccine is for a bat VIRUS. I'm fine with doorways and garlic and stuff."
2
 
@Donald.McLean PoI-fan? Me? Noooo....
65
Q: You are being watched! - Comments of Interest

Simon Forsberg You are being watched Code Review has an open system A machine that spies on you on every hour of every day I know because I built it. I designed the machine to detect suggestions to post on Code Review but it sees everything Horrible comments involving ordinary users Users like yo...

Have no clue what you are talking about 🤣
@rolfl is a fan as well IIRC
@DerKommissar Are you a very private person? Tall guy in a suit? Highly trained assaissin? Assassin and hacker combined? A dirty cop? A decent and honest cop? Or a maffia boss?
I would guess very private person.
@Donald.McLean Last episode watched: s04e14, watched it yesterday
 
4:11 PM
@SimonForsberg Leon
 
4:22 PM
@Mast Yeah not even sure how I would describe that guy 😆
 
4:41 PM
I reposted a simpler version over on codereview. Here is a link to it: codereview.stackexchange.com/questions/259908/…StoneMonkeyMark 42 secs ago
 
0
Q: Is this a good way to construct the class for a C++ template partial specialisation of a member function?

StoneMonkeyMarkI am teaching myself c++ by doing a series of exercises. I liked the idea of working out how hash tables could be done using just the language and no std calls. I discovered that you cant do "class member function partial template specialisation" and so worked on options for how this would be ach...

 
5:35 PM
 
5:54 PM
1
Q: JavaScript ToDoList

AdvancedZinchttps://github.com/abdullahinuur/ToDoList live link at https://abdullahinuur.github.io/ToDoList/ I am new to working with JavaScript and this was the latest project I completed. I tried to keep everything as separated as possible. Essentially a project is just the list of todos, and an item is a ...

0
Q: Setting and clearing setTimeout() inside of an event handler

Sheik YerboutiI have an event handler function which every time is triggered should clear a setTimeout() and set a new timeout. Now the callback for the timeout has to take few arguments, for example the event object received by the handler. And that's it. I did it, but I believe that my solution is not optima...

 
6:17 PM
0
Q: Database normalization for grade management system

tibiI am working on a grade management system web app for a university and I came up with this database schema user |Field |Type |Null|Key|Default|Extra | |-----------------|------------|----|---|-------|--------------| |id |int(11) |NO |PRI| |auto_...

 
@CaptainObvious no code, no glory...
 
I would suggest that you take a crack at it and if you have problems, show us what you tried, show us what is not working, and we can try to help you. Or, if you have successfully done this and are asking for feedback, then maybe codereview.stackexchange.com might be better forum. But, unfortunately, as this stands, it is too broad. Are you asking how to implement an adapter? How to implement factory pattern? How to spy (vs mock)? How to do TDD? Whether unit test is more appropriate than UI test? Etc. — Rob just now
 
7:04 PM
@CaptainObvious If I had a dime for every JavaScript ToDoList post here, then... I'd have at least a few dimes
 
7:24 PM
A todo, just a list.
Adding stuff, that and this.
Larger task/ irritates.
But small scope/ motivates.
C and R, U and D.
Getting told, they will be.
 
0
Q: C# Array Sorting Algorithm

Jonas _I recently created an array sorting algorithm as a training exercise. static int[] Sort(int[] arr) { if (arr.Length % 2 != 0) throw new NotSupportedException("Arrays with an odd amount of items are not supported."); if (IsSorted(arr)) return arr; List<int[]> pairs...

0
Q: How could make this Django logging middleware more efficient?

creyDWe built a REST API with Django and the Django Rest Framework. As we want to track which endpoints get used how much and which users use what areas, I wrote the following middleware: class AnalyticsMiddleware: def __init__(self, get_response): self.get_response = get_response def...

 
But yeah, Todo lists seem to be revelatory exercises for some reason.
 
7:54 PM
They're a great exercise.
 
This might be more for code review stack exchange. — Trilarion 1 min ago
 
They're also a great way to learn about boundaries, scope, scope creep, maintainability, YAGNI, etc.
Make a working version first, uproot it on the next revision for more features.
 
8:16 PM
@Zeta is there a meme about poetry not listed yet?
I also noticed there is a haiku tag on Meta SE...
34
Q: What is this "spam haiku" nonsense all about?

ravenNo one is talking Many of us are clueless WTF

 
I think this question should belong to code review. codereview.stackexchange.comAlbin Paul just now
 
8:53 PM
A side note: since you actually have a working algorithm that you're looking to improve, it seems a better fit for Code Review. Have you thought about posting there? — El_Vanja 48 secs ago
 
9:25 PM
0
Q: Learning OOP (python) and need to know if I'm using the best coding pratice and concepts. The code are working

zaratabataHello. The code bellow are result of my effort to try understand Object-oriented programming (OOP). I'm very new into programming field, so, even it's working, that doesn't mean I'm applying the right concepts, and the best programming practices, and that is my main objectives here. My objective ...

 
10:14 PM
0
Q: 3Sum - leetcode qeustion

Joseph GutstadtHere's my pythonic approach to leetcode 3Sum, it passes and actually beats 93% in time! However, the code is unweildy and the approach seems much overly complicated. I am looking to clean up the two sum function, and overall approach, but I'm not sure how. def threeSum(self, nums: List[int]) -

 
10:25 PM
I’m voting to close this question because this belongs on the CodeReview stack — Brondahl 12 secs ago
@Brondahl No the question is clearly off-topic on Code Review "it does not work on the first one. Why is this?" — Peilonrayz 16 secs ago
 
10:41 PM
Hey, sorry! I'm super new, I didn't realize there was a more appropriate place to post this. I can repost in CodeReview stack and add some troubleshooting I've tried. - thanks — amac 55 secs ago
@amac please don't post this on CR until the code works and you understand it. For more information, Please read the on-topic Help center page — Sᴀᴍ Onᴇᴌᴀ 16 secs ago
If you're looking for a peer-review then you should post this question on codereview.stackexchange. It's a community like SO where people tend to give feedback instead of solutions. — Emiel Zuurbier 47 secs ago
Yes, sorry. My bad. Code Review isn't the right place for this. However, you haven't described doing any debugging of this yourself; you seem to want us to do that all for you? — Brondahl 14 secs ago
I’m voting to close this question because it doesn't belong on Stack Overflow. It belongs on codereview.stackexchange.com. — Scott Marcus 29 secs ago
 
11:03 PM
0
Q: check list of urls response code

αԋɱҽԃ αмєяιcαηimport argparse import logging import os import smtplib import time import httpx import trio from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import tabulate logger = logging.getLogger('MyLog') logger.setLevel(logging.INFO) formatter = logging.Formatter( '...

 
11:27 PM
0
Q: Sorting numbers in an array without using .sort() does not sort all numbers within the array - javascript

AmacI'm a beginner working through some test interview questions. One is asking me to sort an array without using any helper functions. I am trying to sort the following array from lowest to highest, but am finding the output as 29.50 coming before 18.50, while other numbers are sorted correctly: var...

 

« first day (2911 days earlier)      last day (51 days later) »