« first day (2408 days earlier)      last day (458 days later) » 

12:00 AM
RELOAD! There are 6304 unanswered questions (90.0541% answered)
12:10 AM
wow this is the most activity this late on a Friday in a long time!
@RMunroe yeah and eat more gluten free foods because they are "healthier"!
12:31 AM
While parenthesizing this will technically work I'd reject it in a code review. This is confusing enough that you should rewrite it to avoid multiple ternaries. — Chris 53 secs ago
Q: Enables markup to instantiate objects, call methods, and generate HTML

mrherouxI'm looking for a code review for the package PXP. https://github.com/hxtree/PXP/ "PXP enables markup to instantiate objects, call methods, and generate HTML. It works similar to a server-side templating engine, but rather than enforcing braces it enables developers to use markup to build dynam...

If you're code is working, this should be posted on Code Review, not here. — C Perkins 6 secs ago
1:14 AM
Q: C# Simplify the code for Calculation of the Bowling Game score

KVNI am a new in developer role, and I have my code which I wouldlike to simplify or make it better. And wondering if someone can do a quick check. The code calculates the Score of the Bowling game, which is input as a string of the whole game (ex. as following: "X|7/|9-|x|-8|8/|-6|x|X|X||81"). Pr...

1:34 AM
Q: Calculate the midpoint of a polyline

User1973 I have polylines in a GIS database. The polylines are stored using a user-defined type called ST_GEOMETRY. ST_GEOMETRY has lots of spatial functions. However, it does not have a polyline midpoint function. Therefore, I have written a custom PL/SQL midpoint function. As a novice programmer, I...

2:22 AM
any SQL Server people online right now?
3:17 AM
Q: C# How to validate CSV Headers against expected list, without 2 sections like this.?

ShivaMy application (legacy code) reads a CSV input file with an expected format w.r.t. Column names as follows. 1st column - Should say "Marker" 2nd column - Should say "Category" 3rd column ... to ... N columns - These are the actual data columns. Should have number starting with 1 and increasing b...

3:58 AM
Q: Optimize python code for Project Euler Problem 78: Coin Partitions

J. DoeWas working on this problem and made some code that got the answer in 11 seconds average. How can I optimize this code to maybe work in under 5 seconds? import time def pentagonal(n): return int(n*(3*n - 1) / 2) z = [] for i in range(-1, -300, -1): z.append(pentagonal(abs(i))) z.app...

3 hours later…
6:45 AM
Q: 2D array object, replace objects on click (Angular/JS/TS)

CoffeeCupsI'm working on a simple 2D tile editor in Angular 8 like this: The tiles are represented as objects in an array. Clicking on a tile should update/replace the tile with a previously selected one. Concept: interface Tile { id: number, image: string, category?: number skin?: string...

7:26 AM
This is a queation for Code Reviewn. 'pronouns' m. 43 secs ago
Q: Project Euler 21: Sum of amicable under 10000

J. Cricks Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers. For example, the proper divisors of 220 are 1, 2, 4, 5, 10, ...

1 hour later…
8:48 AM
Q: Vulnerable webserver code

user1095332 For the c code in the picture above: <div>Which type of vulnerability is in the code and where?</div> <div>How would you exploit the vulnerability launch a shell with and without ASLR and W⊕X enabled?</div> <div>How would you fix these vulnerabilities in the code?</div>

9:13 AM
Have you considered codereview.stackexchange.com? — Karl Knechtel 12 secs ago
1 hour later…
10:34 AM
I see two things: One is the use of so-called "magic numbers", the other is the redundant stripping of spaces. BTW: There's codereview.stackexchange.com, which may be a better place for such a discussion. Anyhow, one more simplification: Use 97 <= ord(i) <= 122 as condition inside the loop. It does the right thing in Python. — Ulrich Eckhardt 10 secs ago
10:48 AM
@Mast Hmm, do you think this will effect the LCC and UWYA dynamic? Such as as make it seem like UWYA is less or more correct to pick when it's not LCC.
11:16 AM
@Peilonrayz It will change the dynamic, although I'm not sure how.
If the code is working, then this might be better at codereview.stackexchange.comuser3121023 14 secs ago
Initially there will be more confusion, so probably more mistakes. Eventually, I'm guessing it's going to improve the situation.
Ok, that sounds like a good thing. Also what a time for the change, just when we want to change LCC too 😂
Yea, almost perfect timing.
@skiwi @Malachi Found the problem by the way, scope of the last formulae was wrong.
12:14 PM
Q: Postgres Schema Design for School Classes with Cancellations and Substitute Instructors

therewillbecodeI have modelled a series of school classes as follows. The part I am not sure about is having a separate table for cancellations and substitute instructors. With this setup every time you looked up the class schedule for a given week you would have to search the class_exceptions table in order ...

12:39 PM
For me this code is perfectly fine. When you have to return a CompletableFuture but you only get one conditionally, your only option is to return an already completed future in the alternative case, but it is perfectly fine. Note that it might be a better fit for Code Review. — Didier L 23 secs ago
12:55 PM
Q: Source Control and custom VBA Code Exporter

FlameHorizonContext Me and my team which I'm part of, for most of the time code in Excel VBA. Writing code in it self is pretty enjoyable, but combining our work in a shared repository is pretty painful. The ease our pain of combining/merging binary files, we have decided to help ourselves and create the S...

1:16 PM
Q: Program in JAVA to generate random alphanumeric string

Riley JonesThis code will generate a pseudorandom alphanumeric string of given length. I would welcome suggestions on how to make it more random. Beyond that, have I made any convention violations, Exception cases, and the like? Also, is there any way to make it faster? public class Test { public stati...

1:37 PM
Q: Looking for Rust beginner feedback - Advent of Code 2019 Day 2

cpatternalso doing the fun little Advent of Code challenges in order to learn Rust. Until now things went quite smoothly, but while I'm proceeding with the tasks I'd love to learn where I can actually improve my Rust coding (and not only getting the correct results). I'm specifically looking for feedbac...

I don't get what you're trying to achieve here. There's too little relevant info and too much distracting stuff. For example, remove all that shape stuff, it's not relevant what a vector stores when the question is whether an index is valid. Also, could you show working code that you want to improve? With that, it might even be better to take this to codereview.stackexchange.com. — Ulrich Eckhardt 47 secs ago
1:59 PM
while (input < 0 || input > menu.shapes_count()) I mean you have to get the value somehow. I don't really understand your confusion or the issue. This question has too much information for a minimal reproducible example and too little for a codereview, plus it's on the wrong site. — super 13 secs ago
2:16 PM
@Mast Named Ranges are really useful for stuff like that.
Q: Lock-free state machine

EyalI've written a lock-free state machine in go and I would love to receive some feedback on it. Writing this library my main concerns are keeping it lock-free and very light-weight (no bells and whistles like hooks and such). Because this is lock-free I had to use atomic.CompareAndSwap which mean...

@Vogel612 I completely forgot that's an option facepalm
2:32 PM
yea, it's easy to forget they exist
Q: Set values with keeping immutability in React FC

zynknI'd like to know there's a better code than I did. interface AnswerProps{ itemId: string; value: Array<string> } this code works like checkbox, if answers has a value, I try to put the same value again, it would be deleted like toggle. const App = () => { const [answers, SetAnswers...

Q: Code-Optimization: Better way than if else loop

The__DonI am quite new to python (and to stackoverflow), so please be a little patient with me, if I have missed anything! My current problem is as follows: I have two datasets. The first dataset “insideMarke1” contains the Best Bid / Best Ask (=BBA) data for a given day, starting at 8.00 am. Every tim...

2:59 PM
Q: Multi-platfform process handling

Duncanhr23the goal of this code is to handle processes in multiple platforms, Linux initially. Windows later. The high level handler starts and stops a process or a list of processes. The platform specific drivers must conform to the following interface: open(), close() and is_open(). This system is used i...

possible answer invalidation by Riley Jones on question by Riley Jones: codereview.stackexchange.com/posts/233588/revisions
3:40 PM
Q: Hosted service for queuing and running tasks in parallel in ASP.NET Core

BryderI am attempting to construct a background service for an IIS-hosted ASP.NET Core project that basically queues tasks and runs them, and I decided to go with the IHostedService interface in Core 2.1 because of this tutorial. The tutorial does describe the case of running tasks one-by-one and in th...

2 hours later…
6:04 PM
@Mast Another facepalm?
Everyone this is NOT broken code codereview.stackexchange.com/questions/233597/….
2 hours later…
7:47 PM
Q: NOt optimized code,how can i fix it?

Katya_VilI dont now how to optimize me code. The game i created lags 15 fps, how i can it be reduced and optimize.This my code, I try to do optimize, but i cant. Please help: import pygame from random import randint import time import os pygame.init() name = os.getlogin() ...

8:08 PM
Q: Dijkstra's algorithm on ROS

Parth ShuklaI need to implement Dijkstra's algorithm on ROS. (You can ignore the ROS part, that is not important as this moment.) So, I have a map of 1000x1000 pixels which I have converted into a row-dominant matrix for this problem. We start off by creating a structure node for the priority queue which I...

Q: Draw a UML-style class hierarchy of Python's Abstract Base Classes with Python, python-graphviz, and graphviz

Aaron HallMotivation Python's Abstract Base Classes in the collections.abc module work as mixins and also define abstract interfaces that invoke common functionality in Python's objects. While reading the actual source is quite enlightening, viewing the hierarchy as a graph would be a useful thing for Py...

2 hours later…
9:44 PM
@MathieuGuindon I agree.
(Sorry for old message, I'm not in here that often these days)
One thing I miss about being a moderator is the blue icon about new questions on meta.
Q: Open source project to ease the Assert part from the functional tests of .Net Core Web APIs

Adrian IftodeI have built an open-source project based on FluentAssertions in order to solve some recurring tasks I was doing while testing the .Net Core APIs I'm developing. I find the capability of doing in memory end-to-end tests of the APIs I build a great addition in terms of productivity and validity. ...

10:13 PM
Q: MySQL/MariaDB Data extraction / String manipulation / "TopN" processing => Performance focus

Oliver SchonrockSomewhat simplified task is to efficiently extract about a 250,000 user records from a mariadb and do some string munging and then find the "TopN" (eg most common firstnames, etc) for 3 fields. Focus is on performance (real life case is bigger). Focus is firstly on algorithm: I think the unorde...

2 hours later…
11:45 PM
@DidierL Thanks for your comments, here and in below suggested answer. Also, thanks for the Code Review website, I did not know about this, but now I do. Thanks. — dipamchang 31 secs ago
Anyone ever seen this error in IntelliJ?
  class file for kotlin.jvm.functions.Function1 not found
Q: JSP Form send Wrong hidden Input Value to Servlet

AhmetI have an issue regarding sending hidden input value to the servlet. Here is my screenshots shown below. When I try to delete bookId 61, the form send a wrong value having book Id 43 in my screenshots. How can I fix the problem. Here is my related code snippet shown below. <form id="shoppi...


« first day (2408 days earlier)      last day (458 days later) »