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
1 vote
2 answers
45 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 ...
user avatar
  • 121
1 vote
4 answers
79 views

Find first and last matches on a sorted list

This is the solution I came up with: ...
user avatar
1 vote
2 answers
101 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 ...
user avatar
1 vote
0 answers
69 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 ...
user avatar
6 votes
1 answer
123 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 ...
user avatar
1 vote
1 answer
82 views

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

I wrote a merge sort implementation in C++ today in C++20 way. ...
user avatar
  • 1,121
0 votes
1 answer
63 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 ...
user avatar
  • 2,227
0 votes
0 answers
32 views

Python one-line binary search

...
user avatar
2 votes
2 answers
60 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,...
user avatar
1 vote
2 answers
97 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 ...
user avatar
  • 1
5 votes
2 answers
138 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 ...
user avatar
  • 2,227
3 votes
0 answers
56 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 ...
user avatar
4 votes
2 answers
327 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 ...
user avatar
1 vote
1 answer
43 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 ...
user avatar
16 votes
6 answers
2k 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., ...
user avatar
3 votes
1 answer
62 views

Optimize mergesort algorithm

I just started Stanford Coursera algorithms course and I wrote this mergesort based on what was shown: ...
user avatar
2 votes
2 answers
108 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 ...
user avatar
6 votes
1 answer
125 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 ...
user avatar
  • 61
5 votes
1 answer
1k 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: ...
user avatar
1 vote
1 answer
109 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 ...
user avatar
1 vote
1 answer
58 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: <...
user avatar
  • 2,392
3 votes
2 answers
153 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 ...
user avatar
  • 3,302
0 votes
1 answer
80 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 ...
user avatar
1 vote
1 answer
117 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 ...
user avatar
1 vote
0 answers
52 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 ...
user avatar
  • 27k
2 votes
4 answers
298 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. ...
user avatar
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 ...
user avatar
  • 2,392
3 votes
2 answers
125 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 ...
user avatar
  • 43
1 vote
1 answer
75 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 ...
user avatar
  • 43
2 votes
2 answers
86 views

Serializing (nested) data structures in a human-readable format with all bugs fixed

See Serializing (nested) data structures in a human-readable format for more details. This is the latest version, I have fixed all bugs and now this piece of code works completely as intended. And I ...
user avatar
4 votes
2 answers
817 views

Serializing (nested) data structures in a human-readable format

I am reinventing the wheel to write a function that serializes a (nested) data structure human readably. The default output is deliberately similar to that of ...
user avatar
0 votes
2 answers
84 views

Python 3 integer seconds to date-time string convertor

I have written two functions that output a date-time string for any given non-negative integer. The integer is treated as representing total number of seconds in a given time period, the first ...
user avatar
0 votes
1 answer
124 views

Linked List Implementation in C#

I wrote an implementation of the Linked list data structure. I mostly did this because it's the simplest collection data structure (at least the simplest to implement), and I wanted to practice ...
user avatar
  • 1,796
3 votes
4 answers
149 views

Improving my implementation of a unique_ptr - PPP Stroustrup book

This question is an improvement of this one here: Implementing a unique_ptr - PPP Stroustrup exercise Here's my new code, following the suggestions by @JDługosz. I agree with the fact that T* ...
user avatar
0 votes
2 answers
65 views

Implementing a unique_ptr - PPP Stroustrup exercise

I'm doing the following exercise from PPP - Bjarne Stroustrup, Chapter 19, ex.10. Implement a simple unique_ptr supporting only a constructor, destructor,...
user avatar
14 votes
4 answers
2k views

Using Python enums to define physical units

I'm using Python's Enum to define the physical units in which a value is expressed. Eventually, I want to add them as an attribute to my ...
user avatar
  • 261
1 vote
3 answers
73 views

Word frequency finder

Challenge: find the top three most frequently used words in a string. Only imports from the base package are allowed (source: codewars) I'm looking for feedback on (...
user avatar
  • 123
1 vote
1 answer
167 views

Python 3 arbitrary base converter and base36 encoder

This is a script that can convert any numerical value to any arbitrary radix representation and back, well, technically it can convert a number to any base, but because the output is a string ...
user avatar
0 votes
1 answer
88 views

Writing a buffer that takes a header and a variable number of packets and makes a payload [closed]

I'm writing this as an exercise. I would probably use a vector as a buffer internally (the extra capacity pointer overhead is not important enough). Primarily it's an exercise in writing copy/move ...
user avatar
  • 3
1 vote
1 answer
107 views

Implementing conditional execution in Python [closed]

I found abandoned project on GitHub and curious is it possible to implement part of it on just Python? Here is most close example of processing I would like to implement: ...
user avatar
  • 13
3 votes
1 answer
72 views

UNIX calendar(1) in C

This is a simple implementation of the calendar(1) utility included in some UNIX systems (all BSDs have it, GNU has not). I do not have much experience with ...
user avatar
  • 854
2 votes
2 answers
108 views

An implementation of Uber's “Fare Estimator”

CodeSignal put out a challenge by Uber that involves writing a "fare estimator" that involves a function dependent on cost per minute, cost per mile, ride time and ride distance. The formula ...
user avatar
  • 79
4 votes
2 answers
1k views

Stack Implementation in JavaScript

I am learning data structures and below is my implementation of a stack in JavaScript. I didn't want to use built in functions for an array because in JavaScript that would be too easy, so I made my ...
user avatar
3 votes
3 answers
262 views

Java OOP Calculator (no GUI)

i have created an object orientated Calculator without GUI. i have provided only the most important parts of the code. I want to add another review question for those parts (especially: ...
user avatar
  • 2,392
1 vote
2 answers
266 views

Observer pattern in Rust

A simple implementation of the Observer pattern in rust. The Observable constructor (::new) is called with a subscription function which will be called every time ...
user avatar
5 votes
6 answers
2k views

Implementation of itoa which allocates the string

This is my implementation of itoa() (Integer to Alpha), which converts an integer to a string. Memory management and optimization is important. The caller is not ...
user avatar
  • 61
1 vote
1 answer
58 views

Hashing Table in Python

I just want your opinion about that code! :) ...
user avatar
7 votes
2 answers
206 views

Two dimensional gaussian image generator in C++

This is a follow-up question for Two dimensional bicubic interpolation implementation in C++ and Two dimensional gaussian image generator in C. Based on user673679's answer, another file ...
user avatar
  • 3,302
2 votes
1 answer
273 views

Create a Time class - OOP in Python

Create a Time class. Time is on my side Specification Basic attributes: hour, minute, second and day (default is 0), + getters, + setters (using a decorator) If ...
user avatar
3 votes
1 answer
736 views

Two dimensional bicubic interpolation implementation in C++

This is a follow-up question for Two dimensional bicubic interpolation implementation in C and A recursive_transform Template Function with Unwrap Level for Various Type Arbitrary Nested Iterable ...
user avatar
  • 3,302

1
2 3 4 5
19