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
1answer
30 views

Matrix template Class

This is my 2nd shot at dynamic memory allocation. This project is for practice purposes. So many things were considered whilst writing this minimal project. I considered using placement new to ...
7
votes
2answers
291 views

Doubly Linked List Data Structure ADT in C++

I'm trying to implement a Doubly Linked List data structure in C++. Please give me suggestions on how this code can be improved. Try to remain in C++11 because that's what I know atm. ...
6
votes
2answers
197 views

Custom STL Vector container Implementation

For practice purposes, I reimplemented a STL Vector container. This container has most/all of the capabilities of STL vector.In my previous post, the reviewers made critical and concised observations ...
3
votes
2answers
77 views

Linked List Queue Implementation

I implemented a Queue using linked list data structure. This is also my first time using templates in C++. OVERVIEW Queue is a data-structure that supports only ...
7
votes
3answers
1k views

Implementation of Singly Linked List (C++)

I tried to implement a singly linked list myself, sorry it is not commented but I think it should be pretty self-explanatory, if not feel free to comment. I know that using namespace std; is not ...
4
votes
4answers
236 views

Convert Integer to Binary String

This code takes a user input number which is a positive integer, and outputs a string representation of the number in binary. For example, input 2 outputs ...
11
votes
3answers
364 views

FASTA-to-tsv conversion script

I worked on a script that takes as input a multi-sequence .fasta file and outputs the number of each aminoacid/sequence in a .tsv...
5
votes
1answer
62 views

AJAX with Vanilla Node.js/JavaScript – POST JSON without a form

I am new to node.js, ajax, and asynchronous code. I’ve pieced together a working way to exchange json between browser and server and am wondering if someone with more experience considers the approach ...
2
votes
1answer
72 views

Print exact value represented by float in [0,1)

Motivated by yet another floating point question on stackoverflow, I decided to print a float value \$x\in[0,1)\$, i.e., the fractional part of a float (I might try printing whole floats later). But ...
2
votes
1answer
55 views

Converting an integer to a hexadecimal string representation in Java

I have rolled my own Java method for converting ints to the hexadecimal Strings: ...
5
votes
2answers
74 views

Complex Numbers & Unit Tests in Python

I've just started a course that will require knowledge and experience with Python for future projects, which I don't have, so I thought I'd give it a go to familiarize myself with it and get some ...
5
votes
0answers
43 views

Sequence and Series Calculator

The Sequences & Series involved are Arithmetic and Geometric. stores and allows you to calculate using these given formulas and import fractions into micropython Support for micropython! ...
1
vote
2answers
114 views

a simple implementation of unix2dos for windows

On linux there is the utility called unix2dos which converts UNIX EOLs(\n) to DOS EOLs(\r\n). However on windows there is no such tool so as a result I decided to make one. ...
4
votes
3answers
455 views

String class implementation

I'm working on a project (it's a language), and for that project, I decided to go with a low-level C++ style, so that means making my own data types. I recently got done making my own string class ...
6
votes
2answers
348 views

Quadratic Expression Factorer and Solver

I have decided to create a program that can factor and solve quadratic expressions in micropython, where the standard library is limited, and i have no idea how to implement external modules onto it, ...
11
votes
1answer
1k views

C++ : B-Tree in C++20 (+Iterator support)

I wrote a B-Tree implementation in C++20, based on my previous Red-Black Tree implementation. Unit Test Demo : https://wandbox.org/permlink/Brw6TgAhdy89OIyj Any feedback will be welcomed! ...
9
votes
2answers
1k views

C Implementation of atof

I'm a beginner at C. I'm currently implementing atof to build a raytracer, however I'm still learning how to efficiently write programs. Assignement Instructions The program takes a scene description ...
3
votes
2answers
91 views

Binary to Decimal conversion program

I am a beginner in Python and I have written a program to convert binary numbers to decimal. It works, but are there any ways to improve the code and make it better? ...
5
votes
1answer
51 views

Dynamic-sized Hash table with Linked List

Below is an implementation heavily based on climberig's implementation on Leetcode for LeetCode 706. Design HashMap. Just to preface, I am doing this in preparation for an exam. The one below is ...
6
votes
1answer
57 views

Buffered and unbuffered cat(1) implementation

I reimplemented cat(1) for fun. I followed the Open Group Base Specifications (Issue 7, 2018 edition), not the GNU variant and its command line arguments. Buffered ...
7
votes
2answers
625 views

This python code converts integers to strings and strings to ints without the inbuilt functions “int()” and “str()”

It is my solution from a challange from edabit.com named "Drunken Python". Thats the task: You need to create two functions to substitute str() and int(). A function called int_to_str() that ...
4
votes
1answer
176 views

Doubly-linked list with iterators

Writing a double-linked list seemed like a good practice for understanding it. I tried to fix all the errors that were pointed out to me in the last question, as well as add new functionality. In ...
6
votes
0answers
141 views

c++ std::function implementation

When I first tried to implement std::function I thought it would as easy as creating a class that holds a function pointer. Consequently, I quickly figured out that ...
8
votes
2answers
61 views

Line wrapping text utility using fixed-size arrays

As an exercise, I've made a text processing utility that wraps arbitrarily long lines of text, but only using fixed-size arrays and other basic C features. I have mostly programmed in Python, C++ and ...
3
votes
1answer
57 views

creating own javascript join and push methods

I'm a newbie trying to write my own push() and join(). This isn't very serious, just an exercise. This is what I got so far <...
9
votes
3answers
969 views

DynamicArray class in C++

I am pretty new to C++ and I think I have some problems of keeping code clean and optimized, especially I have problems with writing comments. I just don't know when should I be explaining what I ...
8
votes
3answers
795 views

Optimizing a linked list

I wrote a linked list class and don't know how to optimize it, please suggest some ideas for optimizing and fixing possible memory leaks. ...
9
votes
2answers
1k views

Simple square root calculator

Very simple square root calculator. I am sure it's terrible and can be made much better. I feel it's way too many lines. ...
5
votes
1answer
177 views

std::vector remake

Out of the majority of my c++ projects, the most used thing is std::vector because it allows me to not have to my own memory management. However previously I had never really thought much about how ...
2
votes
1answer
78 views

JavaScript — Convert decimal to another base

The Source code is maintained on GitHub and may be cloned via the following commands. A Live demo is hosted online, thanks to GitHub Pages. ...
3
votes
2answers
78 views

Script to generate random password

I made this random password script. It works, but i think it is kind of bloated. The part where random characters are being added is the area where I think it needs work. I don't want to declare if ...
3
votes
1answer
62 views

JSON Data-structure in C++ and querying it

As a personal challenge I want to implement a C++ JSON Parser. As part of that I have implemented the following Types/Data-structures and a way of querying them. To represent the type of an individual ...
4
votes
2answers
110 views

Program to convert number from any base to decimal

I have made a script to convert number from any base to decimal. I am trying to optimize the code because I think it is bloated and can be improved but if I change anything it affects error handling ...
5
votes
1answer
55 views

Doubly linked ring implementation

I was practicing C++ and data structures and wrote my own implementation of a doubly linked ring. I would love to improve my code a little bit more and would need help from the community. Here is the ...
2
votes
3answers
70 views

Perl - Splitting a string

I've decided to work on my Perl skills. I've written a small subroutine that splits a string based on an optional delimiter. I'd like any feedback on this program so I can kick bad habits to the curb. ...
2
votes
1answer
127 views

Generating all variations of M*N matrix containing boolean values

I've implemented an algorithm that generates all variations of a matrix of size \$M*N\$. My approach is that I see a matrix as a list where the position of elements can be calculated from the position ...
5
votes
5answers
926 views

Convert Integer to String without using Java API library

I have written a Java program that converts an integer to String digit by digit and concatenate them together using the + operator without touching the Stock Java API library. I like to have feedback ...
2
votes
1answer
38 views

Merge Sort Implementation Efficiency In Python

I wasn't able to find a standardized source for a working example of Merge Sort. Each learning site had a slightly different take on the algorithm implementation, disregarding the bottom-top ...
3
votes
1answer
46 views

Insertion Sort Implementation Efficiency

Is my approach to insertion Sort in Python efficient? What can be improved efficiency wise? ...
2
votes
1answer
35 views

Re-implementing an Array Class in Python

I gave an attempt at reinventing the wheel and recreate list methods using my own Array Class to broaden my understanding about lists. I would like advice regarding efficiency, and in implementing ...
5
votes
1answer
96 views

An echo program, mostly in C and completely from scratch

This is an echo program with no runtime or standard library. It's meant to be compiled with -nostdlib on an amd64 Linux system. ...
3
votes
1answer
79 views

Implementing Linked Lists in Python as a beginner

I have been learning linked lists for the past three days. I feel I have implemented a complete linked list. Are there any more things a linked list should do? Please can you review any or all of my ...
4
votes
1answer
90 views

A simple printf implementation in C89

I tried to implement printf family functions in C89, after I've read K&R book. The goals are three: Do not use dynamic memory allocation (like ...
2
votes
1answer
100 views

Preserving principle of locality while performing memory allocation

In order to implement an efficient AST visitor preserving the principle of locality, I implemented some reference counting mechanism in C++ with the following set of features: All the newly allocated ...
4
votes
4answers
808 views

std::vector implementation C++

I just started studying data structures and being the std::vector the container that I most use in C++ I decide to try to implement it mimicking its behavior the ...
2
votes
1answer
150 views

Modern C++ Linked List

I have been using this quarantine time to learn "Modern C++" (constructs, move semantics, smart pointers, etc, etc) via implementing basic data structures from scratch. As a first step, I've put ...
0
votes
1answer
66 views

Python extended Euclidean algortihm + inverse modulo

I programmed the extended Euclidean algorithm together with the inverse modulo because I am making an RSA system from scratch. Any feedback regarding efficiency etc. is welcome :) ...
1
vote
2answers
54 views

Binary exponentation with modulo

I have implemented binary exponentiation. Is this good? ...
3
votes
3answers
133 views

An entire file size retriever using a recursive os function in python

I'm a beginner and i just started with automate the boring stuff with python course and reached his first os lesson, so i decided to make a recursive directory size finder since apparently os.path....
3
votes
2answers
115 views

Sorting an array using a Binary Search Tree with C++

Given an array of integer (all different from each other), this program creates a BST with the array elements in order to sort them and put them back into the array, using the BST properties. ...

1
2 3 4 5
17