Questions tagged [reinventing-the-wheel]

For when you know you are reinventing the wheel, but are doing it anyways. Questions with this tag involve code that is already fully implemented (such as from a library).

Filter by
Sorted by
Tagged with
2 votes
1 answer
115 views

C++ std::string implementation

Following is my simple implementation of the std string class. Please review my code and offer some advice. I want to figure out is there anything wrong with my code or is there anything I can improve ...
  • 21
1 vote
1 answer
55 views

General purpose 2D grid

I am developing (WIP) a mine sweeping game to get more familiar with Rust. I decided to represent the mine field as a 2D grid. While developing I realized that this grid can be outsourced as a general ...
2 votes
1 answer
35 views

Quadratic equation solver using ABC and PQ formula

Getting my feet wet with Rust, I implemented a solver for quadratic equations. I implemented both, ABC and PQ formula solvers, to challenge myself with branch conditions. ...
1 vote
1 answer
43 views

Derivative calculator simplifier using python

I am newbie in the field of programming, but I have tried to make relatively "huge" project. My "app" would derivate a mathematical expression, after that simplify the output ...
  • 11
7 votes
1 answer
86 views

Improving the speed of an MD5 implementation from scratch in C++

I wrote an implementation of the MD5 hashing algorithm from scratch in C++, following the original RFC: https://www.ietf.org/rfc/rfc1321.txt . It works as expected, and the outputs match all the test ...
3 votes
1 answer
45 views

Simple ISO date, time and datetime implementation

I am getting started with rust. To get familiar with the language I implemented a datetime library: main.rs ...
2 votes
0 answers
42 views

Vectors in 2D, 3D, and more dimensions

I have written this code to perform vector operations like addition, multiplications and so on. I was wondering if there is a better way to write this code? Because I feel it is a little bit repeated. ...
1 vote
0 answers
52 views

Another quicksort implementation

I have created a program in python using the quicksort algorithm. However, I am unsure if I have properly done so. Is the following program an accurate representation of quicksort? ...
  • 11
5 votes
1 answer
411 views

Simple TimeStamp class in Python

For a project I'm working on we need a basic time holder class. This is written in CircuitPython, which is a stripped down version of CPython that's missing a number of libraries, including the whole ...
  • 263
4 votes
1 answer
119 views

Need for matrix multiplication speed

I need help to make matrix multiplication in C run as fast as possible. On my AMD Phenom(tm) II X6 1090T, my program multiplies two square singe precision 4096x4096 matrices in about 6.9 seconds. ...
3 votes
0 answers
66 views

Securely generate Token for authentication

In my experience i had the need that some application (both desktop and web) can excange data to authenticate users (even if the data for authenticating users are not reacheable form desktop ...
  • 228
2 votes
1 answer
71 views

Calculating Spearman Correlation from scratch

Over the week, I was assigned to create a function in a Jupyter notebook that satisfies the Spearman Correlation formula without the use of any packages e.g. Numpy, Pandas. Below are the rules of the ...
10 votes
1 answer
174 views

C++ imitation of glibc malloc(), free()

I wrote a C++ simulator that performs algorithms for glibc malloc() and free(). The core logic is basically the same, with the ...
  • 1,643
1 vote
0 answers
100 views

C++: STL-like AVL Tree (+ benchmark vs. my red-black tree and std::set)

AVL trees and red-black trees are most famous balanced binary search trees. I've always wondered "Why do all major C++ standard library implementations use red-black trees as their ordered ...
  • 1,643
3 votes
2 answers
74 views

Re-designing c-style Input Output

Re - designing c-style input output [ btw I use printf() and scanf() in the core ] Reasons for redesigning it :- Needs 2 functions for input output [ namely ...
  • 133
0 votes
1 answer
52 views

Approximation of the multiplicative matrix inverse (linalg.inv ())

I am trying to compute the multiplicative inverse of a large matrix (~ >40,000x40,000). This can be done with e.g. numpy.linalg.inv or ...
  • 103
2 votes
0 answers
28 views

Get ffmpeg command to encode video in x265 codec and downscale to `max_height` resolution

I'm translating the python program video-diet as I am learning rust. The program is to recursively compress video files in a directory, but here I'm just preparing ...
's user avatar
2 votes
2 answers
391 views

C++ Hash table, Hash function, benchmark vs std::unordered_set and std::hash

I wrote my own hash function and my own hash table. My hash function seems to work surprisingly well! Feel free to comment anything! Hash function: ...
  • 1,643
2 votes
1 answer
55 views

C++ Doubly linked list, including benchmark vs std::list

I wrote a rudimentary implementation of doubly linked list. Feel free to comment anything! ...
  • 1,643
4 votes
1 answer
63 views

improved "tee" utility

We have modified the tee program with your suggestions from the previous pull request. Did I implement well? I would like to optimize the program even more, what ...
  • 199
3 votes
2 answers
468 views

Implementation of the "tee" utility program

How can I optimize the program? To make it more optimal? The program should be more optimal in terms of source code, compiled executable size, memory usage, speed, bugs etc. Please criticize the ...
  • 199
2 votes
2 answers
116 views

another attempt to implement the tee command

I implemented the tee command from linux. The program implements the -a option Reads standard input until end-of-file, write a ...
  • 199
1 vote
6 answers
152 views

Find first and last matches on a sorted list

I needed a function to find the first and last indices into a sorted list corresponding to a given value (roughly similar to C++'s equal_range()). This is the ...
1 vote
2 answers
145 views

Duplicate Binary Search Improvements

I'm working on an implementation of binary search (in Python) that can operate on a sorted array that may have duplicate elements. I've written a submission that has managed to hold up against my test ...
1 vote
0 answers
92 views

What’s the correct usage of volatile keyword in this Concurrent dictionary implementation?

Can I get some guidance around the usage of volatile keyword and design of the existing concurrent dictionary implementation, please. Here are a few design ...
6 votes
1 answer
140 views

Binary search algorithm (Python 3.9)

New to using this platform and would like to familiarise myself with it so would just like to ask if I am exhibiting good practice with my programming. Started the online CS50 course today and thought ...
1 vote
1 answer
115 views

C++ merge sort, logging, unit test, performance check

I wrote a merge sort implementation in C++ today in C++20 way. ...
  • 1,643
0 votes
1 answer
91 views

std::list implementation learning exercise

I want to improve my algorithms and data structures in C++ understanding and also learn how the standard library containers are implemented. I implemented a std::vector in a previous review and this ...
  • 2,279
0 votes
0 answers
62 views

Python one-line binary search

...
2 votes
2 answers
80 views

Programming Challenge: Python 3 DNS query resolver using socket

This is a DNS query resolver written in Python 3 using socket, I wrote it entirely by myself, it supports 8 primary DNS query types: A, NS, CNAME, SOA, PTR, MX, TXT,...
1 vote
2 answers
104 views

Function that behaves as dup2

I am reading the book Advanced Programming in the UNIX Environment and I have tried to solve the following exercise: Write a function that performs the same actions as ...
  • 449
5 votes
2 answers
157 views

std::vector implementation learning exercise

I want to improve my algorithms and data structures in C++ understanding and also learn how the standard library containers are implemented. This resizing_array is based on the std::vector. My ...
  • 2,279
3 votes
0 answers
65 views

Command line notebook

I used Python and a little bit of JavaScript using the (Python) modules Dominate and Flask to create a web app that somewhat resembles the Jupyter Notebook though with very basic functionality. I ...
4 votes
2 answers
390 views

Bash-based Port scanner (/dev/tcp)

This question is ideal in my case: Ludisposed's python-scapy-tcp-port-scan-of-subnet - At codereview stackexchange But this is not Scapy; nor Python(it might get used in the future though but that is ...
1 vote
1 answer
55 views

Another generic dynamic arrays in C

Wrote this (and others not here) as an exercise to explore how generics could be implemented in C. Question -- if I were to support out-of-band error setting, how would that look like for ...
16 votes
6 answers
3k views

A file class for Python

This is the entire code segment. All the functions for file operations are working perfectly. I just need a professional to help me clarify that am following good standards, documentation, etc., ...
3 votes
1 answer
72 views

Optimize mergesort algorithm

I just started Stanford Coursera algorithms course and I wrote this mergesort based on what was shown: ...
2 votes
2 answers
124 views

Python - Temperature - descriptors with conversion

So I'm trying to understand the concept of descriptors and gathered some code together and made an exampel out of different sources. Like the offical documentation and StackOverflow answers. I'd hope ...
6 votes
1 answer
154 views

Implementation of Singly Linked List in Python

I am learning basic data structures in Python. I'm not confident enough if my implementations are OK or I miss any corner cases. So please check my code for Singly Linked List and Let me know where I ...
  • 61
5 votes
1 answer
3k views

Simple IP address subnet calculator

In this task I had to create simple IP address / subnet calculator in Python. I'm just wondering how you see this problem. There is my code: ...
1 vote
1 answer
324 views

In place QuickSort algorithm in Python

I have been searching for ways to make my algorithm more efficient but most answers told me to divide the array into two differente arrays one of less elements and one of greater elements and then ...
1 vote
1 answer
60 views

first python: maze with backtracker

i'm learning python but i'm used to java development. this might have influenced my programming style. feel free to give any feedback on the code maze_learning.py: <...
  • 2,581
3 votes
2 answers
171 views

Manhattan distance calculation between two images in C++

This is a follow-up question for Two dimensional gaussian image generator in C++ and Image pixelwise operation function with multiple inputs in C++. For learning C++20 and researching purposes, I am ...
  • 3,596
0 votes
1 answer
85 views

Simple sort function

I am learning Python and for practice I have written this function which sorts a list. Can you please provide feedback on how I have structured it and what better ways could be there to write it for ...
1 vote
1 answer
202 views

Python IPv6 verifier, parser and converter

This is a simple Python 3 program that verifies whether a string is a valid IPv6 address or not, parses IPv6 address to its hexadecimal and decimal values, and converts an integer to IPv6 format. I am ...
1 vote
0 answers
64 views

Solving a linear system with Gaussian Elimination

I decided to implement a solver for linear systems of equations based on the gaussian elimination and reduction to upper triangular form. The gaussian elimination is quite simple to implement but the ...
  • 27.3k
2 votes
4 answers
609 views

Single-linked-list in C++ with iterators

I'm implementing a single linked list as close as it could be to std::forward_list. I would welcome a review and also more suggestions on what to test additionally. ...
7 votes
7 answers
3k views

DnD Die in Java with regex

For my game I need to roll some values with a die. A die is formally described as: nDs[+a] n amount of die (optional, 1 of not set, zero must be set explicitly) D ...
  • 2,581
3 votes
2 answers
169 views

C++11 revised `std::latch` implementation

This question follows up on this question. After turning the while-loop into a conditional wait using std::condition_variable, I ...
  • 43
1 vote
1 answer
90 views

Implementation of a latch

As an exercise to learn more about multi-threading and atomic operations work in C++, I decided to implement a latch class in C++11 loosely based off of std::latch ...
  • 43

1
2 3 4 5
19