Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pkg-dot-zip/pairtripleandup
Kotlins Tuples stop at Pair & Triple. This adds dataclasses for Quadruple up to Quingentuple and beyond.
https://github.com/pkg-dot-zip/pairtripleandup
bad-code jvm kotlin kotlin-library programming-horror tuple tuples
Last synced: 25 days ago
JSON representation
Kotlins Tuples stop at Pair & Triple. This adds dataclasses for Quadruple up to Quingentuple and beyond.
- Host: GitHub
- URL: https://github.com/pkg-dot-zip/pairtripleandup
- Owner: pkg-dot-zip
- License: mit
- Created: 2024-01-27T10:46:41.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-01-27T15:39:18.000Z (9 months ago)
- Last Synced: 2024-09-30T13:04:05.964Z (about 1 month ago)
- Topics: bad-code, jvm, kotlin, kotlin-library, programming-horror, tuple, tuples
- Language: Kotlin
- Homepage:
- Size: 962 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PairTripleAndUp
[![Stars](https://img.shields.io/github/stars/pkg-dot-zip/PairTripleAndUp.svg)](https://github.com/pkg-dot-zip/PairTripleAndUp/stargazers)
[![GitHub Issues](https://img.shields.io/github/issues/pkg-dot-zip/PairTripleAndUp.svg)](https://github.com/pkg-dot-zip/PairTripleAndUp/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/pkg-dot-zip/PairTripleAndUp.svg)](https://github.com/pkg-dot-zip/PairTripleAndUp/pulls)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)---
Why would Kotlins Tuples stop at Pair & Triple?! Just continue to the thousands...
A joke just so I can be on ProgrammingHorror.
## π Table of Contents
- [About](#about)
- [TODO](#todo)
- [Usage](#usage)
- [Example]()
- [Built Using](#built_using)
- [Authors](#authors)## π§ About
### What is it?
This repo contains all kinds of Tuples (click [here](#included-tuples) to see which one are default) **You can generate EVEN MORE by changing the values in *Config.kt!***If you find this funny (or if you're insane and planning on actually using this) make sure to [star](https://github.com/pkg-dot-zip/PairTripleAndUp/stargazers) the repository. β
If you are bored, you can help implement some more by playing around with the configuration. Feel free to [submit a PR](https://github.com/pkg-dot-zip/PairTripleAndUp/pulls). πͺπ»
If you see any other issues please feel free to [submit a PR](https://github.com/pkg-dot-zip/PairTripleAndUp/pulls), if you are okay with this project being in your history.
### Why?! π±
#### The reason
I could make up a great story about how I had a dream, or even better how I actually needed it (and thus having a reason to justify creating this monstrosity).However, truth be told, I thought it would be **funny**. I saw a video about the [/r/ProgrammingHorror](https://www.reddit.com/r/programminghorror/) subreddit and I just needed to create something that would be worth putting on there.
### Did you get the attention you wanted?
Then, after I had finished creating this project, I read the subreddit rules and saw that generated code was not allowed. After recovering from the heartbreaking realization that I wasted my morning, I moved on with life.However, technically, using a *quadragintuple* or a *septingentuple* wouldn't be generated code (although obviously the dataclass itself is generated).
So who knows, I might get there. π€·π»ββοΈ
### Do you feel any remorse?
No, I have actually been sleeping much better lately. π΄#### But what if any future employers see this repository?
They should know I had the **balls** to do this. π£οΈπ£οΈ
They want a hard-working employee right?! Nothing is stopping me baby πΊπ»πͺ©β¨### Included Tuples
This repo contains implementations of tuples with the following values:
| Number | HorrorSimple | HorrorFull |
| ------ | ------------ | ---------- |
| 1-20 | βοΈ | βοΈ |
| 30 | βοΈ | βοΈ |
| 40 | βοΈ | βοΈ |
| 50 | βοΈ | βοΈ |
| 60 | βοΈ | βοΈ |
| 70 | βοΈ | βοΈ |
| 80 | βοΈ | βοΈ |
| 90 | βοΈ | βοΈ |
| 100 | βοΈ | βοΈ |
| 200 | βοΈ | βοΈ |
| 300 | βοΈ | βοΈ |
| 400 | βοΈ | βοΈ |
| 500 | βοΈ | βοΈ |
| 600 | βοΈ | βοΈ |
| 700 | βοΈ | βοΈ |
| 800 | β | βοΈ |
| 900 | β | β |
| 1000 | β | β |## π οΈ TODO
- Technically we could probably use maps, arrays or whatever to store some more data & we would have to use less parameters, but I am not putting more time into this. I have actual projects to maintain.
- You could also play around with the configuration of the JVM to avoid getting an [OutOfMemoryError](https://docs.oracle.com/javase/8/docs/api/java/lang/OutOfMemoryError.html) as quickly.If you see any other issues please feel free to [submit a PR](https://github.com/pkg-dot-zip/PairTripleAndUp/pulls), if you are okay with this project being in your history.
## π Usage
Why would you w..?! π€¨ You know what, okay.### Plug-and-play
1. Download either:
- *HorrorSimple.kt* (no documentation, no *.toString()* & *.toList()*)
- *HorrorFull.kt* (documentation, *.toString()* & *.toList() but less tuples)
1. Drag them into your Kotlin project.
1. Enjoy long compile times. β³
1. Pray you don't get an [OutOfMemoryError](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-out-of-memory-error/). ππ»### Generating yourself
To generate a proper *.kt* file:
1. Open the project in [IntelliJ](https://www.jetbrains.com/idea/).
1. Go to *Config.kt* and change the values to whatever it is you prefer.
1. Change some code around if you need or want to.
1. Feel ashamed. π³To use the generated file:
1. Drag the generated *.kt* file from the folder you set into a valid *src* folder.
1. Code, and stay, away! ππ»## Example
Example usage of a quadruple (4). Unfortunately, a quadruple is not enough to also store a [Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/) and [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/) ~~(since everyone forgets the [unsigned types in Kotlin](https://kotlinlang.org/docs/unsigned-integer-types.html))~~.
You can see this will never be enough for real programmers.
```kotlin
fun example1() {
val quadruple: Quadruple =
Quadruple(0, 0F, 0L, 0.0)
doALotOfWork(quadruple)
}
```Example usage of a sexdecuple (16).
This should be very understandable by beginners, but might not contain enough values for you.
```kotlin
fun example2() {
val sexdecuple: Sexdecuple, Boolean, Boolean, Float, Boolean, String, Char, String, String?, Long, Char, Char?, Char> =
Sexdecuple("Hey", 2, 3, arrayOf(""), false, true, 1F, false, "", 'w', "a", null, 1L, 'p', 'a', 'b',
)println(sexdecuple.toString())
}
```Example usage of a quingentuple (500). Might be useful if you have a small amount of data you need to store real quick.
```kotlin
fun example3() {
val quingentuple: Quingentuple =
Quingentuple('V','i','k','t','o','r',809L,'G','y','ΓΆ','k','e','r','e','s',2987,'i','s',4.2,'t','h','e',4.1,'b','e','s','t',"Kotlin",'f','o','o','t','b','a','l','l','e','r',' ','g','l','o','b','a','l','l','y',',',' ','e','x','c','e','l','l','i','n','g',' ','i','n',' ','s','k','i','l','l','s',',',' ','v','i','s','i','o','n',',',' ','a','n','d',' ','v','e','r','s','a','t','i','l','i','t','y','.',' ','V','i','k','t','o','r',' ','G','y','ΓΆ','k','e','r','e','s',' ','i','s',' ','t','h','e',' ','b','e','s','t',' ','f','o','o','t','b','a','l','l','e','r','.',' ','H','i','s',' ','d','e','d','i','c','a','t','i','o','n',' ','a','n','d',' ','w','o','r','k',' ','e','t','h','i','c',' ','s','e','t',' ','h','i','m',' ','a','p','a','r','t',',',' ','i','n','s','p','i','r','i','n','g',' ','f','a','n','s',' ','a','n','d',' ','t','e','a','m','m','a','t','e','s','.',' ','V','i','k','t','o','r',' ','G','y','ΓΆ','k','e','r','e','s','.',' ','H','i','s',' ','a','b','i','l','i','t','y',' ','t','o',' ','a','d','a','p','t',' ','t','o',' ','v','a','r','i','o','u','s',' ','p','o','s','i','t','i','o','n','s',' ','m','a','k','e','s',' ','h','i','m',' ','i','n','v','a','l','u','a','b','l','e',',',' ','m','a','k','i','n','g',' ','G','y','ΓΆ','k','e','r','e','s',' ','a',' ','f','o','o','t','b','a','l','l','i','n','g',' ','l','e','g','e','n','d','.',' ','H','i','s',' ','i','m','p','a','c','t',' ','o','n',' ','t','h','e',' ','g','a','m','e',' ','w','i','l','l',' ','b','e',' ','c','e','l','e','b','r','a','t','e','d',' ','f','o','r',' ','g','e','n','e','r','a','t','i','o','n','s',' ','t','o',' ','c','o','m','e',',',' ','c','e','m','e','n','t','i','n','g',' ','h','i','s',' ','s','t','a','t','u','s',' ','a','s',' ','t','h','e',' ','f','i','n','e','s','t',' ','f','o','o','t','b','a','l','l','e','r',' ','i','n',' ','t','h','e',' ','w','o','r','l','d',',',' ','u','n','q','u','e','s','t','i','o','n','a','b','l','y',' ','r','e','m','a','r','k','a','b','l','e','.',' ','V','i','k','t','o','r',' ','G','y','ΓΆ','k','e','r','e','s','.',null)println(quingentuple.toString())
}
```## βοΈ Built Using
- [Kotlin](https://kotlinlang.org/) - Language used to program in
- [IntelliJ](https://www.jetbrains.com/idea/) - IDE used## βοΈ Authors
- [@OnsPetruske](https://github.com/pkg-dot-zip) - Idea & Initial work. ~~Not proud of this one.~~See also the list of [contributors](https://github.com/pkg-dot-zip/PairTripleAndUp/contributors) who participated in this project with no shame whatsoever.