All Questions

Filter by
Sorted by
Tagged with
1 vote
0 answers
9 views

Snail matrix in Java

Inspired by this post, I decided to solve that problem in Java. The idea is to decide on an \$n \in \mathbb{N}\$, create a square matrix \$M_n = D_n^2, D_n = \{1, 2, \ldots, n\},\$ and set the ...
coderodde's user avatar
  • 28.2k
0 votes
0 answers
21 views

Raw HTTP header parser

The code must produce the desired output Input ...
guest271314's user avatar
-1 votes
0 answers
21 views

Android app speed calculation from gps data using google play services

I have my java code that is working, but I am not quite sure how to know if my app works very well. I used some third party dependencies after adding them like this in the ...
Nadhir NACEF's user avatar
-9 votes
0 answers
30 views

C# Update() Overload(?) XXXXX: URGENT [closed]

https://hatebin.com/kyszaelfmr https://hatebin.com/lntnbnjgtn I know this looks atrocious( I have less than a day to finish the project), but currently the problem I'm facing is somewhat a Update() ...
PleaseSendHelp's user avatar
6 votes
2 answers
519 views

Create a snail matrix

Statement: Create a script that, given an integer n, print a matrix of n x n with the ...
Dorian Turba's user avatar
-2 votes
0 answers
23 views

Learn Java. SharedPreferences putStringSet [closed]

I'm studying java and exploring android Studio. I'm trying to save new string and add it to the list and then< i want this list to show me my saved strings after restarting the app. Unfortunately, ...
eeerele's user avatar
12 votes
2 answers
737 views

Header-only log-structured database

I'm seeking a code review for the ~2000 lines of code. Makefile and tests are available at https://github.com/torrentg/logdb. I would appreciate feedback on the following aspects: Overall code ...
Gerard Torrent's user avatar
3 votes
1 answer
40 views

Observer pattern written in C++

I just carefully studied the observer pattern. And I wrote a demo snippet to better undertand it. I am not so sure that if it's the right way to define ...
John's user avatar
  • 59
1 vote
0 answers
24 views

Collecting inputs from a list of file names or stdin if there is no input files

In my program, I want to either read from a file or stdin depending on the arguments. I did this function to collect input: ...
Fayeure's user avatar
  • 105
5 votes
4 answers
388 views

Optimal Solution for the Four Divisors Problem on LeetCode

I recently encountered the Four Divisors problem on LeetCode and managed to achieve a 100% beat rate with my solution. I'd like to share it with you all and gather feedback on its effectiveness and ...
BrunoBarreto's user avatar
2 votes
3 answers
62 views

Arithmetic practice script in a tkinter window

I wrote a script that gives the user a quick arithmetic quiz and results using a tkinter window. I am very new to programming, and this is also my first time using <...
flakpm's user avatar
  • 23
1 vote
1 answer
21 views

Filter filtered bike prices twice without repeating yourself

dbfiddle Goal Without repetition in the code, I want to filter BikeValuationList to only give the BikePriceId of the latest ...
J. Mini's user avatar
  • 127
5 votes
1 answer
339 views

Optimizing Perfect Hash Table Implementation in C for Improved Performance

I wrote code that implements perfect hash table, according to its description in the book "Introduction to Algorithms by Thomas H Cormen", but the code does not pass time tests in contest. I ...
AndrewStrizh's user avatar
7 votes
3 answers
909 views

Is this Python/Pygame that draws a maze well structured?

I'm not very confident about this piece of code I created, it basically takes a file like this: ## # ## ## # #B # # # ## ## ## A###### Then proceeds to ...
José Gomes's user avatar
1 vote
1 answer
47 views
+50

Json4 parser in Typescript - Optimized

Context This review-request is a follow-up to this question. After the initial implementation, which focused on spec-compliance mainly, I have made some revisions to improve the performance of the ...
Patrick Hollweck's user avatar
3 votes
1 answer
58 views

Multithread execution times are slow on Ubuntu and fast on Windows

I'm working on a project accelerating the execution of a Genetic Algorithm both on multiple cores and on a GPU. The algorithm is specifically suited for the solution of the Traveling Salesman Problem ...
Pietro Pianigiani's user avatar
5 votes
2 answers
144 views

Simple Java Command-line Checkers Game

I was working on a checkers game for a college project. After I did a sprint to finish it, I want to improve the movement logic. Right now, it is housed within the ...
ViceroyFaust's user avatar
0 votes
0 answers
11 views

Calendar Table in Power BI

I've been reusing calendar tables in various formats for a few years now. I'd like to know best practices and if there are ways to improve them. Any suggestions for style, code, etc. are all welcome. ...
aduguid's user avatar
  • 490
-2 votes
0 answers
26 views

C++ and RAII - pass reference in constructor just to be sure that GLFW is initialized [closed]

I'm beginning to work with GLFW and Vulkan and I'm abstracting it on some classes. I'm also trying to enforce the RAII pattern. I want to have a Window class, and during this Window creation I want to ...
Caio Vinícius's user avatar
0 votes
0 answers
29 views

Best practice for function structure and return pattern in safety critical code in C [closed]

We are working on a product that we aspire to make safety critical grade and where my personal aim is to write as clear and easy to read code as possible. Sometimes I get a PR review that some code ...
Krzysztof Bracha's user avatar
2 votes
0 answers
53 views

Compute shader based Particle System

I'm experimenting with compute shaders and wrote the particle system. The emit shader now takes particle data from the constant buffer because I don't have randomizing functions implemented yet. That'...
Edziju's user avatar
  • 319
-3 votes
0 answers
20 views

Turning a table with months and days and adding the month with total number of days into a dict for each month [closed]

What is the better way to do this? I was having issues where when I used one loop it would only contain the last addition rather than the total. Ex. August will have 4, 3, 5 and it would end with 5. ...
user282488's user avatar
-1 votes
0 answers
14 views

Concerns regarding Angular website scalability [closed]

I have a couple of concerns regarding code I wrote in the past on whether it is scalable and maintainable. While I am focused on maintaining scalable and maintainable code, I would appreciate any ...
Yousef's user avatar
  • 1
-1 votes
0 answers
23 views

cloneNode then reset the controls [closed]

I wrote this code below to get the template-input-group and cloneNode the data. I then have to reset all the select and input ...
Jefferson's user avatar
  • 359
4 votes
1 answer
159 views

Executing method with time limit restrictions

I've created a method which allows to run tasks where results might not be fully computed but still are considered valid. ExecuteFor method can be used if you have ...
FlameHorizon's user avatar
-2 votes
1 answer
53 views

I wrote a O(log N) code for largest element in an array today but is this an already existing way to find max element in an array? [closed]

Largest element in an array's most optimal approach. The code I have written has passed all test cases in https://www.naukri.com/code360/problems/largest-element-in-the-array-largest-element-in-the-...
im3shn's user avatar
  • 1
0 votes
0 answers
31 views

Testing whether parenthesis are correct in a string in functional JS

This is a homework exercise and therefore has no further purpose. The writing to me feels clunky, and the typescript types on addParenthesisFactory are unreadable, ...
Tomer Kandel's user avatar
0 votes
0 answers
35 views

The Wacky World of ANSI Escape Sequences?

I just finished creating my first npm package (for learning, not competition) and published it. Now I want to ask some questions, for example: Is my method of writing code good (for later maintenance ...
Maysara Elshewehy's user avatar
-4 votes
0 answers
21 views

Request for Assistance with DFS, PMI, and Pairwise Constraints Implementation (Python) [closed]

I've been working on a Python implementation combining Depth-first Search (DFS depth = 2), Pointwise Mutual Information (PMI), and Pairwise Constraints (ML must link and CL cannot link). While I've ...
Zoge13's user avatar
  • 1
0 votes
0 answers
28 views

Construction Permit Web App

I have a Next.js + Node.js + TypeScript + Tailwind + tRPC project whose objective is to allow a construction manager to figure out what permits are required for his renovation based on if it's an ...
Jason's user avatar
  • 1
3 votes
1 answer
110 views

initializing a timezone database and getting all timezone names (before main())

I have written the below small program that tries to initialize a tzdb before the main() runs. So once the main function runs, it checks the two global variables (...
digito_evo's user avatar
2 votes
1 answer
42 views

Basic rust Celsius to Fahrenheit conversion

I've been following the rust book, and I made a Celsius to Fahrenheit converter as it advised me. After a bit, I came up with this code; however in my opinion, there's a lot of unnecessary parts that ...
icy icy's user avatar
  • 23
2 votes
1 answer
51 views

Python sklearn rolling yearly validation

I am trying to implement a simple modelling pipeline with rolling c.v., making use of the TimeSeries split. The code is provided below with a working example dataset. (please don't pay too much ...
Lucas Morin's user avatar
2 votes
1 answer
149 views

Which is faster: Unhide rows during IF or Unhiding them all at once in another macro?

I have process where I am generating workbooks from a list. One of the tabs has varying height and I have a formula that my macro uses to determine whether to hide a row. As I move to the next ...
Mark S.'s user avatar
  • 211
-2 votes
0 answers
36 views

Learning some functional programming - would like your input on code readability [closed]

These are three different exercises I was working on. I'm new to JS and FP as well, and I'm not sure what guidelines to follow to make my code readable. My tabs got a bit borked. All code has: ...
Tomer Kandel's user avatar
-3 votes
0 answers
21 views

Sending data twice a second with HC-12 [closed]

I'm currently working on a project that involves two stations: a transmitter and a receiver. Please keep in mind that I'm a beginner. On the transmitter side, I'm using an ESP32, HC-12 433MHz module, ...
pepin's user avatar
  • 1
4 votes
4 answers
1k views

Stack - implementation in Java

I implemented a stack data structure without using any libraries or Java API code. ...
Mardson Diego's user avatar
1 vote
1 answer
70 views

CPU emulation library

I've started to work on a JavaScript library called vCPU with the purpose of providing a framework for emulators. vCPU is designed to be able to emulate multiple types of CPUs, with setup only ...
themirrazz's user avatar
5 votes
3 answers
603 views

Password checker using Decorator Pattern

I'm currently trying a Password checker for password in Decorator Pattern, which will point out what the current password missing to be a strong password (my example will check for 8 characters, at ...
DEF ABC's user avatar
  • 53
2 votes
0 answers
50 views

A new Dictionary for VBA

The latest version of the Dictionary class presented in this question is available in the VBA-FastDictionary repository under the latest release. Motivation I ...
Cristian Buse's user avatar
1 vote
0 answers
34 views

Simple CRUD server in rust

This is my first rust application. I tried to pick somewhat low level dependencies to get a feel for the language particulars. I'm especially interested in control flow/error patterns in rust as I ...
intentionally-left-nil's user avatar
3 votes
1 answer
118 views

Binary heap based priority queue implementation in C#

I made this Priority Queue implementation for C# since it doesn't support updating priorities in logarithmic time complexity. I did some tests and it seems that it's correct. However, I'm not sure ...
Programmer's user avatar
4 votes
2 answers
288 views

Optimizing Multiple Subplot Visualization and Navigation in Matplotlib

I have implemented a class in Python using Matplotlib for visualizing multiple subplots along with navigation buttons to move between different subsets of data. Each subplot displays a contour plot ...
Cold Fire's user avatar
5 votes
1 answer
467 views

C++ - Find all duplicate files (follow-up)

What's changed since the first version: Instead of hashing each and every file, the sizes of the files are first compared, and if those are equal, the files are then hashed. A more collision resistant ...
Harith's user avatar
  • 5,834
2 votes
0 answers
54 views

Optimizing even more a C++ matrix class with expression templates using variadic templates

I looked at Bowie Owens' cppcon 2019 talk (the slides can be found here) where he shows how to implement a tridiagonal matrix classes using expression templates but without resorting to the CRTP. (It ...
11house's user avatar
  • 21
3 votes
0 answers
37 views

Created client server with read and write from both side

I have created client and server which can read and write from both side in client as well server. So what more improvement can be done so the code should be performant and better? Following are three ...
i_am_learning's user avatar
17 votes
3 answers
3k views

A tic-tac-toe game in C

I am (trying) to learn the C programming language for fun with my father's book "The C Programming Language". I tried writing a tic-tac-toe game in C. I have no professional experience, so ...
Uriel's user avatar
  • 173
5 votes
1 answer
114 views

Creating random music covers using Conways Game of Life algorithm

(A sample cover art follows.) I'm currently working on replacing all the covers of my music files to have a unified theme, and I've started this project in Java to refresh my knowledge after a gap of ...
Zipity's user avatar
  • 51
-3 votes
0 answers
34 views

Retrieving n bits signed integers stored contiguously in memory [closed]

I'm trying to implement the minecraft protocol in TS/Node, and for the Position data type, the doc here says "x as a 26-bit integer, followed by z as a 26-bit integer, followed by y as a 12-bit ...
Fayeure's user avatar
  • 105
-4 votes
0 answers
29 views

Trying to create full-duplex tcp server [closed]

I am trying to create full duplex server, I have implemented this rust code but it is not working, so what could be modification need to be done to make it works. client.rs ...
i_am_learning's user avatar

15 30 50 per page
1
2 3 4 5
1552