« first day (2898 days earlier)      last day (1121 days later) » 

12:01 AM
RELOAD! There are 7488 unanswered questions (89.4920% answered)
 
0
Q: Using <a> element instead of <tr> to get clickable rows

panta82I want to create clickable rows in an html table. Each row should be a link leading to a different page. I can of course add onclick handler, but that will create kind of a crappy UI - poor accessibility, no keyboard navigation, no right/middle click... I found a better way to do it. Instead of u...

 
12:30 AM
0
Q: Rust backtest forex engine

Le FemI wrote a backtest engine in Rust - essentially it is a bunch of if statements mutating variables in a intensive loop. Recently I had to rewrite the whole because it was getting too complicated for me to understand. I first wrote the code in my usual procedural style with functional iterators. Wh...

 
 
3 hours later…
3:39 AM
 
4:38 AM
-1
Q: vector out of range exception in my code

Kshitij GuptaI am writing a C++ code for some Monte Carlo simulations. In the simulations, I am storing matrices and updating them based on some rules. So to do this, I created two classes : a 5D matrix class, and a 2D matrix class. The 5D matrix is a big 5D table which can store data types of the 2D matrix c...

 
5:27 AM
0
Q: Doing a re.findall with pcre library

David542I am trying to get an array of all regex matches. For example, something like this: PATTERN: (\d+)[a-z]+ STRING: 123asd RESULT: ["123asd", "123"] ^ ^ full capture group 1 Additionally, if there are multiple matches, it should continue matching, for exa...

 
 
2 hours later…
7:37 AM
Monking
 
8:18 AM
This question might be better suited to Code Review. However be sure to take their tour and read their How to Ask page before posting. — Nick just now
 
0
Q: Longest Increasing Path in a Matrix

sworI am solving https://leetcode.com/explore/featured/card/april-leetcoding-challenge-2021/594/week-2-april-8th-april-14th/3703/ I have an error in logic, but can't understand what is wrong. Could you please review my solution and recommend how can i improve it. class Solution { public: // cell ...

 
9:11 AM
0
Q: How to make this special binary-search algorithm more rust style?

prehistoricpenguinI am solving one binary search problem in leetcode. I have accomplished such code: impl Solution { pub fn search(nums: Vec<i32>, target: i32) -> i32 { if nums.is_empty() { return -1; } if nums.len() == 1 { return if nums[0] == target { 0 } else { -1 }; } let mu...

0
Q: Typescript : Adding types to a function that takes in a string and returns a different promise based on the string

rakshithI have a function that takes in a string and based on the string hits different api's to fetch images. I have solved it by writing an interface and then as return type of the function it returns a Promise<Interface> as shown in code below. interface IAnimal { image?: string | null ...

 
 
3 hours later…
11:41 AM
@Malachi I was aware of being the last VTC is possible. I don't see very many questions where the moderator used the hammer to close a very off-topic question.
 
12:06 PM
0
Q: Filtering a DataFrame based on two logical conditions, first one numpy array values, second one current day based

Andrea CiufoThe following is just a working example. I have a DataFrame containings a monotonous growing function. Some of the values are actuals, some are forecasted. I need to filter specific actuals values based on a set of milestones and I have to avoid to take forecasted values from the dataframe I crea...

 
12:19 PM
Monking
Monking
oh, wait
 
12:36 PM
/wave
@pacmaninbw It used to happen a lot more often.
Anyway, if no-one else is going to be the first one to say it, I will.
Yes, I will be running for moderator this election.
8
 
1:37 PM
For those on this thread, I found a comment from Volker Hilsheimer on this abandoned effort to fix the plugin (codereview.qt-project.org/c/qt/qtlocation/+/302357) that old credentials should still work with the HERE plugin without these patches? Can anybody confirm that and do they have any information about how to acquire an "old credential"? — David K. Hess 15 secs ago
 
2:10 PM
0
Q: Snake game in console

PadritonI made a snake game implementation in console with rust. Would like to hear what I'm doing wrong and what can be improved. main.rs mod apple; mod board; mod game; mod position; mod snake; pub const TAIL_SIGN: char = '#'; pub const HEAD_SIGN: char = 'O'; pub const APPLE_SIGN: char = '@'; pub cons...

0
Q: Padding n rows and m columns of 0s to the each side of 2D numpy array

Levon AvetisyanSo here's the problem Given a 2D numpy array 'a' of sizes n×m . You need to pad the matrix with 0s so that the dimensions of the matrix become (n+2n1)×(m+2m1) a = np.array([[1, 1], [1, 1]]) n1 = 1 m1 = 2 print(padding(a, n1, m1)) >>[[0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0], [0, 0, 1, 1, 0...

 
2:25 PM
At this rate, it will be faster for you to delete this page yourself, take the tour and read How to Ask at CodeReview, then copy-paste your question there. — mickmackusa 35 secs ago
 
0
Q: struct iterator and range

user1095108How do you like this struct iterator? #include "boost/pfr.hpp" #include <iterator> #include <memory> //std::addressof() template <typename S> class struct_iterator { S& s_; std::size_t i_; public: using iterator_category = std::random_access_iterator_tag; using difference_type = std::p...

 
3:22 PM
You might get better responses to this kind of question on Code Review. — mkrieger1 15 secs ago
 
0
Q: Hash Table implementation in C using linear probing for collisions

Thibaut D.I've written a simple Hash Table implementation in C, in order to use it in an IRC bot, so mostly storing nicknames, channel names, etc (small strings). I'm using linear probind to resolve collision. Here is the public API (hash.h): #pragma once #include <stdbool.h> typedef struct hash { st...

 
3:43 PM
This question feels quite broad and theoretical. Are you facing a problem with your current design, or are you looking for something more like "code review"? Also, note that "relation" does not mean the same thing as "relationship". — IMSoP 33 secs ago
There are no exceptions in VBA... but if you want black magic error handling supercharged, then you need VBWatchDog (commercial) - otherwise, you're going to need code that logs the errors you're getting. I wrote a rather useful polymorphic VBA logger once, it's on Code Review. — Mathieu Guindon 46 secs ago
 
0
Q: Binary Heap Implementation in Rust

ryanzidagoI'm learning Rust by implementing basic data structures and algorithms. I implemented a binary heap (max heap): mod binary_heap { #[derive(Debug)] pub struct MaxHeap<T> { pub data: Vec<T>, } impl<T> MaxHeap<T> where T: PartialOrd, { pub fn new() ->...

 
4:15 PM
0
Q: Which solution of the two is the most efficient? Is there a better one? (IP Address Defang)

Than1I just started doing preparation for interviews, but im having trouble recognizing the optimal solution Problem: For a given IP Address, replace every "." with "[.]" Example: Input: address = "1.1.1.1" Output: "1[.]1[.]1[.]1" My solutions: First: def defang(x): lst = [] for i in x: ...

 
4:39 PM
If your code works as expected, and you're looking for advice about improving it, your question would probably be more on-topic on codereview.stackexchange.comThierry Lathuille 51 secs ago
 
0
Q: Mocking Interfaces Golang

LfaI thought of doing the following to mock/test functions in Go and wanted some advice. Let's say you have an interface for a repository: type Creator interface { CreateUser(User) (*User, error) } type Updater interface { UpdateUser(User) (*User, error) } ...

0
Q: Scrape webelements

ProtractorNewbieI have been working with requests where I as easy as it is. Scraping the webpage and add it into a dict and print the payload if we find a new value or not. For secure reason, I have not added the correct link for scraping this exactly but the main code review im asking if I have done it correctl...

0
Q: Priority Queue and Heap (Generic)

nerd_eliteHow do i implement the constructor?The array must be generically typed so it can store any type of Object, and it must be initialized to INIT_SIZE. public class Heap implements PriorityQueueADT { private int numElements; private T[] heap; private boolean isMaxHeap; private Comparator comparator; ...

 
5:05 PM
0
Q: Python factory class with dynamic imports

SeamusI'm trying to write a factory class that essentially provides a user-friendly frontend to creating objects of different kinds depending on keywords. So the user will just have to import this module, and then use module.factory.make_new with the relevant keywords. So this file will sit in a direct...

 
5:55 PM
0
Q: RLS channel equalizer is not working correctly

SinscereI've got an example Matlab code. It's perfectly working. Here it is: clc; clear all; close all; % Experiment parameters: Algorithm = 0; % Algorithm = 0 - MI RLS, Algorithm = 1 - NLMS,Algorithm = 2 - LMS equalizer_length = 35; % Equalizer length Delay =16; % Approx. delay by channel + half ...

0
Q: Make Function Generic

AxelHow to make a generic version of my function with unlimited "keys". Please see the function below. It's a mockup for another function that I want to use. But I got stuck. I used switch just to hard code the actual output I'm after. So it's just to illustrate the issue. Sorry friends, I'm not the ...

 
 
2 hours later…
7:59 PM
0
Q: Properly defining a singleton classe in Python

uniXVanXcelI am trying to create a Token class which takes initial values and pass the instance of it into a different class. This is my attempt using Singleton since I only want a single instance of the token per user session. What are ways that I could improve this code? Also, are my class instantiation a...

 
8:24 PM
0
Q: Unique Paths II, dynamic programming problem, O(n^2) time, O(n^2) space

Joseph GutstadtThis is based on this leetcode question please remove if that is not allowed. I get the correct answer, but I know it could be much, much cleaner. I also know there is supposed to be a O(n) space solution, but I'm not sure how to implement cleanly. It is a dynamic programming problem, I tried t...

 
8:49 PM
0
Q: useful multi-inheritance usage

FoxzOolmImagine, you need a filestream encrypted and gzed. how do this stuff in most language? by exemple in fictif java. var f=new filestream("myfile") var e=new encryperstream(f); var z=new gzipstream(e); booooored... here we can take an useful advantage of cpp's multi-inheritance ... code context... ...

 
possible answer invalidation by Seamus on question by Seamus: codereview.stackexchange.com/posts/259320/revisions
 
9:38 PM
0
Q: Racing promises and consuming them in the order of their resolution speed

ReduThe ideas are When multiple async calls are made, to be able to start consuming from the fastest resolving one regardless in what order the promises are fired. To construct a modern emitter of async values to be consumed by the for await loop. One may achieve this functionality by making repeate...

 
10:06 PM
If the code works but you're wondering what could be improved about the design, that's more appropriate to ask over on the Code Review stack exchange. — Nathan Pierson 52 secs ago
belongs to codereview.stackexchange.com — Stack Danny 49 secs ago
some outside global SIZE is not sufficient. If you pass in a pointer, you should pass in the size along with it. This is a billion dollar problem in software, and a major source of security and stability bugs. This is borderline required for any code review, and may cost you an interview if you fail to do that. Just saying, it's REALLY important. Also, this site is not to do your work for you, but to help. Ask specific questions about specific problems, and describe them with enough detail that nobody has to guess what your problem is. — Chris Uzdavinis 8 secs ago
 
10:53 PM
0
Q: I have built snake from scratch and I need to know another approaches and what I could do to make it better

PixDI have decided to make snake game as my first project with C++ (using OOP) and I didn't follow any tutorial while doing it, now I am frustrated and need to know if it the code is good or not and what can be improved in it? It also have some bugs that I can't fix till now: When the player hits a...

 
11:07 PM
Thanks for your advice, I will look for advice at Code Review as well! I understand your comment and I realize that I should also have mentioned that I do not have control of the format of incoming data, as it follows a standard, and obviously not a good one. — sxmdg 40 secs ago
 
11:43 PM
0
Q: Implement Python recvall()-like for xml-like data

sxmdgMoving this here for help after a recommendation at Stackoverflow. So instead of a question I am asking for a review of a method that is written in an attempt to receive a complete xml-like message from a socket. Some notes about the xml/xml-like being received that could be of interest: The xml...

 

« first day (2898 days earlier)      last day (1121 days later) »