« first day (2667 days earlier)      last day (1648 days later) » 

00:00
RELOAD! There are 6929 unanswered questions (89.7999% answered)
00:48
1
Q: `citty` -- CI server in a TTY

Austin HastingsThis is citty.py, part of the citty repository. It's formatted using black, so I'm not super worried about small style items. I'd like a review with suggestions for other, better practices -- choice of technologies or implementations (e.g., "use xml instead of json", or "use goodpackage instead o...

01:38
0
Q: Improving function that parses string and returns first integer present

James KempThis exercise is from jshero.com. Write a function parseFirstInt that takes a string and returns the first integer present in the string. If the string does not contain an integer, you should get NaN. Here is my working solution. I'm posting in hopes of receiving pointers on how I could have writ...

02:03
0
Q: Tic-tac-toe game using Pygame

fabrizzio_gzI programmed a tic-tac-toe game using pygame. It's the first game I make. I'd really appreaciate any comments you have about the coding style and any improvements that could be made. import pygame import graphics # External module graphics.py import logic # External module logic.py # Setting ...

 
3 hours later…
04:58
0
Q: What anti-patterns / negative traits show up in my JavaScript app framework and how could I make the design more efficient?

ViziionaryMy goal with this review is to receive observations and suggestions for improving the efficiency of writing the front end of a web application with this basic framework I've fleshed out. Not interested in performance efficiency, but specifically code patterns and design of the resulting applicati...

 
2 hours later…
06:38
0
Q: ILogger with Delegate Callback

Christian FindlayMy code writes data and then receives data back. I want to log that this has happened, and I also want to inject a delegate so that I can get a callback to trace the data that is going in and out. This is example of the classes for reading and writing data in a request-response style. public clas...

0
Q: draw list how to speed up

Fatir Rizkyis there a way to make this go faster? it takes even 10 minutes when I put more data. I run this code 190 times, which also every times will contain another 100 strings. For i As Integer = 0 To lengthOfX - 3 Dim firstBoxList = TxtBoxIntDrawsX.Lines(i + 1).Split(",") ...

 
2 hours later…
08:14
Monking
08:43
-1
Q: Insert a node into a singly linked list

BestYasuoI use this code from DSA Using C# by Michael Mcmillan, but there are bugs in the Insert and Find method. I have been spending my whole morning on it without any detection. public class Node { public Object Element; public Node Link; //Successor of the node, where it will later...

09:08
0
Q: Oauth2 Connector Frappe Framework - Refactoring Requests and Handling Request Exceptions in the Real World

replaceableheadThis is my first time posting here and I'm am very much a beginner. My first attempt at writing a Python application to solve a real problem is a one way connector between ERPNext and MYOB AccountRight. This is the module I have written to connect to the API and get all the tokens. The user fills...

-1
Q: Getting CSS property as a number with JavaScript

mmaismmaI use this line of code to get the CSS left property of myDiv as a number. Is there a better way? window.getComputedStyle(myDiv).getPropertyValue('left').split('px')[0] * 1;

09:33
0
Q: Build byte array from multiple different types of data for sending over a network

C. LangThe following codes purpose is to generate an array of bytes that represents some user defined data. This array of bytes will later be used for sending over a network. WelcomePacketWriter is a concrete subclass of PacketWriter. Subclasses of PacketWriter can use methods provided by PacketWriter t...

 
2 hours later…
11:30
M.nk.ng
-1
Q: Many operations with functional interfaces

John SpringI have the following structure but is it a good practice to create a functional interface for all different operations? Or any other suggestions? execute @FunctionalInterface public interface Executable { void execute(); } execute with index @FunctionalInterface public interface IndexedExecu...

0
Q: Slow Huffman Code in pure Python

Albert AlonsoI was working on writting a fast implementation of a simple Huffman code compression of text. The idea was to write it using only the standard library, but I can't seem to find a way to make it faster. I am also looking for advise on how to write it more "pythonic" without sacrificing speed. I am...

11:57
What can anyone tell me about Peter Cordes? 2K on CR but 209K on SO.
@pacmaninbw Seen him around before, has some answers that go in-depth really quickly.
Why?
Seems to know his stuff.
Anyone notice any attitude problems?
Yes he mostly know his stuff.
> NULL is a pointer constant. Perhaps you meant ASCII NUL ('\0') as the string terminator? IMO it's clearer to just say 0-terminated. – Peter Cordes yesterday
> @anki: Ok, "clearer" isn't the real reason. Being technically accurate without having to use the obscure term "NUL" is the reason. The fact that "null-terminated" is widely mis-used for strings (rather than pointer-based data structures like linked lists) doesn't mean you should, too. (Unlike natural language which does evolve new meanings and usage, technical language should be kept pure for maximum clarity.) – Peter Cordes 17 hours ago
Comment on my answer.
9
Q: C Implementation of atof

lcols19I'm a beginner at C. I'm currently implementing atof to build a raytracer, however I'm still learning how to efficiently write programs. Assignement Instructions The program takes a scene description file as argument to generate objects. Some of these paramaters are float. Example of the file. ...

NULL terminated string has been in C literature from the very beginning.
12:19
where a lot is going on. I would have chosen the names acc, key and vals, but that is no written rule either. Just pick something that the other people in your team understand. There is no point in writing code that only you can understand (other than keeping your position) and will result in the "legacy code" that everyone is talking about. If this code was written in my team, it would have failed the code review - keeping aside the fact that we don't write JavaScript. I do agree that at this small code snippet it doesn't make too much of a difference, but imagine a whole backend — MauriceNino just now
@pacmaninbw That's an unfortunate side-effect from many experts coming from SO and some of the other sites. Electronics has the same problem at times.
@pacmaninbw sigh
It's one of those things were different people have learned different things. C was a bloody mess back in K&R time.
A lot of people learned it wrong.
In the end, it's a thunderstorm in a glass of water.
anki mixing in probably didn't help.
The cartoon in his profile is accurate. I'm familiar with the problems of C from K&R, that's when I learned it.
This question would be better in Code Review. There you can put code that already works and ask for improvement. — Pedro Lima 23 secs ago
12:25
@Mast True, I wasn't going to reply to Peter Cordes because it wasn't worth starting a long discussion/argument.
0
Q: A simple C WinAPI program for terminating processes via process image names - follow-up

coderodde(See the previuos (and the first) version of this tool.) After taking into consideration all the advices by Martin R, I ended up with the following tool for terminating all the processes with given process image names: #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <TlHelp32.h>

12:53
0
Q: How to increase efficiency of recursion algorithm?

Sthitaprajna MishraThe question is: Given a non-negative int n, compute recursively (no loops) the count of the occurrences of 8 as a digit, except that an 8 with another 8 immediately to its left counts double, so 8818 yields 4. Note that mod (%) by 10 yields the rightmost digit (126 % 10 is 6), while divide (/) ...

13:05
@Mast On some of my HNQ posts people have said "your last code block should be your first code block"... :/ I'm surprised I've not seen anyone say "why you write so much, just post the damn codez".
Everyone's a critic.
 
1 hour later…
14:33
0
Q: Generating display elements with JavaScript, are there any gotchas, negative impacts, or things to think about with my implementation?

TacoI've been writing a modular sandbox that has a web front end. Modules are discovered with reflection and could have parameters to them. When parameters are presented to the UI, I pass them through a set of JavaScript utility methods that map them to display elements which utilize Bootstrap 5 for ...

Going off-line to do some unit testing. TTYL
 
1 hour later…
15:34
Does anyone happen to have experience with a Windows VPS that's directly available?
I want to run some game pretty much 18/7 on there because you can make progress when going AFK in certain spots and parents don't want me to have my PC 24/7 on lol
15:48
0
Q: Interview Coding Test: Transaction Processing: Get balance by category in given period

Sojharo MangiI recently gave a coding test for a job which failed. It had two problems and one of them is shared in this question along with my solution. Problem: Get balance of all transactions in a given category within specified period. This is how a typical transaction looks like: { id: 123, sourceAcc...

16:13
0
Q: Quadratic Expression Factorer and Solver

Eren YaegarI have decided to create a program that can factor and solve quadratic expressions in micropython, where the standard library is limited, and i have no idea how to implement external modules onto it, so i had to bake this program from scratch. The simple premise is, that it can factor and solve m...

I’m voting to close this question because belongs on codereview.stackexchange.comMark Schultheiss 10 secs ago
16:38
-1
Q: ¿Como copiar valores en campos disponibles segun condiciones especificas?

Briam Ramon RodriguezEstoy ajustando las lineas de una macro, la cual debe copiar los valores contenidos desde la columna E hasta la columna H en orden de lista en las celdas disponibles (vacias) de la columna D, sabiendo que estos valores (los contenidos en las columanas desde la E hasta la H) son variables, en cuan...

17:01
I’m voting to close this question because it is better suited for codereview.stackexchange.comluk2302 31 secs ago
0
Q: New Rustacean with Ruby background, wrote a simple scraper for Carfolio

hahuang65I'm new to Rust, coming from Ruby. I wrote a simple scraper that actually runs and works, but I'm trying to figure out ways to refactor and improve it. Was hoping some experienced Rustaceans could give me some feedback. The repo is here: https://github.com/hahuang65/carfolio_scraper Particularly ...

@skiwi Stick a raspberry in a corner.
17:28
And please, for the next time, provide a better prepared code base, boiled down to a real problem, which can be solved while providing a real answer. While I was answering you, the example code got constantly changed. This is rude. With the next similar problem try another place like StackExchange Code ReviewPeter Seliger 42 secs ago
18:05
possible answer invalidation by TinMan on question by TinMan: codereview.stackexchange.com/posts/248109/revisions
18:21
@Duga Notified Matt. May double check in a bit.
18:41
@Duga Handled by Matt
Nice, got an addon to move my tabs into bookmarks. Now I have <100 tabs and YouTube doesn't take a minute to load now
18:56
@Mast Parents don't want it
19:09
1
Q: Bloomfilter in Kotlin

PehejeI would like a code-review. Not so much on if the implementation is good or effecient, it's probably not, more on code style and readability. import java.lang.Exception import java.nio.ByteBuffer import java.security.MessageDigest import java.util.* import kotlin.math.abs fun main() { val fi...

0
Q: Is there a bult-in method or a more efficient way to keep the polies empty?

user229550I am working on a turtle project where the user can draw their own avatar. The thing is, I want the user to be able to decide whether the turtle they drew will be filled, or not. The filled part is simple, as by default, the polies will get filled, but the only way I know how to avoid filling is ...

19:22
Monking.
So, I've spent about 5 hours on a SSD->NVME migration so far. The only thing that didn't went wrong (yet) is accidental overwrite of data.
@skiwi Does that game need a dedicated graphics card to run? VPS usually don't have that much graphics power behind their belt.
@skiwi I've heard good things of Shadow. TBF it was from a video sponsored by them, so... Since it's a game streaming service IDK if you need to be constantly logged in or what tho
20:21
@Peilonrayz Now you have a thousand bookmarks?
@Zeta Many troubles with it? My current system has an NVME boot drive but that was a fresh install. No problems whatsoever.
@Mast Exactly that ;)
20:49
@Zeta O yea they do..
I mean I used to run the game (barely) on a Windows XP VM with 512 MB RAM loong ago
It's from like 2007
 
1 hour later…
22:04
-1
Q: Is there a way to omit the extra turtle, and still have the orange turtle show?

user229550I made this snake game, and it works fine. But there is one turtle that is always hiding behind the head of the snake (see image). Is there a way to omit the extra turtle, and still have the orange turtle show? import turtle from time import sleep wn = turtle.Screen() body = [] for c in ['pur...


« first day (2667 days earlier)      last day (1648 days later) »