« first day (2634 days earlier)      last day (1383 days later) » 

12:00 AM
RELOAD! There are 6836 unanswered questions (89.8580% answered)
 
12:42 AM
Welcome to Stack Overflow, Nathan. Stack Overflow uses a Q&A format, so you have to ask a specific technical question before anyone can help you.Unfortunately, "can someone look at my code" isn't a specific technical issue -- it's a request for code review. By the time you post, you should have already isolated the part of your code that's failing. It would also help if you posted some background info, like what your homework is supposed to do. — MarsAtomic 15 secs ago
 
1:37 AM
0
Q: State Machine with pre-validation

J. DoeIm developing a feature that has to execute ordered async task. However it's possible that the system has to rollback to perform pre-validation tasks which include getSession and getToken. I've created 2 state machines to retain current internal state/sequence. These solves problem because if pr...

0
Q: LinDB: A dictionary type database

LinnyAs an exercise, I've decided to write a lightweight, dictionary type database. Below are some of the features I've implemented: Overwrite Inserting: I allow the user to determine if they want to overwrite existing data, should they insert a pair that already has a value associated with the key o...

 
2:14 AM
@PeterDuniho CA2008 is an code analysis condition from Microsoft.CodeAnalysis.FxCopAnalyzers. I need to satisfy (or suppress) all code analysis warning to pass code review. — Ozzah 23 secs ago
 
2:25 AM
Solves the problem but I'd mention that this is basically a hacky antipattern that simulates an array and not really the solution you'd want in your codebase. This sort of thing should never pass code review. — ggorlen 22 secs ago
 
3:13 AM
If you are just creating a list with each element 'clamped' in a range, then don't understand the purpose of the alist.append(min), alist.append(max) and alist.sort() calls. Also, min and max are not good variable names since replaces built-in functions and so confusing the code reviewer. — DarrylG 6 secs ago
 
4:04 AM
@SimonForsberg I'll have a look somewhere this day, but it might be hectic so please be patient :-)
@SᴀᴍOnᴇᴌᴀ All it needs is one more VTC.
 
5:00 AM
This more of a "Code Review". There is a more specific website for that, but you can do things like str.replace(['1','2','3'],['a','b','c'], regex=True).map(...)David Erickson 32 secs ago
 
5:15 AM
@Mast thus why I used the phrase full count
 
5:42 AM
@SimonForsberg Iffy at best, since they seem mainly confused by the code and your approach instead of providing insight. They could've asked for clarification in the comments instead.
> I'm sure if I just a smidge of BF I would be able to understand ALL of the documentation and be able to see the code would help verify what you have written.
I mean, what...
I can understand why they're confused, it's not an easy language and you have some Brainduck-specific syntax in it that you know better than anyone else so if you don't know the language at all it will make you scratch your head, but that's a good reason to leave the question alone or leave a comment.
It looks like he's praising your documentation, disagrees with your method of asserting and doesn't understand how Brainfuck works.
> Took me to realize that you're calculating each digits of the value and displaying the CHARACTER. I don't know if this is a limitation of BF but this seems wildly inefficient.

...

Every place holder beyond that will be a length made of some composite of the higher precision values.

Since you're writing out digits by digit, this is at least a consideration. Though may again be limited by what BF can actually do.
 
Hey.
 
This looks like they either misunderstand Brainfuck, misunderstand your approach or actually get your approach and suggest a better one. I haven't had enough coffee yet to decide which, it's not that easy to parse.
@FatalSleep Welcome to The 2nd Monitor.
 
Thanks.
Quick question.
Which is faster?
Also which is faster: !condition or 1-condition?
 
6:16 AM
@FatalSleep That's not what we do here, please take a look at the on-topic help page.
 
@Mast
Sorry couldn't find a better place to ask.
Chat says "general discussion."
 
 
1 hour later…
7:23 AM
@FatalSleep About the site, yes.
And if someone interested in it would be available, we'd probably tolerate it. We tolerate a lot of things as long as nothing pressing is going on.
But you're dumping a picture here, not even a code snippet, without explaining what it's doing, without context.
You have two horses. Race them.
What language is that anyway, JavaScript?
I don't recognize the (x)?y:z notation.
 
8:02 AM
setting the value to clear will not clear the value but will assign the string clear to the ButtonReset control. what you need to do is create a function that will handle the ButtonReset click event, and within that function have your code there to reset the values of each control, something like this.Textbox1.Clear();``this.Textbox2.Clear(); ect... if you have a lot of controls, try applying this solution codereview.stackexchange.com/questions/200793/…AndrewE 9 secs ago
 
Monking
 
 
1 hour later…
9:14 AM
-1
Q: php template mvc

MaksStonkafrom several days i learning about mvc, and i do some code but idk if that is correct. I will be greatfull for some tips to get this code better Here is my github respository https://github.com/DanielPeleton/mvc-php class/db.php <?php class db{ public static $host = ''; public static $us...

 
10:02 AM
0
Q: What one should consider about exception handling?

escartaWhat can I improve about this code in order to be production-ready? I'm not worried about security but about errors that could occur. What exceptions should I catch? I feel overwhelmed about exceptions because I feel that there are a lot of exceptions that one can consider. What else should I do?...

 
10:22 AM
"best approach" is subjective. This question is not a good fit for Stack Overflow because it is opinion-based. I suggest that if you want help with this, write one implementation yourself and post it on codereview where people will critique your implementation, and perhaps provide a better one. — Michael 45 secs ago
possible answer invalidation by πάντα ῥεῖ on question by MaksStonka: codereview.stackexchange.com/posts/245741/revisions
 
11:00 AM
possible answer invalidation by Dodzi Dzakuma on question by Dodzi Dzakuma: codereview.stackexchange.com/posts/245729/revisions
 
@Duga that is ok
 
11:17 AM
@Mast For future reference it's a C style ternary - y if x else z in Python
 
@Peilonrayz Writing something terse even more terse, yuck.
I was going to say I didn't know it was legal, but we're talking about C here.
 
AFAIK Python got some backlash because it deviated from the norm as the C style ternary is found in a lot of languages: C, C++, C#, Java, JavaScript...
It seems Scala and Rust have followed Python but stuck with an xyz order - if x {y} else z
 
11:34 AM
Looks like it.
 
possible answer invalidation by Dodzi Dzakuma on question by Dodzi Dzakuma: codereview.stackexchange.com/posts/245729/revisions
possible answer invalidation by greybeard on question by MaksStonka: codereview.stackexchange.com/posts/245741/revisions
 
0
Q: I'm new to coding and I wrote this text-based adventure game.Is this code good?

Bhawesh KumarHere is my vampire based text adventure game. I started learning python and looked up google for some good projects to practice on. I wrote all this code myself after checking out some examples on the internet. import time #added to enable pause #A text based dracula survival game #possible ans...

 
@Duga Not necessarily.
@Duga Just formatting.
 
11:54 AM
Did a programming "assessment" for an interview -- "you have 90 minutes", took <20...
 
@DerKommissar Are you sure you're applying for the right position?
 
@DerKommissar lol
 
We had a video call on Wednesday and they said "with your level of skill you'll probably find it amusing", I think they knew it would take me very little time.
I think I had 1 hour 11 minutes and 30 seconds left when I turned it in, and honestly that would have probably been 1:15+ if I hadn't rewritten all the answers 3 times.
 
If you got the time to spare, might as well make it great.
 
That's what I said. I started with imperative loops on all the C#, then I remembered that they asked be about a bazillion LINQ questions in the video conference, so I switched to LINQ for everything
I had enough time I could have built both answers, and a state machine in each question to pick either LINQ or non-LINQ at random.
But that's not the point.
 
12:13 PM
1: you may want codereview.stackexchange.com instead. 2: you may want to profile it before optimizing, not sure exactly how it works but I know that's how you get an idea of where in the code is taking lots of time, it's possible you have to load a lot of massive html files and by doing it all in sequence you get slowed down. — Tadhg McDonald-Jensen 23 secs ago
 
@DerKommissar Denmark?
 
No, remote here in the U.S.
They're in TX, I'm in OH.
 
0
Q: A proxy replacement for getters and setters

einpoklumHave you ever written proxy objects, instead of using a setter and a getter method? In that case, I'm interested in your opinion on the following design for a templated proxy: #include <type_traits> #include <utility> template <typename Handle, typename Getter, typename Setter> class proxy { pub...

 
12:30 PM
Medi Madelen Gwosdz on July 20, 2020
Traditionally, linters make sure your code is clean and easy for teammates to read. They check for errors, bugs, style, and more. While they are more prevalent in dynamic/interpreted languages, they are not limited to them. Getting code as tidy as possible is the goal, but linters can also take some time getting used to, be a distraction, and might even be impossible to introduce to old, large code bases. We look at why they might still be worth your time.
 
12:50 PM
0
Q: C# Performance in a CircularBuffer architecture in size and time

M.L.I need to speed up a circular buffer that has space and time requirements. Each cell in the circular buffer represents a list of N elements to be sent. The shipment takes place if the list reaches N elements, or if the elapsed time exceeds X ms. At the moment I have found this solution, but I am ...

 
@DerKommissar Nice.
 
1:14 PM
0
Q: Python REST API and Mongo - Aggregation Pipeline/Stage classes

Rfroes87This has been my approach for "simplifying" MongoDB aggregation queries in a pythonic syntax - was my intent, at the very least: from datetime import datetime, timedelta class MatchStage(list): def _get_day_range(self): current_time = datetime.now() return (current_time - tim...

 
1:38 PM
1
Q: Winforms Diary/Jounral (c sharp)

Princess WilsonI have created an app that helps users manage their day to day activities. The app allows users to add, edit and delete notes. The app also allows a user to select a date and see what notes are associated with that date. The application saves all data in a text file so the application remembers i...

0
Q: A Sieve of Eratosthenes

JKRHI have written this Sieve of Eratosthenes. This is a bit of software that will find all of the prime numbers between 2 and n, where n is a user-defined value. The code does seem quite bloated and any help at making it more elegant would be great. I know that I am not very good at list comprehensi...

 
@CaptainObvious Surprised that title was still available.
 
1:50 PM
possible answer invalidation by Another Noob on question by Another Noob: codereview.stackexchange.com/posts/245702/revisions
 
2:26 PM
0
Q: Maybe with a structural pattern matching interface

PeilonrayzWith a reference implementation for PEP 622 now available in a Jupyter playground, I decided to copy over my favourite feature of Rust in full to Python. Note: this won't be released until Python 3.10 but there is a reference implementation available. Given that I do a lot of interacting with JSO...

 
@Rotora I am curious why you voted to keep open: codereview.stackexchange.com/review/close/134085
 
@pacmaninbw I never intended for the user to translate the code, but it wasn't off-topic in the first place.
 
@konijn (Double checking) That won't ping them unless you've invited their chat profile here.
 
Just bloody hard to review in Italian.
But that's probably subjective.
We must have the question in English, but we don't enforce the code to be English.
So a description would've solved it too.
 
Somebody voted to close, it is in the VTC queue.
 
2:37 PM
@pacmaninbw Could be Greekpie (Don't have / know Greek keyboard)
 
@Peilonrayz On our keyboards we'd write that as panta rei.
 
I don't know Greek either :(
I'm a classic Brit, English or confused looks
 
possible answer invalidation by Matias Chara on question by Matias Chara: codereview.stackexchange.com/posts/245727/revisions
 
@Peilonrayz Don't feel too bad, I don't know Greek or Latin either. I can sound out Hebrew, I understand some Spanish I can barely read French. I understand some Cantonese phrases (girlfriend from Hong Kong at the university).
4 Years of studying French.
 
@Peilonrayz I used to know a guy that was obsessed with languages, so I know how to spell my name in close to 10 different scripts.
Utterly useless knowledge.
2
 
2:50 PM
0
Q: Checking String with is_numeric in C

N. DogacI am a newbie in stack exchange code review. I just wrote a C function where the function checks if the given string is numeric or not. What do you think about my way of doing this? And could this be done in other ways? int is_numeric(const char* str) { while (*str) { if (!isdigit...

0
Q: Using struct instead of enum

Matthias BurgerAt our office there is this piece of code (the original author isn't employed anymore, so I can't ask him). Does anybody have an idea, what he did there? Is there any advantage of using this struct OrderDirection instead directly the enum Direction? public struct OrderDirection { private enu...

 
@pacmaninbw In England you have 2 years compulsory French language education, and we also learnt it in primary school for a year or so. I know like three words - un deux trois
 
Obviously you never used it, or you would remember more.
FYI - When someone curses you in a language you don't know, you quickly learn some parts of it (Cantonese).
 
3:06 PM
Probably yeah. I think I know more German / Austrian words for food than French. If you ever visit Austria (and possibly Germany) I recommend trying Kaiserschmarrn mit Apfelmus, Gröstl and Schnitzels 👌
 
"Gröstl" might be "Rösti" depending on where you are
and most of that is more "southern german cuisine", though you get Schnitzel everywhere
 
I've Googled "Rösti" and that looks way different. It probably tastes about the same tho.
 
3:31 PM
@Peilonrayz PHP also has the "Elvis operator" (i.e. ternary with middle expression omitted)
 
Wat
 
and similarly, PHP 7 adds the null coalescing operator - i.e. ??
(plus the spaceship operator)
 
JS has foo = bar || baz
 
From my little use of C# I do like the null coalescing operator
 
I was going to make that comparison with short circuit OR in JS
 
3:36 PM
@konijn tbf I do use that in Python quite a bit. foo = bar or baz
 
-1
Q: How do I Create Several NoSQL Stores and Access Them (Flutter/Dart)?

Joseph SchmidtI am trying to use Sembast as a local database for an app but I am having trouble creating and accessing different "stores" in the database. So far, I can initialize and access a single store but I want to be able to create 3 different stores and access each of them when needed. My code so far is...

-1
Q: C binary search signature

elyashivThis is a question basically just on the signature of the function. I want to implement a binary search in c. A quick signature will be: typedef int (*cmp_t)(void *a, void *b, void *ctx); void *bsearch(void *arr, size_t arr_size, size_t elem_size, cmp_t cmp, void *ctx); Now, I don't want to acc...

 
3:49 PM
@Peilonrayz Can't go wrong with schnitzels
3
 
possible answer invalidation by N. Dogac on question by N. Dogac: codereview.stackexchange.com/posts/245754/revisions
 
@SᴀᴍOnᴇᴌᴀ Is that a play on elif is?
 
@Mast I believe some users think it looks like Elvis Presley
(from that linked SO answer)
I wonder if BalusC did the superimposition manually, or found that image...
 
...
 
TIL'd about quiff
> "Give a man a fish and you feed him for a day; Teach him to use the Internet, and he won't bother you for weeks!"
 
3:58 PM
MOnking
 
@SᴀᴍOnᴇᴌᴀ Instead, he'll bother other people on the internet.
5
 
4:15 PM
@Mast Yeah, they're pretty solid
 
4:26 PM
0
Q: Remove duplicated functions inside different if within a function?

Menai Ala Eddine - AladdinI have a function : function __throwError(func) { if (func.length === 1) { function passNumber() { func(0); } function passString() { func("item"); } function passEmptyArray() { func([]); } function passUndefinedOrNull() { func...

0
Q: Game Event Messenger based on the Observer pattern

Ryan SwannI am making a game event messenger based on the observer pattern and I'd really appreciate some feedback on this please. The intent behind it is that I am sending in a function pointer so that it can work for the broadcasting. Also using the subscribers memory address as a way of detecting it for...

 
@CaptainObvious CNI
 
4:48 PM
@SᴀᴍOnᴇᴌᴀ And buried.
 
As your code works, and you are asking for review in terms of best practice, efficiency, ..., this question is more suited for Code Reviewtrincot just now
 
5:09 PM
@SᴀᴍOnᴇᴌᴀ Wat? "Went to bury"
 
I figured that would come up... I didn't see it on urban dictionary like I expected...
I meant Way to Be
 
Fair :)
 
0
Q: An emotion recognition test I designed using Pygame

Theamazingone1for my dissertation (in psychology) I created an emotion recognition test that displays an image of a face displaying a certain emotion for a set time, then allows participants to press a button indicating which emotion they feel was being displayed. This was my first major Python project - and I...

 
@SᴀᴍOnᴇᴌᴀ Isn't urban dictionary a joke?
 
@Mast I check it for some words and the entries are accurate but over the top. Except if it's the name of someone.
Like to get the top definition you need to be funny so they make the entries jokes
 
5:28 PM
@Mast much of it is... perhaps I should have used the modifier "even" before the word "see"
wiktionary might be a better source for acronyms and slang
at least more likely to be SFW
 
0
Q: General Programming Practices: When should you use a function or a comment?

HugernotTL;DR - What are your guidelines for when to comment a block of code or when to make a function out of that block of code? Reading through my other classmates' code, it seems like a lot of them use an extreme number of functions to do what seems to be small task. These functions are often called...

 
@CaptainObvious no
 
5:44 PM
@SᴀᴍOnᴇᴌᴀ Why?
 
> My question for all of you is this: What are your personal guidelines for when to comment a block of code or when to make a function out of that block of code?
sounds too opinion-based
plus it isn't clear that the OP wrote any of that code
 
@SᴀᴍOnᴇᴌᴀ Seems aite. I found a word that's on UD but not on Wiktionary
But it has a lot
 
> Reading through my other classmates' code, it seems like a lot of them use an extreme number of functions to do what seems to be small task.
 
@SᴀᴍOnᴇᴌᴀ Yep 🔨
 
if we knew that the OP wrote the code blocks and the narrative was changed to be about LCM code without the opinion-based question then maybe...
 
5:49 PM
@SᴀᴍOnᴇᴌᴀ FWIW I personally think this is fine.
It's grey for sure, but I think it's ok
 
also, look at the title
 
Comment & VTC = posted
 
which I'm sure a high percentage of us are familiar with.... I've recently become more acquainted with that
 
@SᴀᴍOnᴇᴌᴀ My interpretation of the rules is that that's around questions with minimal code or when the code doesn't matter (just there to be able to post at all). I'm not sure that's the case here, we can give actual best practice advice here unlike in the BP questions we've said no to
At the end of the day all reviews are just what our BP are
 
so should we update the title to be about LCM code?
oh I see you commented, requesting changes including the title
 
5:56 PM
You can do. I'm just waiting until it's on-topic :)
 
hmm
I can but don't feel like it
 
That's chill :)
 
it seems that today James Khoury got back in the close vote queue for the first time since 2014
 
6:26 PM
@Rusurano, your question starts by saying your code works, and that it's running, even on high frequency. If you feel it doesn't work, then the question should be about that (not about performance, efficiency). Also in your comment you are focussing on speed, not on an error in your code. This question is thus more suited for Code Review. — trincot 48 secs ago
@trincot shall I create a new question in Code Review then, or are there any other options to handle the movement of the question correctly? — Rusurano just now
 
6:53 PM
This question seems suitable for codereview.stackexchange.comCedric Zoppolo 42 secs ago
 
7:38 PM
0
Q: Add values from a dictionary to subarrays using numpy

Carlos Eduardo CorpusI'm working with numpy arrays and dictionaries, the keys of the dictionary are coordinates in the numpy array and the values of the dictionary are a list of values I need to add in those coordinates, I also have a 3D list of coordinates that I use for reference, I was able to do it, but I'm creat...

 
8:16 PM
 
Welcome. Probably it'll be better to ask this on Code Review. — Olvin Roght 49 secs ago
@OlvinRoght 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?". In the current form the code above would likely be closed as off-topic because the code to be reviewed is not embedded in the post. — Sᴀᴍ Onᴇᴌᴀ 5 secs ago
 
@Mast perhaps you saw but Rotora nailed it shut
 
9:14 PM
0
Q: Is associating a file stream with a python class instance, and then closing it on __del__ a good idea?

bool3maxI've got a class that represents a parser of a specific file format. Upon initialization, each class instance is associated with an open file stream, e.g. class A(...): def __init__(self, path): self._reader = io.open(path, 'rb') ... # methods that utilize self._reader to p...

0
Q: Python code takes too long to respond

walid akkaI'm writing an async api wrapper for dev.to using aiohttp module for faster interaction with the API and the problem is some parts takes too long to be done like fetching all articles I'm sure that creating new session each request make it slow , it takes 40s to 1min to respond but I don't know ...

 
Code review is probably the least effective way to troubleshoot such, when live data can easily point out what might be wrong, docs.microsoft.com/en-us/iis/troubleshoot/performance-issues‌​/…Lex Li 7 secs ago
If you have working code that you think could be improved, see Code Review. But you should also search for hex features in the standard library. — jonrsharpe 41 secs ago
 
9:45 PM
@CaptainObvious invalid syntax for both Python 2 and 3, right? class A(...):
 
10:02 PM
0
Q: I have a input grid with more than 40 input-fields hardcoded

DarjuschI am new to flutter and i managed to build a working Grid which does what i want it to do but the code is a duplicated hell and i didn't manage to create it dynamically while still keeping track of the input-fields and its input. I really could use some help! import 'package:flutter/material.dart...

0
Q: Is there a better way to avoid repeated 'Len == 1' when interpreting booleans from strings?

user227432My solution to string interpretation is pretty fast. However, I worry about repeated if (Len == 1). That might make the function bigger in the executable. How can I improve my function, to not be as redundant while checking if Len is equal to 1? #include <ctype.h> signed char BoolFromStr(const ch...

 
10:26 PM
0
Q: LeetCode 906: Super Palindromes

EmmaI'm posting my code for a LeetCode problem. If you'd like to review, please do so. Thank you for your time! Problem Let's say a positive integer is a superpalindrome if it is a palindrome, and it is also the square of a palindrome. Now, given two positive integers L and R (represented as strings...

 
@SᴀᴍOnᴇᴌᴀ No, ... is valid in Python 3. However it results in a TypeError, with a funky message that I don't really understand. Either way it's borked.
 
yeah I saw the error when I tried running it in on an online repl tool
 
 
1 hour later…
11:38 PM
0
Q: Full Adder in Verilog

Ellen SpertusI'll be teaching Computer Architecture at the undergraduate level this fall and want to make sure that my example Verilog code follows best practices. I welcome any suggestions, however minor, for improving this code, which runs at EDA Playground. Our textbook is Computer Organization and Design ...

 

« first day (2634 days earlier)      last day (1383 days later) »