« first day (2053 days earlier)      last day (1955 days later) » 

12:00 AM
RELOAD! There are 5841 unanswered questions (89.7498% answered)
 
12:20 AM
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comEdChum 38 secs ago
 
12:31 AM
0
Q: Swift permutations of an Integer

stevenpcurtisI want to return all of the permutations of an integer in Swift. var outputArray = [[Int]]() func perms ( _ input: [Int], _ output: [Int]) { if input.count == 0 { outputArray.append( [ Int( output.map{ String($0) }.joined() )! ] ) } else { for i in 0..<input.count {...

 
 
2 hours later…
2:30 AM
possible answer invalidation by Jamal on question by user1234433222: codereview.stackexchange.com/posts/209788/revisions
 
0
Q: Sierpinski’s Gasket Triangle in javascript

Zeyad EtmanI wrote the Sierpinski’s Gasket Triangle in javascript, but i feel the code can be better, especially from L32 to L47, Could you make it more organized? var canvas = document.getElementById('chaos'); var ctx = canvas.getContext('2d'); const GenerateRand = () => Math.floor(Ma...

 
possible answer invalidation by Jamal on question by Joe: codereview.stackexchange.com/posts/10271/revisions
 
3:34 AM
0
Q: How to correctly handle an Exception given the specific constraints

AndromedaDisclaimer: This was an exam question we took and we have already solved it. But my friends and I are not sure if this is the right approach. Here is the question(verbatim) and our solution. For this problem, you must implement the following methods String deleteFirst() boolean isEmpty(). This d...

 
3:47 AM
"I would like to ask for an advice if there's a better way to write it?" You might be better off asking on Code Review if you're not having any issues with your code. — Hoppeduppeanut just now
 
0
Q: Posting a question where part of the code contains a known bug

guest271314There is a particular requirement that has two versions. The first version has proven to be more challenging than the subsequent version to both describe the specification and compose; and also currently contains a known bug for only a specific inputs, though outputs the expected result for all o...

 
Who were you told by? There's nothing really wrong with the code here, albeit it looks a bit ugly. Also, seeing as how your code works, codereview.stackexchange.com would be a better site for this question. — FrankerZ 11 secs ago
 
4:07 AM
0
Q: Haskell Hamming Sequence Logic

fp_moraIt was suggested I place this code here. I had posted it on StackOverflow for kind of review. I found in Excel that a candidate number when evenly divided by one of [2,3,5] in can be found in previously generated hamming numbers. The problem is, I thought this would be a little faster. It seems t...

 
4:22 AM
0
Q: Implementing Passport authentication with promises

J.M.Here is code implementing Passport authentication with a Google Strategy. It uses Mongoose to store and retrieve user data. You might need to be familiar with both of these technologies to review this code if not check out the two links I provided. I have included only the Passport file. I was ...

 
4:37 AM
0
Q: Unity: convert 3d mesh level generator code to 2d sprite level generator

WokerHeadCurrently have a script that generates a level using 3d mesh to create hills for a side scroller game that follows the camera. I would like to work on this script and get help on how to convert it to a 2d level generator using sprites and 2d polygon colliders. If you use a 2DCollider player it ...

 
5:09 AM
Monking
 
5:23 AM
0
Q: Finding the duration of how long a search has been popular

Ranch MayonaiseProgram: I have designed a program in python that does the following (in order): Webscrapes google trends for the most popular searches Stores the searches and traffic of the searches in an in-memory database along with a timestamp Finds the trends that no longer exist (I.E the trends that are...

 
 
1 hour later…
7:56 AM
0
Q: How to properly use groupby on pandas

set92I started to work in a startup, but I'm the only data analyst, so I can't ask in my company, my problem is that in a lot of parts of my code I have to divide the dataframe, so I use the groupby to: for name, group in mvtos_material_df.groupby('Referencia'): # Work with the groups But I thi...

0
Q: Moderate return-low risk vs high returns-high risk investments

kamalbangaTo quantify Buffet's #1 rule of investing, "Don't lose money", I take the assumption that % returns of an investment follow a Normal distribution. Now a high return high risk investment might follow N(mu=50%, sigma=70%) while low return low risk investment follow N(mu=20%, sigma=10%). from op...

 
8:11 AM
1
Q: Simple way to show popup

Kamil KiełczewskiAfter small research I found following informations: In this closed question I found some solution which not works good when pop-up has height bigger than screen (and some jquery solution). Here is question about show outside page in popup. And here are some theoretical and angularJS solutions. H...

 
8:27 AM
0
Q: Side menu handling ios

Prashant TukadiyaI am playing with 3 Main Classes Please have a look I have integrated https://github.com/jonkykong/SideMenu I have one tableview which act as leftViewController This class is show the list of menu user has import UIKit struct SideMenuListItem { var name:String var isSelected: Boo...

 
This is better suited for codereview.stackexchange.comFCin 52 secs ago
 
8:42 AM
0
Q: Need a java version of this mathematica code

Thuriya Thwin[https://www.wolframcloud.com/objects/paralesely/Published/a.nb][1] I am researcher and I find difficulties in studying my research because of my reference paper is written in Mathematica ,Wolfarm language . Can somebody help me in translating this code in order for me to trace well. Thanks for ...

 
I'm voting to close this question as off-topic because it would be better on Code Review. — halfer 53 secs ago
 
8:57 AM
0
Q: Represent a Class which holds translation Strings

PatrickI have a class which represents some translations of a keyword. public abstract class Name { private String name; private String name_de; private String name_it; private String name_fr; private String name_hu; private String name_cs; public Name(String name_key, St...

 
Monking
 
Monking
 
9:13 AM
0
Q: Read integers from coupled lines in a text file

majaI'm trying to read a text file formatted as in this example: 5 3 3 1 5 6 6 6 1 3 2 5 4 Where the lines are coupled, with the line above always being of length equal to 2 and the line below having length equal to the the last digit in the line above. (Unfortunately this is from an old note I t...

0
Q: Establish a Debian LAMP with Ansible

JohnDoeaI plan to rent a remote machine with Debian and root access to establish a LAMP server environment with some extras basically via Ansible in the following way. I have yet to test it and can't test it right now (I'm leaving my country and I have no payment option to rent a remote machine) but it ...

0
Q: Finding a string in a text file and reporting full file name and size

Robbie DeeI have the following script to find files containing a certain string and then report on the location of the file along with the size in bytes. It works, but I seem to have made heavy weather of finding the string which involves a fair bit of tidying up afterwards to produce some clean output. ...

 
9:28 AM
0
Q: Reduce the lenght of word in a sentence

Comte_ZeroThis function's goal is to reduce the lenght of a sentence to exactly max_lenght characters by cutting each word in the sentence to a lenght of minimum 4 characters, if cutting each word to 4 characters isn't enough the the sentence is returned anyway. All sentences are free of special characters...

 
9:59 AM
0
Q: Generating strings dynamically in Python

AviónI'm generating a URL (in string) that depends on 3 optional parameters, file, user and active. From a base url: /hey I want to generate the endpoint, this means: If file is specificied, my desired output would is: /hey?file=example If file and user is specified, my desired output is: /hey?file...

 
10:44 AM
I'm voting to close this question as off-topic because it would be better asked on Code Review — RiggsFolly just now
Agreed. Deleting and putting to CodeReview. — Café 21 secs ago
 
11:01 AM
0
Q: WinAPI - Executing a function from a window

Hachem Ben AmorGood evening, So i've this project to create a window where i can execute programs from. I'm really tired of searching so i decided to ask for someone's help. anyways i made a program that shows a window etc but my problem is that i want to execute some functions, such as printf("hello world!").....

 
11:32 AM
0
Q: Python: Optimizing a generator

dustinFor large v_max and v_max_n, the generator below yields very slow when I have 750000000 and 500000000, respectively. I have been trying different ways for days and cannot seem to figure this out. from itertools import product n = 15 * 10 ** 8 (i for i in product(range(2, v_max_n + 1, 2), ...

0
Q: Python Simulation of the solar system with classes

Ian RonkI am currently trying to get a two body problem to work, that I can then upgrade to more planets, but it is not working. It is outputting me impossible positions. Does anyone know what is causing that? This is the code I use: day = 60*60*24 # Constants G = 6.67408e-11 dt = 0.1*day au = 1.496e8 ...

0
Q: ASP.NET MCV Razor - dynamic folder iteration HTML display

Alexander LawaetzVariable Model is essentially a folder from the root-url where its child folders gets displayed through razor. short story long - I got an internship, no past experience with ASP.NET-MCV, a nucance of an assignment (Yet fulfilling), and now I want to optimize my code, giving the content is to be...

 
11:48 AM
0
Q: PHP - select data from csv and make associative array

CaféI've got a .csv file with ZIP codes containing the city and its sub-districts 67401,City 1,district_a 67401,City 2,district_b 67401,City 3,district_c 67401,City 3,district_d 67401,City 3,district_e 67401,City 3,district_f 67401,City 3,district_g 67401,City 3,district_h 67401,City 3,district_i 6...

 
12:03 PM
0
Q: Spotify current track to vk.com user's status

Flynn84This is refactored and much more expanded version of the script reviewed here. The whole authorization process is added. import os import secrets import string import time import webbrowser import furl import requests import simplejson as json import config URL_CODE_BASE_VK = 'https://oauth....

 
12:39 PM
Also, if you do not have a more specific question than "it is weird, isn't it?" then this is too broad. I think even the people at codereview would not accept this. — Yunnosch 21 secs ago
Stack Overflow's scope is limited to narrow, specific questions about broken software. For suggestions on improvement of working software, consider our sister site Code Review (though before moving a question there, read A Guide To Code Review For Stack Overflow Users). — Charles Duffy just now
Code Review is the part of StackExchange for improving already working code. — gsamaras 11 secs ago
@gsamaras I do not think that the codereview gang would take kindly to "Can you explain this weird code?". — Yunnosch 18 secs ago
 
 
1 hour later…
2:07 PM
0
Q: Program takes hours to run: how can it be optimized?

Michael Martinam working on a class project where we have 10 gzip files of PubMed data, each of which has 1000 PMIDs which each have their own features like Title, Abstract, Authors, and assigned MeSH terms. I am a novice at Python and have written the below code to find every article PMID, the title and abstr...

 
2:23 PM
0
Q: snake game in C++ without using cls need suggestions

Diamond32Hello I need help with snake tail, it apears only after second point. I think first part of tail appears under the head, so we can not see it, but I do not know how to solve this problem. I am just learning so all suggestions are welcome. #include <iostream> #include <fstream> #include <string> ...

 
If this code works as intended, I'd suggest posting it on codereview.stackexchange.com instead. That website is more appropriate for this type of questions. — Georgy 14 secs ago
 
2:38 PM
0
Q: Erlang (and dynamic languages in general) type error handling style

NikI am working on a math library for an online game. I want to prevent as much errors as possible and I want to catch all errors as early as possible to simplify debugging in the long run. However I feel like I drown in details. This is quite different from "let it crash" motto. point has {number(...

 
3:09 PM
0
Q: Is this going ok or should I switch to html5 canvas?

Hans DashI'm coding for fun with the secret ambition of making a fun little game for mobile. So I started out building this with Javascript and jQuery. I think it is going ok, but I would love feedback on what should/ could be better/ smarter coded. Also I have this nagging feeling that I should ditch thi...

0
Q: Simple MVC built in PHP

Siddharth BoseI tried to make a MVC in PHP with OOP approach. Code Review this so I can understand whether am I using the best practices and can I legally call it a MVC framework or not. Also, I am going with 1 controller for each action. This blockquote might help you review my code better. The defau...

 
3:28 PM
Get the part of the code that works and submit to codereview.stackexchange.com there's a lot of things can that be improved. As for your question, just search for the line that starts with "{username}," then you'll get the score for that user. — the_lotus 10 secs ago
Hi and welcome. This question is off topic for Stack Overflow, as it is not containing a clear described problem or bug. Refactoring working code is more likely to be accepted at codereview.stackexchange.com. — Randy 23 secs ago
I'm voting to close this question as off-topic because this question does not relate to bugfixing or problem solving. Refactoring working code is more likely to be accepted at codereview.stackexchange.com. — Randy 28 secs ago
 
Hi, is anyone alive?
 
0
Q: SICP exercise 3.47 - implementing a semaphore in terms of mutexes

morbidCodeCan anyone check my solution to the first part of exercise 3.47 in SICP? Thanks. Exercise 3.47: A semaphore (of size n) is a generalization of a mutex. Like a mutex, a semaphore supports acquire and release operations, but it is more general in that up to n processes can acquire it conc...

 
@Randy I'm not sure about conditions of code review, but a bad algorithm is able to define a problem as well. maybe he/she doesn't have complete knowledge about language features. I'm not sure indeed, just asking. — mrReiha 1 min ago
 
3:47 PM
posted on December 17, 2018 by CommitStrip

 
@mrReiha A bad algorithm is a problem indeed, but then I still think codereview is a better place. This exchange is meant for bugs and broken code, not improvements to working but lacking algorithms. If you have a performance problem and want to ask what algorithm to use, I would probably tell you to do some research about algorithms and maybe check here if your assumptions about the found algorithms are correct for the code you posted. Just providing code and asking for improvements shows too little research and effort imho. — Randy 14 secs ago
 
@morbidCode Usually.
 
@Randy couldn't agree more about little research and effort. by the way, do you think should I answer my opinion on this, or leave it for codereview community? — mrReiha 32 secs ago
@mrReiha I've been told in no uncertain terms that code review is for working code only. And you cannot ask them to review a specific part - they will review every aspect of the code and tell you about any and all ways to make it better - they said once I had asked about a specific problem with my working code, my question was bordering on being off topic: codereview.meta.stackexchange.com/questions/6523/…Pete 36 secs ago
 
@Mast nice. Do you mind editing my code formatting on my question? My eyes are destroyed and I am unable to make beautiful code formatting. Thanks! codereview.stackexchange.com/questions/209840/…
 
@morbidCode How do you have it formatted in your original file?
 
3:54 PM
Also, if the code works, you may instead want to post this to CodeReviewBruceWayne 6 secs ago
 
@Mast I use racket and notepad. I formatted it as best I could, but doing it on my own usually leads some people to comment about my code being unreadable. Some codes there are taken from a book so I expect they are well-formatted. Most of the badly formatted code are purely mine. I can usually format code well on c-style languages because there is a pattern. It's hard to follow the pattern on lisp-like languages.
 
@morbidCode It's not exactly hard. Follow the parentheses.
Anyway, the code in your question should be formatted the way it is on your device. Formatting is reviewable.
So if this is how it's formatted on your device, leave it be.
 
@Mast what do you exactly mean by following the parentheses? I can't seem to imagine the formatting rules.
 
@morbidCode Everything that belongs together, together on a level.
(a
    (b
        (c)
        (d))
    (e))
(f)
Something like that.
 
I'm afraid I still can't visuallize it. What about this code? How would you format it?

(define (factorial n)
(if (= n 1)
1
(* n (factorial (- n 1)))))
 
4:06 PM
Follow the parentheses.
(define (factorial n)
    (if (= n 1)
        1
        (* n (factorial (- n 1)))))
I guess.
 
If your code is already working, it might be better to ask at codereview.stackexchange.com. I'd also recommend posting the code you are currently using so we can point out places to improve. — 0x5453 38 secs ago
I had no idea codereview stackexchange even existed, good resource and thank you for the post. — Codejoy 20 secs ago
 
4:24 PM
Monking
 
@Mast I know this format. This is the format I use for java and c++. I can't be so sure, but I believe that is not what they used in scheme. They have something like two spaces before an if, or procedure parameters on separate line. If the format is what you demonstrated this could have been an easy task.
 
0
Q: How do I fix this code smell in a better way?

Afolabi Olaoluwa AkinwumiHow would you identify and fix the following code smell? I don't even know where to start from. I my opinion I will go starting all over, rather than try and refactor. But how would your review and rewrite this code to be more modular? Here is the code-smell below: controllers/api/v1/base_contro...

 
@morbidCode I'd just use C-x h C-M-\ in Emacs, to be honest.
Monking, TTQW, gniknoM!
 
4:42 PM
0
Q: Javascript/Jquery 3 way toggle show div

BlackLotusThe idea is to have 9 unique cases, that will come from combinations of my buttons. We have 2 groups of buttons. The combinations will display a box, and hide the others (we have one box for every case) So cases would be: 1-1 / 1-2 / 1-3 / 2-1 / 2-2 / 2-3 / 3-3 / 3-4 / 3-5 / 3-6 / I have done s...

 
@CaptainObvious sounds a bit demanding...
 
Oh ! Just realized
When did feeds became Captain again?
 
I think that was Friday
 
Nice to see them again :)
 
8
A: We need Captain Obvious back

ArtOfCodeWhat I can't do is assign the feed back to user -263, the "original" Captain Obvious. What I can do is create a new feeds user, -786, and copy Captain Obvious' name and avatar across to it. So I've done it.

Dec 14 at 13:24, by Heslacher
Please show some love for this answer
@MathiasEttinger It would also be nice to see RoboSanta again... I created an issue on the repo but haven't seen any response...
 
4:53 PM
Hmm. Since its working and you want a better way of doing it, this should be asked on Code Review. — Nicholas K 14 secs ago
I'm voting to close this question as off-topic because as this belongs to Code Review. — Nicholas K 1 min ago
 
@Donald.McLean I MOVE IN ON FRIDAY!
 
Monking
 
@Zeta Unfortunately, emacs is inaccessible with my screen reader.
 
@Nicholas In the future, please don't use the existence of the Code Review site as a reason to close questions. Evaluate the request & use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic and Flag it for Mod intervention. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSᴀᴍ Onᴇᴌᴀ 23 secs ago
 
5:12 PM
@SᴀᴍOnᴇᴌᴀ Ask Janos.
 
I didn't want to bother him, since I created the issue in GH but maybe he doesn't go there as often
so maybe I should
 
@morbidCode Sorry, didn't knew you're using a screen reader.
There is a complete audio-based ecosystem called Emacspeak if you're interested, but I haven't tried it myself.
(That being said, it might be a little bit silly to switch your editor and workflow just for indentation)
 
5:28 PM
0
Q: My code displays a sentence word by word including spaces

Samardeep KhuranaMy code displays it correctly: v = lambda x: [x[0:i+1] for i in range(len(x))]+[x[0:-i-1] for i in range(len(x))] print(*v(input("Enter a sentence: ")), sep="\n") Had it type m or else it won't let me post This also works: text = input("Enter a sentence: ") v = [text[:i] for i in range(1, ...

 
5:39 PM
you knows each way works and just want a best practice, (or a better solution if there is one). this kind of question is too open to stackoverflow and you can ask in codereview.stackexchange.comexudong 33 secs ago
 
0
Q: Second opinion of small "Random Overtime Picker" program

JavaDev313Hello and thanks to anyone that reads this. I'm relatively new to programming and object oriented themes and i am applying for a software development placement in the upcoming weeks. They gave me a task of making a program that chooses 2 of 10 provided engineers randomly to work overtime in a g...

 
5:59 PM
1
Q: Using python threads to download images

Elizabeth KeleshianI am using python threads to download images. I have a json file that contains a url to the image in the following structure: images = {'images: [{'url': 'https://contestimg.wish.com/api/webimage/5468f1c0d96b290ff8e5c805-large', 'imageId': '1'},....]} There are over 1,000,000 images. After...

 
That's how a stack works: LIFO. If you think it is correct, this post is better served on codereview.stackexchnage.com. If you think it isn't, your question should include the specific areas that appear incorrect, why you think they are as such, and what you've done thus far to narrow down what the problem is. — WhozCraig 58 secs ago
 
6:13 PM
monking
 
@janos welcome back!
 
6:35 PM
 
@RMunroe cue the sad trombone sound...
 
The question is off-topic on SO. it's opinion-based. The answer is that depends. Considering that you're asking it, it's probably too big, otherwise you would be certain that you're doing the right thing. Consider asking at codereview.stackexchange.comestus 12 secs ago
 
6:50 PM
@Duga interesting- 3 of the 5 users who VTC'd that post have usernames that appear to be a single given name: Amy, Rob, estus, Felix Kling, Kirk Larkin
 
7:01 PM
0
Q: Invert rows and columns in an Excel file

Sandro4912Annother little excercise with openpyxl: Say you have a Excel file like this: The Goal is to make make it look like this: My code to acomplish this: inversion.py """ Inverts the content of table row and columns """ from copy import copy import openpyxl from openpyxl.utils import get_c...

 
7:21 PM
@202_accepted Congrats! Mazeltov even.
 
7:33 PM
@Donald.McLean Thank you, my friend. :)
 
@202_accepted when is the housewarming party? what should we bring?
 
@SᴀᴍOnᴇᴌᴀ Haha, probably spring, and it's BYOB. ;)
 
8:18 PM
Please, add the correct code please. If your code is working, it's possible that codereview.stackexchange.com would be a better place for it. — Sulthan 47 secs ago
 
8:45 PM
For improvement of already working code you should better ask at SE Code Review. — πάντα ῥεῖ 45 secs ago
 
0
Q: Java design that uses two FixedThreadPools and queues

MarkI am working on a design of a program that will need to fetch results from a datastore and post those results to another system. The data that I am fetching is referenced by a UUID, and has other documents linked to it by UUIDs. I will be posting a lot of documents (>100K documents), so I would l...

 
9:07 PM
@Sulthan It appears i wrote the comment above a bit hasty on my phone... I've updated my question with my current code. And yes it works for the time being, however Nivs, answer led me to believe it was a bad way of perfoming this algorithm and therefore I would like to learn how to do it effectively / in good practice. If I may consult you: Is that a valid reason for keeping the question open? Or should i use the code review sister site? — theoadahl 6 secs ago
 
9:33 PM
This is more a question for CodeReview, unless you have a problem with the code? — trincot 53 secs ago
 
10:28 PM
assign all the textboxes you want to the same event for example check the link here codereview.stackexchange.com/questions/54636/… it's pretty straight forward. also google the Cotrols class and how you can do a foreach on controls of type TexboxMethodMan 1 min ago
 
10:52 PM
-1
Q: Passing a list of base class objects to a method and using instanceof to filter

Markus KullbergI'm working on a Java reverse engineering project, where I am analyzing bytecode and trying to identify classes, methods and fields using the ASM framework. After identifying these I transform some classes to implement my custom interfaces with, e.g., getter methods. For identifying classes, I h...

 
11:07 PM
-2
Q: Search Name Option

Matthew MaciejewskiI was just wondering how I could add a search option to this program? I'm stuck. Ex: The program will ask the user to enter a name to search for. it will then display the index position of the name within the array. import java.util.Scanner; public class NameSearcherMAC { public static void ma...

 
@CaptainObvious TL;dr: dog doesn't care about cat
 
11:25 PM
Get a review here: code reviewMartin York just now
 
11:38 PM
0
Q: Writing to a file in Golang across concurrent go routines

RambatinoI've been reading around how golang writes to a file, and this stack overflow question and this reddit question highlights the fact Go doesn't gurantee atomicity when writing to a file system. Although I didn't see any interleaved writes (which I guess could be due to writev(2)), I didn't want to...

0
Q: How to detect line separator and line break in python csv

David542Here is how I'm detecting a field separator and line break in a csv file for which I do not already know the format. Does this look sufficient, or are there other things I should be adding here? SEPARATORS=['\x00', '\x01', '^', ':', ',', '\t', ':', ';', '|', '~', ' '] LINE_TERMINATORS_IN_ORDER ...

 
@BenP. When you want to add something to the view later, and then have to rejigger the whole thing. I absolutely tell you that if a junior put that in a code review for this usecase, I'd tell him to rewrite it using the right tool. — Gabe Sechan just now
 
11:54 PM
0
Q: Any improvements possible for this implementation of merge sort that takes sublinear extra space?

lernerI implemented an algorithm that takes only sublinear extra space as required in the exercise description: Develop a merge implementation that reduces the extra space requirement to max(M, N/M). (dividing the array into N/M blocks of size M). def insert_sort(a, lo, hi): for i in ran...

 

« first day (2053 days earlier)      last day (1955 days later) »