« first day (2524 days earlier)      last day (1494 days later) » 

12:00 AM
RELOAD! There are 6443 unanswered questions (90.1427% answered)
 
 
1 hour later…
1:09 AM
0
Q: Python code refactor to use multiprocessing

snakeandroosterI have written some Python code that opens files one by one, does some work, and writes data onto the filesystem. I figured, I want to make use of my cores.I've refactored the program into this. from multiprocessing import Pool import globdef work(file_name): # do work passif __name__ ==...

 
1:48 AM
This question might be more appropriate at codereview.stackexchange.comMichael Albers 44 secs ago
 
2:05 AM
If your code works, then your question is off-topic for Stack Overflow. If you turn your code example into a good complete example, then you may find it's suitable for codereview.stackexchange.com. — Peter Duniho 55 secs ago
 
2:24 AM
0
Q: I'm a newby and wrote a Sudoku Generator in Javascript. Would like to have some thoughts on it

Yamil DubaThe code returns a string ready to seed at sites like this. It works great but as I couldn't find other simple examples for my level I hope for some insights on this and ways to correct what is wrong. Thanks for your opinions! let sudoku = []; function shuffle(a) { for (let i = a.leng...

 
2:50 AM
Does anyone know if it's possible to make a new branch based on a remote branch with a different name. I.e. foo -> other/master. I've tried git pull other master:foo but that doesn't set the remote, git branch -vv. This is fine, but then I seem incapable of figuring out how to then use --track to set the remote...
 
you can --set-upstream-to a remote ref
git checkout -b [branchname] [remote_ref]
or in this case: git push origin foo:master --set-upstream
 
Wow, just wow
That's so easy
 
anyways: bedtime for me :)
Toodles!
 
Thank you very much @Vogel612 ^^ have a good one
 
0
Q: zip_longest without fillvalue in typescript

jacobcan118I would like to create a function like zip_lognest in python and if the array size is uneven, I do not want to filled any value. following is my code and example const aFixture = [ { name: 'name_a', value: 'value_a'}, { name: 'name_b', value: 'value_b'}, { name: 'name_c', value: 'value_c'}...

 
3:22 AM
0
Q: User defined function for analyzing multiple csvs, create variables, and count NAs in R

mmm216I have roughly 100 datasets with different variables (and different numbers of variables) but each dataset has a household ID (hh_ID) as an identifier. Variables represent survey questions. Each csv represents a different type of survey. I want to write a custom function that counts the number of...

 
3:49 AM
@CaptainObvious Not sure
A lot of ML questions have unsatisfactory output, and that's part of the game with ML. Makes it harder to call whether it's a good fit on CR though.
 
4:42 AM
I don't vote on ML because I lack the knowledge to be anything but a burden. The sentence "This model is taken from the official TensorFlow site" doesn't sit right with me, isn't that authorship. Additionally it just seems like plz debug this, like most ML questions, but IDK if I'm being unreasonable there
 
"Is there any way to optimize" is a better fit for "Code Review", rather than Stack Overflow. Please check the posting standards there and consider moving your question. — Prune 47 secs ago
 
5:07 AM
engineering.upside.com/… -- great read. I should do more of this. I agree that this more of a "code review" — David Erickson 38 secs ago
 
5:36 AM
0
Q: "Write a code to add and print the output of the pattern - +2 -4 +6 -8.... up till 20 "

Om Katepublic class hw1 { public static void main(String[] args) { int a = 2; int b = 4; int out =0; for(int i = 1; i <= 20; i += 2) { out = -a + b + out; a +=2; b +=2; } System.out.println(out); } }...

 
"Is there any better way to do it" is not a Stack Overflow issue -- this is not a tutorial or review resource. If you want to discover better ways, keep working on your class materials. If you want a code review, then post your question to the Code Review site. Stack Overflow is generally to fix specific programming problems; "any better way" is simply too general. — Prune 57 secs ago
 
 
1 hour later…
6:51 AM
0
Q: Spring - on validation failure of the form the list built on model object renders empty

Manan MehtaI am learning spring from Sping in Action 5th edition by Craig Walls. I have searched the internet for the issue but did not land at any solution. Issue: design.html has a form which has a list which is rendered empty if the form fields have validation error. Following is the code: design.html...

 
7:16 AM
Sounds like a post for stack code review... — Simson 50 secs ago
 
@Peilonrayz I share your concerns here.
 
7:56 AM
If you don't have an issue with your code and you are only looking for possible improvements then you should post at Code ReviewJoakim Danielson 51 secs ago
 
8:07 AM
0
Q: how should I optimise the scala code and make it more readable

ManuI have this ugly massive piece of code. It does many things, mostly around querying databases. Each query depends on the result of the previous query or on the parameters of the incoming request body. Queries are done asynchronously using Future. The code works but is not readable. How can I rest...

 
8:25 AM
0
Q: naive suffix tree construction in Python

PerplexityyI'm not certain if my implementation is correct, it appears to be, but looking for any feedback as far as readability and efficiency goes. Obviously using dictionaries isn't particularly efficient space wise, but how else could you achieve O(1) lookup? import os def get_suffixes(string): re...

 
8:44 AM
0
Q: STRING REVERSAL in PYTHON ( without using inbuilt functions)

Ayush ShuklaWHAT IS WRONG WITH THE FOLLOWING CODE? IT' GIVING AN ERROR : STRING OUT OF RANGE def reverse(s): i=0 l=[] while i<len(s): if s[i]!=' ' k=i while (s[i]!=' ' and i<len(s)): i+=1 l.append(s[k:i]) i+=1 return ' '.join(re...

 
8:55 AM
We do not provide code-writing services here. We recommend that you search online tutorials and examples in order for you to learn how to write your own code. See What topics can I ask about? for reference. Once you have written working code, you're welcome to ask a new question here and we can then help you improve it! — Rallen 38 secs ago
 
 
1 hour later…
10:23 AM
@SvenMarnach thanks, it looks like it works for a general case. Are there some areas where that implementation could be improved? However, probably this discussion should be on codereview.stackexchange.comStranger6667 40 secs ago
 
 
1 hour later…
0
Q: Block Bootstrap Estimation in Java - Part 3

ClarinetistThis is an extension of Block Bootstrap Estimation in Java - Part 2. The text file text.txt can be found at https://drive.google.com/open?id=1vLBoNmFyh4alDZt1eoJpavuEwWlPZSKX (please download the file directly should you wish to test it; there are some odd things about it that you will not pick u...

 
12:12 PM
0
Q: Remove repeated words from string

PppI have a text-to-speech app that takes input and 'builds' up a string. The problem is the text may be 'scrolled' at any time. So e.g. - "This" - "This is" - "This is a" - "This is a text" - "This is a test of" - "This is a test of the input" - "of the input. This" - "of the input. This is" - "o...

 
12:31 PM
0
Q: Simple two-mode camera for graphics engine

adesI have a camera class that I use with my graphics engine prototype. For context, the graphics engine is written in OpenGL(4.1) using Qt-bindings (PySide2), since I also used Qt as my window and context manager. The camera's view matrix is used to transform vector positions. The camera has two di...

 
1:09 PM
0
Q: It create a file but no data inside

newbieI've view several solution by adding flush(), but the problem still not solved. The code function in I'll add data after clicked on jbutton1, and print the file by clicking jbutton2 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { ...

 
One final note: The Stack Exchange site best suited to requests for general-purpose improvements to already-working code is not Stack Overflow (which is explicitly focused on narrow questions about specific problems) but Code Review. That said, there are some changes that would needed; among others, whereas we want a minimal reproducible example, they want complete and working code. Should this question be closed as "too broad" here, do consider modifying it per the guidelines in A Guide To Code Review For Stack Overflow Users and then posting there. — Charles Duffy 57 secs ago
 
1:28 PM
0
Q: dynamic insert function for PDO (for any case)

IngusI created dynamic insert function for PDO. It does works but i want to be sure that it is secure and well coded function insertNewRows($pdo, $table, $fields, $placeholders, $values=''){ if($values){ $result = $pdo->prepare("INSERT INTO $table ($fields) VALUES ($placeholders)"); ...

 
2:03 PM
first you know that you can edit your message? second, you need a code review? you are not on the correct meta. — pix 20 secs ago
 
0
Q: How do i write a log base 10 function that returns an integer in Java without using the Math class?

Ziegfred ZorrillaI am assigned to a task of creating a fuction int logBase10Estimate(int n) that returns the log of a number base 10. The answer is integer part only.(w/o using the Math class) Is this okay? static int logBase10Estimate(int n){ int count = 0; for(int x = 10; ;x*=10){ if(x < n){ count...

0
Q: Why is my function timing out when run with a larger data set?

MicFinI am working on a Code Kata // There is a queue for the self-checkout tills at the supermarket. // Your task is write a function to calculate the total time // required for all the customers to check out! // input // customers: an array of positive integers representing the queue. // Each...

 
2:26 PM
0
Q: Guess the number with a twist

S.S. AnneI wrote a program where the computer guesses a random number. To do this, I implemented a form of binary search. This correctly handles any edge-cases that I know of, including 0 and std::numeric_limits<int>::max(). This doesn't handle negative numbers (since rand will never return one) but that...

 
Is there no april-fools joke this year, or is the dark mode beta on SO an April fools joke?
 
@SimonForsberg There is.
With thanks to Journeyman Geek: Stack Overflow Dark mode ultra
> The company is also launching that ultra dark mode as an Easter egg, which will be available from April 1st through April 3rd. Here’s what that looks like if you’re curious. It doesn’t seem that useful to me, but it is indeed very dark.
 
As for this being opinion-based: I see your point, however, I am asking for best practice. Many programming languages allow for a certain variety to write code; thus there is not a single correct way of doing things. Hence, my question about recommendations. Maybe, this question could be migrated to CodeReview. — Dohn Joe 59 secs ago
 
@Mast Where can I find ultra-dark mode?
 
Yeah I can't see it in the preferences
Is it not April 1st in the only country that exists yet?
 
2:38 PM
Been April 1st in The One Big Country for a while now.
 
dark mode seems to be actually a thing, but I really don't like the yellow they chose for the community bulletin
and quotes could've just stayed yellow even with a dark mode :/
 
@Vogel612 I don't like the blue they picked for the question banners (closed/duplicate/etc.), but yea...
 
possible answer invalidation by Ziegfred Zorrilla on question by Ziegfred Zorrilla: codereview.stackexchange.com/posts/239747/revisions
 
I don't think it helps that the person that implemented dark mode has a general distaste for it.
 
@SimonForsberg It's an easter egg. Presumably it's hidden somewhere.
 
2:40 PM
@Peilonrayz It's April 1st on Stack Exchange any time it's April 1st anywhere in the world. i.e. +/- 12 hours around April 1st.
 
@Peilonrayz Ouch. That never helps.
 
@Mast What kind of april fool's joke is it if it's hidden?
 
@SimonForsberg That's not anywhere in the world IIRC there's +13 or +14 or they may be -13 or -14
 
@Duga Rolled back.
@SimonForsberg To fool the fools? I don't know.
 
@Peilonrayz +/- 12 hours around those +/- 12 hours then.
 
2:42 PM
@Peilonrayz Republic of Kiribati supposedly has UTC + 14.
 
Yeah it normally makes sense to be the same day of the week as your neighbors.
 
"So after the function is done returning does the memory allocated to the integer deleted" No, it's not deleted. You have to delete it manually. "is this a good practice?" No, it's bad practice and wouldn't survive any serious code review. — Thomas Sablik 39 secs ago
 
3:04 PM
@Mast The way I read this question, the code works but doesn't pass the performance tests, why are there 2 VTC for broken code? codereview.stackexchange.com/questions/239038/…
 
The subsequent edit also only renamed variables
If it's not correct, then it's broken. Right?
 
@Peilonrayz The edit also removed that part about the correctness test.
 
I'm voting to close this question as off-topic because working code you'd like to make better belongs on codereview.stackexchange.com. You'll need to provide more code for them to review and provide feedback though. (at least one or 2 of the other classes, not necessarily all 12, to compare/contrast and get a better feel for what's going on/what changes/stays the same/etc) — Simple Lime 49 secs ago
 
@pacmaninbw Please can you explain to me how changing a variable's name in Java changes how it function.
 
3:21 PM
@laventnc: I'm afraid it's very hard to understand relatively complex issues with just a code description. You might want to present your code on CodeReview and ask for a review there. — Jon Skeet 38 secs ago
 
3:46 PM
@gold_cy While this may be on-topic on CR in the future, please don't use the existence of the Code Review site as a reason to close a question. Evaluate the request and use a reason like needs focus, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see Does being on-topic at another Stack Exchange site automatically make a question off-topic for Stack Overflow?Sᴀᴍ Onᴇᴌᴀ 47 secs ago
@SᴀᴍOnᴇᴌᴀ OP said It seems to work but would like opinions on if this is the best way to do it which means he would like a code review. for me that is enough to close this question as off topic as it belongs in code review. thanks — gold_cy just now
@gold_cy I agree that it can be migrated - please see Migration of code questions from Stack Overflow to Code Review (and please read that post from my first comment as well) - it should help explain my point — Sᴀᴍ Onᴇᴌᴀ 28 secs ago
 
@Peilonrayz The edit #5 did remove the "and correctness" text. Why? Who knows? Might be a language barrier, might be an attempt at circumventing our rules. Who are we to judge?
If it's not proven to be broken, then I would not VTC at this stage.
So what was this correctness test you were talking about? — Mast Mar 18 at 6:53
@Mast That's not very friendly ^^
They removed the text. They are likely not a native English speaker. They did say this:
@Mast code producing correct output for given test cases, there is some performance issue. — Prerna Mar 17 at 21:17
 
@SimonForsberg I've seen this too many times. Each time it was the same - the code was known to be broken.
 
It's entirely possible that they meant "performance and correctness test" as one thing, not separating the two and not making it clear which one was failing.
@Peilonrayz Does the OP know that?
 
The question can always be reopened if the user provides a link to the test and they just mistook the output.
@SimonForsberg Can you repeat this, this time not in pro-form.
 
@Peilonrayz Good way to lose new comers if the code works.
 
4:01 PM
@Peilonrayz Is the OP of this particular post aware of your previous bad experience, seeing the removing of such wordings, "too many times"?
 
@SimonForsberg No, but why do I or my experiences matter? When there are comments stating similar things
Should I just duplicate some comment adding some noise and not much help?
@pacmaninbw I could be worse, could be downvoting on-topic questions like some users.
2
 
@Peilonrayz There are comments fixating on the "correctness test" part, which has been removed from the post. There is no comment saying "We/I become suspicious when you just remove the 'correctness test' part from your question because we have seen way too many times this behavior in questions and found it to be a way to circumvent our rules about code requiring to be working. Therefore we still believe your code to not be working"
 
@SimonForsberg Right... And all bar one of the comments are before it was removed yeah?
 
@Peilonrayz I'm sorry, I don't understand what you mean?
 
> There are comments fixating on the "correctness test" part, which has been removed from the post.
 
4:13 PM
@Peilonrayz "correctness test" was removed from the post, yes. Which IMO makes the comments about that mostly obsolete.
Anyways, I have reasons to believe that the code showing is not the OP's exact code. It's possible that it is the exact code, but it's a bit unlikely.
 
@SimonForsberg Then don't vote to close it?
 
@Peilonrayz Exactly. I didn't.
 
Great!
 
4:25 PM
@SimonForsberg that's not very helpful. How would you formulate that better?
3
it might be blunt, but honestly I don't think it's unfriendly
 
4:55 PM
@Vogel612 It just reiterates something that has been edited away. If anything, maybe it could be written as "In a previous version of the post, you mentioned correctness tests failing, but this was edited away from the post. Can you verify that correctness tests is not an issue and that it was just a language barrier?"
something like that
 
@SimonForsberg I don't believe a covert attack on a persons ability to speak English is particularly friendly.
 
0
Q: Verifier for multi-purpose scripting language

HydroperI rewrote a compiler project right now containing semantics, parser and verifier, in Java (only now I've realised Scala and Haxe are among Ubuntu packages...). Links: source code, language overview. As an example, the verifier explicitly marks 'frame properties' (or locals) captured by inner fun...

-1
Q: How Do I Use Subtraction on a List? - Python

VivWhen using lists to store information, how does one perform math on it? No in a (list * y) sort of way or a a = (list(3)+list(4)) sort of way. Instead, something like this: List = [1, 2, 3, 4, 5, 6, 7] print (MissingFunctinon.List) Result: 1-2-3-4-5-6-7 or something like that. Below is was what...

-1
Q: Would anyone be willing to comment on the structure, design, and effectiveness of my Python program?

Bob JeansThe gist of my program is to simulate the growth of some virus. I used (attempted) to use OOP concepts to break down the problem into chunks and have the chunks talk to each other. Not sure if my implementation is effective but it seems to work pretty good. Currently, the bottleneck seems to b...

0
Q: Optimize chess piece string location to an index

SkynetThis code works for converting a chess piece location to an index. A chessboard piece describes its location with file a-h (x-axis) and rank 1-8 (y-axis) so this can be represented with indices from 0 to 63. 56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 34 35 36...

 
5:37 PM
-1
Q: Performance tuning & simplifying JavaScript code

PugazhI'm trying to develop a web application for documentation.. I managed to achieve a live preview with Syntax highlighting. Please help me with performance tuning & simplifying the JavaScript code.. I'm not so good with JavaScript & performance tuning. Any suggestions or comment most welcome. Tha...

 
@CaptainObvious wat
2
 
Code Review might be a better place to ask. — Andy Turner 16 secs ago
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comAndreas 55 secs ago
I have some other answers you might be interested in but none of them are a direct duplicate. You should really get rid of the nested vectors too though, a single vector is fine but the double indirection of the extra layer of vectors prevents some vectorizations (funny how that goes) — harold 41 secs ago
 
@SᴀᴍOnᴇᴌᴀ Could you provide a little more information? Wat is a little problematic.
 
5:54 PM
@pacmaninbw isn't that a valid response when the request seems vague? e.g.:
May 2 '18 at 14:20, by Mast
@CaptainObvious Wat
I guess it does have two sentences describing what the code is supposed to do...
> I'm trying to develop a web application for documentation.. I managed to achieve a live preview with Syntax highlighting.
 
@SᴀᴍOnᴇᴌᴀ So you want more details or more context?
 
@pacmaninbw Please can we move discussions about why a post are bad onto the post themselves. Not much point in discussing it here if the OP can't see it now, is there?
 
6:29 PM
I think it should be migrated to codereview.stackexchange.comphd 47 secs ago
@SᴀᴍOnᴇᴌᴀ "Answers can suggest any improvement" The Q is exactly for CodeReview. — phd 37 secs ago
Ah yeah, right. Well, then keep the HashMap. You can put your code on Codreview if you want to see if there's something to fix with the design. — Kayaman 6 secs ago
 
@Peilonrayz ... Nevermind. I'll leave you to it then.
unmarking this room as a favorite
 
I'm voting to close this question as off-topic because questions about core review should be asked on CodeReview.SE: codereview.stackexchange.comMarco Bonelli 26 secs ago
I'm voting to close this question as off-topic because it's asking for a code review rather than about a specific issue. This question may be on-topic at codereview.stackexchange.com, but please review what types of questions are on-topic in that community before posting there to ensure that your question is on-topic. — Ryan M 22 secs ago
 
6:57 PM
Ben Popper on April 01, 2020
Embrace the darkness.
 
@RyanM Thank you for your answer. I did not know the existence of this community for code review. I will post there from now on if I ever have a similar issue. — WhiteGlove 24 secs ago
 
@SimonForsberg @Mast It's now available as a preference
Strange it's like the end of April 1st for me now...
 
7:50 PM
0
Q: Python prime finder

K00lmanI wanted to try and learn multi-threading, so I thought it would be good to make a small program normally first and make it multi-threaded, so I made this prime finder. from time import sleep def prime_finder(num: int) -> bool: """Checks to see if a number is prime""" if num == 2: ...

 
8:09 PM
0
Q: Parallel download of rpm packages

André WerlangI use zypper to download and install for openSUSE Tumbleweed (much like everyone else of course). Unfortunately it downloads packages serially, and having about a thousand packages to update a week, it gets quite boring. Also, while zypper can download packages one-by-one in advance, it can't be ...

 
8:47 PM
-1
Q: OVH : Cloud Web and Gitlab-CI

XemI already asked this question on StackOverflow and I was told I better should make it here. I'm used to Gitlab, and now I want to start deploying with Gitlab-CI, directly on the server. I've an OVH Cloud Web 1 account. Currently, I made it work with this code in the .gitlab-ci.yml file and acco...

 
9:25 PM
0
Q: LeetCode: Search a 2D Matrix C#

Giladhttps://leetcode.com/problems/search-a-2d-matrix/ Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first integer of each row is greater than the last integer of...

0
Q: Conway's game of life in C++ using SDL2

NadpherI finally finished my Conway's game of life in c++ project and i'd love to find out how to improve the code. main.cpp #include "Engine/Engine.h" int main() { Conway::Engine Engine(1280, 1024); Engine.Run(); return 0; } Engine.h #pragma once #include <SDL2/SDL.h> #include <memory>

 
"summarized" is not clear or objective any more than "better". If there's a specific problem you have the code or a specific target, elaborate on that. Otherwise you should ask on Code Review, which allows for more opinion-based reviews of code. — TylerH 52 secs ago
Code Review is a better place to request advice on improving working code. Also, pick C or C++, not both. — Barmar 28 secs ago
 
9:44 PM
0
Q: Count distinct records in a JOINed SQL query

Chris.BI have two tables with a 1-many relationship, Device and TestResult. My application has a filter builder front-end that allows a user to retrieve TestResults based on whatever filters they specify. This generates queries similar to this: SELECT d.id, d.serialNumber, d.createdAt, ...

 
 
2 hours later…
11:43 PM
or you can see a similar question has been answered codereview.stackexchange.com/questions/213208/…vikram just now
 

« first day (2524 days earlier)      last day (1494 days later) »