Questions tagged [comparative-review]
This tag is used for questions which present a problem and multiple solutions, where the asker wishes to know which solution is best (and why).
937
questions
1
vote
1
answer
41
views
Send a QNetworkRequest with a parameter
I want to send multiple QNetworkRequests in Python 3.12 that each downloads one image from a server, using a single callback function. To be able to distinguish ...
2
votes
3
answers
693
views
Capture multiple errors before raising an exception
I have a scenario where I need to store values from some environment variables (names of which I cannot control). My first run at this was pretty basic, however this is not usable as an exception ...
3
votes
1
answer
86
views
How to avoid null Values in a .NET 6+ ASP.NET project [closed]
I'm currently exploring multiple options to get rid of null values in my .net web api applications.
Let's say, that we have the following Project:
...
3
votes
2
answers
69
views
Reading a file into lines (benchmarking getline() vs mmap_memchr() vs mmap_getline() vs fread())
This is a follow-up to: Reading a file into lines with mmap vs getline.
The actual names of the functions are not ...
12
votes
1
answer
468
views
Resizable containers with VueJS
A month ago I reviewed the code in Resizable split DIVs Vue.js, suggesting that the OP use computed properties and bound styles to simplify the code (at least reducing the need to use ...
7
votes
1
answer
232
views
Reading a file into lines with mmap vs getline
I required a function to read a file into lines for a text editor, and ended up with two routines. One uses getline(), and the other uses ...
19
votes
2
answers
597
views
Count the occurence of nucleobases in DNA string
Inspired by this meta question I decided to take a look at Rosalind. Their first challenge seemed easy enough:
An example of a length 21 DNA string (whose alphabet contains the symbols 'A', 'C', 'G', ...
3
votes
1
answer
92
views
Simple C++ event loop - static vs dynamic dispatch performance
I have two extremely simple toy implementations of an event loop, and would like to understand the performance differences between them.
First impl - events with a virtual 'handle' method - dynamic ...
4
votes
1
answer
163
views
Array Implementation In JavaScript
Review
I have written my own implementation of Array in JavaScript with the basic functionalities. Can anyone please review this code and point out the mistakes/how to make the implementation better?
...
3
votes
1
answer
47
views
Comparing a set of parameters contained in two separate strings in Powershell
I have a situation where I need to compare two strings with each other in a foreach loop that potentially run over millions of rows of data. The two strings will always contain between 1 and 12 ...
7
votes
5
answers
5k
views
Given N, generate sequence of random numbers from 0 to N - 1 with no repetitions
Problem statement:
Given an integer n, write a function to return an array of size n, containing each of the numbers from 0 to n-1 in a random order. The numbers may not repeat and each number must ...
3
votes
1
answer
80
views
calculating the percentage of distribution of ids per Loc for each country
Which of the two queries is theoretically better and why?
I would like to understand why query 2 takes longer although there is no relevant information in the Execution Plan.
I'm querying a Presto ...
3
votes
1
answer
54
views
maxlist(L, M) that succeeds if M is the max number in the list L
I'm working my way through "Prolog For Artificial Intelligence" by Ivan Bratko, and exercise 3.17 is to write a maxlist(L, M) that succeeds when ...
7
votes
2
answers
281
views
Subtract two lap times (m:ss:fff)
I have two lap time strings I need to subtract, the format is minutes, seconds, milliseconds. This is to compare a new world record time to the previous holder's ...
2
votes
0
answers
101
views
Why does my Clojure implementation of Conway's Game of Life run so much slower than my Java implementation?
I'm trying to learn Clojure coming from a Java background. I have written a simple implementation of Conway's game of life in both Clojure and Java, trying to keep the overall structure of the code as ...