« first day (2525 days earlier)      last day (1489 days later) » 

12:00 AM
RELOAD! There are 6456 unanswered questions (90.1262% answered)
 
12:34 AM
0
Q: Simple Json log Parser Application

AbhiI had a coding assignment task(interview) for a senior data engineer role, JSON data validation. Every record in the input json indicates a customer record, I need to write a script to validate that all records confirms to few business rules and few more field type/length restrictions. I used ob...

 
1:30 AM
Seems like the code is working? This might be better on codereview or Software Engineering. — Craig Estey 23 secs ago
 
0
Q: animate button presses in a sequence (tkinter)

dunclinI am attempting to animate the series of button presses in the simon game I am creating with tkinter. The animate method is called for each button that needs to be pressed in the series. It currently presses all of the buttons at the same time rather than in a series as it is meant to. from tkin...

 
1:50 AM
0
Q: Inserting data from client-side to MySQL via Flask-Sqlalchemy

Kartikeya SharmaI am creating a Bill of Materials (BOM) web app with flask as a backend. As a part of this app I am inserting data into BomStructure table from FpbChildrenAssociation. Their models: class FpbChildrenAssociation(db.Model): __tablename__ = "fpbChildrenAssociation" id = db.Column(db.String(...

 
2:47 AM
0
Q: Case of Cyclomatic Complexity

SevilaI'm trying to recreate the method inject (Works like Reduce) from ruby Enumerable Module. Using Rubocop (A Linter) I got the error: Cyclomatic complexity for my_inject is too high. [7/6] The code is: module Enumerable def my_inject(*args) list = to_a if Range reduce = args[0] if ar...

 
 
1 hour later…
4:04 AM
0
Q: How do I write a float function that accepts float n and returns the floor of n without using java.lang.Math?

zzzI tried converting n to an int, and somehow it worked. static int floor(float n){ return (int) n; } Is this okay?

 
 
2 hours later…
5:56 AM
Sorry, but firstly, you are not actually asking a question, and secondly, you probably need to extract a minimal reproducible example and provide that instead of your whole program. BTW: There's a lot wrong with your code, so take it to codereview.stackexchange.com once you fixed it. That said, please take the tour and read How to Ask. — Ulrich Eckhardt 7 secs ago
 
6:10 AM
@SimonForsberg I'm not going to reply to that accusation.
Just removing something from a question doesn't fix the problem. OP was hiding something and I wanted to know why to determine whether he/she could be helped by us or not. If that's unfriendly, sod it all.
@Peilonrayz And strange the feature was already reported before we could actually see it.
 
6:36 AM
0
Q: Simple Book List App

btow54I've built a simple Book list app. It allows users to enter the name, author and isbn of a book into a form. Then when this is submitted successfully, the details get added to a new row in the table. I've tried to make the code as optimal as possible. Any feedback would be greatly appreciated. ...

 
7:13 AM
0
Q: Runtime error: std::vector larger than max_size()

shubham goyalA function that returns integer 1 or 0 based on whether an integer B is present in 2D integer Vector A. If present return 1 else 0 from function searchMatrix. I get runtime error with the only test case which is mentioned in main() function Here is my Code #include<iostream> #include<vector> ...

 
8:10 AM
0
Q: PrintLn header for C++

OsteriI've always wondered what's the most elegant way of implementing PrintLn in C++. I have not yet come with perfect conclusion. This is my shot. Shortcut for std::cout, std::cerr and std::clog "print line" version. So you can type CoutLn << "Hello world!"; instead of std::cout << "Hello world!" <<...

 
If this is already a working code, and you are looking for someone to peer review it, you might want to check out Code Review. Make sure to go over their How to Ask page for more information. — Gino Mempin just now
 
8:29 AM
0
Q: A Simple Method With A Return Statement Within A Loop

Mans FI am new to programming and would like to know if I will continue looping even though I return false? boolean boardIsFull(char[] board){ for(char mark : board){ if(mark == EMPTY){ return false; } } return true; }

 
 
1 hour later…
9:45 AM
0
Q: Would love feedback on my first mini-script

Martin.3112Wrote my first mini-script to get data from the german football league table and save the data to a csv file. Do you like the approach or could I be more efficient? Thanks in advance! from bs4 import BeautifulSoup import requests import csv url = "https://www.bundesliga.com/de/bundesliga/tabell...

0
Q: PHP 7.3.9: Check if uploaded file is an image (I don't care about the format)

Matt KomarnickiI just care if it's any of the common formats so that later when I list all files, for those that are images, I can generate previews based on mime type. So PHP.NET suggest to use exif_imagetype function to check if file is an image. In case of success an integer will be returned indicating one ...

 
There's no real question/problem here. Maybe you should head to Code Review. — Martin Prikryl 52 secs ago
 
10:23 AM
0
Q: Execute command using `asyncio.create_subprocess_shell` and yield lines of stdout, stderr and finally the return code

user7610My task is to run a subprocess using asyncio.create_subprocess_shell and yield the lines of output. I am using asyncio to avoid creating threads just to pump the streams. It is necessary to separate stdout lines from stderr lines. Both outputs need to be read simultaneously, it is not possible ...

 
11:01 AM
0
Q: Make code efficient for Remote to Remote copy files

Arunkumar GI've written a logic to copy files remote-remote using SCP command, paramiko, pexpect, paramiko-sftp I want someone to make my code efficient as I'm new to python I don't know the levels in python. Here logic is in 3 steps: Find checksum of a file by executing cksum command in remote-1. Executi...

 
If you are looking for advice on improving your code then you should post at codereview.stackexchange.com instead. This site is for specific programming questions/issues. One advice though, variables names should start with a lowercase letter and for better understanding of the code do not use one letter names but instead more meaningful ones. Like month instead of MJoakim Danielson 18 secs ago
 
11:58 AM
0
Q: Visual Studio npm breaking terminal

Griffin MareeWhen running clear and help commands the terminal works fine, but when running npm start or npm update the terminal completely bugs out, dropping text under and even warping lines into the directory. See below screenshots Now the buggy text is fine but the real problem is now npm commands won...

0
Q: C# Quicksort Assignment

Timon de GrootFor my CS minor I was assigned to implement the Quicksort algorithm in C#. I gave it a go and found that I like the implementation of the algorithm more than Mergesort. Now that I've got my Quicksort implementation running, I'm very curious about what optimizations could be done. using System.Co...

 
12:55 PM
-1
Q: hello world!!!- ANY WAY TO OPTIMIZE GIVEN CODE

Ayush Shukla`print('hello world') print('hllo word') print('helo Wrld') print('hell orld') print('helloworld')` OPTIMIZE THE GIVEN PROGRAM

 
RGS
1:10 PM
Hello everyone; I wanted to post code review questions on APL but I see there is not tag for it.
2
 
Notably, there is a tag.
 
RGS
So I was wondering how I should tag my questions while there isn't a tag.
@Adám I did note that; 7 questions tagged with .
 
0
Q: Find an Element in a Linked List

Darnoc ElocThe find function is designed to start at the given node and return the index of the node with the value valueInput (indices start at 0). Return -1 if valueInput does not exist. How can this code be improved, optimized and free of potential runtime errors? Please note I am new to data structures ...

0
Q: python caesar cipher encrypt

newcomer_coderi have the majority of the code done for the encryption of the input and shift. I'm at a complete loss when trying to implement the capital letters to re-wrap around after trying to go beyond Z. Here is my code so far def encryptedmsg(): text = input("Enter your message: ") shift = int(i...

 
Bottom one is more concise and easier to read and understand. Yours, however, isn't wrong. It's not much harder to read, either. The logic is the same, aside from not returning a value, like @ADyson said. So, honestly, your solution is nod bad. It can just be cleaned up a bit. If it helps, the fizzbuzz challenge is a staple of code reviews and some (supposedly) experienced developers fail it. So, you've done much better than actual applicants. — VLAZ just now
P.S. There is a StackExchange Code Review site, which you could check out, and see if your question is on-topic there. They might be able to give you a more detailed run-down. Here at StackOverflow we don't really deal in these subjective kind of questions. — ADyson 38 secs ago
 
1:28 PM
@Mast SE still sucks at working with the press
@RGS theoretically there is the tag, but I'm not sure whether a user can apply that to their own post
 
RGS
@Vogel612 I cannot, just tried it.
Should I ask the question with no tag, would that be the appropriate behaviour? And after a couple of questions you create the tag? Or I create the tag if I have 300 rep by then?
 
just post it with any tag that's useful and drop a link here
I'll create the apl tag for you
need a question to attach it to, though
 
RGS
Ok thanks; I'll ping you when I write the question; probably will only do it later today.
 
sure :)
 
FWIW, I'm available to review questions.
 
1:34 PM
-1
Q: How to find the sum of numbers in a list when a particular element in the list is found using for loop

emmanuel ubahI have been trying to find if an element exist in a list and sum the values of the elements before the exact element is found using for loop or while loop it seems hard in python. List = [2, 3 ,4 ,5 ,6] Sum = 0 For i in range(Len(List)): Print(list) If 5 in List: Sum = sum + List[i] i+=1

 
Hey - just checking in on ya'll. Everyone doing alright?
 
2:13 PM
I should read all messages before leaving another one, it's already handled.
 
RGS
Thanks Mast, Vogel also addressed my issue :)
 
No problem, we're here to help.
@Vogel612 No, and even if they could, they wouldn't be supposed to.
 
I believe A&M recommend adding a popular tag like or and put at the bottom of the post a note saying the anime, in this case language, doesn't exist and what the tag should be.
 
That would work. Not necessarily pretty, but it happens so rarely it doesn't have to be.
 
possible answer invalidation by Chris.B on question by Chris.B: codereview.stackexchange.com/posts/239766/revisions
 
RGS
2:21 PM
(What is an answer invalidation?)
 
@Duga Harmless.
@RGS If a question is posted, answered and has the code altered after the first answer has come in while that part of the code (or that part of the edit) has been mentioned in an answer.
 
RGS
I see; and you replying to the bot was a command? So that the bot doesn't notify you again?
 
If that happens, and a fresh reader passes by, it's hard to follow what's going on since the answer mentions things that are no longer in the original code or suggests things that are already implemented.
@RGS No, that's so others in this room don't have to follow-up on it.
 
RGS
ok thanks!
 
I mean, would be a cool feature to have specific replies be commands
 
2:30 PM
Why?
 
If you wanted to keep track of answer invalidations in a graph, you could have them categorized by response
As a result you would have fairly concrete evidence of whether or not answer invalidation needs to be addressed as a site
 
@FreezePhoenix I was thinking about that, but the only utility I could think of is at 00:00 to repost all unhanded AI messages.
 
@FreezePhoenix We already know it needs to be addressed on this site.
Hence the messages.
 
Well, you could also track progress.
 
RGS
(maybe the bot could delete its own message after you reply "harmless" or "handled" or wtv?)
 
2:33 PM
No. that would be counterproductive.
 
IIRC there's a time limit to delete posts of ~5 mins. So not entirely practical
 
That would bring it out of attention, and lower the number of responses people made to it.
If it were to say, move the most recent so many messages from it to a trash bin room after so many people confirmed or denied them, that would be different
 
@FreezePhoenix Given that most of the time it's one person saying "handled", I'm not sure I agree with that claim
 
@CaptainObvious There is no code in this question, and it is not really a question about coding.
 
shrugs I'm willing to retract that claim.
 
2:36 PM
@Peilonrayz Room owners can sweep up the trash.
 
@Mast I don't think I've ever seen it here ;P
I see it in room 5
 
@RGS Someone is still using APL?
 
1 message moved to ­Trash
Wooosh.
4
 
Please provide an example input and output so we can better understand your ask. My first instinct is to look at the Code Review stack site, find some interesting questions and answers, and ask the authors if you can use their code, or snippets of it, in your research paper — G. Anderson 55 secs ago
 
ngl
the authors don't actually own the code, do they?
 
2:38 PM
 
Or is that stuff protected from the SE creative commons licence thing
 
@FreezePhoenix Who are these authors?
And what code?
 
@pacmaninbw I've always suspected APL to still be used in Eastern Europe in military systems, like COBOL is still in use in the US Navy.
 
1 min ago, by Duga
Please provide an example input and output so we can better understand your ask. My first instinct is to look at the Code Review stack site, find some interesting questions and answers, and ask the authors if you can use their code, or snippets of it, in your research paper — G. Anderson 55 secs ago
 
@FreezePhoenix CC-BY-SA etc. license
 
2:39 PM
Yeah, I own all my posts, comments, edits
I even own this message :O
2
 
@Mast Hopefully the US Navy isn't still using it to calculate firing trajectories.
 
@pacmaninbw Probably are.
 
LOL
 
@pacmaninbw COBOL, ADA, who knows.
 
I mean, it works. why would they change it?
They use ancient stuff for nuclear reactors. Because it works.
 
2:42 PM
Verbose code is hard to maintain.
 
If it works, don't touch it.
 
@Mast If it works and turning it off might cause problems, don't touch it :P
 
As long as it isn't written in C...
 
@Mast K&R or something newer? What's wrong with C?
 
1) Way too many jokes possible with C in the Navy. 2) Writing something that has no undefined behaviour at all in C is hard.
 
2:44 PM
I would imagine if they used anything newer they would just write it straight in JVM bytecode.
 
I never heard that ADA was phased out as the US Government programming language.
 
@FreezePhoenix Suspect C++ with CSSLP checks.
That's like MISRA on steroids.
But their payroll is probably on Java or something, sure. That's not mission-critical.
 
@Mast Obviously you're not a fan of pointers.
 
s/pointers/shooting yourself in the foot/
 
Well, i'd honestly rather they wrote it in C.
C can do everything they need to xd
 
2:52 PM
ADA is so much cooler than C though (aside from the compiler-mandated three space indent)
 
@Mast What does hard have to do with anything? They have all the time they need to get it to work. And it is used by trained people, not normal people.
 
@Vogel612 LOL.
 
They don't screw up the inputs
 
@Vogel612 I think you need to kill this codereview.stackexchange.com/questions/239793/…
 
@FreezePhoenix lol,
 
2:56 PM
@FreezePhoenix What's a normal person?
 
I think it's safe to say there's a difference between the people in the navy and perhaps reactor operators, and the people who work at mcdonalds.
 
@FreezePhoenix Yes, some of them glow in the dark.
 
... and the former two know what they're doing.
Does anyone know why Java Reflection even exists
 
This is a question more suited for Code Review as the code works, although not efficiently — Jab 8 secs ago
@Jab Hi! Oh I didn't know about code review. Thank you! — Tim Alym 6 secs ago
 
3:16 PM
@FreezePhoenix that's a pretty bold assumption.
@FreezePhoenix why does Reflection exist in any programming language?
 
Probably so you can still work with code written by self righteous people? Who don't want you to mess with their internal stuff?
 
@Mast I doubt it. They might use LYaPAS, though:
Logical Language for the Representation of Synthesis Algorithms (LYaPAS, Russian: ЛЯПАС) is a programming language created in the Soviet Union in 1964, by Arkady D.Zakrevskij of the Laboratory of System Programming and Logical Synthesis, of the Academy of Sciences of the Byelorussian SSR, since renamed the National Academy of Sciences of Belarus.LYaPAS is an extension to the programming language APL, and was initially designed especially for non-numeric programming for the Soviet designed and built line of mainframe computers named Ural-1. An interesting feature of LYaPAS is its use of octal numbers...
 
0
Q: Anonymous class and interface, returning a List

AccollativoI have a main that call the method genericQueryFromTable, that return a list of objects that are modified by an interface ResultSettable. Foo1, Foo2, Foo3 have the same data, only the implementation of the interface is different. All works fine, but I would like re-engineer it. Does it exist a w...

 
@FreezePhoenix It's strange Googling terms I don't know, and then finding I've already used it before...
2
 
3:32 PM
@FreezePhoenix no, because some things are just easier with runtime access to compile-time information
 
3:48 PM
@Vogel612 Look up "Accessing private fields in java"
 
~sigh
 
You can also set final fields. You can change their types. You can do all sorts of stuff that just shouldn't be able to be done.
 
I have a gold badge in java. I regularly work with reflection
Reflection isn't only about accessing internals
 
I've had to become acquainted with it, to modify minecraft.
Too often, it's because a field is set to be private. Other times, I need to access runtime information at runtime, and not cause errors at compile time.
Class.forName, for example.
@Vogel612 I see. Then you are already aware of it's shortcomings, and it's bright spots.
 
It's a fantasy that you can enforce an architecture by any means other than code review. — David Browne - Microsoft 29 secs ago
I guess you should ask that question here on code review: codereview.stackexchange.comIfaruki 26 secs ago
 
4:25 PM
Requests for feedback on working programs should go to codereview.stackexchange.com instead. Make sure to read their question guidelines. — Nate Eldredge 7 secs ago
 
5:13 PM
@brug oh wow, that's a lot of awesome games
 
Right! It is a massive amount of content and some of it is just awesome. There are some pretty cool graphic novels in there and a few books too!
 
yea, I'm extremely tempted, if only for superhot, undertale and into the breach
 
-1
Q: SwiftUI: Implementing extension of a class for a struct workaround - MKMapViewDelegate

Kevin GallowayI have tried a number of GitHub repo's to add styling to my Apple's MapKit and each of their directions say to extend a class of ViewController: MKMapViewDelegate like this - extension ViewController: MKMapViewDelegate { func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> ...

0
Q: using system calls to compare text files

omer peretzwas trying to make a script that compare 2 txt files. basically no problem and it works but wanted to double-check with you guys if there's something i missed about these system calls (since im new at this), any improvment you would've done or anything else you think can help me improve with it....

 
RGS
5:49 PM
@Vogel612 I wrote my first code review question on APL :)
 
tag added
 
RGS
thanks o/
that was efficient
 
@RGS I've never seen APL before. But to me it looks like a strange mix of code golf and hieroglyphs
 
RGS
@Peilonrayz I am very new to APL and I confess I only learned about APL over at codegolf.SE.
But it is fun learning! And the glyphs bother me less and less by the minute
The only thing I can't live with is the fact that a comment line is marked by ⍝
 
lol, I can imagine it's quite fun to learn a language through code golf
 
5:59 PM
0
Q: Implemention of 'Final Version Perfected' Productivity Algorithm

BeeperTeeperThis is a small program to implement the FVP algorithm (outlined here). I'm still quite new to C++ and don't have a strong grasp of basically any concepts. Concepts I tried to use in this program: OOD Header files Lambda functions std::list and std::vector I would be grateful for any suggesti...

3
Q: Finding legal knight moves in a chessboard in APL

RGSI wrote a function that takes as input a vector with two integers between 1 and 8 representing a position in a chessboard and that should output a vector where each cell is a similar vector of integers, with the positions that a knight in the input position could reach. E.g. for the input 1 1, m...

 
RGS
6:15 PM
@Peilonrayz but I haven't been learning the language through code-golf. What I meant was, I only learned about the existence of APL through golfing challenges. But I am learning it properly.
 
@RGS Ahhh
 
RGS
@Peilonrayz might as well ask you: what makes for a good code review question? I guess I'll be asking a couple of these and I might as well do it well
 
What do you deem good? Going hot, quality or just being on-topic?
 
0
Q: Python Alien Blitz Game

Robin AndrewsPlease review my Python Alien Blitz Game code. There are several points I'm keen to hear about. I used globals. Was that an evil choice given the context? In the past when I've tried to refactor these kinds of programs to pass arguments instead, I've got in a real muddle keeping track of them ...

0
Q: ES6 how to avoid nested functions

HarryI have functions nested here in setTimeout function startWorker (obj) { if (!code) { return setTimeout(2000, () => { startWorker(obj) }); } // do stuff } How do I correctly use startWorker as the callback without using more functions than needed.

0
Q: Simple GUI unit converter with tkinter

JustinI happen to delve into tkinter and create a couple mini projects so I could familiarize myself with it. I was wondering if there were any portion of my code or entire code structure that is sloppy and could be more pythonic. As a beginner in both python and tkinter (been learning during this shut...

 
RGS
@Peilonrayz Quality and on-topic
Going hot is not my objective when I post a CR question.
 
6:19 PM
Being on-topic's easiest. Always provide a description and some code. The code should output what you want it to. If it takes 5 years to output on bigger data that's fine.
As for quality, you question looks good. I can't really describe it better tho :(
If you want to go hot, post some code with some really low hanging fruit on one of the first 5 lessons of <insert 'competitive' programming site here>
 
RGS
@Peilonrayz xD best advice I was ever given on any SE site ahah
Thanks for your input
 
6:37 PM
0
Q: Spring, Kafka and Mongo how to create a RestController

FrakcoolI'm learning how to use Kafka, I've never used something similar in the past. In my job I was required to create a POC using it and integrate it to Spring Boot and save information on MongoDB (because we will need to retrieve information on-demand and I thought that it would be the best approach)...

 
I don't know what So is doing but diffing can easily be done by JS at the client side to relieve the server from this unnecessary task. I had done a preliminary work on that. Perhaps you may check A String.prototype.diff() implementation (text diff). — Redu 7 secs ago
 
 
2 hours later…
8:50 PM
-1
Q: Input in python3

user221258Can a program in python, take input in the same line like in C, where we can can use scanf to take input differentiated by space? And, how. In C, #include <stdio.h> int main { int x,y,z; Scanf("%d %d", &x, &y); z=x+y; print ("%d", z); return 0; } Similar, in python but input in one line x=...

 
9:09 PM
-1
Q: Execute async task in constructor

Logan KI've been playing around with this style and wanted to get other opinions on it. I know others have mentioned that you should design your types for async calls so you don't block the async call in a constructor. I've thought of doing this: public class SomeClass { private readonly IDepende...

0
Q: bash script to delete files resurrected by Adobe InDesign bug

John QuirkAfter a March update, Adobe Indesign will resurrect removed directories it was responsible for creating in the first place, but not any files except for one file called "AdobeFnt.lst". So where once you had a complex folder structure, but then deleted it, you'll now have the whole structure back,...

 
9:46 PM
-1
Q: Alternative to Sort Order field?

Taimoor ChathaI have predefined order I want to display my items. However, I am wondering if there's a solid alternative without too many tradeoffs to having a field called sort order. For example: item_a = {sort: {user_type_1 = 0, user_type_2 = 1}} item_b = {sort: {user_type_1 = 1, user_type_2 = 0}} S...

 
10:05 PM
-1
Q: How should I store API keys and check if the code is being run locally?

Jacobimport spotipy from PIL import Image, ImageFont, ImageDraw import requests from io import BytesIO from flask import Flask, render_template, url_for, request, redirect, send_file def return_sp_oauth( scope = "user-top-read", client_id = "<MY CLIENT ID>", client_secret = "<MY CLIENT...

0
Q: A self contained parser generator implementation

JeacomThis is a recreational project, I was trying to make a parser generator with a grammar inspired from: https://docs.python.org/3/reference/grammar.html Unfortunately, understanding that specific grammar's syntax (meta-grammar?) ended up being way harder than I expected so, I ended up creating my ...

 
 
1 hour later…
11:14 PM
Brilliant - but you actually solved the problem, so now the question is more suited for code review. That's where working code goes to get better. :-) — Ted Lyngmo 33 secs ago
 
11:29 PM
That is true. really i just wanted to find a solution and as soon as i found it i just put a fix together in a couple of seconds. of course one would need to settle down to design everything correctly but this is not codereview lol. — Nadpher 59 secs ago
 
11:40 PM
0
Q: Unit Testing - test deletion of archived files

inikiI am writing unit test for this function - public void DeleteExpiredArchiveFiles(string directory, int daysInArchive) { //Delete files from the directory which are older than parameter - daysInArchive } I need to access some sample files in the code for this unit test. What is the correct...

 
11:59 PM
0
Q: Improving loop through xml files ad add to DF

guialmachadoWith this code, i loop through similar xml files and add them to a DataFrame. How can i make this code better so it is more pythonic? Dados = pd.DataFrame([]) folder = os.listdir(path) for file in folder: if file.endswith('.xml'): with open(os.path.join(path, file), encoding="utf8...

 

« first day (2525 days earlier)      last day (1489 days later) »