« first day (3090 days earlier)      last day (910 days later) » 

12:02 AM
REFRESH! There are 7879 unanswered questions (89.2781 answered)
Were I to do this, I'd make some changes (if you have it working, just consider this some code review, hand in what you have unless you are very keen). Create an enum for the 4 suits (clubs, hearts, ...). Create a class that contains both the suit and the value as properties. Figure out how to load the card image from the properties of the card class, and make the card image a read-only property that works once the image is loaded. Now you can build your deck with two nested loops (1..13) and (Heart .. Spade). Once the deck is built, tell each card to load its image. Then shuffle the deck — Flydog57 15 secs ago
 
1:01 AM
0
Q: Implementing a Most Recently Used Cache

Hooman BahreiniI want to create an In Memory Cache in .Net. The primary usage for this cache would be to store addresses... I want to keep around 1000 addressed in memory and once the cache is full, remove the Least Recent address from the cache. Microsoft provide 2 versions of MemoryCache, one is implemented i...

 
 
3 hours later…
3:52 AM
0
Q: Generalized implementation of Binary Tree DFS and BFS traversals factored into one class using generators and lambdas. [python3]

josevilleThere are six Binary Tree DFS traversals (preorder, inorder, postorder, and their reverse counterparts). Their implementations can be very similar 1, so I factored out the core logic into a class Traverser (found in the first code block below). As an example, say you want the "inorder" traversal ...

 
5:07 AM
0
Q: Express.js and jsonplaceholder application

Razvan ZamfirI have put together a small node application with Express.js and jsonplaceholder. On the homepage, it displays posts by all users. You can also filter posts by one user (author). In app.js I have: var createError = require('http-errors'); var express = require('express'); var axios = require('axi...

 
Monking
 
5:42 AM
Monking
 
 
2 hours later…
8:05 AM
possible answer invalidation by Vishnu on question by Vishnu: codereview.stackexchange.com/posts/269105/revisions
 
9:04 AM
I think you are trying to use wrong tool for the job. This sounds like human problem, not technical problem. Correct solution would be documentation, guidelines, training and code reviews. — user694733 59 secs ago
This kind of questions is better asked at Code ReviewJens 25 secs ago
 
9:46 AM
0
Q: Does Angular (or other frontend framework with auto UI update) break Single Source Of Truth since using function within template should be avoid?

Ricky MoI know when building an Angular app (or other frontend framework with auto UI update by change detection), using function in a template is not recommended since it will result in the function being called every time when change detection runs. This means if we want to display a value derived from...

 
10:10 AM
possible answer invalidation by Vishnu on question by Vishnu: codereview.stackexchange.com/posts/269105/revisions
possible answer invalidation by Vishnu on question by Vishnu: codereview.stackexchange.com/posts/269105/revisions
 
10:51 AM
0
Q: C++20 std::array implementation

NeverI'd like to have a review on my C-style array wrapper. I based this on std::array implementation. I hope you can leave some feedback! array.ixx module; #include <cstddef> #include <stdexcept> #include <utility> #include <type_traits> #include <compare> export module array; export namespace stl...

0
Q: Get data from a chain of lists

user3378165I have 3 different lists which I get in 3 separate API calls. persons 2. cars 3. xategories What I need to do is: Get persons -> then pull cars ids from the persons list Gel cars based on the cares ids I got on #1 -> then pull categories ids from the cars list Get categories based on categorie...

 
 
1 hour later…
12:12 PM
@Duga OP rolled back the edit.
 
@newtocodingyikes: there are a number of points that would deserve improvements in this code. As soon as is works, you should post it on Code Review in order to get useful advices. — Serge Ballesta 14 secs ago
 
12:34 PM
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 24 secs ago
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 8 secs ago
 
12:47 PM
Post your working code on the Code Review stackexchange and see if anyone will help with that. (Check their on-topic guidance though first oviously). It's not really what we do at Stackoverflow. — ADyson 37 secs ago
 
1:01 PM
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 48 secs ago
 
1:28 PM
In case this is working code, you can post it at codereview.stackexchange.com instead. — Lundin 52 secs ago
 
1:43 PM
Monking
 
0
Q: create a list of functions to be executed from constant file in node.js

prideI have list of functions to be executed based on certain rule. for e.g. if age <=10, then no vaccine. if age > 10 && age<=18, then execute function first dose of vaccine. if age > 18 && age <=40 then execute two function, first dose, second dose. if age >40 then execute 3 functions, first dose, s...

 
2:22 PM
The best way to answer this is, post this on Code reviewJeroen van Langen 26 secs ago
thanks for all - also critical - comments, | 'codereview' - will check | 'flooding the stack' - me: 'script kiddie', just wanted to have the 'data production' away from the timing | 'optimized out' - proposal to get them executed also with optimization? | +4386427 - me bad, corrected | -SimonC - if had found a good example within 8 hours research on SO i wouldn't have asked, if code works it may help others | @Ted Lyngmo: 'tag C' - see 'issue list', 'how to port to C' |'std::this_thread::sleep_for' tried that and had the impression the timing didn't wait for sleep to finish, parallelization? — user1018684 5 secs ago
 
0
Q: Parse CSV file from bytes

petrushfrom sanic import Sanic from sanic.response import json from io import StringIO import csv import json app = Sanic("My Hello, world app") @app.route('/', methods=["POST"]) async def parse_file(request): file = request.body.decode() # from bytes to string with StringIO(file) as f: ...

0
Q: Advise to optimize the following code in a better way

ArjunI have some data stored in a dictionary where the values are basically a list of objects with few attributes in them. Right now I'm looping through as following to get the data stored in a specific attribute. These data are then added into a drop down list (unity UI dropdown) foreach (KeyValuePair<...

 
2:45 PM
I suggest posting your actual, working code for code review. — jaco0646 28 secs ago
I’m voting to close this question because it is about improving working code - ask on Database Administrators or Code ReviewDaniel A. White 5 secs ago
 
0
Q: What's the best practice element to use when allowing selection in C# website?

user17135324To display text where each word is selectable. Which Html element is recommended to surround each word. I would like it to be visible to the user and underline when selected. Then, a submit button that handles all the selections. This doesn't didn't reference to my call of the C# public void <spa...

 
3:24 PM
0
Q: How can you get an enemy sprite to chase your sprite?

benji07This is my first pygame project, and my first post on this platform! I am a student, creating my own project for my dissertation. The task I have has my participant use a joystick (Logitech 3D Pro) and move a sprite, avoiding a spider that comes from the top of the screen to the bottom. One thing...

 
possible answer invalidation by JDługosz on question by Never: codereview.stackexchange.com/posts/269126/revisions
 
@Duga that's okay
 
possible answer invalidation by JDługosz on question by Never: codereview.stackexchange.com/posts/269126/revisions
 
3:49 PM
0
Q: Separating odd numbers and even numbers into two vectors in C++

Asher II'm learning C++, and would like some guidance. I'm pretty sure I'm doing something wrong. This algorithm runs in O(n) time and uses O(n) external space. Could I make a more efficient algorithm for doing this, time and memory-wise? Also, could I multi-thread this? Here is my code. Ignore my codin...

0
Q: FizzBuzz JSON via Unix socket (Go)

farawiAt heart, this program is just the basic "FizzBuzz" program. However, the program was pushed further, by making it a client-server via Unix Socket: Server run, and listening on a socket. Client run with an argument, a file containing a JSON one query or more. The client opens the file and takes ...

0
Q: Benchmarking data copying

upkajdtI got inspired by a recent question to do some benchmarking on the different methods to copy data and this is what I have come up with: #include <iostream> #include <iomanip> #include <chrono> #include <vector> #include <cstring> class TimedTest { public: TimedTest(const std::string& name) ...

 
Monking
 
@StephenRauch do this happen for you? VV
0
Q: Review submission gets 418 error

Sam OnelaI'm attempting to review an item in the Code Review SE reopen queue. After opting to leave the post closed, I select a reason and then click the button labeled Keep Closed an error notification is displayed at the top of the screen. In the console I see the request received a 418 response. Can th...

 
4:14 PM
0
Q: How can I create generated clickable text which calls a c# function onclick?

user17135324How can I call the function and get the element ID from within the function? <span runat="server" ID="span_1" OnClick="my_c_function"> text here </span>

0
Q: iterating a big list of objects throws a memory issue

SlimI'm writing a function which iterate through a list of objects and should return: true if all the items have the attributes (cp and type). false if all the items haven't the attributes (cp and type). throw an error if one of the attribute is missed in the object. const checkList = (list) => { ...

 
@SᴀᴍOnᴇᴌᴀ - there appears to be no POST data sent with that POST request 🤦‍♂️
 
Asking for improvements to working code is a better fit for codereview.stackexchange.com. That being said, my immediate understanding of this problem is that there are 2 cases: 1) The numbers does only digits <=4, in that case replacing the left most digit with its +5 value is the correct solution. 2) The number does contain digits >= 5, in that case replacing the right most digit that is >= 5 with its +5 value will be the correct solution. eG if you take the number 145071 you replacing the 7 and getting 1450121 is the correct solution. — OH GOD SPIDERS 11 secs ago
There's a specific place for code review on stack exchange where you should post this. Stack Overflow is more for debugging help. — Aaron 24 secs ago
1. You can't link code here, you have to include it in your post itself. 2. You appear to be asking mainly for a code review - StackOverflow is for getting help with issues, so you would be more likely to get this kind of help on codereview.stackexchange.com. 3. If you want to have both a code review and get a specific question answered, it's fine to make a post asking exclusively about the issue, and a separate post about the code review. — Random Davis 10 secs ago
 
4:42 PM
Thanks for reporting - I'm looking into it right now. Will keep y'all updated. — kristinalustig ♦ 46 secs ago
 
4:52 PM
@StephenRauch Best of luck in the Stack Overflow moderator election.
 
@SᴀᴍOnᴇᴌᴀ Yes it does. Last time it happened it seemed to be on reopen vote, that I have already voted on. So I skipped it. I was going to watch and see if continued and if the behavior was the same.
 
0
Q: Looking to upgrade to webpack 5 in the near future

blankpage985I am running a hybrid angular/angularjs app with support for IE11. I have a build that meets my needs but I feel like its a house of cards. I am really just looking for someone with more webpack experience than me to look at my code and see if there is room for improvement or anything obvious I c...

 
5:11 PM
Note also that we don't generally do code review here; Stack Overflow is only for narrow, specific questions about clearly-identified problems. — Charles Duffy 14 secs ago
 
5:29 PM
0
Q: little program / code to check how **costly** atomic operations or program snippets are, perhaps can be done better?

user1018684I want to learn about cost / performance impact of different calculations. also would like to have a opportunity to check other influences / optimizations like compiler flags, use of SSE, AVX etc. I'm going to code some small subroutines which will take place in almost every arithmetic operation ...

 
possible answer invalidation by user3378165 on question by user3378165: codereview.stackexchange.com/posts/269127/revisions
possible answer invalidation by user3378165 on question by user3378165: codereview.stackexchange.com/posts/269127/revisions
 
5:52 PM
Very unclear what you need help with. From the "listen to any feed back" statement it sounds like you are looking for general review of your code (which is not on-topic on SO - possibly suitable for Code Review. Can you please edit the question to clarify whether the code shown in the post works or it has some issues like does not compile/throws exceptions/does not return data you like? (Note that one never should get count of records in DB separately from iterating them... but it does not look like a serios problem for the code yet) — Alexei Levenkov 20 secs ago
 
6:05 PM
possible answer invalidation by user3378165 on question by user3378165: codereview.stackexchange.com/posts/269127/revisions
If this is working code that you want reviewed, you may get a better response at codereview.stackexchange.com — dbush 7 secs ago
This is Stack Overflow, not Code Review. Here we DO assist with code that isn't working. — user4581301 33 secs ago
 
6:25 PM
I’m voting to close this question because it belongs on Code Review. — SuperStormer 24 secs ago
 
7:16 PM
@Duga Seems like answerer knows the question is unclear, so the error seems on them.
 
7:27 PM
This is a bit off topic for a few reasons, but I opted for "needs debugging details" as this question only seems to be asking for improvements to existing working code. Stack Overflow is not a code writing service. That said, Code Review I think is what you want for this sort of question; you have working code and you want to know how you can improve it in some way. — Bender the Greatest 52 secs ago
 
0
Q: leetcode 169 optimzations reducing complexity

Preston_JarvisThis is for leetcode problem: https://leetcode.com/problems/majority-element There is something wrong with the way I create solutions, and not sure how to stop doing it. Basically the problem is I always create a count variable. Here is it called greatest_count. For the if statement, I create a c...

 
@Hanselmann - PEP 20 - The Zen of Python: There should be one-- and preferably only one --obvious way to do it. Column lookup by attribute doesn't cover all cases and its common to end up with a mix of column verses index lookup - ugly! Similar thing with map - its only useful in edge condtions. Assigning a lambda to a variable my_fctn = lamba x: x**2 ... do def my_fctn instead. A good code review regimen includes a style guide. As for perl... what? I didn't mention perl. — tdelaney 8 secs ago
 
7:46 PM
@Duga Rolled back and commented.
@Duga Handled by my last rollback.
@Mast Then vote the question down with a reason. I have advised the person that answered on another question that they shouldn't answer questions where the code doesn't work.
 
Downvoted answer and left a comment.
 
@Mast Shouldn't we down vote the question as well?
 
@pacmaninbw What, for attempting to fix what was wrong with it in the first place?
 
OK I'll go undo my rollback, but leave my comment.
 
If the question was good, the answer is good and the question gets 'improved' after the answer has arrived, it's possibly answer invalidation.
If the answer arrived stating that the question was unclear and the question gets fixed up, the answer should've been a comment.
In my opinion. Feel free to state a different one.
 
7:56 PM
Cause and effect
 
0
Q: deleting the element that is smaller than left side element in array

user250707I'm trying to write a program whose input is an array of integers, and its size. This code has to delete the elements which are smaller than the element to the left. We want to find number of times that we have repeat this action to not be able to delete any more elements. Here is my code, it wor...

 
@StephenRauch If you are elected in SO, will you still have time to go through the CR queues?
 
8:49 PM
0
Q: Leetcode First Unique Character in a String code optimisation

D_S_XI was working on First Unique Character in a String Question Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1. Example 1: Input: s = "leetcode" Output: 0 Example 2: Input: s = "loveleetcode" Output: 2 Example 3: Input: s = "aabb"...

 
9:06 PM
This question would find better answers at [codereview](codereview.stackexchange.com) — tucuxi 59 secs ago
 
9:35 PM
possible answer invalidation by Hooman Bahreini on question by Hooman Bahreini: codereview.stackexchange.com/posts/269120/revisions
 
0
Q: React Native useForegroundResettingState hook

Stepan Parunashviliwould love a review for this hook. The context: I have a "date slider", which has "today", and previous days It's possible that a user leaves the app, and when he re-opens it from foreground, it's the next day In a scenario like this, I'd like to reset the state. So, to do this, I wrote up the ...

0
Q: The Rust Programming Language Pig Latin

CGLikeThis is my implementation of the Pig Latin recommended exercise in The Rust Programming Language book. Any pointers on making this code more idiomatic or run more optimal? fn pig_latin() { let s = String::from("Some abobus string 32 text привет абоба 123"); let mut new_s = s.clone(); ...

 
9:50 PM
possible answer invalidation by Hooman Bahreini on question by Hooman Bahreini: codereview.stackexchange.com/posts/269120/revisions
 
10:03 PM
0
Q: Create incremental backup of git bundle

bluerayJust after creating a new bundle (using git bundle create scr.bundle --all): git rev-parse HEAD equals to git bundle list-heads scr.bundle | head -1 | cut -d' ' -f1 Now to create next incremental bundle (after adding few commits), I can run: git bundle create scr1.bundle $(git bundle list-heads s...

 
10:15 PM
possible answer invalidation by user1018684 on question by user1018684: codereview.stackexchange.com/posts/269148/revisions
 
@Duga rolled back
 
possible answer invalidation by Hooman Bahreini on question by Hooman Bahreini: codereview.stackexchange.com/posts/269120/revisions
 
@Duga rolled back
 
11:18 PM
0
Q: Substring extension method with a method of removal

Taco タコスI consistently have code where I need to pull individual chunks of substrings out of a larger string; while I won't get into details, it's easy to replicate in a proof of concept: var data = "alja5nerjvnalskjnbaeviunreklvnaslidhfvbaelkjnrfvliasndve"; var open = data.Substring(0, 4); var inputLeng...

 

« first day (3090 days earlier)      last day (910 days later) »