« first day (2474 days earlier)      last day (1399 days later) » 

12:00 AM
RELOAD! There are 6393 unanswered questions (90.0908% answered)
"it's not really an "improvement" thread" - your original title of "Is this a good implmentation of asynchronous code?" is clearly code review which is off-topic for SO. How to AskMickyD 32 secs ago
12:58 AM
Q: PHP MySQLi Database Object

sBucholtzI've been learning more about PHP Objects and Classes, and my immediate reaction was to create a Database Object for handling the MySQLi Connection, Statements and Results. Its not meant to be an ultimate do-all object, but help with WET code. Obviously this has been done before... at least a h...

1:40 AM
Also Stack Overflow is tailored more towards solutions for specific bugs. You may be able to get more constructive, general feedback over on Code Review SE. Good luck :) — HewwoCraziness 21 secs ago
2 hours later…
3:20 AM
Q: Java: Trouble with appointment calendar program

BrewCrew15/** * Class HandleInput: * This class is used to hold static methods that can * be used to get input from the user, and validate that * the user entered correct values. * * Last Modified: [DATE LAST MODIFIED] * Author: [YOUR NAME HERE] */ import java.util.Scanner; public class HandleI...

@SᴀᴍOnᴇᴌᴀ OK, this one had a 3k view, took you up on your challenge
Q: Java AES-256 GCM file encryption

ZiXoneI wrote my first file encryption program, that encrypts a file with AES-256 GCM and stores IV and salt prepended to the file content, so it's likely that I did something worse than possible. I would like you to look at my code and point out errors or places where it is possible to make better....

It's actually not even that bad.
I really really don't like that "reinventing-the-weel" tag. It seems abusive and can be slapped on almost all code that comes from challenges etc.
1 hour later…
4:26 AM
@HewwoCraziness Code review is for working code. Please don't recommend questions which are off-topic for Code Review. And/Or direct new users to the FAQ and mention ensuring it's on-topic before posting. — dustytrash 33 secs ago
4:55 AM
Q: Monthly Countdown Timer

Thet Myat NoeI'm making Monthly Countdown for my project. It should be a countdown for every 1st day of the month. But I only found Yearly countdown and that is troubling me. Here is the example I got. Sorry for my English skills. const year = new Date().getFullYear(); const fourthOfJuly = new Date((yea...

5:14 AM
5:47 AM
Ben Popper on February 11, 2020
Sara returns from Miami. The crew chats about Monoliths vs microservices and the lessons we’ve learned as manager and ICs.
6:23 AM
Q: Postgres query to extract a JSON sub-object from a JSON field

pennstatephilI have a json field in a table that I want to select certain fields from into a new json field. So far I have this, which works, but I feel may not be optimal: select to_json(new_obj) from ( select big_json_field->'json_property_1' as json_property_1, big_json_field->'json_property_2' a...

6:51 AM
What have you tried so far? What specific problems are you having or what are you hoping to improve? For speed, have you considered something like multiprocessing? If your code is already working and you can show more of it, you might consider asking at Code Review. — jtbandes 30 secs ago
1 hour later…
7:52 AM
@Mast Just got your ping; was I shown as online last week?
8:03 AM
github is big, reliable, trusted in the dev and open source community and everybody knows how to use their website, either for code review, forking, creating pull requests etc. its just very convenient to check new librarys on github before installing and running them local. — Frederick Behrends 24 secs ago
possible answer invalidation by klutt on question by klutt: codereview.stackexchange.com/posts/236841/revisions
8:40 AM
If your code is working and you want to get a sort of code review, please visit codereview.stackexchange.comsanyash 57 secs ago
@Zeta At the time of that ping, yes.
@Duga Fine.
This looks straight-forward to combine to a single function with a parameter. What problem are you facing? (as asked above). As you code appears to work, you might like to ask on codereview.stackexchange.comfreedomn-m 24 secs ago
I think this belongs more into code-review section - codereview.stackexchange.comNeo 28 secs ago
9:05 AM
Q: How to get the next occurrence of Friday the 13th?

FluxHow can I get the date of the next occurrence of Friday the 13th? Below is my attempt. It returns the correct results. I think there must be a better way of writing this without checking thirteenth > start_date for every month. import itertools from datetime import date def next_fri_13(start_...

9:45 AM
Q: Java wrapper for a movie database API

Karl S.I am still a beginner and I would love to hear some feedback on a small wrapper I wrote for the TMDb API (https://developers.themoviedb.org/3/getting-started/introduction). It is used for queries on a movie database. I tried to make it as simple as possible so all that is needed to get relevant i...

I'm voting to close this question as off-topic because This question are better suited at Code Reviewstovfl 35 secs ago
"could you please help in improving it" - This is not what Stack Overflow is for; please see stackoverflow.com/help/on-topic . If your code works, you can ask a question on codereview.stackexchange.com to get general, open-ended feedback; if it doesn't work, you can ask a question here about a specific problem with it. — kaya3 47 secs ago
this might be more suitable for Code Review... — A Honey Bustard 1 min ago
10:05 AM
Q: User class for future inheritance in other programs involving user activity

VISHAL AGRAWALI am making an user class which i could inherit and use in future could you please help in improving it(recently started learning python and oop) import mysql.connector as mycon class user: host = "localhost" user = "root" password = "pass" database = "USERS" table = "UserDat...

10:49 AM
Side note: Always use official documentation as canonical reference as edited by Sherif. Also, w3schools shouldn't really be recommendedvivek_23 21 secs ago
This might be better suited to codereview stack — B001ᛦ 17 secs ago
11:06 AM
Q: Mocking pathlib.Path I/O methods in a maintainable way which tests functionality not implementation

gerritI have a function that constructs a path based on a function of inputs and creates the parent directory. When writing a unit test for this function, I want to mock the I/O part of the function, namely the .exists() and .mkdir() methods of the pathlib.Path objects. However, since both are not ...

This indeed could make a good Code Review question. Since the premise of that site is improving any and all code, to make your question fit better when posting it would be best if you provide more description on what the code does. A short explanation on what these filters, tables and code does would make it a good question. — Peilonrayz 20 secs ago
possible answer invalidation by kyb on question by kyb: codereview.stackexchange.com/posts/236851/revisions
11:26 AM
Q: Rxjs - switchMap - countdown timer

3D_funI'm learning rxjs and I've implemented my own solution for task: "Countdown timer with pause and resume". Please, do a check review and give me some valueable feedback. Regards /* Own implementation of example 2 - Countdown with pause and resume https://www.learnrxjs.io/learn-rxjs/operator...

possible answer invalidation by kyb on question by kyb: codereview.stackexchange.com/posts/236851/revisions
@Duga Please can someone review that, from rev 4. It looks to me like they've appended new code.
11:46 AM
Q: An AKS-like primality test

Peđa TerzićHere is a working pari/gp implementation of my variation of AKS test (see here). Problem is that my code is extremely slow. Is there something that I could change in code to achieve a better running time? xmat(r,n,a) = [2*x, a; 1, 0]*Mod(1,x^r-1)*Mod(1,n); AKSv2(n)={ if(!(ispower(n)==0),print("C...

possible answer invalidation by gerrit on question by gerrit: codereview.stackexchange.com/posts/237060/revisions
@Duga Technically yes, but an edit on the answer - provided by the OP should be fine.
12:06 PM
Q: build own cache, in Kotlin

TomásI have a list with four elements: created_at, text, name, screen_name. The first represent a date of creation, the second the texto of a tweet and the latest the name and screen name of user. I want to storage this information with lifespan, a random lifespan. For this i thinking using the cache ...

Q: c++ scoped thread using modern c++

dev65I wrote this simple scoped thread to use it as a class member to ensure the the thread running on a class method doesn't continue running after the class has been destructed . also to spawn threads from the main function to ensure that I don't forget any running threads upon exit . this can be a...

Q: Simple arithmetic operations in MASM using dosbox

JoeThis program does simple arithmetic calculation (+. -, *, /, %) in masm. I've tested the code. disp_str macro msg ;print a string lea dx, msg mov ah, 09h int 21h endm input macro ;move values to ax & bx for execution call clear_reg mov ax, num1 mov bx, num...

Q: Reverse string by separator

goldstarHere is problem: There is string (domain) divided by dots (like www.part1.partN.com) Need to build reversed by dot string (like com.partN.part1.www) Both strings are utf-8 encoded My solution: std::string reverseHost(const std::string& host) { std::string ret; ret.reserve(host.size())...

Should be closed and moved to SE code review since the code works. — Dorian Turba 58 secs ago
There is quite a mess here:
Q: Format raw bytes in hex and ascii in manner like Wireshark does

kybThis function formats raw buffer output in manner as Wireshark and many others does: 0x00: 68 65 6C 6C 6F 20 77 6F 72 6C 64 02 6B 68 67 61 |hello world.khga| 0x10: 76 73 64 20 0B 20 0A 05 58 61 73 6A 68 6C 61 73 |vsd . ..Xasjhlas| 0x20: 62 64 61 73 20 6A 61 6C 73 6A 64 6E 13 20 20 30 |bdas...

- OP posted a question tagged [c]. The code does not compile as C because a function has the the return type `std::string` from C++. I left a comment.
- πάντα ῥεῖ re-tagged the question to [C++].
- Jerry Coffin wrote an answer (treating the code as C++).
- Three days later, OP edits the question and adds a pure C implementation (but does not change the language tag). Judging from OP's comment *“This Q is about pure C impl. I forgot about return type.”* I assume that a pure C implementation (and having it reviewed) was the original goal.
So what to do now?
- Revert everything to the original code (which is valid C++ code)?
- Or close as off-topic because the original code is invalid C code?
@MartinR I think the nicest way forward is to rollback the added C code and ask them to reask the question with just the C compatible code.
Closing not only wastes 5 CVers time, it makes an answer invalid and make the post history a bit messy. It's not what I'd call a clean fix.
12:22 PM
@Peilonrayz Agreed. I'll wait a bit to see if other opinions come in, and then act accordingly.
Oh, it already has 3 CVs, so it'd only need 2 more people. Whilst closing is 'the correct' way I still don't think it's the best way here.
I have reverted it and left a comment. Let's see what happens.
12:54 PM
I agree with the revert by the way.
This is the kind of crap you get when OP is not careful before hitting the post button. It's unfortunate the messes it can create, but it should be fine now.
1:07 PM
Q: Please help me make this ironpython script more pythonic is Spotfire

K RI am using the code below to pass filter selections from table A to table B in Spotfire. I am doing this to create a filtering relationship between the tables, but skipping the creation of a traditional spotfire table relationship, as this is not advisable in this setting. The code is associate...

If your code does not contain errors, better ask on Code Review. — usr2564301 just now
If your code works and you just want improvements, try codereview.stackexchange.comPeter Collingridge 23 secs ago
Strange that @Duga didn't pick up the following comment:
Hi @Peilonrayz. I posted the question to Code Review, and added the additional information you suggested. Thank you. — K R 13 mins ago
1:35 PM
possible answer invalidation by awwwww on question by awwwww: codereview.stackexchange.com/posts/237033/revisions
1:56 PM
But if you see the length of title in the response most of them are of similar length ("Stack Overflow en español", "Hot Questions - Stack Exchange", "Code Review Stack Exchange") but are given different score (2621.44, 655.36, 1820.4445). Why is that happening ? — Vedanshu 19 secs ago
If is works, you could try to post the question on Code Review. You could get more extensive answers there... — Serge Ballesta 39 secs ago
Does it give expected results? If no, you should explain what the problem is with some sample input and the expected and current results. If yes, the question would be on topic on Code ReviewSerge Ballesta 24 secs ago
Q: Is there a better way to write this multiple method calling and multiple list-append code?

Mo7artIs there a better and more efficient way to write this code? This may be a stupid question, but I would be really interested to know if there is a better way. In this code I calculate the statistically mean of different files and save it into a CSV file for each statistically method. def mean(d...

Q: Angular ReactiveForm Error Association

CharlesNRiceI want to associate an error message to a Validator and not have to in the html check for a specific error. aka *ngIf="controls.name.required". I've seen generic error message helpers that build up an javascript object with an index and a message that goes with that index. What I want is to act...

2:13 PM
@Peilonrayz Duga is getting a little picky? Shame on her?
2:28 PM
Q: How can I re-factorise this circular nesting dictionary function?

MrDRPThe challenge: I recently received a data extract with a list of folder names and associated subfolders. The challenge was to produce a reusable function that could provide a summary of the unique folder names and all the nested subfolders. The data source was an excel spreadsheet contai...

Q: Codeabbey Code Guesser

Name Is HKI was doing this exercise on codeabbey. Andrew and Peter play the code-guessing game. Andrew chooses a secret number consisting of 3 digits. Peter tries to guess it, proposing several values, one by one. For each guess Andrew should answer how many digits are correct - i.e. are th...

2:39 PM
I'm voting to close this question as off-topic because it belongs on CodeReview. — Scott Hunter 22 secs ago
Q: Re-write custom feature encoding function python

PasDeSenceI have a question regarding code quality and best practices. My task - to write a feature encoding function that will encode categorical labels, boolean labels as one-hot encoding, timestamps for further usage for ml training. Input - dictionary of several dataframes, each dataframe consist of s...

Q: Removing nodes from a linked list

awwwwwIs this a good way of removing all the nodes that contains a value x? This function takes as input the head of a list and has to delete all the nodes that contain a given value taken. If there is any better way of doing this can you please show them to me? typedef struct node { int val; ...

Q: First part of Black Jack game

Aaron PlylerI wrote this code for class, and its one of the first big projects we made with new concepts. It feels messy and I think it needs cleaned up. import random def main(): bank_balance = 1000 player_name = input("Please enter your name: ") while (bank_balance >= 25): print (f"Welcome {p...

3:03 PM
Probably it is better at CodeReview, but you should provide more informations: Are those three possibilities the end, or do plan to add more? If you want to add more, you should think about adding a new abstraction layer. One easy solution is to merge the lists first and then check the list. Also how big are the lists and how often is this function called, because you load all data in the memory. Your use-case is not clear, do you excpect some kind of bottleneck? — Frieder 15 secs ago
@instantDev - because you dont have a Question About a Problem at Hand, but instead Looking for a review there is a different place for this Kind of Question: codereview.stackexchange.com - but since your Question has Nothing to do with c# or Code at all, and you are asking for Input About your database structure Maybe this would be the better place: dba.stackexchange.comRand Random 8 secs ago
this could maybe make a good quesiton for codereview.stackexchange.com (supposed you turn it into complete and correct code), but here it is imho purely opinion based — idclev 463035818 16 secs ago
3:28 PM
Q: Format raw bytes in hex and ascii in manner like Wireshark does in pure C

kybThis function formats raw buffer output in manner as Wireshark and many others does: 0x00: 68 65 6C 6C 6F 20 77 6F 72 6C 64 02 6B 68 67 61 |hello world.khga| 0x10: 76 73 64 20 0B 20 0A 05 58 61 73 6A 68 6C 61 73 |vsd . ..Xasjhlas| 0x20: 62 64 61 73 20 6A 61 6C 73 6A 64 6E 13 20 20 30 |bdas...

3:48 PM
Q: C# - FixedWidthFileUtils - Serializing/Deserializing Fixed Width Files

Michael JonesIn order to play with reflection/generics, I created a utility to serialize/deserialize fixed width files. I am planning to separate out some of this into separate methods for easier readability, but the way that I'm handling this feels quite messy to me. Does anyone know of a better way to handl...

4:42 PM
@Duga rolled back by forsvarir
@MaartenBodewes I am familiar with the phrase "elephant in the room" - I presume bear in the room is highly similar...
Q: Best way to structure and dynamically instantiate subclasses

QuantumHoneybeesSo I have this setup where I have an AbstractBaseClass that defines an interface for some websites' rest APIs. Let's call this Messenger. I then define a bunch of subclasses which implement the superclass' @abstractmethod's. I want to set things up so that my main class would take in a list of m...

5:01 PM
@SᴀᴍOnᴇᴌᴀ OK, OK, I'll use the grey beast rather than the brown beast. Tnx.
@MaartenBodewes I'm not saying there is anything wrong with it...
I can write sentences that are perfectly fine w.r.t. grammar, but in the end I want to communicate :P
I think I might have combined a Dutch proverb with an English one...
5:41 PM
And Duga didn't report possible answer invalidation for this question: codereview.stackexchange.com/posts/237007/revisions
maybe we should get her some miracle grow...
@Peilonrayz @SimonForsberg should we report these (&^) on GitHub?
6:07 PM
@MaartenBodewes If you're referring to 'beren op de weg zien', that's not a related saying.
Does that mean I cannot marry Amelie?
@MaartenBodewes Reverse-translating of butchered sayings isn't my strong suit, so, uh, wat?
Sorry, movie reference. In the Amelie movie the prospective partner of Amelie is checked out by one of the persons in the bar if he knows the ending of many French proverbs.
I saw that movie a few years ago but don't remember enough to recall that
Oh? I vaguely recall seeing that movie and not understanding most of it.
The soundtrack was more memorable than the plot.
6:14 PM
What's there to understand? It's more of a humorous description of her life.
@MaartenBodewes perhaps as an ordained minster you can marry anybody...potentially every person you meet
Hah, now I have an image of a minister that walks on the Kalverstraat in Amsterdam marrying random couples :P
This probably means I watched too much Monty Python lately.
@MaartenBodewes I don't know how to find Monty Python any more.
6:19 PM
I tend to stay away from you tube.
@MaartenBodewes Ministry of Silly Couples
@pacmaninbw It's even on Netflix nowadays
@Mast 2 services I don't pay for.
Netflix and Youtube
Youtube is still free last I checked.
Youtube is free-ish.
Good adblocker helps.
6:24 PM
You pay with your personal data :)
@Mast depends on what you view.
+ using private window
I don't have a VPN, but private windows keeps things easier.
That won't hide your IP address.
6:25 PM
yeah, I know, it's not like that I use that either.
but it is a leak
Google must think there live 9 people here with the odd browsing habits and amount of devices, VMs and e-mail accounts I got in use.
Enough for them to figure out that there is a nerd living there, I suppose :P
But some of the browsing would give that away by itself.
I learned a long time ago I can't hide my data anyway, so, I'm only careful with the sensitive stuff. And even then...
6:28 PM
How do I find out what Google knows about me?
I don't like them having my data, but what the carp am I going to do about it?
@pacmaninbw An incomplete guide to get you started.
At least my browsing history is non-existent for Google, thanks to the Duck.
Hmm, almost everything collection misses Erik the Viking and Jabberwocky as they arenot officially made by the Monty crew as a whole.
@MaartenBodewes The 'Monty Python the Flying Circus' account has the extended version for free on YouTube.
@Mast This link blew away all my connections, or my ISP didn't like it.
Oh, dear, I'm not sure if I would want an extended version of that :)
6:40 PM
I was just reading an HNQ post on SO by Jabberwocky, that was confusing for a moment...
Seriously, search for the holy grail and especially life of brian is the best they produced. If you like it The meaning of life has brilliant parts and Live at the holywood bowl contain the best sketches. More you don't really need. Although you'd still miss the fish sketch.
@Maarten Roughly where are you located in our cold and stormy country anyway?
Q: in theory this code should work because it will check all combinations beetween 1 - 1000 and find the one, but my program keeps running with no result

dinajsdef sqr(number): return number ** 2 def triplet_check(a,b,c): if sqr(a) + sqr(b) == sqr(c) and (a < b) and (a < b) and (b < c): return True else: return False for i in range(1,1001): for j in range(1,1001): for y in range(1,1001): ...

I had it in my profile, but I'm not that nationalistic.
6:50 PM
Ah, that's quite a bit away.
Where are you located?
Near Zwolle
@skiwi is from near Eindhoven
There's a whole bunch of German regulars here as well, so we got it all sewn up.
I've had some jobs lying around there waiting for me. But I like Haarlem too much and my family is around here. And the sea.
No sea kajaking without sea.
@MaartenBodewes No, that would be like lumberjacking in the desert.
@Mast @Vogel612 I'll start flagging comments as as no longer needed there ... or a mod could just sweep 'em up...
7:03 PM
@Mast + 1625 rep please :(
two users voted to leave that question closed...
@SᴀᴍOnᴇᴌᴀ I normally just flag the question. I swear Vogel's a god when it comes to comment cleanup
@Peilonrayz 🆒
@SᴀᴍOnᴇᴌᴀ If clean-up is straight forward, flagging the message is usually preferred indeed.
@SᴀᴍOnᴇᴌᴀ Either I need glasses or that's really tiny text.
7:08 PM
That's like 3 pt even at 130% zoom in... :O
It's even smaller than the standard size of a 1-rule chat avatar.
7:49 PM
I honestly don't care either way, thanks to tooling improvements it's become easier to deal with a "thread" where every obsolete comment has been flagged
also: Yay, boosted my comment deletion stats :D
@Vogel612 Oh? When did that happen?
Good chance my information has been out of date for a while already...
user-scripts and a few months back mods got a bit of additional tooling together with a "timeline" button
that timeline was later rolled out to users overall
Yes, that button was a very welcome addition.
@Vogel612 Thanks
You also might consider posting some of this to the code review stack exchange, I don't know if they can help you or not, but particularly your use of View.x and View.y seems to me, is non-standard and will lead to confusion. — greeble31 8 secs ago
@greeble31 Sounds like the program doesn't properly function yet, so it's too early for Code Review. — Mast 26 secs ago
8:29 PM
SO is considered to be a problem solver. If something doesn't work post it for an answer. Code Review is about improving code that works. Suggest posting there. — SmileyFtW just now
It's not a code review site. Ask about specific issues, with well defined inputs and outputs. — duffymo 18 secs ago
Q: Transforming NodaTime ZoneIntervals, version 2

Rick DavinVersion 1 may be found here. I have implemented the suggestions by Jon Skeet, plus some of my own. Key differences between versions: ZonedDateRange class is now immutable. LocalDate variables no longer are named with "Day". Some ToString() methods were added. ZonedDateRange.cs using System...

8:47 PM
You should probably post this on codereview.stackexchange.com. — Fiddling Bits 15 secs ago
Q: Program that outputs the chords in a given key

MrMineHeadsI am built a program that will give the 7 chords that are found a given major or minor key. My program takes in first a key (C, Ab, F#, etc.) then takes in its mode (Major (input is 'M') and minor (denoted by 'm')). From there the program builds the chords in that key in a specific manner dependi...

9:32 PM
Q: Calculating a Score in VBA based on selected ShapeStyle. Is there a better/shorter way to do this?

Michelle I'm calculating a score based on whether or not certain colors shape is selected. Some of the shapes are in groups, some are not. For the shapes which are in groups, only one of them will count towards the score. I have figured out how, as you can see below. However, I have 9 more shapes/scores t...

9:52 PM
Q: Refactoring try blocks with async/await

FelixI have two functions which I would like to simplify. They have largely the same logic, but one is asynchronous and uses one await in a try block. I'd like to have the logic in one place, but could not figure out a clean way of doing that. Any suggestions? from requests import get, HTTPError # D...

Q: Improvements suggestions to this hashing algorithm?

Thiago AntunesThis is my first hashing algorithm. My goal is to be simple and performatic. How can I improve it? char *hash(char *input){ // Alphabet and length const char alphabet[] = "abcdefghijklmnopqrstuvwxyz"; const int alphabetLen = sizeof(alphabet)/sizeof(char) - 1; // Randomization va...

Q: Copy and delete node in a linked list

awwwwwI have got some problems with this exercise I have to create a list in the main, pass it to the function that takes it, removes all the duplicates counting how many they are and prints the value of all the single nodes with how many times it was repeated in the first list. So imagine having a lis...

10:12 PM
Q: Strange NullPointerException

Ludwig von Drake I am currently working on a project for uni. This is my run method in my class Session. public void run() { CommandParser parser = new CommandParser(this); List<Command> commands = parser.initialiseCommands(); while (running) { String input = Ter...

Q: file manipulation in C

Abstract Approach#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main(void) { FILE* file; //open file of integers; indicies followed by attributes file = fopen("file.txt", "r+"); if (file == NULL) { printf("file not found\n"); return ; } int index; ...

@CaptainObvious it likely wouldn't work but maybe the site logo should have the word "working" above the words "Code Review"...
10:50 PM
possible answer invalidation by Thiago Antunes on question by Thiago Antunes: codereview.stackexchange.com/posts/237107/revisions
11:13 PM
Q: Password Manager

Chris Girvinall, This is my first post on here, so please forgive me if this is the wrong place or incorrect way to go about this, and if so, some direction as to where I should be posting this would be greatly appreciated. To make a long story short, I'm new to coding and Python 3 was the first la...

11:29 PM
@CaptainObvious Super off-topic

« first day (2474 days earlier)      last day (1399 days later) »