« first day (2695 days earlier)      last day (1305 days later) » 

12:00 AM
RELOAD! There are 7000 unanswered questions (89.7613% answered)
4
 
12:23 AM
@pacmaninbw ty
@Duga That's a nice round number. However not a fan of what it means... :)
 
12:47 AM
 
1:05 AM
@Peilonrayz yw
 
1:21 AM
1
Q: Parse python code, for specific pep8 issues

Eren YaegarI am aware, that libraries exist for parsing python code, however, for the sake of learning how they parse errors, I'm creating a script that checks a file for only 6 Pep8 errors just for reference. This is how my current 6 Pep8 functions look (they append an issue to the issues list, if issue wa...

 
1:47 AM
You say that you "weren't sure of the best way". Were you able to produce a way? If so, what you do is go to codereview.stackexchange.com, read their policies, and see if they have suggestions to improve your working attempt. — Karl Knechtel 19 secs ago
 
2:11 AM
0
Q: Rolling average over predictions

yuRaI am using a Deep Learning model I trained and want to improve its accuracy by implementing a rolling average prediction. I have already done it but want to improve it as I am making predictions on every 3 frames. Input: Each index represents a class and the respective prediction the model makes....

 
3:25 AM
0
Q: pytorch image train

mathcomp guyI have pre-defined code for the ants/bees dataset (2 labels) as follows: %matplotlib inline import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torch.autograd import Variable import numpy as np import torchvision from torchvision import dataset...

 
4:25 AM
@Andreas This question would be off-topic on Code Review as it does not work as intended. In the future please link to the help center and use wording that shows the post may be off-topic when recommending Code Review. Take, "This may be on-topic on Code Review. Please check if it is on-topic and how to post a good question before posting there." — Peilonrayz 58 secs ago
 
5:22 AM
@prl by the way, if helpful, here is what I was trying to do with the above instruction: codereview.stackexchange.com/questions/249563/…. — samuelbrody1249 18 secs ago
 
5:33 AM
0
Q: Printing a decimal number as a string

samuelbrody1249I've written a short script to print a number to a string. This actually was very difficult for me to do -- I'm not sure if this is actually a tricky task or just because I'm so new to asm I was having a hard time. Here it is: SYS_EXIT = 60 SYS_WRITE = 1 SYS_STDOUT = 1 .section .rodata num...

 
6:16 AM
@CaptainObvious One more VTC
 
 
2 hours later…
8:27 AM
0
Q: Drawing dragon curves using Turtle graphics

Khashayar BaghizadehThis is exercise 3.2.23. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne: Write a recursive Turtle client that draws dragon fractal. The following is the data-type implementation for Turtle graphics from the book which I beautified: public class Turtle { priv...

 
9:26 AM
avoid this king of expressions. They do not have any practical use. Actually if I see something like this doing the code review - I ask to rewrite the whole thing. — P__J__ 46 secs ago
 
10:06 AM
0
Q: asynchronously extract title from urls using python

bluerayThe following code asynchronously extract title from urls (saved in book-urls.txt). from bs4 import BeautifulSoup import grequests links = list() file1 = open("book-urls.txt", "r") Lines = file1.readlines() for line in Lines: links.append(line) file1.close() reqs = (grequests.get(link) for...

 
 
1 hour later…
11:22 AM
Google Translate (if anyone happens to know a decent alternative that covers more languages than Deepl does, please tell) has this window notifying users of an upcoming change.
In Dutch, it says "Geplande wijzigingen in de geschiedenis", which basically translates to "Planned changes in/to history".
And I'm like "What?! They're going to time-travel?"
 
11:42 AM
Monking
 
Monking @skiwi
 
12:10 PM
0
Q: Suggestion regarding fixing the seed through all the modules of a project

BeginnerI am building a project and I have some parameters which I want to fix through all the modules of the project. Below are the parameters - # Deterministic Behaviour seed = 1 os.environ['PYTHONHASHSEED'] = str(seed) ## Torch RNG torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual...

 
1:09 PM
@CaptainObvious this is off topic not sure what reason we use for it, and on the phone.
@Mast lol, I've been seeing something similar but never made the time travel connection. I'm guessing in/to doesn't translate well
 
1:22 PM
@Peilonrayz Dutch can be a bit ambiguous to translate sometimes.
@Peilonrayz Left a comment, not sure what he's after.
We could UWYA it and leave it closed once it's clear he's not looking for a review...
 
1:43 PM
@Peilonrayz My take is they are asking for a feature request and that means the code isn't written yet, what is clear is they are asking what a best practice.
@Mast @Peilonrayz Is there a way to create a module for import ala C or C++ and header files in python?
 
@pacmaninbw Just put it in a class and import it from another file.
Or are you talking Namespaces?
 
Not namespaces, you answered in in the first line.
 
I'm sure we have some examples on CR, but I can dig around for you if you like.
 
No need, I was curious.
 
2:10 PM
@Mast If I understand correctly they're asking for a file structure review. Like this. I don't think we have a "we don't review this language" close reason so, eh something will stick.
 
@Peilonrayz The language is irrelevant if they want a high-level review instead of an actual code-review.
Perhaps Programmers can help them.
Yea, anything will stick.
@retailcoder, don't migrate Jamal, just the question — Malachi ♦ Nov 21 '13 at 18:16
lol
 
@Mast Yeah as long as it gets closed that all that really matters
 
@Peilonrayz There's always the possibility they'll take it to meta after closure, that might be fun...
 
@Mast I think that'd be the cherry on top for this week. Worst case we can point to the meta I linked to and go through the help center. I'm sure we'd find a way to explain it.
 
@Peilonrayz Probably.
 
2:24 PM
@pacmaninbw You can import packages, modules and classes in Python. A module is just a Python file that is in your Python PATH or a package, you import it by importing it's name minus the .py. A package is a folder that contains modules and an __init__.py, the folder has to be in the Python PATH, you can import it by importing the folder's name. A class is just a class in a module, you can import it by importing the class' name. E.g. import package.module.class.
In the question the import_packages folder is a package and all the .py files are modules.
 
Showcase:
7
Q: Lightweight LED library

MastOne of the projects that have been on my to-do list since years involves controlling a number of Inter-Integrated Circuit (\$I^2C\$) peripherals. Lately I've been turning everything into it's own library and I'm wondering if I'm doing it right. While the libraries are usually called by a server-...

Have a Led.py, class LED in it, import Led from different file you want to use it in, create an instance with led = Led.LED()
And yes, there's a whole lot of naming problems in there.
 
@Mast I saw that and was like this has got to be an older question. ;)
 
@Peilonrayz Naming is still hard, but at least now I realize it while writing it down the first time.
I should read a book about it sometime.
A good one.
Too many crap books around.
 
@Mast Isn't there that saying "there's only two hard things in programming; cache invalidation and naming things"
@Mast Ty for posting a comment
 
2:46 PM
@Peilonrayz Two hard things in programming: cache invalidation, naming things and off-by-one errors.
 
@Peilonrayz ty
 
Maybe take a look at CodeReview. — Just learned it 5 secs ago
 
3:10 PM
@Mast lol
 
3:28 PM
0
Q: Game of Life state calculation in javascript

Noel NemethI've created a Life implementation in javascript with the goal to be as fast as possible, with the rendering I'm satisfied (see picture bellow), hovever the next state calculation is really slow and I'm out of ideas how to speed it up even more. Current state of the implementation Rendering Scree...

 
@Mast Someone can't count, I hate off by one errors.
 
Everybody does
 
 
2 hours later…
5:25 PM
@Mast My favourite is when you have two, or more, one off errors in the same function. I remember that happening to me fairly vividly, never again. I'd fly the SRP flag for that alone.
 
0
Q: Finding sum in an array

user230763I have this program finding 2 numbers in the array (unsorted) so that its sum equal to the target sum. Here is my program: vector<int> findNumbers(vector<int>& nums, int target) { vector<int> result; for(int i = 0; i < nums.size() - 1; i++) for(int j = i + 1; j < ...

 
@CaptainObvious Broken code, missing code context.
 
5:41 PM
@pacmaninbw Doesn't look like it, "if I remove it, it will cause error." But the last return is not removed. And how is it at all MRC? It's a fully functioning two sum function...
 
@Peilonrayz But in the last line, the return result doesn't seem to do anything,
The reason they can't remove it is in the declaration of the function, it must return a vector. Seeing the calling code might provide some idea how that can be rectified.
 
This is just the standard two sum problem
The user probably doesn't have any more code cause it's probably a programming challenge.
 
 
1 hour later…
7:04 PM
If you need code review, go to codereview.stackexchange.comEOF 32 secs ago
 
8:01 PM
0
Q: Is this Recursion Program Correct?

Subhadeep BanerjeeThis code runs properly, tested on the various test cases. But is my approach, right? #include<stdio.h> #include<math.h> int primefactors(int); int main() { int num; printf("Enter a no:-\n"); scanf("%d",&num); printf("%d",primefactors(num)); return 0; } int primefactors(int n)...

 
8:50 PM
0
Q: Disable background dim when alert dialog is shown

Magnus ErlerI want to disable the dimming of the background when an alert dialog is shown. An option would be to design my own type of dialog box, but I rather not My code: public void infoWindow() { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle("name"); alert.setMess...

 
I’m voting to close this question because it belongs to codereview.stackexchange.com. — a_guest 24 secs ago
@a_guest Don't use the existence of Code Review as a reason to close a question. From now on evaluate the question and use a reason like; needs focus, primarily opinion-based, etc. — Peilonrayz 14 secs ago
@EOF Code Review isn't where to go to ask if your code is correct, it's where you go if you think/know it's correct and want open-ended constructive feedback on how to improve it. If this were posted on CR, it'd be downvoted and closed promptly. See CR on topic. — ggorlen 1 min ago
 
9:33 PM
@ggorlen I don't think the question is off-topic on Code Review, nor does it have any close votes there. As "To the best of [the OPs] knowledge, [...] the code work[s] as intended". Since they've tested it this is true. And it looks like they're looking for "correctness in unanticipated cases" or just a general review. — Peilonrayz 45 secs ago
 
9:47 PM
@WeatherVane Sorry, I don't understand the parallels you are drawing. I only see you saying it makes a good question for Code Review as we can expose this problem and help the OP write better code. — Peilonrayz 36 secs ago
 
10:01 PM
@WeatherVane Their rules are far more nuanced then you've depicted. As you can see in some of my Meta answer on undiscovered bugs and the ambiguity of to the best of the authors knowledge. — Peilonrayz 34 secs ago
 
10:19 PM
I've never had a comment like "Is there a comment about deleting comments, if so I am happy to delete comments".
 
10:30 PM
Try codereview.stackexchange.com and post your example there; don't link to github. — j08691 59 secs ago
This sounds more on-topic on Code Review than here, but even there you'll have to include your code in the question not just a link to it. — Bergi 58 secs ago
 
10:44 PM
Welcome to Stack Overflow! Please note that there are many other Stack Exchange forums besides Stack Overflow. In this specific case, your question would be more suitable to the Code Review community in the following link: codereview.stackexchange.comMy Koryto 27 secs ago
 
 
1 hour later…
11:53 PM
@Duga @pacmaninbw This may shed a little light on this comment. Additionally the first version had some problematic wording. In that it's common to misinterpret.
 

« first day (2695 days earlier)      last day (1305 days later) »