« first day (2973 days earlier)      last day (36 days later) » 

12:02 AM
REFRESH! There are 7639 unanswered questions (89.4263 answered)
If you have working code and want someone to critique it, post it on codereview.com. The write-to-video-RAM case is pretty specialized, and not the same as incrementing a string of ASCII digits and calling puts or fwrite on them in a loop. (Or manually storing them into a larger buffer for an eventual fwrite.) — Peter Cordes 29 secs ago
1 hour later…
1:30 AM
Q: Unsigned 64bit subtract-with-borrow in Standard C++

yuri kilochekI'm writing a (compile-time-)fixed-width unsigned big integer. To implement subtraction, a subtract-with-borrow primitive is required. When efficient platform-specific implementation isn't available (e.g. x86_64's _subborrow_u64 intrinsic), it needs to be implemented in Standard C++. I've been ab...

I’m which case, this site is targeted for answering specific technical questions. codereview.stackexchange.com Is for reviews on approaches (although read their rules first - I don’t personally know if this would be ok there). — BeUndead 14 secs ago
2 hours later…
4:00 AM
4:51 AM
What's your question? Do you need a code review? — slideshowp2 7 secs ago
5:01 AM
yes, code review would fine! — John John 27 secs ago
5:14 AM
Q: How can I optimise this webscraping code

PyNoobThis code scrapes www.oddsportal.com for all the URLs provided in the code and appends it to a dataframe. I am not very well versed with iterative logic hence I am finding it difficult to improvise on it. Code: browser = webdriver.Chrome() class GameData: def __init__(self): self.da...

5:39 AM
Q: C++20 Coroutine Task

rafooThis project is the natural extension to my attempt to make a templatedgenerator coroutine. This time, I tried what I called a "task" (may be not the real term for this) : it generates a value or not, and is recursively awaitable. It can call other coroutines which each pause will also pause the ...

2 hours later…
7:40 AM
@JohnJohn Then why not post it to the site dedicated to it? codereview.stackexchange.com (Ref.: meta.stackexchange.com/a/199681) — brc-dd 56 secs ago
7:50 AM
@slideshowp2 yes, code review would be fine! — John John 31 secs ago
8:08 AM
Q: Mutating the shopping cart using redux-saga

John JohnI am trying to implement a shopping cart using redux-saga. The following code is working fine. But it does not look right to me. I am mutating the cart whenever I am adding the product. Let me know if I can improve the code. If this is the case. import { takeEvery, put } from 'redux-saga/effects'...

Q: How to make the right js function for the reward system

Ductor MasterI know that should be easy, so I'm sorry for stupid question. I didn't learn that. But I'll be happy if someone will be kind to help me. .rating { color:#02dbdd; font: 700 26px/normal 'Montserrat', sans-serif; text-transform:uppercase; display:block; cursor:pointer; margin-right...

8:32 AM
Q: Combine elements of two lists into another list

OmarI have two lists, I need to make another list with the same elements than the other lists. But elements on this list need the next sequence. newList (list1[0], list2[0], list1[1], list2[1], ...); // and so on for that, I made this code. List<string> list1 = new List<string> { "rabbit", "dog", "cat"

Q: window.location.hash or useHistory() in react-router to access hash in url

MBehtemamif you have react-router you can access hash of url with hooks something like below const history = useHistory() console.log(history.location.hash) another way is using window object console.log(window.location.hash) assume that you are in React component, which solution do you use and why?

8:55 AM
9:20 AM
9:40 AM
If the code works (a hard requirement) then this seems more suitable for the Code Review SE. — Some programmer dude 31 secs ago
You may find more help on codereview.stackexchange.com as it's more designed for help with optimising working code. — Nigel Ren 56 secs ago
1 hour later…
11:02 AM
Q: Python scripts that generate valid ngrams for use in pseudoword generation

Xeнεi ΞэnвϵςThese are the scripts I wrote to generate valid ngrams, the output will be filtered manually then used in Markov chain style pseudoword generation. You will need PowerShell 7 and gcide_xml to make these scripts work. I wanted to find an English corpus/dictionary library for Python, and didn't fin...

Q: My little C++ library for comfortable programming

JeniaI've tried to make a little library in C++, to gather all useful and necessary functions. I wrote the code(in one file, to make it more portable). Unfortunately, it works on Windows only. #pragma once #ifndef NEWCPP #define NEWCPP #include <iostream> #include <windows.h> #include <...

Working code is better on codereview.stackexchange.com if you meet the question requirements. — Richard Critten just now
11:25 AM
@BittermanAndy But @PandaWood already told you you can use Directory.build.props which has more advantage than your solution because you don't have to modify every project to add this Shared.AssemblyInfo.cs file as link. You don't have to teach developers that they should add it when they create new project and check it on code review. It just works for all current and new projects automatically. How doing nothing is "harder" than having to remember to modify csproj. — Mariusz Pawelski 41 secs ago
Q: Haskell Function to get the List representation of an Integral

Moritz WolffThis is a simple practice problem. The task is to write a function getLR that receives an Integral, n, and returns a list representation (LR) of n. For example: 73847 -> [7,3,8,4,7]. Negative numbers return the LR of the absolute value, for example: -837 -> [8,3,7]. In the following code I use th...

11:52 AM
Q: Simple Scraper_Downloader based on Youtube-dl

XusAny help with my code. I think it's kind of hard code where I want to extract links from a page and download them. It's going to scrape some links from websites (but the Scraper function that I've written is hardcode) and download the videos if they exist and I'm sure it's not good at all and it'...

12:37 PM
I see it and, again, please see How to Ask. If you delete your answer, copy/paste the code from it into your question, and add concise, testable sample input and expected output then you will arguably have a valid question for this forum as then you'll at least have the required (and currently missing) minimal reproducible example though some people may tell you that you should post it on some kind of code review forum instead of here depending on how you phrase the text of your question. — Ed Morton 12 secs ago
"which works, but it looks too long" - Code reviews are not the topic of SO -> codereview.stackexchange.comAndreas 13 secs ago
I’m voting to close this question because the code works but simply needs optimization: better asked on CodeReview instead. — Terry 21 secs ago
1:01 PM
Welcome to stackoverflow! You might be interested in codereview.stackexchange.comStef 24 secs ago
Q: replace li tag with different tag according to the bullet level

Piponeed to replace the li tags with different customized tag according to the bullet level For example for the input below <p><strong>Basics to Macros & VBA Code</strong></p> <ul> <li>Create a Macro MsgBox <ul> <li>test</li> <li>test 1</li> </ul> </li> <li>Workbook and Worksheet</li> <li>Object Range<...

Q: Check if array of strings have the same substring

Renaud is Not Bill GatesHello I have a list of files that has a template like this: XXX_{project}_{variation}---XXX.html and XXX_{project}_{variation}.html The variation is not always present, so there are also files like this: XXX_{project}---XXX.html and XXX_{project}.html What I want to do is to check if all these ...

Q: How to generate a auto incrementing number Rails

Andrew ReibleinI am very new to rails and was wondering if someone might be able to help me. I need to generate and save an auto incrementing number for an invoicing. Ive already created the field 'invoicenum:integer' in my billing_history table. I was wondering how I can do this from the controller ? This is t...

1 hour later…
2:20 PM
Q: Generating an auto incrementing number in rails

Andrew ReibleinI am very new to rails and was wondering if someone might be able to help me. I need to generate and save an auto incrementing number for invoices. Ive already created the field 'invoicenum:integer' in my billing_history table. I was wondering how I can do this from the controller ? This is the e...

Q: Spring Boot Elastic Query not working correctly

PhilbanI have some code I've written which I need a review of (if possible) as I know I have a bug somewhere. Most likely due to my (lack) of understanding of some concepts in ElasticSearch and Spring. For context: I have a simple Spring boot API which allows students to add their college projects. Thes...

I guess I see the problem here: You want to have a reference to your Main in your Quiz instance and vice versa. I think you can defer this design problem to a later code review. For now you change the instantiation order. See my updated answer. — Pythocrates 45 secs ago
2:38 PM
example here: codereview.stackexchange.com/questions/196540/… I suggest reading through that (Code Review) stack exchange, for questions tagged [C++] to get a feel for the common review issues. — JDługosz 22 secs ago
Q: Assembler. Algorithm for incrementing a decimal number

FER31I share an algorithm that I have written myself. It is useful for incrementing any digit of a decimal number. That way, a conversion to decimal is not necessary. Please excuse the mistakes. I am learning assembler and x86 architecture. I am sure that it is possible to improve and optimize it (tha...

3:03 PM
3:21 PM
Q: TypeScript, React and Node app to get 'games' data from a database and display them on a frontend

uberBackend app.ts import { mySqlConnect } from "./utils/mySqlConnect" const NUM_GAMES = 50 const app = express() app.use(cors()) const db = mysql.createConnection(mySqlConnect) db.connect(function (err) { if (err) { console.error("failed connection:" + err.stack) return } console.log(

3:38 PM
4:00 PM
Please use Code Review if you have a working solution - this site here is primary for solving problems with broken code. — Filburt 55 secs ago
4:24 PM
I think you will get better answers if you post this on Code Review instead. — mkrieger1 39 secs ago
4:49 PM
Q: State monad and pattern matching on data constructors

The Coding WombatI am writing a Settlers of Catan server in Haskell for fun. Currently I am passing around state manually. I want to learn more about the State monad and want to incorporate it into my project. However, my GameState has multiple data constructors that I pattern match on to yield different function...

this might be better suited for Code Review since you're asking for improvement suggestions on working code — devlin carnate 43 secs ago
5:39 PM
Q: UPGMA tree building in python

Roni SaibaAs a part of coursework, I had to build an UPGMA tree from a given distance matrix and a list of species names. As a beginner/intermediate in python I saw this as a good opportunity to learn about classes. The code is as follows: """ UPGMA - Unweighted pair group method using arithmetic averages ...

Q: What is the most efficient way of looping though lists

pchatzikoThis code calculates the probability of a runner finishing 3rd and it works like expected. I'm pretty sure though that is woefully inefficient. How could this code be transformed in a much more cleaner and performance efficient way? def Trd(mylist=[]): third=[] for thirds in range(len(my...

Q: Is this the correct way of predicting with multiple independent hot-encoded variables

TheWorkerMy attempt at multiple linear regression. I am trying to make a qualified guess about a user's rating of a movie, through machine learning. I am new to this, so my judgement isn't the best. And I am also getting a result but I have no idea if it is the result I want. The code is setting up a fini...

@CaptainObvious its a shame it doesn't produce the correct output :/
6:04 PM
Q: Stack of Plates: Cracking the coding interview , Personal Solution

UomolepreStack of Plates: Imagine a (literal) stack of plates. If the stack gets too high, it might topple. Therefore, in real life, we would likely start a new stack when the previous stack exceeds some threshold. Implement a data structure SetOfStacks that mimics this. SetOfStacks should be composed of ...

6:40 PM
6:53 PM
Q: Applied Solution Based On Polya Enumeration Theorem

Anit Shrestha ManandharProblem A function solution(w, h, s) that takes 3 integers and returns the number of unique, non-equivalent configurations that can be found on a grid w blocks wide, h blocks tall and s possible states. Equivalency is defined as above: any two grids each with same state where the actual order of ...

Q: Two dimensional gaussian image generator in C++

JimmyHuThis is a follow-up question for Two dimensional bicubic interpolation implementation in C++ and Two dimensional gaussian image generator in C. Based on user673679's answer, another file image_operations.h is created for those non-member helper functions for image operations implementation. Moreo...

First write the program using scanf(), and then demonstrate that it is too slow — measurements! If you've already written the code using scanf(), show that code — though there's a risk that the question becomes more suitable for Code Review than SO. — Jonathan Leffler 11 secs ago
7:18 PM
Q: Simplify IF/ELSE Statements for a Javascript Array - Multilingual Site

Rebecca BI have written some javascript code for a multilanguage site. The code works great but I feel like I have a lot of duplicate code. I was wondering if someone can explain how I can make this simpler or minimized. I have tried to use a forEach(function (item, index) but it does not seem to be worki...

8:00 PM
@SᴀᴍOnᴇᴌᴀ Stay cool this week, I just heard it will be 113 degrees Fahrenheit in less than a week.
It's 80 here
That's enough for me
Ideally I'd be happy with 65-72 out
If your code works, but you are interested in ways how to improve it then it may be better suited for codereview.stackexchange.comPshemo 58 secs ago
Also for those who don't measure in bald eagles 80 -> 26, 65 -> 18, 72 -> 22 if I did my math right
@pacmaninbw yes - its a good thing we got our A/C unit cleaned out last month
the technician said it could have failed at any time
Q: Generates JMenu Radio Buttons Using An Enum

Tim HunterPut together a RadioMenu class that can use a Enum to generate a Single-Selection Radio Button Menu. My main question is about whether there's a way to remove the need to pass in the Class of the Enum to the generateButtonsFromEnum() method. Otherwise, would appreciate any general pointers on way...

Q: Check if Profile name is contained in Tagged Profile names: added link

Prosy ArcenoI have a function which checks for a profile name and determines if it is in a tagged profile name. def check_profiles(request): try: # get all individual profiles profiles = Profile.objects.all() # get all individual tagged profiles tagged_profiles = TaggedProfiles.objects.all() ...

8:08 PM
@DerKommissar Me too.
(113 - 32) * 5/9 = 45 degrees C.
I was curious about Death Valley's temps a couple weeks ago and saw it had highs of 126ºF/50ºC a week ago
8:24 PM
Not optimal is also not a problem for Stack Overflow. You may be better off at codereview.stackexchange.commiken32 17 secs ago
Chandler AZ (Phoenix) was 119 last week.
8:57 PM
Q: Hello, i would like to ask how you would fix this

Jonathan van esi wrote some code, about a password generator for a schoolproject. But i think it needs more getters and setters however when i add these it gives errors when i run the program. The code works but i think i need to improve it, But im hitting a wal at the moment. class Generator extends JPanel { ...

9:22 PM
Q: edit array you included php OOP time complexity

MatteoIn order to reduce time complexity, instead of loading (and then dumping to use it for later) the whole file into an array (It would be O(n) with n=number of lines), I have saved it as array into a PHP file and included it index.php <?php include "english.php"; $test = new English("false_friend.php"

Q: Best practices for using rest api in react native

leo giovanniIn a recruitment process, the company gives me a project to do in react native. I finished all the tasks. But company gave me a feedback and said that your project was good, but you did not apply best practices for using rest api. So we are not proceeding further with your application. I used red...

1 hour later…
10:36 PM
Q: Scraping OddsPortal with requests only

ReinderienThis is a scraper written to do most of what had been attempted by another user in this question: How can I optimise this webscraping code I did the rewrite because I felt bad that the new user didn't get an opportunity to talk about their code (even though the off-topic closure was correct). Als...


« first day (2973 days earlier)      last day (36 days later) »