« first day (3004 days earlier)      last day (996 days later) » 

12:03 AM
REFRESH! There are 7709 unanswered questions (89.3772 answered)
 
12:47 AM
Please post this on codereview.stackexchange.com — Bill Lynch just now
Requests for feedback on working code should be posted at codereview.stackexchange.comFrançois Andrieux 17 secs ago
 
1:09 AM
Fewer lines of code would not necessarily be more efficient. Please read How to Ask and post an minimal reproducible example. Actually, you might want to consider posting to CodeReview, since you don't have a bug to track down. — jwdonahue just now
 
0
Q: How can I clean up the code for making a 10x10 times table using two dimensional arrays

NOKLOCPLUSI have been on the C++ learning grind for the last 2 weeks using caveofprogramming videos so don't judge too hard if this seems like a dumb question. My last lesson covered arrays and the assignment was to make a 10x10 times table using multidimensional arrays. I succeeded in making this times ta...

 
1:30 AM
You can post this question on Code Review, including your current code, and ask for peer help to optimize it. Be sure to read that site's help center pages before posting, so that you make sure you do so properly. You can't ask this sort of question on this site, however - you have working code that you're asking for help optimizing. — Ken White 54 secs ago
 
2:06 AM
0
Q: Correct usage of atomic structs and correct benchmarking

lukropI am wondering whether I correctly made the struct atomic, since in this benchmark showed quite a big difference, which is exactly what i need. Is there anything i could improve in terms of runtime? setting the members without the setter did not seem to make too big of a difference. #include <ios...

 
 
3 hours later…
4:37 AM
0
Q: Simple battleship game in Groovy

Koray TugayI am trying to learn Groovy and I did an attempt on implementing a simple Battleship game. Any feedback is welcome. I will start with the modal classes I have. Modal classes Coordinate.groovy package biz.tugay.groovyship.modal import groovy.transform.Memoized /** * A Coordinate represents a ce...

 
5:21 AM
This kind of question is better asked at Code ReviewJens 28 secs ago
 
6:13 AM
In my 15 years of professional code writing that additional (hidden) if-check wouldn't have passed any code review, though (relying on compiler to optimise away being unpreferrable). Seems once more not all people apply the same criteria... — Aconcagua 17 secs ago
 
6:43 AM
0
Q: Is this a reasonable way to test/compare javascript loop speeds?

GollyJerI'm playing around with understanding array looping speed. I'm trying to make the contenders equivalent and close to realistic. Is this a good approach? Are there other iteration approaches to test? let suite = new Benchmark.Suite(); const length = 10000; const arrayToTest = []; for (let i...

 
7:17 AM
If you are looking for a review of working code then codereview.stackexchange.com may be a better place to ask your question, but be sure to read through their help section first to make sure you meet their requirements. — Retired Ninja 22 secs ago
 
7:59 AM
0
Q: optimization of my code for less flag use

Shreeyash ShresthaI've been trying to make a rubik's cube project and it succeeds nicely . The only problem(or something like that) is that i need to optimize my code for easier understanding and more flexibility. Here's my code to optimize: [...] int main() { [...] while (!glfwWindowShouldClose(window)) {...

 
8:24 AM
0
Q: Cubic Permutations | Project Euler #62

SSSNIPD The cube, 41063625 (3453), can be permuted to produce two other cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube. Find the smallest cube for which exactly five permutations of its digits are ...

 
8:49 AM
0
Q: Python case insensitive three level nested dictionary

Xeнεi ΞэnвϵςThis is a custom case insensitive nested dictionary class created by me, its main usage is to populate QTreeWidget and keep track of said QTreeWidget, the main incentive behind this class is to prevent case insensitive duplicates from entering the tree, and to report the indexes of the nested key...

0
Q: Reviewing my shader class for efficient use

Shreeyash ShresthaIm just trying to setup my shader function in a class in a way that would make me work with it easier and in a more understandable way. In Shader.h: #pragma once #include"Includes.h" #include<unordered_map> namespace GAME { enum class Shader_Type { NONE = -1, VERTEX = 0, ...

 
9:11 AM
Please make sure your question contains all relevant info inline. Also, what have you tried? What are your thoughts on this? That said, consider putting your code up for review on codereview.stackexchange.com, oncy it is actually in a working and presentable state. — Ulrich Eckhardt just now
 
0
Q: Is there a faster solution to this - Programming challenge

Vineeth SaiI am trying to solve this question, But I am getting time exceeded error in some of the test cases. I want to know if there are any other optimized solutions that I am missing on. I have pasted my solution below which is correct but for some reason, the judge thinks its too slow for some of the t...

 
 
3 hours later…
12:44 PM
This question should be in codereview.stackexchange.com because it is working and you want to speed it up. — Xitiz 17 secs ago
 
1:02 PM
0
Q: A c++ library that sends and reccieves data using https or http

The Masked Rebel#include <iostream> #include <openssl/x509.h> #include <openssl/x509_vfy.h> #include <sstream> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <string.h> #include <unistd.h> #include <vector> #include <string> #include <openssl/ssl.h> #include <openssl/err.h> #include <

 
1:27 PM
0
Q: Ratio of intra-class scatter by inter-class scatter is getting minimised by linear discrimination process

Sukti SenThis question is complicated (at least for me who is new in machine learning and image processing). I need help in understanding, why my iterative process is minimising the ratio of inter-class scatter by intra-class scatter after Fisher-Rao discrimination, rather than maximising it. Background: ...

0
Q: pandas.DaraFrame resample OHLC based on a non-time value

Edward JamesI have a csv file that looks like this: time, price 0 2021-07-23T20:00:00.000221421Z 368.06 1 2021-07-23T20:00:00.001131397Z 368.06 2 2021-07-23T20:00:00.008030544Z 368.06 3 2021-07-23T20:00:00.00807574Z 368.06 4 2021-07-23T20:00:00.008084129Z 368.06 ... ... ... 32435 2021-0...

 
2:05 PM
Welcome to Stack Overflow. Please take the tour to learn how Stack Overflow works and read How to Ask on how to improve the quality of your question. Then check the help center to see what questions you can ask. You might want to delete this question and ask it on codereview.stackexchange.com instead, but check the help pages there first. — Progman 44 secs ago
"I wrote this script and it worked. I would like to know if this script can be improved." Questions like that belong on codereview.stackexchange.com0stone0 40 secs ago
I’m voting to close this question because questions like "I wrote this script and it worked. I would like to know if this script can be improved." can better be asked on codereview.stackexchange.com. — 0stone0 30 secs ago
@0stone0, I didn't there is a code review forum. — sudoi just now
 
2:59 PM
@IllusionalProgrammer - This answer already contains some good sample code. My comments were just suggestions. You also don't need to ask us if your code "is ok now", just test it. If it works as expected and you want to know if it can be improved, post it over at Code Review. If it doesn't work, explain the issue you're facing. — Magnus Eriksson 6 secs ago
I’m voting to close this question because it belongs on Code Review SEMarco Bonelli 21 secs ago
 
1
Q: parse two csv files, calculate a product and sort the result by product

dm90Problem: Given two csv files science_courses.csv and other_courses.csv, which has students name and their respective course points. Calculate the CGPA and sort by the same (highest to lowest CGPA). sample file content: science_courses.csv: Name,Physics,Chemistry Susan,6.0,5.5 James,4.7,8.5 Linda...

 
3:15 PM
Its not just code review its asking a specific question about programming. I have a pseudo solution at best and am looking for assistance with solving the problem in a more elegant way. — mellocellofello 34 secs ago
That is exactly what Code Review SE is for. You should ask there. — Marco Bonelli 17 secs ago
This question belongs on code review site. You are doing so much wrong, but a broad question like this isn't suitable for Stack Overflow. — Dharman 46 secs ago
 
3:29 PM
@Dharman looks like a generic best practice question to me, which is off-topic on Code Review. — Peilonrayz 43 secs ago
 
0
Q: Need to revise PHP backup script

sudoiI'm learning PHP and try to write some scripts as I go along. I wrote this script and it worked. I would like to know if this script can be improved. The purpose of the script below is to prompt the user to input the version of the backup file, and proceed to make a backup fo the Nextcloud direct...

 
you should ask this question in codereview, not here — Łukasz Kwieciński 33 secs ago
 
3:48 PM
@ŁukaszKwieciński Absolutely not. "Does someone also know why the status doesnt work" indicates the code does not work the way it should yet, thus it's not ready for review. Please familiarize yourself with Code Review's scope before making such recommendations. — Mast 38 secs ago
In general: your code does not work as intended or does not work at all -> SO; your code works, but you would like suggestions to optimize/improve it -> Code Review SE. If anything is not clear, feel free to ask about your question (providing a link) on [Meta SO](meta.stackoverflow.com). — Marco Bonelli 46 secs ago
@ŁukaszKwieciński The question is not an acceptable question for Code Review. — Peilonrayz 16 secs ago
@ŁukaszKwieciński Irrelevant. The code not producing the correct output is not a side-issue, it's one of the main reasons NOT to post on Code Review. We simply don't accept questions of which the code doesn't work yet. Whether it's on-topic on Stack Overflow is not our concern. You invoked the name of CR and it's bad form to redirect crap. Just close it, don't mention other sites. — Mast 59 secs ago
@Mast yeah, you're right, upon closer inspection this would need improvement before being possibly posted on Code Review SE. Also, this is a very common question that has probably been asked and answered a thousand times before. — Marco Bonelli 38 secs ago
 
-1
Q: want to avoid return by value

rohittI have a function that is returning a vector of set of vectors. This is quite expensive for the reason that the C++ version is C++03 or less, so there is no move semantics to take advantage of. The best thing I can do is create a pointer to the object and then return the pointer and then assign. ...

1
Q: Python code for eliminating options for random intergers as they get picked

mellocellofelloMy goal is to write code that picks several random numbers from a range without repeating any previously chosen numbers. I figured out a functional solution for my problem but it seems very bulky and there must be a way to do this in fewer lines. Mine feels brute force and not very elegant and be...

 
@CaptainObvious cc @Mast
 
Waste of effort...
 
I'm not sure I agree with your suggestion the question is off-topic however
 
Go ahead and answer it then.
 
4:03 PM
I wasn't going to, but I can :)
 
4:19 PM
Monking
 
0
Q: Python Code Style If,elif, else

Eliaz BobadillaI have this Python code: def main() -> None: print("Welcome To UltiList!") lst = [] len_of_list = int(input("Enter the len of the list: ")) while len(lst) <= len_of_list: print(">> ", end="") args = input().strip().split(" ") if args[0] == "append": ...

 
4:35 PM
You also already know this site is not for code reviews, so it’s bizarre that you’re continuing to request them — Clive 13 secs ago
If this is a general question, it is a bit too broad. If this is a question about your code displaying pyramids it would be better suited for codereview.stackexchange.com. Note that there you should show the code, probably both versions for comparison. — Werner Henze 10 secs ago
 
 
1 hour later…
5:40 PM
0
Q: Daily coding problem: Job scheduler invoking a function after specific time

Michał Dobi DobrzańskiThis is a problem from Daily Coding Problem. I have implemented it in Java. For a function f I have used Runnable interface. Problem: This problem was asked by Apple. Implement a job scheduler which takes in a function f and an integer n, and calls f after n milliseconds. Solution: import java.ut...

 
6:31 PM
0
Q: building a simple password program that leads to a main menu for a game just as practice and im having problems with the do while loop

NOKLOCPLUSI am working on making a program that just uses all the concepts I have learned so far. it starts out as just an input for a password (int spam) but for some reason its saving the users input when the password is incorrect and it keeps saying its incorrect until all the guesses are used. its not ...

 
7:06 PM
Please keep your questions focused and limited to one issue. We don't provide code feedback here. If you would like to learn how to improve your code, please submit to Code Reviewsinanspd 48 secs ago
 
7:47 PM
0
Q: Is this a true implementation of XOR in python?

SeVenVo1dI have implemented a simple XOR encryption in Python. However I am not sure this is the right implementation or it can be further improved ? from math import ceil from random import uniform from numpy import array, repeat, vectorize #---------- HELPER FUNCTIONS ----------# def addtrailingzer...

0
Q: Error posting after an update with Supabase and Angular

Prodigy7kXThe Problem I've been trying to learn Angular and Supabase for the past few months, and right now I'm trying to build a good ol' Todo app with CRUD functionalities using Angular and Supabase. I've managed to get it working for the most part, like, everything works until I edit a Todo. After I sub...

 
@pacmaninbw lol, I think someone probably was meant to say "sound" not "light"
 
Let's just say there is nothing I trust when Fox News reports it.
 
8:05 PM
It's 2021 pacmaninbw, everything's fake news now...
 
Some is more fake than others.
 
Touché
2
 
@Peilonrayz Well, there's fake news and then FAKE NEWS
 
8:28 PM
Hey dddxxx! I'm not going to vote to close, but I thought I'd mention that, IMO, if the code works but you want it to be faster or better written, then it's a better fit for Code Review than Stack Overflow. You might get better answers over there — en_Knight 31 secs ago
 
8:41 PM
possible answer invalidation by sudoi on question by sudoi: codereview.stackexchange.com/posts/264380/revisions
possible answer invalidation by sudoi on question by sudoi: codereview.stackexchange.com/posts/264380/revisions
 
8:57 PM
Blade not caching your policy.. he cache only compiled view, you can see it in cache folder. Btw, your question not correct - this is not code review service. — Maksim 17 secs ago
 
0
Q: Vectorizing a working custom similarity function further using numpy

dddxxxI am new to python, and even more new to vectorization. I have attempted to vectorize a custom similarity function that should return a matrix of pairwise similarities between each row in an input array. IMPORTS: import numpy as np from itertools import product from numpy.lib.stride_tricks import...

 
9:13 PM
There's a significant overhead to creating and waiting for threads to complete. It's faster to create threads one time and use semaphores as shown in this bottom up merge using Windows native thread API. — rcgldr 13 secs ago
 
 
1 hour later…
10:19 PM
0
Q: Monthly Cost for House Code - Output not coming out correctly

user245363My output is returning 0 for the value for the costs and I am not sure why. #include <iostream> #include <iomanip> #include <cmath> #define TAXRATE 0.0125 #define UTILITIES 300.00 #define INSURANCE 550.00 using namespace std; // Function Prototypes void getInput(double& sellPrice, double& inte...

 
10:34 PM
Yep, you can use focusout for lose element focus. I did update code review and cleaned up js. — ЖнецЪ 31 secs ago
 

« first day (3004 days earlier)      last day (996 days later) »