« first day (2461 days earlier)      last day (1549 days later) » 

12:00 AM
RELOAD! There are 6377 unanswered questions (90.0840% answered)
 
12:23 AM
Welcome to SO. This would be better posted to the code review stack exchange at codereview.stackexchange.com This forum is for problem solving rather than style improvements. — sprinter 59 secs ago
I'm voting to close this question as off-topic because it is better suited to code review stack exchange — sprinter 57 secs ago
@sprinter CR requires code to be working to the best of the OPs knowledge and thus such a post would not be on-topic. — Sᴀᴍ Onᴇᴌᴀ 18 secs ago
 
0
Q: Check existence of user identification number

LinnyI was tasked with writing a python script to check if a passed ID number exists within a file. The file I was give contains roughly 25,000 unique ID numbers. An ID number is a unique 9 digit number. I have a couple specific things for you to comment on if you decide to review this: As it stan...

 
 
1 hour later…
1:56 AM
If this code works (really) then it could be a candidate for codereview.stackexchange.com. The question is "Too Broad" for StackOverflow. — Stephen C 45 secs ago
 
 
1 hour later…
2:59 AM
Hmm, it already has a code review-y answer, so now migration is necessary for that one.
 
3:35 AM
0
Q: Takes a twitch IRC message as string and parses it to a message object returns tuple with event string and message object

Eli ReidI am looking for a better way to minimize nested if statements in my MessageHandler.handleMessage method. I am looking to adhere to SRP and a function should do one thing and one thing well! any input would be greatly appreciated thnx from dataclasses import dataclass, field from typing import ...

 
I see that your Tour the first example answer has "The algorithm looks fine to me. It shows no clear flaws, and will work fi" (yes, the ne is missing in action). That doesn't sound like a great example for the tour, as the algorithm should run fine to be posted, right?
Similarly the example comment starts with "@FlorianF this is Code Review, not Stack Overflow. " - while the comment for which this comment was posted on is MIA.
Sorry, I'm getting that Review vibe, and the badge "Informed" came up :P
 
3:51 AM
@MaartenBodewes I can't see anything past "work". I found the post. I don't know why you're talking about "action", but "fine" is spelt correctly. And yeah the missing comments are strange, since they definitely exist.
And the algorithm should work the best to the author's knowledge. If the OP is a new programmer, then they may make some pretty big mistakes - which we can comment on in an answer.
 
Just thought that these were a bit strange as example in the Tour. On their own / in context they are probably fine.
I'll have to thread careful and check the tour on Crypto before I mention anything else, I suppose...
 
0
Q: More efficient way than creating scanner of .txt file twice

Luke KellyI am working on a simple personal project to build a Hoffman Tree. In my constructor, shown below, I am reading in a file, creating HoffmanNodes that represent each char in the file then I got through the file to encode it. I need to create a Scanner to go through the file once to find all the ch...

 
I looked at the the Crypto one, and was like "I'm sure D.W.'s a mod", why no diamond?! Just on a different site...
Then again Mat doesn't have his diamond in our example comment...
 
4:18 AM
0
Q: Proper way to use dicts as python class attributes

Woody PrideI have a python class that draws on a number of default values stored in a separate module. These values are stored as class attributes as dicts. The value of the dicts depends upon other arguments given to the class constructor. The user of the class needs to be able to view the default values, ...

0
Q: Execution time grows exponentially in estimation of min_samples for DBSCAN

SethI'm attempting to speed up some python code that is supposed to automatically pick the minimum samples argument in DBSCAN because the execution time grows exponentially as the number of training examples increases: 0.128999948502 seconds for 100 training examples 0.281999826431 seconds for 100...

 
4:58 AM
0
Q: Python Dynamic Array HackerRank code

Arun KumarI am trying to solve this question from HackerRank about Dynamic Array. Below is the code that i am trying to execute. Its running fine for sample small input but for large integers its not working and throws ZeroDivisionError: integer division or modulo by zero for some values. Could you please...

 
D.W. was a mod on our crypto site a long time ago. Now SEJPM and me wear the diamond hat.
 
5:49 AM
Monking
@Mast memory-leak seems closed now !
 
0
Q: A function to scan user input as string

d4rk4ng31I know that multiple functions are already available. However, I thought of writing my own because I wanted to learn the logic (and also because I thought there wasn't enough confusion :P). Please review the function I wrote and suggest me efficient changes. Without further ado, here I go: #inc...

 
6:39 AM
0
Q: Accepting the values by reference

MannojI have below code : template <typename T> T* Accept(const T param) { //some code here return std::move(&param); } Now changed it to: template <typename T> void Accept(const T& param); But the question: The Accept() is used at many places in huge code. Not able to understand the impa...

 
 
1 hour later…
7:40 AM
0
Q: Producer consumer problem using pthreads vs C++ 11 threads

Thrisha RamkumarI wrote code in C using pthreads, two threads, one producer filling the buffer, one consumer reading from the buffer. In C, the program is synchronized. But in C++ 11 threads, the program doesn't seem to be synchronized. The C code #include <stdio.h> #include <stdlib.h> #include<pthread.h> #de...

 
8:10 AM
possible answer invalidation by d4rk4ng31 on question by d4rk4ng31: codereview.stackexchange.com/posts/236334/revisions
 
@Duga rolled back
 
8:41 AM
0
Q: Implicitly passing client context to services in Node.js

FTorradoIn node.js I have been trying to find a way to pass client context from the Express routes into the services without every service function to have a context. By context I mean an object with user type, ID, possible queries passed on the request, etc. I see four possible ways to do this, keep t...

 
 
1 hour later…
9:42 AM
0
Q: form1 string is don't pass to form2

J.ColI want to make form1 pubId value changed from form2. pubId is always get null didn't change. How can I solve this problem? Form1 code: public string pubId = string.Empty; public void button1_Click(object sender, EventArgs e) { try { form2 _frm2 = new form2(); _frm2 .For...

 
Does it do what it should (encrypt the same input to the same output as Java does)? If not, fix that. If it does, you might want to try CodeReview for tips on how to make it "better". — Corak 39 secs ago
 
10:42 AM
0
Q: Array of objects to array

KilipukkiWhat would be the "correct" way of transforming an array of objects into an array? Suppose I have this array that contains objects: const paintings = [ { painting: "Mona Lisa" }, { painting: "The Starry Night" }, { painting: "The Last Supper" }, { painting: "Girl with a Pearl Earring" }...

 
 
2 hours later…
12:44 PM
I think this question is more suited for codereview.stackexchange.com — Rahul Bharadwaj 39 secs ago
 
1:04 PM
0
Q: Chaining Promises in React

NadineFirst I fetch an instance from the database. The three functions getSwitches, getSingle and getLinears need the return value instance. When all requests are finished I want to fill the array barFrequencyData with the data. How do I correctly refactor the code? Should I use async/await or promi...

0
Q: Python coroutine and linked list solution

MasterOfTheHouseA few days ago someone asked this question but was quickly deleted as he offered no solution. Giving: a = ['COP' , '\t\t\t', 'Basis', 'Notl', 'dv01', '6m', '9m', '1y', '18m', '2y', '3y', "15.6", 'mm', '4.6', '4y', '5y', '10', 'mm', '4.6', '6y', '7y', '8y', '9y', '10y', '20y', 'TOTAL',...

 
1:24 PM
0
Q: Filter one array based on values of another, is this the best way?

Dupdroidcategories = [{id: "761601bc-4daf-4db2-a0cf-fe7f443fcb94", name: "Shoes"},{id: "601ebcfe-fcbd-4075-a4b4-a42e356c5747", name: "Hats"},{id: "238933cf-77a5-4443-b290-7d7c836f80ff", name: "Eyewear"}]; voucher = {id:1,categories:["761601bc-4daf-4db2-a0cf-fe7f443fcb94","601ebcfe-fcbd-4075-a4b4-a42e356...

 
Questions about working code are off-topic for Stack Overflow. Your question may be appropriate for Code Review. — Michael 55 secs ago
 
1:44 PM
0
Q: Dependency Injected StackExchange.Redis Client

ThorbearI am currently building cache for my application, and I would like to have my redis cache client work the same way you would dependency inject a DbContext. I am using StackExchange.Redis to manage my redis cache: https://github.com/StackExchange/StackExchange.Redis I have made it work, but I am...

 
2:05 PM
0
Q: How to check multiple roles assigned to user in yii2

QuestionsI am using Yii2 basic. I have implemented RBAC successfully. I have roles as Admin, Field Officer and Pastor. Now there is user which has Field Officer and Pastor roles assigned. Now in main.php which is a layout file I have assigned menus based on the roles in the side bar. When there is user wh...

 
you should look up codereview.stackexchange — Nicolas Gervais 11 secs ago
 
2:25 PM
0
Q: python code - try/except and file handling

Gunasekaran Desaiyantrying to learn python programming I am not sure if I can write a try/except code like this: import os import shutil try: shutil.rmtree('c:/guna/newCAT1') print("dir newCAT1 deleted") except: os.mkdir('c:/guna/newCAT1') print("dir newCAT1 created") fileIN=open('c:/guna/newCA...

 
2:41 PM
posted on January 29, 2020

We’ll be performing some server maintenance on our Stack Exchange Data Explorer server starting at 2:00 PM UTC (9:00 am US/Eastern) on Wednesday, February 5, 2020. The service outage could be up to 12 hours.  For more details, see our post on Meta Stack Exchange.

 
2:55 PM
possible answer invalidation by Franartur Čech on question by Franartur Čech: codereview.stackexchange.com/posts/236316/revisions
 
~sigh
it seems like the Markdown plugin for IntelliJ is hemmorhaging memory
 
0
Q: c# minimizing massive functions

TravisI'm taking on a project from a previous programmer. My goal is to make it a bit smaller and hopefully better. Originally the code has a bunch of length checks and booleans as shown below. string[] splitStrArray = SNString.Split('-'); string part1 = splitStrArray[0]; string part2 = splitStrArray...

 
Just as a general tip, this isn't code review, but cut up your hugemongous function in several functions. This is too long, has too many responsibilities and is generally unreadable. What happens with your code if someone enters a " in a field like $fname or $c_email or $c_sname? It will break your code massively. Make sure all your output is sanitized and conform acceptable output. also, you'd better put those variable values in data-attribute-name="" on the <input id="ajaxbutton" data-c_email="<?= htmlspecialchars($c_email) ?>"> and then just do var c_data = $this.data('c_email')Tschallacka 47 secs ago
@Liam I'm not downvoting, though I think this question is better suited to codereview.stackexchange.comcharlie_pl 28 secs ago
Maybeon codereview.stackexchange.com ? — RemcoGerlich 54 secs ago
 
 
1 hour later…
4:15 PM
Does your code work fine on a smaller data set? If yes, this question may be better suited to codereview.stackexchange.com That said, you may want to look into having the first loop be i = 2 To lr - 1 and the second loop be j = i + 1 To lrcybernetic.nomad 21 secs ago
 
4:46 PM
0
Q: Is my palindrome program correct and in an organized way?

Austin V Nguyendef is_palindrome(x): for i in range(0,len(x)): x = x.lower() if x[i::1] == x[::-1]: return("%s Is a palindrome" %(x)) else: return("%s Is not a palindrome" %(x)) print(is_palindrome('racecar')) Here is my palindrome program I was just wonde...

0
Q: Video thumbnail creation during file upload (POST)

David AlfordI have a helper function which is sometimes freezing up the site so I am trying to clean up the code to remove possible issues. This helper function creates a thumbnail for videos when they are uploaded if the user does not upload a thumbnail. helper.py: def create_thumbnail(input_path, output...

 
5:10 PM
Monking
 
5:21 PM
This is probably more appropriate for codereview.stackexchange.com — Titus 13 secs ago
 
5:39 PM
This question is probably more appropriate for code review. See Which computer science/programming site do I post on?John Wu just now
 
0
Q: Javascript validation Class & Functions

MarcI wrote javascript code for form validtion. The goals is to implement fast validation with data attributes on HTML input elements. I'd like to hear from you how i can improve the class or function. Personally i think i can divide the form.js into more class e.g. error class? types.js expor...

0
Q: React-Native Account screen with a modal for updating details

JimJust looking for advice/thoughts on the overall AccountModal and how its written. looking to achieve better written, more legible, less repetitive code, more concise, cleaner etc... AccountScreen.js: import React from 'react'; import { StyleSheet, ScrollView, View, Dimensions, Image } from 'rea...

 
5:57 PM
@Heslacher 👍
 
6:25 PM
possible answer invalidation by Lisa on question by Lisa: codereview.stackexchange.com/posts/236293/revisions
 
@Duga appears to be in response to request for main() to show intention of usage - from comment (from OP of lone answer)
@Lisa Please provide a main() which shows how you intend to use Camera and I can give a fuller answer. I suspect the answer is: you are prematurely worrying about copying/pointers etc. C++ is extremely good and fast at "value types". So at 2x 24bytes I wouldn't worry too much at all until you have a real example to test with. Why are m_width and m_height and the resulting AspectRatio() of type float? When everything else is a double? I would just stick to double. With H/W acceleration they are almost the same speed and there is probably no issue with storage here. — Oliver Schonrock 15 hours ago
 
6:40 PM
 
0
Q: Records and elements class, small "database" c++, no sql

Vital ZeroI'm trying to construct a simple database for use by 2 persons only (myself and other guy), right now, we're using excel table with 4 fields "requisition, origin date, request date and authorized date", but I want to take it to the next level :D. So, I'm building this small database app to emulat...

 
Ryan Donovan on January 29, 2020

You’ve seen those job listings that are looking for a “JavaScript Rock Star” and likely rolled your eyes. It seems silly to think that whatever skill you have at programming is going to get you featured in Rolling Stone. Besides, code on a screen is not likely to land you the legions of screaming fans that a sick guitar solo will. 

Unless you’re Sam Aaron, that is. He’s the creator of Sonic Pi, a live coding language for making music. It’s an open source project that he built which creates music from code in real time. The world of music is taking notice: Rolling Stone described him as “transcending the present” when he performed at the same festival as Grimes.  …

 
Questions with regards to refactoring advice should be made on codereview.stackexchange.com , not StackOverflow. Make sure before posting there, however, that your code is in a working state. — Taplar 31 secs ago
 
7:08 PM
0
Q: shopify get jquery code more readable, usable

PiotrHi so like in my question, i wrote some part of code for shopify to get recent orders for past 30 day and i wondering if it is really readable, or maybe i schould change something? I mean maybe there is a better way to achive same result. Or maybe i schould use different names? change position...

-1
Q: C# simple console program

tramadaCan someone with good C# knowledge give me feedback about code from repository https://github.com/nanquim/solucao-apisul I know is simple, but I want to know what is wrong and how it could be better They asked me to implement the interface above: using System.Collections.Generic; namespace Pr...

 
7:40 PM
possible answer invalidation by Piotr on question by Piotr: codereview.stackexchange.com/posts/236370/revisions
 
-1
Q: How to express multi variable conditions

Vector JXI have a below mentioned multiple variable which match with the other variables and gives output like TRUE, FALSE or HOLD. I have tried to represent it here in table format. Variable Condition Var1 Var2 Con1 Con2 Con3 Con4 Con5 A A1 Hold True Tru...

 
8:13 PM
I'm voting to close this question as off-topic because it fits better here: codereview.stackexchange.comSebastian Kaczmarek 6 secs ago
I would suggest following up on the suggestion from @SebastianKaczmarek above and posting on Code Review. StackOverflow avoids taking questions that are primarily opinion-based, such as things to do with code style and good design. — Conspicuous Compiler 40 secs ago
 
8:49 PM
0
Q: Safe Integer Library in C++

S.S. AnneI've designed a single-file safe integer library in C++. safe_integer.hpp: /* * Copyright © 2020 James Larrowe * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation,...

0
Q: Add Copyright to PDF File

JeffersonWill you review the syntax, structure, and logic of my code. It can be tested using the main. using iTextSharp.text.pdf; using iTextSharp.text; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace AddCopyR...

 
9:09 PM
0
Q: Simpler Poker Counter

ElbaselThis is a simple poker counter. It lets players decide their actions and makes the currency calculations for them. While adding a bit of console animation. Can I achieve the same results with simpler code?? from string import ascii_lowercase def get_player_names(): ''' Returns a List...

 
9:45 PM
possible answer invalidation by S.S. Anne on question by S.S. Anne: codereview.stackexchange.com/posts/236376/revisions
 
@Duga OP got permission from answerer to add more implementation
@S.S.Anne go ahead and add them. — 1201ProgramAlarm 4 mins ago
 
10:17 PM
The functional code you provided doesn't seem terribly inefficient. Maybe submit to the codereview stackexchange for ideas on how to improve instead of here. — h0r53 just now
This seems more appropriate as a comment than an answer. Albeit, the question seems better suited for the codereview stackexchange. — h0r53 13 secs ago
 
10:30 PM
0
Q: I am trying to create a number guessing game in python 3.7 and am stuck on the difficulty levels which needs to be by how many guesses

alicia johnsonhere is the objectives for the code: 1) You are to ask the user if they wish to play the game or continue playing the game after they have guessed the number 2) You are to ask the user if they want easy, medium or HARD (Easy = unlimited guesses, Medium = 10 guesses, HARD = 5 guesses) 3) Once t...

0
Q: Converting a string into a string array

iMazingI'm implementing a game server and representing the game board as a string, take this state as an example: String b = ", a36, a32, a26, a40, a295, a41, a49, /, , a16, a09, a68, a11, a99, ," I want to convert this string into the following string array: [, a36, a32, a26, a40, a295, a41, a49, ...

 
11:11 PM
This would fit better on Code Review, but if it's moved: Please add the GetName method text... — Austin T French 8 secs ago
 
11:30 PM
Bleh, you indicate to somebody that they are entirely on the wrong track when it comes to detecting overflow, and they immediately vote down because "undefined behavior" (very easily fixed). I'll leave them with their jokingly bad implementation of it.
 
bugger...
 

« first day (2461 days earlier)      last day (1549 days later) »