« first day (2661 days earlier)      last day (1371 days later) » 

12:00 AM
RELOAD! There are 6912 unanswered questions (89.8094% answered)
 
12:30 AM
possible answer invalidation by bliboy on question by bliboy: codereview.stackexchange.com/posts/247966/revisions
 
1:23 AM
0
Q: cartesian product of two vector spaces

Miguel AvilaA few days back I found an interesting problem which reads the following: Given two vector spaces generate the resulting set of its cartesian product. \begin{gather} \text{Let: } \mathcal{V}, \mathcal{W} \text{ be vector spaces}\\ \mathcal{V} \times \mathcal{W} = \{ (v,w) \mid v \in \mathcal{V} \...

 
Maybe try posting this on codereview.stackexchange.com for better feedback — sagar1025 16 secs ago
 
2:02 AM
I’m voting to close this question because this suit for code review. — Arun Vinoth 43 secs ago
@ArunVinoth Don't use the existence of Code Review as a reason to close a question. From now on evaluate the question and use a reason like; needs focus, primarily opinion-based, etc. This question could quite easily be off-topic on Code Review as "even more so if key.length > 5" means one interpretation of the question is off-topic and can be closed. To avoid these complications please close for the reasons SO provides. — Peilonrayz 43 secs ago
 
2:48 AM
re: code review: consider posting on codereview.stackexchange.com, although posting here in the micro-optimization tag might work too. Especially if you phrase it as a description of the high-level problem you're trying to solve, and the inline asm is your current best attempt. That invites other totally different options, like SIMD if that's possible. I'd be more than happy to see a question like that on SO, even if it was a bit code-reviewish. If the main point is how that asm or equivalent executes quickly on a CPU, it feels more SO than codereview. — Peter Cordes 54 secs ago
 
3:03 AM
0
Q: A Tic-Tac-Toe AI based on two rules

RocknRollDeltaSo i made a tic tac toe bot with the following rules (its not unbeatable) 1) If bot is about to win, it will find the winning move. 2) If bot is about to lose, it will find a move that prevents the other player from winning. 3) if none of rule 1 or 2 is found, then it will play a rand...

 
3:53 AM
0
Q: Correct way to define variables and methods in Ruby

Lax_SamI am trying to write a Person class in Ruby which has some methods and properties. The below is how I have implemented it now. class Person attr_accessor :name, :gender, :mother, :spouse def initialize(name, gender, mother = nil) @name = name @gender = gender @mother = mother ...

 
4:07 AM
Your question would be more fitted on Code review site of SE — Vega 47 secs ago
 
4:18 AM
0
Q: My solution for IPO (Initial Public Offering) auction interview q

Grshh *TLDR: Input: bids = list of lists of ints representing [userid, # shares, $bid, timestamp] totalShares = total # of shares to be distributed. TODO: distribute shares amongst bidders and return userids of bidders that got 0 shares. Share distribution logic: 1) Bidder with highest offer gets all ...

 
4:38 AM
This has been posted on Code Review. Please don't use it as a reason to close this question as some users on Code Review will likely think it's off-topic. If this is off-topic here please use your standard close reasons. Thank you. — Peilonrayz 15 secs ago
 
5:03 AM
I feel the "Do you spot any issues with my approach?" is seem like a code review question which is not supposed to be here as per the SO Faq. — Arakkal Abu 29 secs ago
 
5:53 AM
1) Just to confirm, you really want an IEnumerable<T> that enumerates a difference sequence each time it is enumerated, correct? 2) You wrote, Is there any issue with this implementation ? -- what is your question here? Is the code working correctly? If not, can you provide a minimal reproducible example? If your code works correctly and you want a general critique, this might be more appropriate for Code Review. — dbc 26 secs ago
 
6:26 AM
I’m voting to close this question because it belongs on codereview.stackexchange.comtgdavies 58 secs ago
@tgdavies Don't use the existence of Code Review as a reason to close a question. From now on evaluate the question and use a reason like; needs focus, primarily opinion-based, etc. This question may be off-topic on Code Review as the OP is asking if it is correct - for debugging help. Please familiarize yourself with what is on-topic and our guide to Code Review for Stack Overflow users. — Peilonrayz 32 secs ago
 
@Duga Wow, that went so smoothly. Nice :D
 
6:43 AM
inlining the function often breaks stuff - because your constraints are broken. You modify the %[temp_v1] register, but you told the compiler it was an "r" input-only operand. It looks like you just want the compiler to allocate a scratch register for you; do that with an "=r" dummy output operand! Maybe you should have posted to codereview.SE after all. (Still looking at the overall question, it's very long; this was just the first thing I noticed.) — Peter Cordes 35 secs ago
 
7:12 AM
-1
Q: Octave Matrix Determination

Ashish JindalWe had given a code ro write an Octave code to find the product of two matrices A and B, element-wise, and then reverse the rows. Print them, and then find the determinant of the resulting matrix. 3 3 1 2 3 2 3 4 1 3 5 2 3 4 1 3 5 4 5 6 Sample Output: Reversed_Matrix = 4 15 30 2 9 20 2 6 12 Dete...

 
7:37 AM
-1
Q: Call an function from another function

helenchamlingI have written a python script to login to an FTP server and check the files and folder. For it, I have created two functions one to log in and another to list the files/folders. I want to call the login function from the list_directory function. Please, someone, take a look into my script and su...

0
Q: I have a Java Class that I suspect can use a ReflectionUtil here because there are too many switch/cases, any advice?

John LexusI have a chunk of code here: public class ParserFactory { public static ParserClass getParserClass(InputStream is, CustomMap customMap, DataHandler recordHandler, DataHandler columnHandler) throws JsonProcessingException { ParserClassType...

 
 
3 hours later…
10:31 AM
0
Q: How to clean the indexes, and ideally not create an additional array

UberhumusSo I answered this question on SO and probably did someone's homework along the way. In the original question the OP has the answer variable and wants it split to real and imaginary values with the original coefficient (q in the original post) as an array for each q from 1 to 10, so you get an ar...

0
Q: Why below recursive DP solution is so slow? (Leetcode Q# 123 - Best Time to Buy and Sell Stock III)

Rajdeep PaulThis is regarding leetcode Question# 123. I have solved the question (code below) but the solution is showing "Your runtime beats 5.89 % of cpp submissions."? Is there any additional optimization I can do to make it run faster? class Solution { int maxProfitUtility(vector<int>& prices, int i,...

 
11:10 AM
possible answer invalidation by LV98 on question by LV98: codereview.stackexchange.com/posts/247577/revisions
 
11:42 AM
Anyway, these sorts of questions aren't really on-topic for stack overflow, that is, asking for suggestions on how to imporve working code. There is a Stack Exchange site, Code Review but this may not be appropriate for there either. — juanpa.arrivillaga 58 secs ago
If this is working code that you think could be improved, see Code Review. — jonrsharpe 12 secs ago
 
12:11 PM
0
Q: A program that performs logistic regression based on Iris dataset

farhad mabrookiI am a newcomer in Machine Learning and I have wrote a simple program for logistic regression based on Iris dataset. I would like for experts to tell me about its drawbacks and bugs, and if it can be implemented in easier ways. #Loading data import pandas as pd df=pd.read_csv('file:///C:/Users/De...

 
12:36 PM
0
Q: Binary to Decimal conversion program - How to make it better and more efficient?

Ak119I am a beginner in python, I have written a program to convert binary numbers to decimal. It works. But are there any ways to improve the code and make it better ? A review would be really helpful. Thanks. def binary_to_decimal_converter(binary_value): print(f"Binary: {binary_value}") dec...

 
1:05 PM
Monking
@Duga Rolled back.
 
 
2 hours later…
3:19 PM
M
 
3:45 PM
See codereview.stackexchange.com/q/109260/308 and the discussion comments there. And don’t just read the answers, in particular note that the currently accepted answer is flat out wrong. — Konrad Rudolph 22 secs ago
 
4:01 PM
If this is working code that you're looking for improvements with, then codereview.stackexchange.com is probably where you should post. Please read the posting rules there first so you format your question appropriately. — jfriend00 13 secs ago
 
4:22 PM
0
Q: Task and their usage

orbit obalgini have a question regarding Tasks. I understand that we should choose Task if we need the method to be awaited, void if we dont need it and Task if we are returning something. Right? Now i am using Task <T> and taking parametr List<Article> that is returned from api and returning return Task.Comp...

 
 
2 hours later…
6:03 PM
0
Q: Abstracted email sender, with content providers

m.ShreemThe Email Sender IEmailSender using the IEmailProvider to get the message Information EmailMessage. So we can abstract the Sending mechanism about the message information. and use email providers like WelcomEmailProvider to abstract each type of message. interface IEmailProvider { Ema...

0
Q: Scraping reddit using Python

User00257My objective is to find out on what other subreddit users from r/(subreddit) are posting on; you can see my code below. It works pretty well, but I am curious to know if I could improve it by: First, restricting my code so that it only considers users only once (i.e. not collect the posting histo...

 
6:28 PM
0
Q: JSON serializable string enum in C# with generic JsonConverter

rraallvvHow can StringEnumerationConverter be changed into a generic class, so that ConsensusState wouldn't need the JsonConverter attribute to enable a class to be used as if it were a serializable enum with associated string values? Here is how to define a class using those types: /// <summary>Consensu...

 
@CaptainObvious A little too abstracted, MRC.
 
6:53 PM
0
Q: Codewars kata - "Repetitive Sequence"

sid_mallickI am trying to solve the following Codewars kata. We are given a list as seq = [0, 1, 2, 2] We will have to write a function that will, firstly, add elements in the list using the following logic. if n = 3 and as seq[n]=2, the new list will be seq = [0, 1, 2, 2, 3, 3] if n = 4 and as seq[n]=3, th...

 
7:38 PM
@MaxtronMoon as someone just remarked over at codereview.stackexchange.com/questions/247981/…, ^ is xor in Python, it is not for exponential computation, you want to use ** instead. — Uberhumus 16 secs ago
Code Review might be more appropriate for this type of question. — Harun Yilmaz 43 secs ago
 
0
Q: Handling Promise that resolves but returns a 404

FlameDraThis is in a node and express API. I'm trying to figure out the best way to handle Promises that resolve, but return a 404 response. I have a method which uses node-fetch to make a POST call to update a row in a database. If an invalid profileId is provided, the Promise will resolve even though t...

 
8:33 PM
0
Q: Basic java Tetris game

binyaI'm learning really basic java at school but I learn on my own at home. I've had some experience with simple swing games, but this one exceeds all. I want any opinion and advice someone may contribute. public class Display { private JFrame frame; private Canvas canvas; private Strin...

 
8:58 PM
0
Q: Refactoring of two command handler implementations with F# in the context of event sourcing

Kerry PerretI've written some F# code to handle commands in the context of event sourcing which works along the lines below: Read Events from a specific event store stream Build the current state in the given business / domain context accordingly to the events that has just been read right above Decide new ...

 
9:48 PM
0
Q: Minimum Window Subsequence LeetCode Solution

Rahul WadhwaniProblem statement : Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence of W. If there is no such window in S that covers all characters in T, return the empty string "". If there are multiple such minimum-length windows, return the one with the left-...

 
10:38 PM
0
Q: Game scraper for Steam

F.MI made a scraper for Steam that get different info about a Steam game, such as the price, the specs and the supported platforms. The reason I made this was because I have a super slow laptop, so looking at many games would take a long time :) Some things I would like to improve is have better err...

1
Q: a utility to swap two files

user222866While I have never had to swap two files I have always wondered if there was command for swaping two files and recently I decided to see if there was one. Eventually I found out that there wasn't one and as a result I decided to create one. Here is the code: main.cc #include <iostream> #include <...

 
11:03 PM
0
Q: WinForm Logon Best Practices

RandyI have a working logon for a WinForms Project. I use the program.cs file to launch the login form. I am not so sure there isn't a better way of implementing this. Here is my program.cs file: using System; using System.Windows.Forms; using WindowsFormsApp.Presenters; using WindowsF...

0
Q: React is there a way to write cleaner code when setting values?

TrainI would like to know if there was a cleaner way of setting values in react. The code just sets values onChange event for select lists. I'm used to using angular [(value)]="form.CampaignID" directives and model binding. Is there a more succinct way? I'm going to have around 30 select lists. import...

 
11:41 PM
@SᴀᴍOnᴇᴌᴀ IMHO on this question If one form is blocked while another form is loading the code is still broken.
 
11:53 PM
0
Q: checks validity of credit card in python (cs50 pset6)

mushie2I'm new to using python and wanted to know how I could improve my program. I'm using the Luhn algorithm, the beginning numbers of the credit cards, and the number of digits in the credit card. from cs50 import get_string import re import sys number = get_string("NUMBER: ") check = [] if (len(nu...

 

« first day (2661 days earlier)      last day (1371 days later) »