Skip to content

Commit

Permalink
made updates
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasthaddeus committed Aug 15, 2023
1 parent 863c88c commit 3e85677
Show file tree
Hide file tree
Showing 47 changed files with 1,536 additions and 546 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ coverage.xml
*.pot

# Django stuff:
*.log
#*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
Expand Down Expand Up @@ -122,3 +122,7 @@ dmypy.json

# Pyre type checker
.pyre/

docs/extras.html
docs/old_styles.css
src/app/logs/previous-runs/*.log
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"src/app/tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"svg.preview.background": "transparent"
}
120 changes: 87 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,97 @@
# Musical Chairs

[![Deploy Jekyll](https://github.com/thomasthaddeus/musical-chairs/actions/workflows/jekyll-gh-pages.yml/badge.svg)](https://github.com/thomasthaddeus/musical-chairs/actions/workflows/jekyll-gh-pages.yml)
[![Deploy Jekyll](https://github.com/thomasthaddeus/musical-chairs/actions/workflows/jekyll-gh-pages.yml/badge.svg)](https://github.com/thomasthaddeus/musical-chairs/actions/workflows/jekyll-gh-pages.yml) ![GitHub top language](https://img.shields.io/github/languages/top/thomasthaddeus/musical-chairs?logo=python&logoColor=yellow) ![GitHub repo size](https://img.shields.io/github/repo-size/thomasthaddeus/musical-chairs?logo=github)

This project contains implementations of a seating arrangement algorithm using four different approaches: using a class, using Python's heapq module, using standalone functions, and using Python's zip function along with the built-in sorted function.
## Table of Contents

<details markdown="1"><summary></summary>

- [Musical Chairs](#musical-chairs)
- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [The Musical Chairs Problem](#the-musical-chairs-problem)
- [The Algorithm](#the-algorithm)
- [The Web Application](#the-web-application)
- [About the Project](#about-the-project)
- [Built With](#built-with)
- [Directory Structure](#directory-structure)
- [Files Overview](#files-overview)
- [Running the Tests](#running-the-tests)

</details>

## Introduction

This project is a simple web application that demonstrates the use of four different approaches to solving the musical chairs problem.

## The Musical Chairs Problem

Suppose that you are hosting a dinner party and have invited some number of guests. When the guests arrive, you realize that you don't have enough chairs for everyone. You decide to solve this problem by asking some of the guests to stand while the others sit. Your guests are all very close friends and have no preference for where they sit at the table, but you would like to maximize the number of guests sitting at the table.

## The Algorithm

The algorithm is implemented in four different ways. The basic idea is to sort the guests by their total number of friends. Then, starting with the guest with the most friends, assign them a seat at the table and remove them and all of their friends from the list of guests. Repeat this process until there are no guests remaining. The different implementations of the algorithm differ in how the guests are sorted.

## The Web Application

The web application is built using [Jekyll](https://jekyllrb.com). The source code for the web application is located in the `src` directory. The web application is deployed to GitHub Pages and can be accessed via the following link [Musical Chairs](https://apparellnstuff.me/musical-chairs/)

## About the Project

This project contains implementations of a seating arrangement algorithm using four different approaches:

1. using a class
2. using Python's `heapq` module
3. using standalone functions
4. using Python's `zip` function
- with the built-in `sorted` function.

### Built With

- [Python](https://www.python.org/)
- [pytest](https://docs.pytest.org/en/6.2.x/)
- [Jekyll](https://jekyllrb.com)
<!-- - [Bootstrap 5](https://getbootstrap.com/docs/5.0/getting-started/introduction/) -->

## Directory Structure

The project has the following directory structure:

```markdown
```bash
.
├── .gitignore
├── LICENSE.md
├── LICENSE
├── README.md
├── src
│   ├── logs
│   │   ├── class.log
│   │   ├── hq.log
│   │   ├── standalone.log
│   │   └── zip.log
│   ├── _main
│   │   ├── _decorators_main.py
│   │   └── _functions_main.py
│   ├── main.py
│   ├── modules
│   │   ├── __init__.py
│   │   ├── with_classes.py
│   │   ├── with_heapq.py
│   │   ├── with_standalone.py
│   │   └── with_zip_sorted.py
│   └── tests
│   ├── __init__.py
│   ├── __pycache__
│   ├── test_with_classes.py
│   ├── test_with_heapq.py
│   ├── test_with_standalone.py
│   └── test_with_zip_sorted.py
└── .vscode
└── settings.json
└── src
├── app
│   ├── main.py
│   ├── pylint.rc
│   ├── logs
│   │   ├── class.log
│   │   ├── hq.log
│   │   ├── standalone.log
│   │   └── zip.log
│   ├── _main
│   │   ├── _decorators_main.py
│   │   └── _functions_main.py
│   ├── modules
│   │   ├── __init__.py
│   │   ├── with_classes.py
│   │   ├── with_heapq.py
│   │   ├── with_standalone.py
│   │   └── with_zip_sorted.py
│   └── tests
│   ├── __init__.py
│   ├── test_main.py
│   └── test_modules.py
├── css
│ └── styles.css
└── js
├── accordion.js
├── dropdown_enhancements.js
├── fetch.js
├── myModal.js
└── smooth_scrolling.js
```

### Files Overview
Expand All @@ -48,14 +102,14 @@ The project has the following directory structure:
- `with_heapq.py`: Implementation of the algorithm using Python's heapq module.
- `with_standalone.py`: Implementation of the algorithm using standalone functions.
- `with_zip_sorted.py`: Implementation of the algorithm using Python's zip function along with the built-in sorted function.
- `test_with_classes.py`, `test_with_heapq.py`, `test_with_standalone.py`, `test_with_zip_sorted.py`: These are pytest files for testing each of the four implementations.
- `test_main.py`, `test_modules.py`: These are pytest files for testing each of the four implementations.

### Running the Tests

To run the tests, you will need to install pytest

```python
pip install pytest
```
```python
pip install pytest
```

Then you can run pytest command from your terminal at the root directory of the project.
93 changes: 93 additions & 0 deletions assets/fonts/Source_Code_Pro/OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
79 changes: 79 additions & 0 deletions assets/fonts/Source_Code_Pro/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
Source Code Pro Variable Font
=============================

This download contains Source Code Pro as both variable fonts and static fonts.

Source Code Pro is a variable font with this axis:
wght

This means all the styles are contained in these files:
SourceCodePro-VariableFont_wght.ttf
SourceCodePro-Italic-VariableFont_wght.ttf

If your app fully supports variable fonts, you can now pick intermediate styles
that aren’t available as static fonts. Not all apps support variable fonts, and
in those cases you can use the static font files for Source Code Pro:
static/SourceCodePro-ExtraLight.ttf
static/SourceCodePro-Light.ttf
static/SourceCodePro-Regular.ttf
static/SourceCodePro-Medium.ttf
static/SourceCodePro-SemiBold.ttf
static/SourceCodePro-Bold.ttf
static/SourceCodePro-ExtraBold.ttf
static/SourceCodePro-Black.ttf
static/SourceCodePro-ExtraLightItalic.ttf
static/SourceCodePro-LightItalic.ttf
static/SourceCodePro-Italic.ttf
static/SourceCodePro-MediumItalic.ttf
static/SourceCodePro-SemiBoldItalic.ttf
static/SourceCodePro-BoldItalic.ttf
static/SourceCodePro-ExtraBoldItalic.ttf
static/SourceCodePro-BlackItalic.ttf

Get started
-----------

1. Install the font files you want to use

2. Use your app's font picker to view the font family and all the
available styles

Learn more about variable fonts
-------------------------------

https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
https://variablefonts.typenetwork.com
https://medium.com/variable-fonts

In desktop apps

https://theblog.adobe.com/can-variable-fonts-illustrator-cc
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts

Online

https://developers.google.com/fonts/docs/getting_started
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts

Installing fonts

MacOS: https://support.apple.com/en-us/HT201749
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows

Android Apps

https://developers.google.com/fonts/docs/android
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts

License
-------
Please read the full license text (OFL.txt) to understand the permissions,
restrictions and requirements for usage, redistribution, and modification.

You can use them in your products & projects – print or digital,
commercial or otherwise.

This isn't legal advice, please consider consulting a lawyer and see the full
license for all details.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 3e85677

Please sign in to comment.