« first day (2901 days earlier)      last day (36 days later) » 

12:01 AM
RELOAD! There are 7509 unanswered questions (89.4712% answered)
Q: Retrieve filename and ID with Google Drive API in C#

JimmyHuI am trying to retrieve filename and ID list with Google Drive API (the latest Drive API version v3 is used here) as a first step in order to analyze and manipulate these files on Google Drive. The experimental implementation is as below. (Note: credentials.json file is needed and the step to gen...

12:52 AM
Q: Modulo Algorithm

Tree DevI want this function to find the closest value to n such that 32 % n = 0 in Java. I'm trying to make this more efficient / functional. Here is what I have tried, but I'm sure their is a better way. I'm using Java 8 Question: Is their a better way to implement this function that is more efficient?...

1 hour later…
2:08 AM
Q: A simple console in Rust that stores variables runs commands

AccumulatorI'm a C/C++ programmer and this is my first Rust program. A heavy simplification of the console system like used in Quake and Source engine games, that lets you set variables and run commands. I'm aware the parsing algorithm is bad, it's just supposed to be simple. I want to know how I can improv...

2 hours later…
3:41 AM
3:59 AM
@CaptainObvious no code no glory
4:13 AM
Q: Solution to Javascript coding assignment that did not get me to the interview stage

thesaladbowlI recently completed a coding challenge for a company that did not get me to the next stage. They were kind enough to provide the following feedback: The coding assignment does not match what we are looking for, a mid-level Front End Engineer. The code does not fully comply with what is asked in...

2 hours later…
6:10 AM
That's a topic for codereview.stackexchange.com - but first read their help section/rules. — Andreas 11 secs ago
6:34 AM
@CaptainObvious That's because it wasn't working while you thought it was.
@CaptainObvious One more VTC.
Please be more specific on what's wrong with your game, because this is not for code review — Ernesto Alfonso 50 secs ago
2 hours later…
8:22 AM
@AlanWik saw this post about an object pool yesterday. Probably not exactly what you are looking for, but maybe it can give you some ideas. — super 23 secs ago
8:50 AM
Q: Unix timestamp to days, months, years

QuestImagine you can't use the standard functions for time calculation or anything alike. You have to start from scratch as it is the case on embedded systems. Thus I came with the following code to determine the seconds, minutes, hours, days, months and years from unix timestamp. Tested the code, wor...

9:40 AM
Q: UDP image livestream from Android device to C# desktop application

Roland DeschainAfter searching a lot, on how to do it and not finding any good solutions, I implemented my own UDP livestream from an Android device to a C#/WPF desktop application. It works, however, since I get complete JPEG images from the camera2 API each frame in android, I need to wait until I have data f...

I think this question can be moved to codereview.stackexchange.com. — Lakshya Thakur 46 secs ago
9:55 AM
I am not sure what your actual question is. If your current code works, but you are looking for improvements, there is codereview.SX. In case you face difficulties/problems/issues about using Jcrop (or else), please focus your question on that issue only. As it stands, the question looks too broad. — ojdo 10 secs ago
Q: Is adding-removing classes in JavaScript a bad practice for toggling?

Jones SmithI just want to ask for your opinions. For instance I have the following javascript: goBtn.onclick = () => { current_step++; let previous_step = current_step - 1; if(( current_step > 0) && (current_step <= stepCount)){ prevBtn.classList.remove("none"); prevBtn.cla...

Q: Python Genetic Algorithm Implementation

AfiJaabbI've made this to pick the LQR parameters for my self balancing robots simulation. So to break down what I have done, Randomly Create Population I create a random population. The population is a list of lists having 4 parameters each of which is randomly generated. But I have applied bounds for ...

10:30 AM
Q: Reading and analyzing budget and transaction data from user input and .csv

JavierJoseI'm looking for ideas on how to optimize the following code. I don't really know how to condense anything, I'm still very new to coding and this is the first time I've really created anything besides "Hello World". import pandas as pd import csv #Method that calculates the Current Budget of the ...

10:41 AM
This question would be better suited for codereview.stackexchange.comMr T 48 secs ago
10:57 AM
@Robula that's more thought for another question. You can try in codereview.stackexchange.comMario Pérez 9 secs ago
1 hour later…
12:12 PM
Q: What is the best way to login according to account type with server-side validation?

user9437856I have two access roles as of now for example account_type 1 and 2. What I am doing is, account_type 1 can log in using mobile no and account_type 2 can log in with email and password. Both scenarios are working with the below code but is this code is the best code or is this the right way to do?...

12:34 PM
Hi, I was thinking to ask a question to improve the coding of this python web app (github.com/rafisics/suvat_calculator/blob/main/…). Can you check the code and tell me if asking for improvement in code review SE would be a good idea or not. :)
@raf From a 2 second glance I could make some comments about the code. However since I don't know streamlit I can't comment on how helpful the comments would be.
The code works. But by improving the coding, I meant the code can be written more neatly. I have repeated the same operations many times which can be done by defining some functions. I am confused how to do so.
@Peilonrayz sure. tell me please.
@raf Reviewing in chat is not my forte. If you'd like a review (not guaranteed to be by me - I'm busy today) please ask on Code Review main
@Peilonrayz Thank you. I am going to ask it soon. But from my previous experience of asking, I am aware of the strict rules of Code Review, I need to make a good MWE for my program... which is still kind of tough work for me. It would be easier for me if sharing the github link was enough. :)
12:49 PM
@raf Posting the code as is would be fine. The only thing you would need to do is explain what the code does.
If your code is working, and you can fix the syntax errors, and you'd like to get a review of all of your code, you could check the help center to see if your question is on topic for Code Review. — Heretic Monkey 15 secs ago
@raf Nono, no MWE on CR. That's Stack Overflow. Please show the real code, as-is.
A: Checklist for how to write a good Code Review question

Simon ForsbergSimon's Guide for posting a good question There are a lot of questions that appear on Code Review, and all questions are fighting for reviewer attention. This is a non-exhaustive list of items that I am looking for in a Code Review question when determining whether or not I should review it and ...

1:28 PM
@Mast @Peilonrayz I don't see your nominations yet in the election
@pacmaninbw Both Mast and I are still writing the answers to the questionnaire - chat.stackexchange.com/transcript/message/57634408#57634408
Actually I'm at work, so I'll be writing them this evening (local time).
@Mast ohh okay. my bad. thank you.
1:48 PM
Another thing, in my code (github.com/rafisics/suvat_calculator/blob/main/…), I have used Bangla as the user interface of the web app. Would it be okay or should I put everything in English for CR question to get a better response and understanding?
@raf I would say translating the text to English may allow users to more easily understand the code and see repeating patterns. But if you don't want to not converting the text, you should be fine
@Peilonrayz Thank you. I totally agree. I am gonna translate the whole thing in English.
Make sure you check the translations for correctness before posting the question :-)
2:24 PM
@Mast haha. okay :)
2:59 PM
Oh... and this might be better placed on CodeReview rather than StackOverflow. — codingCat 7 secs ago
3:27 PM
As you are looking for advise for structuring your code more than fixing an error, this question may be better suited for the codereview.stackexchange.com site. — codingCat 50 secs ago
3:42 PM
@codingCat if the OP isn't interested in feedback about any or all facets of the code then it wouldn't really be on-topic for CR. Please refer to this meta answer (and its siblings) for more information. — Sᴀᴍ Onᴇᴌᴀ 49 secs ago
4:04 PM
If you are working with a GUI having redundant small functions is quite common, one to propagate the command from the view to the model and another to elaborate the requested operation. For the rest, I suggest posting your code to Code Review, where they will give you pointers in what you can change. — Pietro 28 secs ago
@codingCat when suggesting users post on CR it would be great if there was also a suggestion like "Please read the relevant help center pages like 'What topics can I ask about here?' and 'How do I ask a good question?". The OP has posted on CR without changing the post and unfortunately in this form it is not on-topic since the code does not work as expected — Sᴀᴍ Onᴇᴌᴀ 58 secs ago
Q: Is it impossible to use variables in line?

oioThe txt content will be added every time, so the number of the last line keeps changing, so I read the number of the last line, declared it as a variable, and put it in the lines, but there's an error. Can you help me fix any other countermeasures or errors about this? Below is an error message. ...

4:21 PM
Greetings, Programs.
@pacmaninbw Just posted mine.
I think it would be much more fun to nominate myself and give only ridiculous/satirical/sarcastic/ironic answers to the questionnaire questions.
I think people would still vote on you, with your years of experience.
Here's the answers to your questionnaire from 2015.
@CaptainObvious CNWAI; RBA
@Mast I have done it. Let me know please if my question needs more improvement: codereview.stackexchange.com/q/259468/230104
@raf I'm not familiar with the module streamlit and I don't think it's part of a standard installation.
pip install streamlit
cd <directory path of `code.py` file>
streamlit run code.py
should I put this installation lines in the question?
And I was wondering when I didn't find the streamlit tag here :)
5:04 PM
@raf If it's in pip, that won't be necessary. Could you include your Python version in the question?
Q: Find the duplicate entries (2nd occurrence onwards) in the given numpy array and mark them as True. First time occurrences should be False

Levon AvetisyanSo the problem is Find the duplicate entries (2nd occurrence onwards) in the given numpy array and mark them as True. First time occurrences should be False. And my solution is: import numpy as np def duplicates(a): uniques = np.unique(a) result = [] for i in a: if i not i...

Q: SUVAT Calculator web app using python streamlit

rafI have made a calculator app to help Bengali high-school students in solving mathematical problems on Newtonian equations of linear motion aka SUVAT equations. Originally, I have used Bangla as the user interface language of the web app (Github Repo). But here, I am showing everything in English ...

@Mast sure. Done
Ryan Donovan on April 13, 2021
Part 4 In this session, we will make our p5.js sketches interactive! Together with Morgan, we will work on the Generative Art Creator project using the p5.js web editor! We will make a tool to create, control, and combine generative works of art inspired by early media artists, such as John Whitney and Vera Molnar.…
Sometimes it takes real work to keep answers and comments gender neutral.
FYI, I have suggested a couple of additional nominations.
5:27 PM
@raf I don't see any glaring issues with it.
It's even answered already.
... a testament to how active python reviewers are here
Q: Video Editor Clean up

MiniMinnowI am making a video editor with tkinter, and seriously need to clean it up and make it nicer to read / more efficient. Can anybody help me clean up my code (I was sent here from stackoverflow) Here it is: https://github.com/MiniMinnoww/moviepy-video-editor The parts I kinda need to figure out are...

@pacmaninbw @SᴀᴍOnᴇᴌᴀ Did you notice one of the nomination requests is about you?
@Mast I did.... I'll try to go over the questions later today..
@Mast yes, I am really overwhelmed by the quick response! :)
5:42 PM
@Mast I was such a greenhorn - only three years experience.
@SᴀᴍOnᴇᴌᴀ Good! Now, don't feel pressured, you're not required to do anything. But if you want to, you're welcome to nominate.
@Donald.McLean Never knew you were a moderator at some point.
@pacmaninbw I'm an appointed mod on two beta stacks: astronomy and music fans.
6:01 PM
Not exactly code review but does anyone know what on earth { "sk_apikey", "v1" } exactly is in Javascript?
It looks like a dictionary
So I guess the four stacks I'm most active on represent my four main professional and hobby interests. Those two, here, and SFF.
@skiwi is it posted online somewhere we can see it with more context?
@skiwi Not a dictionary.
@SᴀᴍOnᴇᴌᴀ github.com/iexcloud/iexjs/blob/main/src/js/client.js this is the consuming side
The fun part is that I'm using Typescript and I need to type whatever-I-have properly
So this time I actually need to know what I'm doing
We couldn’t find any code matching 'sk_apikey' in iexcloud/iexjs
6:05 PM
I was looking at this page for an example of what a dictionary would look like: pietschsoft.com/post/2015/09/05/…
@SᴀᴍOnᴇᴌᴀ That is my private key :P
The example is here: github.com/iexcloud/iexjs
Have you worked with JSON in JS before?
normally the format would be {key: value} though if the key is the same as value then key: can be omitted in ES6+
@skiwi Would be a keyless dictionary then, so, basically a list?
Maybe it's just a typo and I don't need to add the curly braces
if you just need a list (i.e. without keys) then use an Array
6:10 PM
I'm obviously doing something wrong as my program just exits now
@skiwi If it throws a SyntaxError you know enough.
@Mast Can't see the error because it immediately disappears :D
oh were you following the example from the documentation: const client = new Client({token, version});?
I don't know, this construct doesn't even appear to be valid Javascript
@SᴀᴍOnᴇᴌᴀ Correct
so you would likely need to supply keys: e.g. const client = new Client({token: "sk_apikey", version: "v1"});
6:14 PM
I'll try
it looks like the default version is "v1" so you don't have to specify that
Would also kind of want to know why my program just exists :D
<- Typescript/node.js noob
Actually the token key appears to be api_token so make it like this const client = new Client({api_token: "sk_apikey"});
it also appears to default to an environment variable IEX_TOKEN - did you set that @skiwi?
@SᴀᴍOnᴇᴌᴀ Aah thank you, that did the trick! Still not nice that the program just crashed on me :(
(When I did it wrong)
you could fork the repo, update the README.md and submit a PR
6:20 PM
It's probably me using TypeScript that complicates things
6:33 PM
@SᴀᴍOnᴇᴌᴀ PR created
6:57 PM
Looks like I went down a rabit hole trying to find out which source has the news first and if there's a (reasonably priced) API available for it
7:36 PM
Q: I'm following the Brackeys 2D game tutorial on YouTube, and I don't know how to reference the character controller in my PlayerMovement file

gmorri34In the video, he is using a little older version of Unity, while I'm using Unity 2019.4.17f1. In the video he uses this code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public CharacterController2D controller; ...

7:52 PM
If you have working code that you would like reviewed, Code Review is more appropriate than Stack Overflow — Cory Kramer 39 secs ago
I’m voting to close this question because it belongs to codereview.stackexchange.comtink 30 secs ago
Q: Arduino algorithm

ShaanI have 3 push buttons, 3 leds, and 2 relays. When you push button1 once, the led1 turns on and timer is set to 10 sec. When push button1 twice, led2 turns on and timer is set to 20 sec. When push second button once, select first relay. When pushs second button twice, then select second relay. And...

1 hour later…
9:09 PM
Q: Simple Brainfuck Interpreter in C

Andy Sukowski-BangThis is a simple interpreter for the esoteric brainfuck programming language, written in C. It is one of my personal projects and I would love to receive expert advice. Behavior All characters except the eight commands ><+-.,[] are ignored and treated as comments. The array has 30,000 cells and...

9:39 PM
Q: Javascript Pub/Sub

Aksishere is a short pice of code that suppose to work as Pub/Sub or EventDisptacher of some sort. I only do code in JS a few times a year, so hence I'm asking for your time. Right now I'm working on little full-stack pice for my portfolio, and I'm really not a frontend developer :) Here is the code: ...

2 hours later…
11:15 PM
"tell me whether my code is designed well" This is a better question for codereview.stackexchange.com. Stackoverflow is more about why things don't work, or specific questions with generally applicable answers. — Nick Humrich 31 secs ago
Please repeat on topic and how to ask from the intro tour. An open-ended code review is off topic. Please join StackExchange.CodeReview and follow their posting guidelines. — Prune 33 secs ago

« first day (2901 days earlier)      last day (36 days later) »