« first day (2529 days earlier)      last day (1492 days later) » 

12:00 AM
RELOAD! There are 6468 unanswered questions (90.1208% answered)
 
-1
Q: Python code interacting with rest api

Varun ChadhaPlease help me with code review of a simple python function interacting with rest API def submit_notebook(): job_submit_url = "some_url" authorization_header = "Some token" path = "some_path" temp_run_id_file = "file_name" submit_response = requests.post(url=job_submit_url, j...

 
 
3 hours later…
3:30 AM
0
Q: Roman numerals isomorphic conversion in Go

Christophe MaroisI always try to port the roman numeral conversion algorithm to learn new languages. Reading the Go manual as a beginner, this is the most idiomatic way I've been able to write it. I would love it if you could give me comments/advice on the following code, and also maybe on some questions I have ...

0
Q: Simple Tic-Tac-Toe game in Javascript (NO A.I.)

kibeAfter some hours of coding trying to implement "algorithms" to make a Tic-Tac-Toe game, I came up with something I'm not really proud of. Here's the code: const TicTacToe = (function(){ const grids = document.querySelectorAll(".box"); const winning_combinations = [ [0, 1, 2], ...

 
Hi @remyfra - this question might be better suited for Code Review rather than Stack Overflow. — Samuel Everson 32 secs ago
 
 
2 hours later…
5:05 AM
0
Q: Advice on taming a slow loop required for visualization of large GIS dataset

BBirdsell I'm working towards plotting a large GIS dataset of which I've shown a sample above of about 1/6 of the data. I'm happy with how quickly the data loads in, and bokeh renders the html nearly instantaneously. However, I've encountered a pretty hot loop in my code that is not scaling well as I in...

 
5:43 AM
0
Q: Refactor the code which performs "cross-product", "reduce", "product of list" and "sum of list"

joe733I have come up with a sequence of steps to find the maximum product of y positive numbers which add up to x. But the program is highly inefficient. Here's my code: from itertools import product from functools import reduce from operator import mul for i in range(int(input())): # <...

 
6:02 AM
0
Q: I am trying to understand the code given below that implements trie using unordered_map in C++. Can someone please explaing few things in it

harsh kumar ChourasiaI found this code for the implementation of trie in C++ using unordered maps but was not able to understand few things in it. class Trie { public: /** Initialize your data structure here. */ Trie(): root_(new TrieNode()) {} /** Inserts a word into the trie. */ void insert(const string& word) ...

 
6:21 AM
0
Q: Python code for checking request headers

hkjhadj1I am trying to validate a HTTP REST API request in my python code. It checks for some request headers (X-Foo and X-Bar) and two keys in the json body/payload (someKey and someNestedKey). I have written this code with if/else conditions as well as a simple try-catch. headers = event["headers"] i...

 
6:59 AM
0
Q: Sum of all the values which comes in the path of a graph

dgjhcuifI have written a code. In which I created a graph. Then traverse from source to destination using DFS. I sum up all the values of nodes which I have visited. But I could not know why it is wrong answer and later it shows Segmentation fault (core dumped). I have taken help from here : https://w...

 
7:36 AM
0
Q: Fast way to calculate Standing Wave modes in NumPy

Bahauddin OmarI am trying to plot the standing wave modes in a 2D box over time. The equation for this is: $$ A(x,y,t) = \sum\limits_{n,m} sin \left( \frac{n \pi x}{L_x} \right) sin \left( \frac{m \pi y}{L_y} \right) cos \left( w_{n,m}t + \phi_{n,m} \right) $$ where $$ w_{n,m} = \sqrt{ {\left( \frac{n \pi}{L_...

 
8:33 AM
0
Q: Keeping template code DRY

CortexI have the following code that transforms a string to upper/lowercase: #include <iterator> #include <algorithm> #include <type_traits> #include <vector> #include <vector> #include <iostream> #include <string> #include <locale> #include <functional> namespace ae { template <typename StrT> ...

0
Q: health care managment application using java enums

pavanWrite a Health Care Application in which use an enum to store the available doctors with attributes name, consultation fee and specialization.Ask the user to enter the patient_name, age and create a patient id automatically. Now display the details of all the available doctors and ask the user to...

 
I'm voting to close this question as off-topic because it belongs to Code ReviewOlivier Grégoire 22 secs ago
 
9:30 AM
0
Q: F# Array with tuples or Map

Wojciech SzabowiczI have a sample code and some question. Simple type property member val CabinetNetworkState : uint8 = 0uy with get, set member this.CabinetNetworkStateAsValues : (CabinetNetworkStateHosts * uint8) array = let cabinetNetworkStateMap = new ResizeArray<(CabinetNetworkStateHosts * uint8)> ...

 
10:08 AM
0
Q: Pairwise hamming distance for binary data with missing values

zeawoasI just started learning Rust and my first project is a command line tool generating a pairwise distance matrix for binary data while ignoring missing values. The input files look like so: 001N0 011N0 10N10 with N denoting missing values that should be ignored. The example yields 0,1,1 1,0,2 ...

 
10:50 AM
What a strange approach, @PedroCosta. Writing something in a non-OOP language such as C and then translating the result into an OOP one is irrational. Even if you reinvent OOP wheel in C and even manage to make a digestible API for it, then that solution will almost nothing useful for your Java implementation. That's only my opinion, and, I'm sure, you'll not find a definite answer to your question. By the way, it'd be more appropriate, if you posted asked the question on codereview.stackexchange.comRuslan Osmanov 21 secs ago
one benefit I see to the api-impl split is that by depending only on the api at compile time the client will not be polluted with extra stuff available on the impl - the Java 9 module system comes to mind. I would also imagine this separation would make more obvious when changes are being made to the api and thus assist with code reviewing - I am making stuff up now. I cannot clearly see if this api-impl separation in practice is more beneficial than problematic. — beluchin 56 secs ago
@RuslanOsmanov The objective proposed was to do it the get-set-clone way, even in C, but that didn't sounded very interesting so I wanted to try something else. Thanks for the useful comment, I was not aware that there was a proper place for code review matters! Do you think I should close this thread and ask there for a more detailed discussion then? — Pedro Costa 58 secs ago
 
11:52 AM
I'm voting to close this question as off-topic because it would be a better fit on codereview.stackexchange.com. @PedroCosta, I've flagged the question for moderator attention. Moderator can move it to any site in the Stack Exchange network. — Ruslan Osmanov 6 secs ago
 
12:29 PM
This question is probably better suited for Code Review Stack Exchange. — 0x5453 18 secs ago
 
12:39 PM
-1
Q: F# InitInfinite(Async) implementation in C# without disabling ReSharper warnings?

Kerry PerretWhen coding in C# I miss some functions from the F# world. One of them is Seq.initInfinite, others are its counterparts with the AsyncSeq library, aka: AsyncSeq.initInfiniteAsync AsyncSeq.initInfinite public static class Enumerable { public static IEnumerable<T> InitInfinite<T>(Func<T>...

 
12:58 PM
0
Q: Java - parser for html-table

chrysaetos99I wrote a program that saves the data from the first table of this wikipedia-article (in german) and then saves the column "Gesamt" (contains daily update of absolute numbers of Covid-19-infected people in Germany) together with the date in a csv-file. For the parsing, I used JSoup and for savi...

0
Q: Heap selection sort in Javascript

coderoddeI have (designed and) implemented this fancy sorting algorithm that combines natural runs in the input array with a heap data structure: function ArrayRangeException(message) { this.message = message; this.getMessage = function() { return this.message; } } function RangeCheck(arrayLengt...

 
1:36 PM
-1
Q: Automation program remake

RozakosSome time ago i started making a program to automate a test. The thing is, my knowledge in python was a bit limited at the time, and the 'final program' was a 3000 lines, single file monstrosity. It works, but it's ugly. Some info about the program's functionality, it connects through serial/teln...

 
2:19 PM
@RuslanOsmanov Using OO design is language agnostic and those who don't realize that haven't worked much with program design on a system level... also, this question is definitely off-topic on Code Review so don't recommend the OP to post there. Code Review requires complete working examples, not snippets or pseudo code. — Lundin 53 secs ago
 
2:36 PM
Ryan Donovan on April 06, 2020
Writing a technical spec increases the chances of having a successful project, service, or feature that all stakeholders involved are satisfied with. It decreases the chances of something going horribly wrong during implementation and even after you’ve launched your product.
 
2:51 PM
@PedroCosta, so the moderator has only questions for you. As I was ordered to not recommend you to post on Code Review, I won't. But I would do this myself, with the only exception that I would make the code more "real". See codereview.stackexchange.com/help/on-topic . — Ruslan Osmanov just now
 
0
Q: Finding permutations efficiently

XbelI have the following: A set of K time-series in a numpy array with dimensions T x K. A set of P permuted approximation of them in a numpy array with dimensions P times T. I need a dictionary that tells me which is the most probable permutation. For that I've created the following function,...

0
Q: A class that can only have one instance at a time (not singleton)

René VogtI need a class that can only have one instance at a time. In contrast to the singleton pattern I don't want it to be instantiated only once, but I want to avoid to create another instance as long as the previous instances have not been disposed of. It's ok to have "old" instances that have alrea...

 
3:29 PM
-1
Q: Python - Input a list and store as list not string

Lorenzo BeronillaHow might I be able to input [1,2,3] into python and store it as a list and not as a string (i.e.'[1,2,3]'). input() returns a string so does anybody have any ideas?

 
3:48 PM
0
Q: Python COVID-19 Simulation with Marov Chains Random Walk

D.OeI have written a code to simulate a simple COVID-19 spread scenario. I create a little 2D world where the people walk around in a markov chain random walk, I create a patient zero, then after they walked around a little, I introduce travel restrictions. Every step I visualize how the people are m...

 
4:07 PM
-1
Q: Created a Mastermind game to practise OOP as well as PyQt5

Adam DodsonI have created a mastermind game however the code is not amazing, at this point I'm not worrying about the front end programming (it could be neater) I just know I could have been a lot more compact with my test_input class. I could not figure out how to go from self.Results_guess_1 to self.Resul...

-1
Q: Creating a Finite State Machine of the verb 'do' in Python

anoI'm extremely new to programming and I just learned the basics. However, due to illness, I missed my advanced Python classes and did not learn the knowledge that is required of this course. I'm currently learning through Udemy, but I have to hand in this assignment, otherwise I won't be allowed t...

 
4:26 PM
-2
Q: Python simple card game

jinane jmh1.At any point during the game, someone should be able to type "--help" to be taken to a screen where they can read the rules of the game and instructions for how to play. After they're done reading, they should be able to type "--resume" to go back to the game and pick up where they left off. ho...

 
MOnking
 
4:45 PM
-1
Q: 'Ugly and exceptionally illegible' code of mine [C++]

domocar1Here's my code for this' weeks homework I had. The code should take an expression , preferably in prefix notation ( otherwise throws exception ), that evaluate prefix expression. I've given three example in the main function. The expression gets saved in the object at the mText variable type of s...

 
You can lead a horse to water, but you can't make them drink. codereview.stackexchange.com/questions/240063/…
@CaptainObvious ^^^
 
 
1 hour later…
5:58 PM
If you have code that works and you want to improve, please head on over to codereview.stackexchange.comMike 'Pomax' Kamermans 6 secs ago
 
6:19 PM
0
Q: Decoding a telephone number that was masked with letters from the respective keys with APL

RGSLegend says phones used to have keyscitation needed and in those times, a person could "encode" a phone number by creating a word from the letters in the keys with the given numbers. Below is the usual layout of the keys (that matter for my question) of a phone: | abc | def | 1 | 2 | ...

0
Q: String Permutation

ByWaleedBelow is my permutation function and I'm looking to make it more elegant and efficient if possible. The function should return a string which includes all the permutations of the given string (separated by comma). private static String permutation(String prefix, String str) { int n = str.le...

 
6:53 PM
You might want to present your current code in a question on codereview.stackexchange.com. — El_Vanja 46 secs ago
 
7:46 PM
0
Q: Simple Card Reveal Game in react.js

Joshua KarpI am new to this React.js and currently learning about 'State'. The task: Three ‘Cards’ components are displayed that can be clicked. When the user clicks on a ‘card’ the card should be ‘turned’ to reveal a message which either indicates that they’ve won or lost. They should only be able to pic...

0
Q: Command line dictionary tool, using webscraping

Cole128This is my first proper Go program, after completing Go by Example and https://tour.golang.org. I have a background in Python. This program scrapes definitions from Wordnik, then prints them nicely in the commandline. It's made for looking up a word quickly in the commandline. I'm hoping that s...

 
8:05 PM
Can we please have more people in the review queues?
And, while in the review queues, don't forget to actually look at the question. No robo-reviewing please :-)
2
Thanks!
 
it would be nice to have more users reviewing posts...
I've been surprised that suggested edits have been hanging around so long lately
 
I used to be more active in the queues. Figured I'd give the new users a shot at it.
Didn't work. Now I ran into my review limit again.
 
@Mast I will when notifications are fixed in Firefox, I don't have time to fix it atm.
 
@Peilonrayz There are currently so little people in the room queue that if you check it once a day, there will be reviews waiting.
 
It's not a habit I have, nor one that I've been able to aquire
Also for some reason any sound seems to make my Firefox crash... :/
 
8:22 PM
You could go there now if you have the time, I'm sure there's plenty left.
 
Will, do, 20 is a lot of reviews...
 
8:40 PM
@Peilonrayz Too many tabs open?
 
No, this is a pretty new install so I only have ~50 and like 2 addons
 
That sounds pretty unstable. What OS?
 
The most stable OS, Arch
 
@Mast Close vote limit?
Got my second steward badge yesterday for first timers.
 
9:06 PM
@pacmaninbw I'm having difficulty finding documentation about it but I believe if you review twenty items in a queue in a day it tells you to come back the next (UTC) day before you can review more
3
Q: review times are off: "come back in X <units> to continue reviewing"

Richard SitzeSame problem described elsewhere for other "come back in <time>.." aspects of the "stack" (here and here). To repeat the descriptions elsewhere: After completing review of 40 "Close votes", I may see "come back in 1 hour to continue reviewing". So, I do that... and in one hour I see "come back ...

 
possible answer invalidation by Sterling Butters on question by Sterling Butters: codereview.stackexchange.com/posts/240011/revisions
 
9:36 PM
@SᴀᴍOnᴇᴌᴀ Haven't hit that limit yet, might have gotten close in the close vote queue.
 
-1
Q: State and performing calculations in React

Josh WrenI'm creating a trip calculator that has some basic arithmetic and I'm just not grasping how to handle calculations. I feel like I'm doing a bunch of stuff wrong here. What initial values should I have in state? Am I putting too much in state? Is state saving these as numbers or strings? I include...

 
10:01 PM
-1
Q: Monte Carlo Simulation of "DNA Mutation" Game Mechanic

nokkoThe game Space Station 13 (on the Paradise Station codebase) contains a DNA mechanic. Every carbon-based lifeform with DNA has 55 "blocks" that can be altered in a DNA Modifier, giving the mob disabilities or superpowers once they reach a certain threshold. DNA blocks are 3-digit base-16 number...

 
10:21 PM
@ThomasWeller I answer your question with a question; isn't this the whole reason why there's a Code Review.SE with a performance tag? — esqew 11 secs ago
@esqew "requires optimization" is a stretch. OP says it's taking "too much time". In other words, though it compiles and runs, it is not working as intended and does not satisfy the requirements. There is a problem to be solved. Code Review is for soliciting as-yet-unknown improvements in style, algorithm, technique etc. — Asteroids With Wings 37 secs ago
 
@Duga @SᴀᴍOnᴇᴌᴀ Why did you chose to ping Thomas Weller rather than esqew or Asteroids With Wings?
 
@Peilonrayz based on what Thomas commented:
@esqew: no. Just because there is another website where performance is on-topic, doeasn't mean it's off-topic here. We have performance as well. — Thomas Weller 5 mins ago
... to provide a supporting resource
 
Ok, that makes more sense than I originally saw.
 
I'm not sure why but the name Asteroids With Wings makes me think of sharks with lazers
 
@AsteroidsWithWings Code Review allows performance questions. Performance is not deemed to be "not working as intended" there. Please don't spread misinformation about what the site does or does not allow. — Peilonrayz 30 secs ago
 
10:38 PM
0
Q: PHP/SQLite3 form pre-populated does not update database when hitting submit

BashGuySituation: On a web page, the end user is asked to provde a database id. They enter the database id, hit submit, and a pre-populated form appears where they can edit any parts of the record that they need to. They then hit submit and, theoretically, the form updates the SQLite3 database and displ...

 
 
1 hour later…
11:38 PM
@CaptainObvious oh really...?
> Please help! This is for my aunt and a cemetery.
"you should have mentioned that earlier..."
 
11:54 PM
0
Q: Python text input

Thunderlord ZinogreIs there a way in Python to do text input in input in Chrome (or any browser) For example... str = input("What do you want to spam with?") and in the browser, the program put the text inside the input field and emulates the user pressing the [Enter] button and repeating the process for a cert...

 

« first day (2529 days earlier)      last day (1492 days later) »