« first day (2423 days earlier)      last day (1612 days later) » 

12:00 AM
RELOAD! There are 6326 unanswered questions (90.0644% answered)
 
12:40 AM
0
Q: Looking for feedback/advices for ReactJS Code (Working on navigation menu)

bpdgSo, I learned how to create a navigation menu for mobile I want to see if I'm in the right direction. If could you give some advice or helpful feedback, please and thank you. The goal for the User is to display the navigation menu on the phone and tablet they can click on the hamburger menu to o...

 
1:00 AM
0
Q: Values Not Interested In From Hook Causes Re-Render

Matster2I posted a question on stack overflow earlier somewhat relating to this issue but this take it further. This is the code (here) import React, { useContext, useReducer, createContext } from "react"; import ReactDOM from "react-dom"; import "./styles.css"; const stateReducer = (state, act...

 
 
2 hours later…
2:42 AM
0
Q: Compacting this repetitive JavaScript bit which trims values in an object

McDerp shippingAddress.first_name = shippingAddress.first_name.trim() shippingAddress.last_name = shippingAddress.last_name.trim() shippingAddress.address1 = shippingAddress.address1.trim() shippingAddress.address2 = shippingAddress.address2.trim() shippingAddress.phone = shippingAdd...

 
3:13 AM
For simplicity sake I'll just link you where my code is, and my description of it: codereview.stackexchange.com/questions/234458/… but in short, this part of the code is normalizing my datatable values by dividing the values in each row of my datatable by the values of dilution. I use pandas to form the datatable (so I can't ditch it entirely). Its more obvious why when you see the full code in the link, I only posted the portion of the error here because given those inputs, that single line should work. — samman 15 secs ago
 
0
Q: PHP code structure for string manipulation tasks

montrealistI need to perform a bunch of string manipulation tasks on an original string, then output the final string. Best I could think of is extracting some functionality into functions. Any better way to structure it? Also, are the variable/function names too long? strip out unicode chars from origina...

 
 
2 hours later…
5:48 AM
0
Q: Colourful block digits

FromTheStackAndBackI have not done Javascript programming in almost a decade. I see that it has changed a lot. Below is code that displays colourful block digits. Any constructive feedback is welcome. function getRandomColor() { const colours = ["#FF6663", "#94FF63", "#63FFEA", "#A763FF", "#F2FF63"]; retur...

 
 
2 hours later…
8:11 AM
0
Q: Refactoring Python unittest code

Alex HarveyI have some Python tests I have written, but these are for making assertions about data in infrastructure code (AWS CloudFormation templates). I am using the Unittest framework. I have code like this: class TestData(unittest.TestCase): def testConfigStackYaml(self): bad_list = [] ...

 
8:52 AM
0
Q: iOS Body-Mass-Index (BMI) app

michael.zechIt's a "homework" from a Swift-course, which I'm currently taking. A mockup and the image-assets are provided by the instructor. We are supposed to create the layout and to write some appropriate code. Here's the code of my ViewController: import UIKit class ViewController: UIViewContro...

 
9:32 AM
Does anyone have any problems if I mass edit the Python tags? Remove and if a question has both (22) and add if it has or (14)
 
0
Q: Constructor to call a method

jennifer ruursBellow I show a simplified version of my question. I want to create a constructor new Hood("Jennifer", "Ruurs"); Is input derived from a SQL query. From there I want my constructor to call a method that does some magic and shows the output to the end user. Does somebody know how i can do th...

 
9:53 AM
0
Q: Thread-safe console for C#

AWhiteFoxI've created an small lib to allow writing to console with multiple threads and reading from console at the same time avoiding output being written in the middle of input because console cursor is there. My library implements simple mechanism to make console write output above input. TSConsole ...

 
10:14 AM
0
Q: iOS: configuring UI appearance and layout, use protocol to extract common code

dengAproThere are many side controllers in my project, like the following images. They share the same head view appearance and layout. Use protocol to extract common code . protocol SideHeaderDelegate: class { var h: SideHeader{ get set } var view: UIView! {get} var follow: UIView {g...

 
 
2 hours later…
11:57 AM
0
Q: Returns nothing in the console

LukaThe code is mess using stdio.h and iostream, (working on converting it to stdio.h only :) ), I've been told to change endl's to \n, and it does make sense but it seems it broke something and the code doesn't work as it should, i tried changing it several times it just doesn't work. It works fine ...

0
Q: N-Body Gravitational Simulation of Point-Masses in Python

allthemikeysaretakenI made an n-body gravitational simulation in python. The algorithm does produce an approximate solution, which is shown at the bottom of the post. Additional methods to produce animations (among other things) can be found here. I would like to see if efficiency, readability, and/or accuracy can b...

 
 
1 hour later…
12:59 PM
0
Q: ASP.NET EF seed one to many relation

BikramI am creating a simple model relation in ASP.Net core. My model relations are like this. 1. A user can have many posts 2. A post can have many comments 3. A user can have many comments Now I am trying to seed the relations using the dbcontext. I have a feeling that I am doing something wron...

 
@Duga @Vogel612 @Mast This might need some attention. Unsure if it's an invalidation.
 
1:28 PM
@SimonForsberg Bloody messy timeline, had to check twice to see it actually was invalidating the first code-block of the answer.
Rolled back and left a comment.
Thanks for the heads up @Simon
@Peilonrayz If it has both, don't remove both. Now the tags make it explicit it has to work on both (assumed usage).
 
@Mast That isn't how we have historically tagged them.
 
@Peilonrayz What does the tagging guidance say about it?
 
What do you mean by "tagging guidance"? We have meta posts that say don't mix them, and says "Do not mix this tag with the python-2.x tag." Much like 2.x says the same
 
Wiki on python states to tag additionally if it should run on a specific version, so you can probably remove them if it has to run on both, yes.
After all, running on both is as non-specific as it gets, even if it specifically has to run on both (if that makes sense). When in doubt, it should be added to the question body, so, sure, clean-up the tags.
 
1:44 PM
Sure. I'll try not to flood the homepage, so will do it over a couple of days or something. To note, I was going to add to the question body if it wasn't already there, so no information is missing.
 
2:01 PM
Monking
 
Monking
 
2:22 PM
0
Q: Semi sorted binary search

David RefaeliSay you have an array that is "semi-sorted", e.g. something like this: [7,8,9,10,1,2,3,4,5,6] Where a part of the end of the sorted array was transferred to the beginning. Is there a way to still find an element in it in log(n) time? Here's my solution: public static boolean find(int[] arr,...

 
2:58 PM
@Mast Some @Duga alerts can be easy to miss :)
@Duga @Mast speaking of which...
yesterday, by Duga
possible answer invalidation by lucieon on question by lucieon: https://codereview.stackexchange.com/posts/231848/revisions
 
0
Q: Codewars: Sum Strings

Tobi AlafinSum Strings Codewars kata.   Question Given the string representations of two integers, return the string representation of the sum of those integers. For example: sumStrings('1','2') // => '3' A string representation of an integer will contain no characters besides the ten n...

 
3:58 PM
@Mast You're labouring the point to someone who was trying to support your model. This was concurrent access, check the timings. Hardly any users anyway. Now, looking for a new platform with more practical /knowledgable community police, or tech that supports the policy (ie prevent the concurrent access!)., — Oliver Schonrock 33 mins ago
sigh
 
4:24 PM
@Mast I haven't read the comments much on either question or answer, if it's two users doing edits/answers at the same time, then sure. If there's any answer invalidation, I'd say that a simple "Edit: Note, this answer was posted right before the question was updated" could maybe work
 
@SimonForsberg The question was changed 10+ times, 2 of which after the answer came in.
Answerer hasn't done anything wrong.
 
5:03 PM
I'm voting to close this question as off-topic because questions on how to improve already working code should be on codereview.stackexchange.com — Iguananaut 26 secs ago
 
5:48 PM
0
Q: Is there a way to turn this if-else statement into a for loop?

MaladyIs there a way to turn this if-else statement into a for loop? I need the index "i" to be accessible in the loop from 0 to whatever number, while also stopping after a certain number of iterations. i = 0 list = open("text.txt").read().splitlines() while True: if (((not i) + i) % 6) != 0: ...

0
Q: Check if Radio Button is Checked and if Value Matches

David SchroederWracking my brain trying to figure this out. I'm not the greatest with Jquery but know enough to kinda get by. Right now I am trying to develop something that will check if a radio button in a group is checked and then to see if its value matches so it can then show the correct corresponding sect...

 
6:13 PM
I you want to know whether you are doing bad practice, then you should post working code. Your code is not working. Then this question would be better suited for Code Review. — Olivier Jacot-Descombes 9 secs ago
 
6:30 PM
0
Q: Is this a good way to write a lexer?

rsonxI don't know whether if this is the right place to ask this. I am semi-beginner in C. I always wanted to build my own Programming Language. Here I have built a lexical analyser completely myself. The lexer breaks the source code in tokens consisting of strings, characters, identifiers, constant...

 
 
2 hours later…
8:54 PM
0
Q: Too many elif - need to make the code short (python)

sf31I'm writing a tool which users can select multiple choices at once. for example here we have three fruits: 1- apple 2- orange 3- kiwi I wanna let users to type "12" or "appleorange" or "21" or "orangeapple" for selecting apple and orange, or "123" or "appleorangekiwi" or vice versa to select ...

0
Q: I need a feedback for a rusable card component that I built using angular 8

sm12I tried to create a reusable component which would allow the user to create cards which can have a header, cover image, avatar section ( image, title and sub title), a description , a table , a list and a few buttons (add , delete, edit, like, share). All of these are optional and the user can om...

 
possible answer invalidation by Yulia V on question by Yulia V: codereview.stackexchange.com/posts/234414/revisions
 
9:20 PM
possible answer invalidation by Yulia V on question by Yulia V: codereview.stackexchange.com/posts/234414/revisions
 
9:35 PM
possible answer invalidation by samman on question by samman: codereview.stackexchange.com/posts/234458/revisions
This is off-topic IMO. There’s very little here but try Code Review, maybe? — AMC 38 secs ago
 
9:56 PM
0
Q: A broken code for simple connect four

Norbert WesolowskiI'm attempting to make a connect 4 game in Python, everyone's first game. I'm using basic 2d arrays to create it. Creating the basic "adding counters" was relatively easy, but I can't seem to create an efficient or working code/function to allow me to check if a victory has been achieved. The cod...

 
10:17 PM
0
Q: How to return the difference from my dictionary in a list

Mayi007I'm trying to compare the values of my dictionary and display my results like this. Field Values Mismatch For Field: Expected:001 Actual:002 Field Values Mismatch For Field: Expected:003 Actual:002 I'm able to get the difference for each of the rows in my dictionary but I'm not sure how to d...

 
10:44 PM
@sehe: there are definitely more things which need fixing in this code snippet. However, doing a full code review on a mobile phone is kind of challenging... — Dietmar Kühl 30 secs ago
possible answer invalidation by samman on question by samman: codereview.stackexchange.com/posts/234458/revisions
 

« first day (2423 days earlier)      last day (1612 days later) »