« first day (2648 days earlier)      last day (52 days later) » 

12:00 AM
RELOAD! There are 6868 unanswered questions (89.8425% answered)
 
0
Q: Reddit Hangman Bot Python3

ShokoNBack with another Reddit bot. This one provides games of Hangman to an arbitrary number of players simultaneously. Users interface with the bot by mentioning it for a new game. Once that game is started, the user guesses continuously and the bot replies until win, loss, or forfeit. A user is limi...

 
 
3 hours later…
2:35 AM
1
Q: React hook: useAsyncValue

mpenI wrote this little hook so I could fetch some remote resources: import {DependencyList, useEffect, useRef, useState} from "react"; export default function useAsyncValue<T>(cb: ()=>Promise<T>, deps?: DependencyList): T|undefined { const [value,setValue] = useState<T|undefined>(undefined) ...

 
3:00 AM
2
Q: Elixir generate inverted / reversed map

Mark McElroyI would like to transform the input elems = [a, b, c] terms = [t1, t2] @spec contains?(term, elem) :: boolean def contains?(term, elem), do: #implementation to either of %{t1 => [a, b], t2 => [c]} or %{t1 => [a], t2 => [b, c]} where t1 |> contains?(a) #=> true t1 |> contains?(b) #=> true t1 |>...

 
3:51 AM
0
Q: Customization of memory class C++

starrkI have implemented some customized memory allocation class template for an assignment. Codes are commented; Hopefully it's clear. I would love to know if there is any way to make the code more optimized. Note: int main() should not be modified. From the requirements of my school (Must be adhered ...

0
Q: Comparison "Cart" for different types of "products"

vphilipnycI am looking to compare two different types of items separately. I essentially created a session-based "shopping cart" to add stocks. This works fine (cart code pasted below). I have the first part done and the output looks like: Stock A. Stock B. Stock C. Criteria 1 ...

0
Q: async/await vs promise.then() for simple task

Ye CaiI made a helper function for drawing the map(OpenLayers), then another helper function for fetch(axios.get) the map URL, So my question is, switch from .then() to async/await loadMap_before() to loadMap() way which way is better ,or option3 is the best that loadMapUrl() helper is totally unneces...

0
Q: Decode FEN string into separate variables for the 6 categories

enzostackFEN strings are compact representations of chess board positions which allow you to derive every piece of information to start playing a chess game from that position. This includes things like the pieces on the board, castle statuses, etc. More information here: https://en.wikipedia.org/wiki/For...

 
Monking
 
 
1 hour later…
5:07 AM
0
Q: Representing a property with a non-nullable getter & a nullable setter

gldraphaelI have a class as follows, where I want the user of the class to know that setting the Slug property to null is supported, and its getter will still return a valid value: public class Post { public string Title { get; } public Post(string title) { Title = title; } pri...

 
 
2 hours later…
7:13 AM
0
Q: Fetch StackOverflow questions and save them to a markdown table

political scientistI'm trying to write a script that would (a) fetch StackOverflow questions and (b) update a markdown table with new entries. With github actions I automated this script to run daily. Idea borrowed from simonw Code: import re import requests from pathlib import Path from datetime import datetime ...

 
Are you sure that you compile for C++17? Also note that there's no C code in the initial question on code review; that's also C++ code. — Daniel Jour 46 secs ago
 
 
1 hour later…
8:29 AM
0
Q: Heartbeat pattern with Websocket in JS - annoyed by global dictionary

Arthur AttoutI'm implementing a kind of 'heartbeat pattern' with websocket in JS. The idea is: the server keeps a dictionary holding a Websocket object for each uuid (an uuid is a client). const WebSocket = require('ws'); const wss = new WebSocket.Server({ port: 8080 }); const DELAY_TO_DECLARE_DEATH_CLIENT = ...

 
 
1 hour later…
9:41 AM
Monking
 
0
Q: Getting 6000+ substrings from large a large string

Mert YI have a class that opens a text file and reads out its content. This class has a member function that will extract a substring between two given delimiters. My application needs to extract between 6000 and 7000 substrings of this text file content on start up. Even though speed is not the most i...

 
10:10 AM
0
Q: ZigZag array implementation

Neslihan BozerI have implemented a zşgzag array which will sort smaller greater smaller and goes on... Are there any other suggestions for improving the solution? Thanks. package main.algorithms; public class ZigZag { public static void main(String[] args) { int[] array = {4,3,7,8,6,2,1}; ...

 
10:35 AM
0
Q: Compare List to Enum Where Contains Any

indofraiserI have a List that I want to compare to an Enum. So if a.Value is found in the Enum we return True. I feel that I should be able to make this a single line, but have struggled. private bool IsFound(IEnumerable<SomeAttribute> attributes) { foreach (AttributesInMethod option i...

 
 
1 hour later…
12:00 PM
possible answer invalidation by Dan on question by Dan: codereview.stackexchange.com/posts/247317/revisions
 
12:14 PM
Didn't know about codereview.stackexchange.com. Thanks for the suggestion! — acoomans 23 secs ago
 
12:30 PM
possible answer invalidation by starrk on question by starrk: codereview.stackexchange.com/posts/247412/revisions
Welcome to Stack Overflow. Well played, this is a good first question but it misses some info. Could you provide some insight about what works and what doesn't in your code so others can help ? You also can look at codereview.stackexchange.com for a better code review platform, where these types of questions are better recieved. — Leogout 20 secs ago
 
@CaptainObvious Missing context.
 
0
Q: Python - use a list of names to find exact match in the free text pandas column

mantasbacysI have an Excel file containing a free-form text column (that sometimes is structured like an email), where I need to find all first and last names and add an extra columns saying TRUE/FALSE to these fields. I do not need to extract matched data (i.e. note it down in an adjacent column), although...

0
Q: Undirected graph data structure in C#

Al2110Description A class representing an undirected graph. At the moment, it supports integer values as vertices. An example of the type of graph represented is shown in the following diagram: It is represented internally as an array of adjacency lists. Each index of this array corresponds to a verte...

 
Question is more suitable for codereview — Vishesh Mangla 54 secs ago
 
12:56 PM
If the code works, and you'd like a review of all of the code, I'd encourage you to check the help center of Code Review to see if your question is on-topic there. The question is not on-topic here, as it is asking for opinions about the code, which encourage discussion and commentary that Stack Overflow is not built for. — Heretic Monkey 33 secs ago
 
1:07 PM
0
Q: Hashing and sliding window for string

Neslihan BozerI have implemented a solution for finding all anagrams. Are there any other suggestions for improving the solution? Thanks. package main.algorithms; import java.util.ArrayList; import java.util.List; public class AllAnagrams { // Sliding window public static void main(String args[]) { ...

0
Q: implementing Fingerprint in android webview using shared preferences

Pradeepkumar'''protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView webView = (WebView) findViewById(R.id.webview); WebSettings webSettings = webView.getSettings(); webSettings.setJavaScriptEnabled(true)...

 
1:59 PM
Greetings, Programs.
 
Ryan Donovan on August 03, 2020
It can be intimidating to start contributing to an open source project. But with a little research and planning, you can be a valuable part of your favorite open source software.
 
2:30 PM
possible answer invalidation by Xamtos on question by Xamtos: codereview.stackexchange.com/posts/245518/revisions
 
2:57 PM
Since the code appears to be working, this seem more appropriate for CodeReview. — MisterMiyagi 36 secs ago
 
3:10 PM
possible answer invalidation by Drise on question by Maria: codereview.stackexchange.com/posts/247405/revisions
 
M0nk1ng
@pacmaninbw revision 2 adds sufficient context, right? or should usage still be added?
I think @Johnbot found you performance issue, but I can't be sure without seeing how this class is used. If I write a review there will be very little about performance for this reason, I can only review what is posted. — pacmaninbw 37 mins ago
 
3:29 PM
If this code is working in principle, it may be more appropriate for CodeReview. — MisterMiyagi 45 secs ago
 
3:40 PM
You might want to take a look at codereview.stackexchange.comkhelwood 17 secs ago
 
@SᴀᴍOnᴇᴌᴀ I'm considering writing an answer to this at the moment, there are some real issues in the code besides the performance such as unsafe type casts. I don't think the code has been fully tested yet, since the unsafe type casts can mutilate binary data going in or out.
Only the class itself can be reviewed at the current time, and the prohibits a full performance review.
 
@pacmaninbw okay - thanks
 
@SᴀᴍOnᴇᴌᴀ read my last comment.
If I could I would change the VTC to broken code.
Amazing how you can fit a mini-review into a comment.
 
@pacmaninbw just because there is no usage/application of it, or is there something that is not working about it?
 
3:55 PM
If the binary input or output value greater than 255 the data is mutilated. Broken code that hasn't been tested.
@SᴀᴍOnᴇᴌᴀ ^^
 
0
Q: Queue implementation by using two Stack

Neslihan BozerI added a queue implementation by using two Stack. Could you please review my solution and provide other ways if it is possible? Thanks. package src; import java.util.Iterator; import java.util.Stack; public class QueueWithStack <T> implements Iterable<T>{ Stack<T> stack = new Stack<>(); ...

0
Q: Padé approximants as acceleration for lebniez series of pi

Dhaval BothraSo i read about lebniez series for pi. I made a program and noticed that it converges very slowly... So in series acceleration in Wiki i read that Padé approximants can be used to approximate arctan(x) then x = 1 can be put into it (Will give pi / 4). But i have no Idea how can i program it. Here...

 
This question may be better suited for Code Review. — BigBen just now
 
4:33 PM
Might this question be a better fit over at CodeReview? — Pranav Hosangadi 31 secs ago
I’m voting to close this question because it might be a better fit over at CodeReview.SEPranav Hosangadi 49 secs ago
@PranavHosangadi While this may be on-topic on CR in the future, please don't use the existence of the Code Review site as a reason to close a question. Evaluate the request and use a reason like needs more focus (as I have done here), primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see Does being on-topic at another Stack Exchange site automatically make a question off-topic for Stack Overflow?Sᴀᴍ Onᴇᴌᴀ 33 secs ago
 
 
1 hour later…
5:44 PM
0
Q: What is the best way to make this code dry?

user10792602I have a script that makes a bunch of api calls (xml) and it's not adhering to DRY because I am repeating a lot of the code in the functions, what would be the best way to clean this up and reduce the amount of repeat code? def get_api_key(hostname, username, password): url = 'https://' + hos...

 
@CaptainObvious Was about to say that's not a good title, but there was already a comment :-)
 
@Mast ♫ "We do what we must Because we can." ♫
 
@Duga Eh, can I have a second opinion on that?
@Duga That's fine.
@SᴀᴍOnᴇᴌᴀ For the good of all of us.
Quite fitting.
 
6:01 PM
@Mast after quickly scanning through the answers I don't see that part of the code mentioned explicitly so I don't feel it invalidates anything, but I could be wrong... and we could follow the rule @Peilonrayz mentioned last week. i.e.:
Jul 30 at 20:32, by Peilonrayz
@SᴀᴍOnᴇᴌᴀ It's really quite simple. If the question is not closed it's AI. It has 0 close votes and looks like it's going to stay that way. Therefore it's AI.
 
Heh, thought that I was the only one with that unpopular opinion.
RB
 
@Mast Except the ones who are banned.
Monking.
 
0
Q: C# threading and synchronizing methods

tyler jSo I started this question, I believe i have synchronized the methods correctly, need some insight on whats wrong and what should be done. I have to modify ths class Purse so that the method AddCoin is synchronized and implement a synchronized RemoveCoin method with a Coin argument, I believe t...

 
@Zeta Sometimes people are banned for their own good and that of the rest of the world.
 
You were supposed to continue with "But there's no sense crying over a wrongly moved post / you just keep on voting till the queue is closed" :(
 
6:14 PM
Sorry.
 
"Still Alive" jokes aside, yeah, I concur.
 
6:35 PM
0
Q: Python decorator for token for REST API client

ring bearerMy goal is to provide a decorator named @with_access_token that can be added to API calls that need an access token - so that the method's caller doesn't have to worry about getting/refreshing it. Here is how I have separated my implementation. Is this right? I find the cyclic dependency between ...

 
Is there a problem? If so, what? If you just want a code review, there's the Code Review Stack Exchangeikegami 51 secs ago
 
 
2 hours later…
8:25 PM
Re "I would like to get some reviews", This belongs on Code Review Stack Exchange. — ikegami 9 secs ago
Re "I would like to get some reviews", This belongs on Code Review Stack Exchange. — ikegami 47 secs ago
 
9:06 PM
0
Q: trying to make a app that accesses music databases to gather information on songs such as popularity and metrics of the song

spikethedrummerstuff like bpm that you can only find by opening up the file, or accessing the database that already has that information, popularity like on charts and such, etc. and other factors of the music. need some help coding, am a beginner, this is just the first idea I came up with considering im a mus...

 
@CaptainObvious CNWAI
 
9:22 PM
2600 items, you would want to use reduce for that, codereview.stackexchange.com/questions/141530/…Lawrence Cherone 49 secs ago
 
9:32 PM
1
Q: What are some ways I can make my code more efficient?

calghirall. I decided that in order to get better at programming, I should focus on building and improving simple projects. I made a library program that contains collections of unique books of varying quantities. Although this runs as expected, I am not satisfied with the potential of expanding it to c...

0
Q: Get username from full name PowerShell function

Zoran JankovI would like your opinion of my PowerShell function. Does it follow conventions, and what could can I do to improve it. It is made to create LDAP friendly username from Serbian language. function Get-UsernameFromFullName { [CmdletBinding()] param ( [Parameter(Position = 0, Man...

0
Q: run loop and use async code inside

Jenny MI've the following code which works, I currently configure eslint and got following error 1. ESLint: iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations. (no-restricted-syntax) 2...

 
9:47 PM
@SᴀᴍOnᴇᴌᴀ I meant that when there is invalidation whether it's AI or not. I'm not really a fan of any change to code = invalidation.
Like it's much simpler but, it's not for me
 
@Peilonrayz what isn't for you? the rule?
 
Any change to code = invalidation
 
oh you mean the rule isn't "per" you...
 
I'm guessing "not for me" is slang. I mean I don't follow "Any change to code = invalidation" as I'm not keen on it.
 
10:08 PM
"[...] articles, books, blogs [...]" - Unfortunately, asking for those is explicitly off-topic for Stackoverflow. There's no quick and easy way to get better at coding, but like most major skill-sets, they get better with time and experience. If you want to use a Stack-like website, you can post your code over at codereview.stackexchange.com and see if anyone is willing to offer suggestions for improvement, but beyond that, just keep at it. — Tim Lewis 27 secs ago
 
10:38 PM
 
@Peilonrayz based on your answers like this I was looking over PEP8 and noticed a word that seemed unfamiliar: "frobnicate" - after looking it up it seemed new, though I later realized I had seen the phrase "frobbed" somewhere... I guess it was the PrototypeJS documentation
 
0
Q: Is possible to use script for dependencies in c++?

milanHrabosI wanted to make a script that would parse a main file (with int main()) look in its #include "..." local headers, and if they were not in the current dir, then find those headers, then its source files and provided them as implementation in g++. In other words, I wanted to have a script-helper, ...

 
10:54 PM
Hi, can I discuss a custom flag here where I put the wrong link to a duplicate question on SO, or should I just raise it over meta?
just for the sake of argument, the CR question is this one: codereview.stackexchange.com/questions/247457/… while the SO question is here: stackoverflow.com/questions/63237153/… and I doubt it's a valid question for CR
 
11:56 PM
@CeceDong-MSFT yeah it was definitely helpful? However the query you posted didn't return anything until I removed this where statement: Source.[System.TeamProject] = @project. Also I do not seem to be getting code reviews that people I requested I review. — user5924660 41 secs ago
 

« first day (2648 days earlier)      last day (52 days later) »