« first day (3341 days earlier)      last day (659 days later) » 

12:03 AM
0
Q: Python while loop - How to print last value without tab

RebeccaWI am working to create a program that creates a hailstone sequence and I'm nearly there except my last value is printing with a tab after it. I can't figure out how to fix my code below to not have a tab at the end of my last value so any help is appreciated. I am just learning Python and this is...

 
REFRESH! There are 8109 unanswered questions (89.3015 answered)
 
12:21 AM
possible answer invalidation by manungsa on question by manungsa: codereview.stackexchange.com/posts/277624/revisions
 
0
Q: Decorator implementation around xarray.open_dataset

Jason LeaverIf you want to download some grib data for yourself the script below will pull data range of data on an hourly interval from the google api. Extract some hrrr grib2 data from pathlib import Path from typing import Iterator from datetime import datetime from shutil import copyfileobj import warnin...

0
Q: Trying to optimize this rust code to faster than numpy. I'm not sure what more I can do

Karl Hernandezfirst off I'm running this in release mode. Currently, the following function takes around 6.7 seconds to run on my computer vs 3.7 seconds on python. I know that numpy is just calling to c, but I'm trying to reach faster performance on the rust version. I would appreciate any help. I've been try...

 
 
3 hours later…
3:58 AM
Monking
 
4:20 AM
Monking
 
5:10 AM
0
Q: Avoid if statements or condense it

sangharshCan any one please help me to condense this code?: if x > 0: do y else: a if #something# in y: do z else: a if x > 50: do p else: a if #something# in p: do z else: a As you may observe things like "#something# and a are common. Specific functions are at place. But then...

 
6:06 AM
GET request means sending HTTP GET message to a specified URL. To do that, use HttpClient as per the answer linked in MindSwipe's comment. It has an issue with instance management though but I think that's really beyond small apps like this. Maybe a senior doing you a code review will mention it so you can use that opportunity to ask how these issues are typically solved at your company. — Zdeněk Jelínek just now
possible answer invalidation by greybeard on question by manungsa: codereview.stackexchange.com/posts/277624/revisions
2. Code review. When I see ... in function parameters or placeholders passed as function arguments, I focus on required function parameters and double check them. If I am still unsure, I copy a function declaration from a manual into my code, it prevents from typos. — 273K 23 secs ago
 
6:51 AM
0
Q: Invoke method in a cleaner way for performance and clarity

BezhasWe have exposed a single endpoint for handling multiple request. The base request is like this public class InformationBaseRequest { public string Code { get; set; } public object Payload { get; set; } } After the request is received, we serialized the Payload to identif...

 
 
3 hours later…
9:50 AM
0
Q: Implementation of A star Algorithm

Cheena FloresI am implementing an indoor map, using A star algorithm as its pathfinding algorithm. I came across a library in github and modified it into my floorplan, it works but now I'm trying to study how the user implemented A star algorithm and compared it to the algorithm's pseudocode. I can't seem to ...

 
 
1 hour later…
11:18 AM
I have to wonder that if you're asking how to improve working code, then perhaps this is perhaps better posted on the Stack Exchange Code Review site. — Hovercraft Full Of Eels just now
 
 
2 hours later…
1:14 PM
0
Q: Return type-erased object to the caller, use typesafe cast in a subsequent call

irishaccentLibraries might need to return "context" objects to the caller, and then require the same object in subsequent calls. In some cases, the user is not required to know what's the concrete type of the "context" objects. In these cases, it is beneficial not to require the user to include the declarat...

 
@devlincarnate This question is not a good fit for Code Review Site because it is not an actual code review. The user is hiding the details of the code. When you direct users to the Code Review Site please direct them to our help pages such as How do I ask a good question?. We do the same, we direct bad questions to the help pages on other SE sites so that the user can make an informed decision. — pacmaninbw 59 secs ago
 
1:43 PM
@CaptainObvious Please explain someone else's code to me.
 
1:57 PM
closed
 
2:13 PM
Rosie on June 27, 2022
From Chemistry to Raspberry Pi: Sites covering Q&A on tech, leisure, language, and more celebrate their first decade.
 
@Heslacher Thank you.
 
2:31 PM
what is the question? code review? — Esther 34 secs ago
 
3:27 PM
This question may be better asked on codereview.stackexchange.comcybernetic.nomad 29 secs ago
 
3:56 PM
Monking
 
4:07 PM
@pacmaninbw et al: I’m on vacation this week so I’ll just be checking on mobile occasionally
 
0
Q: Code for setting all child controls to the default message font on Windows

Govind ParmarIf you aren't aware, if you hand-code a GUI with the Windows API you will find your controls look quite ugly by default due to their font. Running this code: #include <Windows.h> #include <windowsx.h> #include <CommCtrl.h> #include <strsafe.h> #include <sal.h> #pragma comment(lib, "comctl32.lib"...

0
Q: Hack assembler/disassembler in x86_64 assembly language

EdwardStarting from this answer I thought I would show a fully worked example of how to create a data-driven version of the assembler for the Hack assembly language. As I noted in that answer, having things data driven also provides the opportunity to create a disassembler using the same data structur...

 
Questions asking for review of working code is a better fit for codereview.stackexchange.com. That being said you certainly don't need the static field private static int numberEntered;. Your method userPrompt() returns the entered number. You could work with the return value instead. Currently you just ignore the return value. — OH GOD SPIDERS 39 secs ago
 
4:22 PM
@SᴀᴍOnᴇᴌᴀ Enjoy!
 
5:13 PM
First, search the internet for "C++ profile", "C++ benchmark". Second, if your program works correctly, post to Code Review. Third, post the code that your profile and benchmarking have found to occupy most of the execution time. Add more code per recommendations. — Thomas Matthews 30 secs ago
 
5:31 PM
0
Q: Using methods to get and dislay userInput

Mangiwould like to know if I could have done anything better with the code that I wrote. Want to also know if i could have avoided using a static variable. private static int numberEntered; public static void main(String[] args) { int quit = 0; int sum = 0; userPrompt(); while(numbe...

 
5:47 PM
@Duga thanx
 
5:58 PM
0
Q: List with values not found in another list when each index has two objects

Digital FarmerAs the question already says, my code returns a list with the index's that don't exist inside another list. For this I currently create two lists joining the objects of each index, then filter the values not found and finally I do a loop searching in which index I will find this value within the ...

 
6:49 PM
0
Q: Created a todo list in ts

Mubashir WaheedI am learning Typescript and created a straightforward to-do list project to practice some basic concepts. I am able to Edit the todo Delete the todo Mark the todo as completed I want to how can I better structure my code and what typescript best practices I am not using. index.ts import { v...

 
7:15 PM
0
Q: Animating GIF on hover in Javascript

EdeniaI don't know JavaScript and it's safe to say this is my first code ever written in JS. I just needed to animate my GIFs when user hovers over them only. Googling separate concepts such as "string functions", "catch element mouse hover", "set element attribute", "get element attribute", "get eleme...

 
8:01 PM
possible answer invalidation by Edenia on question by Edenia: codereview.stackexchange.com/posts/277668/revisions
 
 
2 hours later…
9:50 PM
0
Q: Small units: property initialization

XerillioWe're using Sigrid as our code analysis tool and one of the metrics it uses to measure code maintainability is the well-known "unit size". Units between 1-15 lines of code is deemed to add "no risk to maintainability". I know it should never be a goal to stay within those limits for 100% of the c...

 
 
2 hours later…
11:59 PM
0
Q: Framewise Full-Reference Image Quality Assessment (PSNR and SSIM) for Two Videos in Matlab

JimmyHuBesides the case of No Reference Image Quality Assessment for Video. I am attempting to implement a code snippet for calculating framewise Full-Reference Image Quality Assessment (FR-IQA) (PSNR and SSIM) scores for two videos, and the results of calculation will be written to an Excel file. The e...

 

« first day (3341 days earlier)      last day (659 days later) »