« first day (2385 days earlier)      last day (31 days later) » 

12:00 AM
RELOAD! There are 6250 unanswered questions (90.0767% answered)
2 hours later…
2:06 AM
codereview.stackexchange.com is a more suitable venue for this kind of broad question. — kaya3 54 secs ago
2 hours later…
3:46 AM
@kaya3 Code review requires working code. This code doesn't work (according to the title). So this is not a good fit for code review. — user3386109 24 secs ago
1 hour later…
5:03 AM
Q: How to Replace Values in a Python Function

JessI want to write a function that adds points iteratively. The way I tried to do this was if my inital points were P and Q, I calculcate P+Q with some elliptic curve formulas which may or may not be correct, but that's not what this question is about. Then, I want to replace Q with P+Q, but the ...

Nice, I got an upvote and accept of a question asked and answered 5 years ago :-)
1 hour later…
6:33 AM
Q: Pong game in Python with tkinter

SrivathsI created a pong game, but it doesn't have methods to store scores yet and also might have some bugs. It is also very slow. The code: from tkinter import Tk from random import choice import os def clear(): os.system('cls' if os.name == 'nt' else 'clear') class Pong: def __init__(self)...

6:56 AM
Noice, about 1K in rep increase
7:54 AM
Q: I need to reduce the execution time from my code which verify the data from 2 apis

Ali KhanI am new to python. I have been given a task to verify the data from 2 apis which give similar data but in different format i.e. Json and XML. I have written the code but it is taking too much time to execute. I am unfamiliar with formatting and etc so please help me here. (I am excluding urls an...

8:14 AM
Q: Is that code a false positive in cppcheck?

skratchi.atI analyzed some code with cppcheck for errors and code quality. I came across an error which I think is an false positive. I tried a minimal code example and I would like some expert opinion on that. #include <string> #include <vector> #include <iostream> std::string func() { std::vector<char>

That doesn't really look like a Minimal, Reproducible Example. And if the code is working (very important) then perhaps this would be better of on the Code Review SE site? — Some programmer dude 31 secs ago
8:55 AM
Q: Averaging quaternions

remy_rmTo compensate for shaky hands when holding a mobile device i'm averaging the rotation of the phone over the last n (in this case 16) frames, and setting the camera's rotation to this average. This works smoothly and allows the user to look around in 360° by moving their phone around without getti...

Would you look at that: some people are leaving sensible comments when closing a question.
There appear to be some magic numbers in the code. Do you mean base everywhere you use 10? Would you please comment your variables so that we know what they are supposed to represent and please comment your code so that we know what you are trying to do? The code makes no attempt "to collect them in an array", no array is declared. As it stands, this code is not ready for review. — Peter Jennings 8 hours ago
@Heslacher That's always nice, to know the knowledge you shared years ago is still appreciated by passers-by.
9:25 AM
Sure, depends on how exactly you want your code to behave. {...}.get(x, lambda: None)() is also a possibility. In other words: there are many ways to skin this cat. The best would be to post more complete, concrete code at codereview.stackexchange.com. — deceze ♦ just now
9:35 AM
Q: NLP sentiment analysis in Norwegian

GrevioosPlease keep in mind that I am very new to data science and completely new to NLP! I am trying to create a model to classify customer reviews as either negative or positive. However, my main problem is that most of them are in Norwegian, which seems not to be very well supported. I have found this...

1 hour later…
10:36 AM
Q: Excel VBA code that writes to a Table - much slower than writing to a simple range

Mike LangstaffI have a piece of code (below) that checks a data table (45,000 rows) to see if the row matches any entries in a range elsewhere on the workbook (using custom functions). The routine then creates an array of Flags and writes that array back to a field in the table - so a series of Sumifs formula...

11:05 AM
possible answer invalidation by rogday on question by rogday: codereview.stackexchange.com/posts/232106/revisions
11:23 AM
What forces you to useOffice 2019 x64an not Office 2019 x86`? Stay on x86 as there are some traps on switching to x64 (e.g WinAPI calls). For x64, e.g. search on codereview.stackexchange.com/search?q=%5Bvba%5D+datepickerComputerVersteher 40 secs ago
Q: Plot timings for a range of inputs MkII

GraipherIn order to celebrate questions getting more reputation points per upvote, I thought I would revisit my previous question, Plot timings for a range of inputs. Since the time of that original question (more than two years!), this code has undergone quite a few changes. I incorporated some of the ...

12:07 PM
I think you should move this to codereview.stackexchange.comNick 45 secs ago
Questions about working code should probably be posted on Code Review, not SO. — underscore_d 35 secs ago
12:27 PM
@Duga Rolled back.
@pacmaninbw If I see it correctly then it should be rolled back to revision 3.
Rev 4 added the “Update” and rev 5 was only a minor change after that.
@MartinR Yes, it probably should be. Did you already roll it back to 3?
Done now.
@MartinR Thank you
1:09 PM
@Mast How much of a boost did you get from the change in question values?
~sigh ...
how is a 15 minute build acceptable to any sane development team??
nice -n 20 mvn -q clean install -DskipTests=true -Dmaven.javadoc.skip=true  674,19s user 16,57s system 72% cpu 15:58,41 total
1:39 PM
Q: for of loop that stops at last object of array

Peter BoomsmaI have a for of loop, for each item in the childElements HTMLCollection I want to subtract the height of the elements from the parent height. let height = element[0].clientHeight; const childElements = <[HTMLElement]>element[0].children; let i = 0; for (const childElement of childElements) { ...

2:12 PM
Greetings, Programs.
possible answer invalidation by astef on question by astef: codereview.stackexchange.com/posts/231311/revisions
Q: Fluent code generation library Part 1 - interface structure

DenisSince T4 templates are removed in .net core I needed a way to generate some files such as unit of work and dtos, I thought it'd make a good home project so I made a library to do that. In contrast to the T4 templates this is not self executable in it's own file, but it requires a console applicat...

???? That's not a question. Post it here- codereview.stackexchange.comSid 18 secs ago
2:28 PM
oh wow, I got 1.5k rep from the question vote adaption
I got about 1.6-1.7k
Looks good. I think that is the best you can get. I wouldn't worry about optimizing it anymore unless you are facing any performance issues. Note that codereview.stackexchange.com is the right site for such questions. Also, you shouldn't post this as an answer, you should edit your question to include it. You'll get downvoted, I suggest deleting this answer and including it in the question itself. — Nikhil 56 secs ago
@Vogel612 3k or so. Got my level 20 privs back, finally.
How's everyone?
I got “only” 660 (and lost 6 places in the overall ranking). Too few questions! (But proud author of the top-voted unanswered question :)
@SimonForsberg About the comment, why not just show the close reason right away? "Your question is in danger of being closed for X reason: N votes have been cast."
2:42 PM
@pacmaninbw 3k
From slightly over 8k to slightly over 11k.
@MartinR That's what happens when you get good at a language or use an obscure language.
None of my latest C# reviews have been worth it for me.
I might have an Angular post sooner rather than later though.
@CaptainObvious RBA
@pacmaninbw But I have 48 questions, 23 of which at score 11 or higher. That's some points.
3:00 PM
Q: Automate html file edition with python - Change the author

LouisonoHello I would like to use python to change the author of an html file, in order to do so I have written a few lines. First I have used the HTMLParser class from the standard library to make a class that indicates which line of the html page needs to be changed. from html.parser import HTMLParse...

3:10 PM
@Mast Congratulations on godhood.
Vicki Boykis on November 14, 2019

In Pycon in 2014, Guido van Rossum, the creator of Python and, at the time, the Benevolent Dictator For Life of the language, stood on stage in a shirt that had a large 2.8 written on it in block letters, with a big red no entry sign through it. “It’s time to move on to Python 3,” he said, telling the audience that they should start adopting the new version of the language into their workflows. 

After many years of hard work towards that goal from the core committers, and surrounding community of libraries, Python 2 is finally at end of life. January 1, 2020, according to pythonclock.org, is the drop-dead date for support of Python 2.  …

@Mast I have 15 questions and gained about 480 pts.
@Vogel612 Lunch time.
Could SE have increased the value of questions to get some more people at moderator level?
Q: Chaining statistics in a dice queue

Wim ten BrinkI've previously came up with the question "Rolling dice in a method chain" and was interested if this could be improved. It could, so now I have this class: public class DiceQueue : IEnumerable<int> { public int Sides { get; } internal Random Rnd = new Random(); public DiceQueue(int ...

@pacmaninbw lol, not even a Trusted User (20k+) yet.
But it helps.
@Feeds Because porting all those old libraries takes forever and new stuff keeps crashing.
We recently had a pip problem, is that solved yet?
Besides, support is dropped. That doesn't mean much, since Python 2 is so stable it won't need fixes (and if it does, workaround it).
As long as you don't need Unicode, shrug
And it's becoming more and more static-typed. Which can be fine, if you like that kind of thing. If you like that kind of thing, Python often isn't the first choice though.
3:27 PM
So what you're really seeing, is that Python 2 users don't move to Python 3 but pick-up a new language on the side.
And still use Python 2. Because it works. And it won't magically stop working next year.
It's still fantastic.
And backwards compatible.
Very old Python scripts still run fine on the latest 2.x
3:43 PM
I'm trying out the razor pages in asp.net core, what's your preferred way of exposing data to the view? Do you use a separate ViewModel which you wrap in the page model or do you inline them directly in the page model :?
Can you give me an example of both ways?
I (used to) do ASP.NET MVC (which is super similar) for a living.
Technically, I still do--if the client uses it.
public class UserModel : PageModel
public UserViewModel ViewModel {get; set;}


public class UserModel : PageModel
public string Name {get; set;}
public int Age {get; set;}
Pardon the formatting, just wrote it here
And then the UserModel is what handles the get/post, etc, right?
It really depends on the data you are modeling.
@Hosch250 Yes
For a simple one with 1-3 fields, I'd probably do the second version.
3:46 PM
@Mast But you do have access to some moderator tools now.
That does sounds reasonable, however it's a bit inconsistent and I wonder if it's even worth it to do the second version
That basically does what I recommended.
@Denis Well, if you have a single string value, for example, why bother wrapping it?
That's exactly my current case :D
I'd not wrap it in that case. Basically, model the data.
If you are returning a single object, wrap it.
3:48 PM
And it felt kinda wrong to introduce a class to host that 1 string
If you are returning 2 or 3 distinct items, don't necessarily wrap it.
If your single value is already typed by the framework, don't wrap it.
If you have a User, don't expand it inline--return an actual User object.
That's a good advice ty
If you have a string pageSlug as your data--the string is the object. It just happens to be a framework type.
Funny thing, that's one thing I have to argue with people about a lot. They are all "them vs us" when it comes to framework types vs our own types. They don't realize that they are all just types, but the framework helps us out by having experts write fast, safe versions of very common types.
Here is another calendar: Excel Custom Calendar ControlTinMan 1 min ago
4:05 PM
@Mast CR for me went 16.8k to 19.4k
4:20 PM
possible answer invalidation by Wim ten Brink on question by Wim ten Brink: codereview.stackexchange.com/posts/232387/revisions
4:38 PM
Q: Shoe shine shop model in Rust and C++[2]

rogdayI've just refactored my Rust and C++ code which simulates the shoeshine shop model from this question. What else can be improved? C++: #include <iostream> #include <iomanip> #include <random> #include <numeric> #include <algorithm> #include <array> #include <queue> ...

We use Gerrit Code Review (gerritcodereview.com) - it uses intermediary refs/for branches, where changes stay until they have been reviewed by another developer, and verified by Jenkins. Only then can changes be merged into the actual refs/heads branch. Works quite well, but is not a small thing to introduce. — sonicwave 5 secs ago
4:57 PM
5:18 PM
This question looks more appropriate for the code review site — Óscar López 35 secs ago
Q: Interview Questions: Fibonacci & Array Balance Point

Eli Livshitz Task #1: Return the fibonacci value at a given index. e.g: input: 6, return: 8. public static fibonacci(input: number): any { let result; try { if (input <= 1) return result = input; return result = this.fibonacci(input - 1) + this.fibonacci(input - 2); } finally {...

5:41 PM
Code Review is a more appropriate place to ask for improvements to working code. — Barmar 1 min ago
Q: why pytorch return all staffs while i only return a single linear

namo i tried to return fc1 but instead it returned all three linear ! , i expected to return only the fc1 ! class NetWork(nn.Module): def __init__(self): super().__init__() self.fc1 = nn.Linear(784,128) self.fc2 = nn.Linear(128,64) self.fc3 = nn.Linear(64,10) def forward(...

@pacmaninbw Yes, progress.
6:02 PM
it work well as a job but it uses 'while(true)' so it's really inefficient for CPU it seems you are asking for a review and or other suggestions. If that's the case, head over to Code Review as that place would be best. — Çöđěxěŕ 45 secs ago
Q: Interview Questions: Choosing between 2 Fibonacci alternatives

Eli Livshitz Task: Return the fibonacci value at a given index. e.g: input: 6, return: 8. Algorithm 1: public static fibonacci(input: number): any { if (input <= 1) return input; return this.fibonacci(input - 1) + this.fibonacci(input - 2); } Time complexity: \$O(n^2)\$, Space complexity: \...

1 hour later…
7:04 PM
Q: Mouse move event outside of form

Badr AdnanI am creating a 'C#' WinForm application and I want to detect mouse move when the mouse is outside the form. I already tried to create new thread that continually calculate the mouse coordinate, it work well as a job, but it uses 'while(true)'. It's really inefficient for CPU. Thanks. while(true...

7:45 PM
Q: unique username generator

Joshi RI have written a class to generate a unique username from the full name. The full name is the name of a company usually containing 4 to 5 words. The username generated will be of format {preffix}{username}{suffix}. The user name should not be derived from stop words. stops words are generated ana...

8:03 PM
You're getting downvoted because this question doesn't belong here, you'd have more success at codereview.stackexchange.comUncleDave 56 secs ago
Ho hum. No other place to go but chat.
And chat has a two-for-one special today.
8:21 PM
I think it may be a message from the Exchange gods that I should get a life, though. There's actual weather outside today.
@rolfl Entire SE just went hiccup.
Hi @Robert, what brings you here?
Main sites down. Nowhere else to go.
Looks like they just rebooted SO's hamsters.
Well, feel welcome, even if you're only here because there's nothing better to do ;-)
If you're really bored, how about taking care of a zombie of choice? We have a broad variety to pick from.
Just pick one with BRAAAAAaaaiiiinnnnsssSSSS
8:49 PM
where is the code review site? I actually don't know. — user63710 47 secs ago
9:11 PM
Sorry, I should have provided the link. Here you go: codereview.stackexchange.comÓscar López 30 secs ago
10:08 PM
@rolfl When your exception handlers give you exceptions..
10:20 PM
possible answer invalidation by Mike Langstaff on question by Mike Langstaff: codereview.stackexchange.com/posts/232374/revisions
10:31 PM
@Duga its okay - OP added helper functions per request of MG♦ (who supplied the one existing answer)
11:25 PM
Q: How can I implement this React Native component without relying on a conditional statement?

FabianI have a component, it's actually an entire screen in my application. This screen/component renders multiple other components. However, what it renders is conditional. Currently, I have an if statement, which decides which markup is returned. The only differences between the two markups is one ad...

Q: DDD - Interaction between 2 entities

vanilla_milkI've been taking a crack at Domain Driven Design, SOLID principles, and unit tests to write more maintainable code in the future. Though I tend to run into the same issue: While I have many classes/objects that are easy to test, and do one thing well, I'm completely stumped on how to get classes...

Q: Average row id volume

SerpitonAfter a test run with LoadRunner I wanted to know the average time for each transaction for each VU volume step, the LR let you create a graph for this but don't give you the point values... so it's not possible to further analyse the data. As I'm learning python I decided to write a script to do...

Q: Provide one file where all error messages are defined in c++

Jonas SteinI would like to store all error messages in one file and call them for example with if (!std::filesystem::exists(ArgFilename)) { throw std::runtime_error{error_001_nofile}; } else { //do something } The file errorcodes.h is included to the main program and looks like #ifndef SRC_E...

11:45 PM
Q: Should a class directly access its attributes or setter methods should be used?

gatorThis is part of a Particle Swarm Optimization algorithm, a snippet of a Particle class implementation. /** * Particle class constructor * @param p - the position of the particle * @param v - the velocity of the particle */ Particle::Particle(std::array<double, 30> p, std::array<double, 30> v...


« first day (2385 days earlier)      last day (31 days later) »