Giter Club home page Giter Club logo

prime-generator's Introduction

Prime-Generator

A python coded prime number finder. This is a practice piece of work to work on coding practices and develop my understanding.

The user interface is a simple cli menu that allows users to find new primes, or view the list of primes already found. The program itself uses the sieve of eratosthenes to find primes. It then writes all the prime numbers to a sqllite3 database.

To run the application run the code in app.py to access the CLI.

'f' option is the find_primes workflow that finds primes and saves them to a sqlite databse Users will be prompted to fill in an integer to define the upper_bound to find primes up to. This upperbound is currently searched for in a single array so large numbers will use a lot of memory (plans to segment the array to improve memory usage)

'r' option reads all primes found from the database as a list

'q' quits the program cleanly

prime-generator's People

Contributors

thysk avatar

Stargazers

 avatar

Watchers

 avatar

prime-generator's Issues

Option to clear the database

When testing the speed and edgecases of the scripts it can be sometimes useful to clear the database.
This should be added to the CLI

Add some functionality to recall certain primes

After generating the primes, the current only method for recovering the primes is to read the entire database out.
A use most likely will not want this.

A method, or set of methods should be created to:

  • Read the nth prime number
    This may have to include a change to the database write method, as currently this is not included

  • The prime numbers between a range.

Segment Large arrays to improve memory usage

When searching for large prime numbers the array generated get extremely large. To the point that memory usage gets too large.
The method for finding primes should either:

  • Chunk the arrays, completing them in turn, to restrict memory usage
    or

  • After a certain point become a generator, like the original design

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.