« first day (2698 days earlier)      last day (1302 days later) » 

12:00 AM
RELOAD! There are 7006 unanswered questions (89.7572% answered)
 
12:17 AM
0
Q: How to speed up a treeview population in Access?

leopardxpreloadI have the following function that causes a significant visual jittering and lag in my access database - This is a treeview selection based on data in a table (tblDATA) with the fields: Object | Attribute | Property | Value I have tried echo and me.painting but figured my actual for loops need to...

0
Q: Speed Efficiency of Decompression Algorithm

StephenI've rewritten a piece of Javascript in Python 3.7 that decompresses a file compressed in a specific format. The project that I got this from is available here. The code I've come up with is as close an analog as I could interpret (I'm not the best at Javascript). def decompress_lz2(data): gl...

 
12:42 AM
0
Q: TCP Multithreaded Server and Client C#

HodorKingI created a TCP Server and Client and I really would like to know if its any good in regards of performance and code quality / safety. I hightlight the server and client class here. If you need more insight in the Helper classes I could share them as well. One thing I know is creating threads for...

 
12:57 AM
 
1
Q: Martingale Betting Simulator 2.0

Stephen WilliamsThis is a second shot at creating a Martingale betting simulator. The original code needed such heavy refactoring that I just started from scratch. Script simulates the Martingale betting strategy of betting a fixed amount until a loss occurs, at which point the bet is doubled to make up for the ...

 
 
1 hour later…
2:35 AM
On Stack Overflow, it's not really acceptable to change the question after it's been answered. The answer I gave is for the code you gave. Changing the code is essentially changing the question. If you want someone to review your code, post it to codereview.stackexchange.comDoug Stevenson 1 min ago
 
2:47 AM
1
Q: A simple Snakes and Ladders implementation in Java

P. BeriI created a pretty straightforward snakes and ladders implementation in Java just for the heck of it. The program can be summed up as- a. Object of Board contains an array of Type Tile to represent the actual board. b. Object of type Tile contains an Enum data member to identify if its a regular ...

 
3:32 AM
Note that Code Review requires code to already be working correctly to the best of the author's knowledge. CR is more for broad critiques and suggestions on readability, maintainability, professional conventions, but only on correctness in unexpected edge cases that happen to not have been taken into consideration yet. Asking how (or if) something works is still better suited for SO than CR — CertainPerformance 30 secs ago
 
1
Q: Returning a promise with nested conditionals from a Firebase function?

acidgateThis Firebase cloud function must return a promise but my understanding of nesting them is shaky. This function performs a Firestore read and then sends a remote message if a condition is met (based on data from that read). I first return the call to get the document because get() itself returns ...

 
3:55 AM
Dear OP, code that works but may be improved or review is much more likely to be better-suited to [C.R.S.E] (codereview.stackexchange.com) , since that S.E. site exists precisely for this . — A P Jo 29 secs ago
 
4:40 AM
Monking
 
5:16 AM
Monking
 
5:42 AM
0
Q: Simple html/css challange for learning purposes

MatiGood morning, As part of my study, I decided to do some tasks from frontendmentor site. It's a short html code but I would like to learn good practices from the beginning. The problem I encounter is adding names to classes to make them readable and second problem is what should I pay attention to...

0
Q: Remove Duplicates from the ArrayList

tyMindI know that this challenge can be solved using HashSets, but what is the disadvantage of this way except the time complexity. public ArrayList<String>removeDuplicates(ArrayList<String>emails){ String m=""; for(int i=0; i<emails.size(); i++){ if(m.contains(emails.get(i))){ ...

 
6:02 AM
If you are looking for a way to improve your code and not fix it then I think you might want to head over to Code ReviewThe Grand J 20 secs ago
oh ok thank you i didn't know there is a code review forum. — Aaron Wei 48 secs ago
 
6:27 AM
If your code is generally working it sounds like this is more a case for Code ReviewderHugo 36 secs ago
If your code is generally working it sounds like this is more a case for Code Review .. though yeah .. lagging comes more likely from a particle system (and other heavy stuff) than from your lines of code. As suggested use the Profiler with Deep profiling and chenge TimeLine to Hierarchy to find out what exactly takes longest in your frames and start reworking there instead ;) — derHugo 15 secs ago
 
6:47 AM
"Does it work?" – Well, you should know. Do you have a real problem? If you do not have a problem, and just need a code review, please go to Code Review. — Martin Prikryl 26 secs ago
 
7:22 AM
0
Q: Force Download anything in PHP

Sujal JainI want to force download only images in PHP. But, the problem is that I am not able to modify the code for the purpose. The code which I made is able to download any file in that folder. So, can anyone help me with modifying the code for downloading only images (.png, .jpg, .gif, .webp, etc.,)? I...

 
Hello Rick, This was not intended as an code review or problem as such, but as curiosity why POST is used in logout and not GET, since my google -fu failed me :) — Jupi 40 secs ago
 
7:47 AM
0
Q: How can a code that takes dict as input and validates it based on multiple conditions be further optimized?

JunkratI have a piece of code that takes a dictionary as input and validates it based on the following rules: The dictionary has a key named items and its value must be a list Now, the list from point 1 must be a nested list with the length of each list should be 2 The first element ([0]) of every nest...

 
 
1 hour later…
9:02 AM
0
Q: Efficient loop over a integer range in Python

snowflakeI want to search for positions inside a range of integers. How to improve the code in terms of efficiency, since both my search list and the ranges are very big: #Range list with ids range_lst = [(121000, 122000, 'foo'), (123456, 124557, 'bar'), (156789, 163659, 'egg')] # Positions which we want ...

 
9:49 AM
this question may be better suited for CodeReview sister site on the exchange network. It seems like you're basically asking for a cleaner way to do this functional code, right? — Brett Caswell 35 secs ago
if it works then it should be on Code Reviewphuclv 27 secs ago
It's clearly to do the same code cleaner, but never went to the CodeReview site. @BrettCaswell — peljoe 11 secs ago
 
10:17 AM
I posted the question on CodeReview. — peljoe 5 secs ago
 
0
Q: .NET Core api : Return viewmodel/response based on Enum value

peljoeI'm working on an API endpoint working with enums, and I need to return a different Response/ViewModel based on enum value. I'm sure Generics can help me here but I can't figure how. Multiple entry points that looks like : public async Task<IActionResult> Get[ElementEnum](Enum enum, int? id = nul...

 
10:42 AM
1
Q: A Pong Game using C++

EonI wrote a simple, 2-player Pong game for a Udacity Nanodegree in C++. The program has the following class structure (relatively new to UML so any tips on here would be very much welcome too): Towards the end of the project, as I needed to add more features, my Game class started to do many many...

 
11:32 AM
1
Q: C++ Thread Server: Thread control & management

charlie00_So I created a thread server that creates threads and associates them with a handle so that you can keep specific threads for specific tasks e.g. run all graphics rendering on thread 0, run physics stepping on thread 1 and use thread 2 for downloading a file of the internet etc. Personally I've f...

 
11:49 AM
Questions like theese are off topic for Stack Overflow. Post on codereview.stackexchange.com instead — MathewHD 24 secs ago
 
12:22 PM
0
Q: Netlify plugin to generate CSP rules on the fly

marcellothearcaneThe following code is a Node-based Netlify plugin to generate Content-Security-Policy rules based on inline styles and scripts. Inputs buildDir - a string for setting the build directory. exclude - an array of file paths to exclude from processing. (defaults []) policies - an object of policies ...

0
Q: CSS Selector “A and (B or C)”?

bluerayTo get the book list from https://www.java67.com/2015/09/top-10-algorithm-books-every-programmer-read-learn.html , I am using the following code in the console of the firefox DevTools: var select = document.querySelectorAll("div.post-body.entry-content div h3 b"); for (i = 0; i < select.length;...

 
12:38 PM
Thank you, I do not know about this website. I posted here codereview.stackexchange.com/questions/249680/…TomTom 58 secs ago
 
0
Q: C# nested if-else optimization with almost similar values

TomTomI have new user data (i want to import/update it). Accounts is finded by user data. I want to update or create new accounts depended on finded accounts by user data : if (accountById != null) { if (accountByNumber != null) { ...

 
1:37 PM
1
Q: Node.js package that retrieves data from an API, formats it and sends it out via email to a distribution list

Arran ScottI've created a Node.js package that retrieves data from Icinga (a monitoring platform), formats it and passes it off to a class that generates some HTML and then sends it all out as an email. The email, in its simplest form, looks something like this: I come from a Ruby/Python background and thi...

 
 
1 hour later…
3:06 PM
Monking
 
Monking
 
3:18 PM
0
Q: Python Tic-Tac-Toe

OmikronI made a very primitive Tic-Tac-Toe using Python and I would like a grade on how well I coded the game. What code was there that could've been simpler or more efficient? And any advice you can give me? Below is my first 3 line of code but the link to the entire source code is: https://onlinegdb.c...

 
@RMunroe perhaps for some values of "okay"...
 
:)
Might be well preserved.
 
@Mast bearing in mind it was answered 6.5 years ago, would you or anybody else @here have an answer to this meta post that would be different than rolfl's answer? Does it merit re-asking the question in today's context?
3
Q: Would it make sense to copy (some) tag wikis from SO?

ChrisWueThere are a lot of good tag wikis on SO and some of these tags apply to CR as well. So I was wondering if it would make sense to copy them from SO? I guess the excerpt might be different to state why or which questions should be tagged as such in the context of CR but the tag wiki could easily be...

@CaptainObvious There is a great answer by CertainPerformance on that one
 
3:35 PM
@SᴀᴍOnᴇᴌᴀ Seems like a solid policy to me.
"Does it merit re-asking the question in today's context?" Only if there is something lacking with it.
 
okay - I was thinking about this conversation from last year
now that I re-read his suggestions it appears to be congruent with rolfl's answer
 
@SᴀᴍOnᴇᴌᴀ I don't know what the edit was, but I too read Mast's points the same way.
 
3:53 PM
Ok yeah, even with the added context I think Mast has a fair point
 
4:08 PM
0
Q: Javascript Online Notebook

Антон БоровикI use an online, simplified notebook. I'm able to add notes, delete notes, and edit existing notes. I find the code to be pretty unattractive and is heavily repeated. When I built this, I borrowed code from many sources (I was still learning web programming) and I had a hard time consolidating th...

 
Monking
 
What computation errors do you have? If there aren't any, then this is not a Stack Overflow problem; it might fit CodeReview (see their posting standards). If you don't know whether or not your code works, then you need to complete testing before you post. — Prune 49 secs ago
 
4:48 PM
Yay, I have a file 'so big' VS Code breaks if I open it. It's only 4.9 MiB... :/
2
 
4:59 PM
0
Q: Print exact value represented by float in [0,1)

ManuelI decided to print a float value \$x\in[0,1)\$. But not the rounded value like print(x) does but the exact represented value. And only using basic operations: def print_float(x): # Convert float x to integer fraction num/den. num, den = 0, 1 while x: x *= 2 num *= 2 ...

 
5:31 PM
@Peilonrayz There you go breaking things again. :)
 
@pacmaninbw lol :)
 
if your code works it doesn't belong on stack overflow, it belongs on code review. i will say though, the biggest improvement you can make to your code right now is formatting. what is that } at the end of the post? — I wrestled a bear once. 41 secs ago
 
@SᴀᴍOnᴇᴌᴀ It's only worth re-asking the question if you're aiming for a different answer. Is there a problem? cc @Peilonrayz
 
@Mast no i think thinks are cleared up
s/i/I
 
Ok
If there's anything wrong with the current policy, feel free to mention it.
 
5:42 PM
codereview.stackexchange.com post here and delete this or you might get downvoted to oblivion — Tom Wojcik 26 secs ago
 
@Peilonrayz do you typically use MiB more than MB?
 
1
Q: What can I learn from this coding test?

Russ JSo I was recently asked to complete the following challenge for an interview: Programming Problem Provide a production ready solution that accepts a new user name, validates a single string input as the password, and stores it locally. The solution should be written in C#/Xamarin with native UI ...

0
Q: Filling a struct array with a repeated value

user230882memset() copies bytes faster than copying them one at a time in a for loop. However, is there an equivalent for struct arrays, if I need to fill a struct array with a repeated value? Here's my current code. for (unsigned int i = 0; i < 4096; i++) { Voxel.Material[i] = (struct Instance){.ID = ...

 
@SᴀᴍOnᴇᴌᴀ I don't really make a conscious effort on which I use. I just copy the units verbatim. Last thing I want is to say 4.9 Mb which is drastically smaller.
 
good call
 
6:10 PM
sigh
My obfuscation-method is partially screwing-up the usage of my program. Not good.
I need better cases.
 
6:23 PM
@CaptainObvious I think that needs a language tag and needs a better tag description.
Oh my is the current usage guidance useless.
 
@Mast :(
 
Eh, I'll think of something.
But I don't want to list a bunch of spam-domains in a CR question.
 
@Mast Yeah, I think it was taken from Wikipedia verbatim the current pretext for it is shockingly alike, even after 5 years.
 
That would increase their footprint.
I could (ab)use some name-generator to switch out names of users and domains by equal-length once so it's still unique-ish and clear what's going on...
 
That sounds like a fairly ok way to do it
 
6:38 PM
@CaptainObvious there is a VTC to send it to SO... is that appropriate?
 
@SᴀᴍOnᴇᴌᴀ Rarely, doesn't stop some people...
 
0
Q: Using Token Bucket to rate limit function calls

Vishal SharmaThis program is my attempt at solving the below problem: We have a function which is going to be called by multiple threads. The problem is to find a way to limit the number of times this function is executed per second given that we don't have a control over: a) The number of threads calling thi...

0
Q: Getting value from a property according to some parameters

CDrososIm curious if my approach is correct in this case: I would like to get two DateTimes from a public property, but one of the dates i want them only if a user has purchase a feature or if he has not activate a switch, otherwise i want to get the same DateTime twice. More specifically, the way im ge...

 
@SᴀᴍOnᴇᴌᴀ Quality: Ok, On-topic on SO: I think so, Duplicate: Don't know. I don't want to check for a duplicate so I'm not going to vote to migrate, however if you want to and you don't find one I think it's ok.
 
@Peilonrayz IMO that seems too broad for SO...
 
I personally don't ever vote to migrate. Not a fan of the system and I'm somewhat aware of my lack of understanding of other site's rules.
@SᴀᴍOnᴇᴌᴀ Then the answer to "is that appropriate" is a definitive "no".
 
6:42 PM
It seems to be more on-topic on CR... but might be missing review context...
 
Yeah could be a best practice question. Rubs me up the wrong way.
 
7:30 PM
Now I'm writing the meta-script to test, sanitize and validate the real script.
But why does it always have to take so freaking long.
I could use the API for part of that, but that would blow-up the development-time another ten-fold.
 
8:05 PM
Also, if the code works and you're willing to share all of it, you should check the help center to see if your question is on topic for Code Review. — Heretic Monkey 26 secs ago
Please repeat on topic and how to ask from the intro tour. You ask for a code review and other tutorial help; this is too broad for Stack Overflow. Some might be covered by CodeReview. — Prune 53 secs ago
 
8:21 PM
0
Q: Generating random 64/32/16/ and 8-bit integers in C

JohnnyLeekFirst of all, I wasn't sure whether or not to post this on StackOverflow, because I'm simply asking for an explanation of how this code works, not necessarily improving it. My professor has given us this code snippet which we have to use in order to generate random numbers in C. The snippet in qu...

 
@Prune No, this question would not be welcomed on Code Review for multiple reasons. — Mast 21 secs ago
 
8:42 PM
Why are you doing this? — Mast 2 hours ago
@Mast Idk how to answer that — user230882 1 hour ago
ಠ_ಠ aimless coding??
 
0
Q: Possible improvement on join query

RaymondI have the following query which retrieve all those who have ordered a book_id n°10 and but never ordered the book with id n°1. http://sqlfiddle.com/#!9/1bb9e8/44 |user_id | book_id | | 1 | 1 | | 1 | 2 | | 1 | 3 | | 2 | 1 | | 2 | 10| | 2 | 9 | | 3 | 5 | | 3 | 10| | 4 | 6 | | 4 | 7 | | 4 | 10| | 8...

 
@SᴀᴍOnᴇᴌᴀ They may not understand what is meant by "this". tbh I'm not really sure what @Mast's question is. But given your response I'm assuming "Why are you programming this?" might be somewhat close.
 
@CaptainObvious it's still September...
@Peilonrayz okay I left a comment with the goal of obtaining more information from the OP... actual results are less than expectations :/
 
@Peilonrayz My bet is this is a user that has plagued us before. There are 3 reasons to close the question as off-topic.
See my comment after @SᴀᴍOnᴇᴌᴀ comment.
I think a moderator should hammer it shut, but one of my flags was declined 2 days ago so I won't flag it.
 
8:59 PM
@SᴀᴍOnᴇᴌᴀ Thanks ^^
@pacmaninbw I don't see how that has anything to do with the topic on hand - language and interpretation.
@pacmaninbw I think one of our mods is having a well deserved break at the moment :)
 
I saw that @rolfl had voted to close 2 questions in the Low Quality Queue earlier today maybe they would like to help.
@SᴀᴍOnᴇᴌᴀ Yes it is, but the worst questions are always at the beginning of a term or semester.
 
Oh, I just realized why this 'wave' is full of noobs in Python land... Wow I'm slow.
 
9:15 PM
:) Python is always slow.
 
Someone thought I was lying when I said Python is slow. I even had a graph showing a naive amalgamation of C and Python destroying optimized Python...
 
9:43 PM
@SᴀᴍOnᴇᴌᴀ Don't expect more from this user, I have a feeling we have closed their questions before and that moderators have deleted their accounts. I also believe they were banned from SO for 300 years.
 
~ flexes ears back in shock
 
Always questions in C about memset().
 
10:02 PM
0
Q: Are These Python Nested Functions and Classes OK?

Chris DrymonI created a program that simulates World of Warcraft combat. It used global variables intellect, crit_rating, etc. to time how quickly someone would do a certain amount of damage. Later, I decided to make this into a web app wherein the intellect, crit_rating, etc. could be manipulated by the web...

 
@CaptainObvious mrc
 
This question is probably much better suited to Code Review. — MattDMo 9 secs ago
@MattDMo Sounds like the OP is asking for golfing not Code Review. — Peilonrayz 39 secs ago
@MattDMo 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?". The question "is my code right?" would likely be perceived off-topic on CR. — Sᴀᴍ Onᴇᴌᴀ 53 secs ago
 
10:30 PM
If your code does work and you "only" want improvement, consider posting it to code review stack exchangeJan Stránský 19 secs ago
 
10:53 PM
0
Q: PyPDF2: merging PDF files

medic17I sometimes need to merge some big PDF files. Looking around I decided to use PyPDF2. All files are in the same directory as the script. The code works as intended and was tested with 5 small PDF files. I found many variations and decided to write this one myself: import glob from PyPDF2 import P...

 
@MichaelFreidgeim This question would be off-topic on Code Review as it is missing context. In the future please link to the help center and use wording that shows the post may be off-topic when recommending Code Review. Take, "This may be on-topic on Code Review. Please check if it is on-topic and how to post a good question before posting there." — Peilonrayz 54 secs ago
 
@SᴀᴍOnᴇᴌᴀ @Peilonrayz I'm going to start calling the asker of questions like this the memset bandit.
 
@pacmaninbw Lets not engage in name calling?
 
Why don't you add the fifth nail in the coffin.
 
11:02 PM
If it's the same person as before flag it and ask for the user to be IP blocked
@pacmaninbw Because I can't vote twice
 
:)
I can't prove it is the same person as last time, and who knows how many internet cafe's he can visit or IPs he can access.
 
maybe if you go to code review stackexchange it will throw less errors... — Eugen Sunic 1 min ago
 
@pacmaninbw Yes. But that's not the point I'm getting at. If you don't report it how will the mods know to, and possibly how to, fix it?
 
@Peilonrayz Flagged. I hope it doesn't get declined.
@Peilonrayz this is why I was hesitating to flag it. > declined - Using standard flags helps us prioritize problems and resolve them faster. Please familiarize yourself with the list of standard flags: see What is Flagging?
That was from a flag I raised on 9/18.
 
@pacmaninbw Unless you have a high percentage of declined flags then I wouldn't worry too much about it
 
11:17 PM
@pacmaninbw I don't have, nor do I want, the context to comment on that. I almost exclusively use custom flags. I wouldn't take it to heart, just try to use the normal flags if they seem apparent from now on.
 
I have about 10% declined.
Out of 329 helpful flags.
 
@pacmaninbw I have ~5% but I know the mod's tendencies now and most of my declined are either special cases or because mods have a different POV on the rules. If you check out your flag history page you possibly can see a pattern. If you can see say your VLQ posts are being declined just stop reporting them, if the site then turns into a cesspit because of this it's not your fault.
 
Wish I could star just this portion - if the site then turns into a cesspit because of this it's not your fault.
 
I had the same sentiment
 
lol
 
11:33 PM
@Peilonrayz I look at that page almost every day.
 
@pacmaninbw Wow, we have completely different workflows. I look at it once in a blue moon ;)
 
Normally to check if my flags been declined. But it seems like they've recently removed the need for me to do that now.
What's rarer then a blue moon, a cheese moon?
 
blood moon? supermoon?
 
You're making me think I should study astronomy more, and not get my moon facts from Wallace and Gromit
3
 
11:42 PM
My hypothesis appears to be correct: "2020 [Cooper's Hill Cheese-Rolling and Wake] event cancelled due to COVID-19. A solitary cheese is expected to be rolled to maintain tradition" - en.wikipedia.org/wiki/…
 
0
Q: Determine dependency injection type at runtime from config

Michael Brandon MorrisI have a .NET application with a .config file that has content like this: <appSettings> <add key="SmtpConfiguration" value="Db" /> </appSettings> Inside the application's code I define an ISmtpConfiguration interface and several different implementations. DbSmtpConfiguration gets configurati...

 
I think I answered another HNQ.
12
Q: A Pong Game using C++

EonI wrote a simple, 2-player Pong game for a Udacity Nanodegree in C++. The program has the following class structure (relatively new to UML so any tips on here would be very much welcome too): Towards the end of the project, as I needed to add more features, my Game class started to do many many...

 
@SᴀᴍOnᴇᴌᴀ Wat, English town traditions are weird man
 
@Peilonrayz Says the man that lives in the UK.
 
11:55 PM
@pacmaninbw Well when you put it that way, it might explain a few things... ;)
 
;)
@SᴀᴍOnᴇᴌᴀ How many rep pts do you need to see time line, or is there something I'm missing?
 

« first day (2698 days earlier)      last day (1302 days later) »