From 77a33a73cc11e2a4a66db549f43ec5f0e0c6eb56 Mon Sep 17 00:00:00 2001
From: braxtonhall
Date: Sun, 23 Oct 2022 19:29:26 -0700
Subject: Add Reid's contribution
---
README.md | 3 +++
.../Fibonacci series in JavaScript - Stack Overflow.webloc | 8 ++++++++
2 files changed, 11 insertions(+)
create mode 100644 entries/rtholmes/Fibonacci series in JavaScript - Stack Overflow.webloc
diff --git a/README.md b/README.md
index 4eb6fa1..51ade8f 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,9 @@ For a submission to the upcoming "Reclaim your space" exhibition at [Hatch Art G
### [`nritschel`](https://github.com/nritschel)
- [`fib-java`](./entries/nritschel/fib-java/src)
+### [`rtholmes`](https://github.com/rtholmes)
+- [`stack-overflow`](./entries/rtholmes/Fibonacci%20series%20in%20JavaScript%20-%20Stack%20Overflow.webloc)
+
### [`shayanh`](https://github.com/shayanh)
- [`matrix`](./entries/shayanh/matrix.go)
diff --git a/entries/rtholmes/Fibonacci series in JavaScript - Stack Overflow.webloc b/entries/rtholmes/Fibonacci series in JavaScript - Stack Overflow.webloc
new file mode 100644
index 0000000..939529d
--- /dev/null
+++ b/entries/rtholmes/Fibonacci series in JavaScript - Stack Overflow.webloc
@@ -0,0 +1,8 @@
+
+
+
+
+ URL
+ https://stackoverflow.com/a/55764043
+
+
--
cgit v1.2.3-70-g09d2
From 4c717196fd630c5c207e114ffa9ca9c301eb1198 Mon Sep 17 00:00:00 2001
From: Jonathan Chan
Date: Sun, 23 Oct 2022 23:07:43 -0400
Subject: Fortran :) (also moved my Agda file up a dir)
---
README.md | 3 ++-
entries/ionathanch/Fib.agda | 19 +++++++++++++++++++
entries/ionathanch/agda/Fib.agda | 19 -------------------
entries/ionathanch/fib.f90 | 21 +++++++++++++++++++++
4 files changed, 42 insertions(+), 20 deletions(-)
create mode 100644 entries/ionathanch/Fib.agda
delete mode 100644 entries/ionathanch/agda/Fib.agda
create mode 100644 entries/ionathanch/fib.f90
diff --git a/README.md b/README.md
index 51ade8f..0fcbc53 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,8 @@ For a submission to the upcoming "Reclaim your space" exhibition at [Hatch Art G
### [`ionathanch`](https://github.com/ionathanch)
-- [`agda`](./entries/ionathanch/agda/Fib.agda)
+- [`agda`](./entries/ionathanch/Fib.agda)
+- [`fortran`](./entries/ionathanch/fib.f90)
### [`funemy`](https://github.com/funemy)
- [`agda`](./entries/funemy/agda/fib1.agda)
diff --git a/entries/ionathanch/Fib.agda b/entries/ionathanch/Fib.agda
new file mode 100644
index 0000000..a12b0a5
--- /dev/null
+++ b/entries/ionathanch/Fib.agda
@@ -0,0 +1,19 @@
+
+open import Agda.Builtin.Nat
+open import Agda.Builtin.List
+open import Agda.Builtin.Reflection
+
+data Fib : Nat → Nat → Set where
+ instance F0 : Fib 0 0
+ instance F1 : Fib 1 1
+ instance Fk : ∀ {k n m} → ⦃ Fib k n ⦄ → ⦃ Fib (suc k) m ⦄ → Fib (suc (suc k)) (n + m)
+
+fib' : ∀ k {n} → ⦃ Fib k n ⦄ → Nat
+fib' k {n} ⦃ fib ⦄ = n
+
+macro
+ fib : Term → Term → TC _
+ fib t hole = unify hole (def (quote fib') (arg i t ∷ []))
+ where i = arg-info visible (modality relevant quantity-ω)
+
+{- Get the [n]th Fibonacci number by normalization via C-n `fib [n]`. -}
diff --git a/entries/ionathanch/agda/Fib.agda b/entries/ionathanch/agda/Fib.agda
deleted file mode 100644
index a12b0a5..0000000
--- a/entries/ionathanch/agda/Fib.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-
-open import Agda.Builtin.Nat
-open import Agda.Builtin.List
-open import Agda.Builtin.Reflection
-
-data Fib : Nat → Nat → Set where
- instance F0 : Fib 0 0
- instance F1 : Fib 1 1
- instance Fk : ∀ {k n m} → ⦃ Fib k n ⦄ → ⦃ Fib (suc k) m ⦄ → Fib (suc (suc k)) (n + m)
-
-fib' : ∀ k {n} → ⦃ Fib k n ⦄ → Nat
-fib' k {n} ⦃ fib ⦄ = n
-
-macro
- fib : Term → Term → TC _
- fib t hole = unify hole (def (quote fib') (arg i t ∷ []))
- where i = arg-info visible (modality relevant quantity-ω)
-
-{- Get the [n]th Fibonacci number by normalization via C-n `fib [n]`. -}
diff --git a/entries/ionathanch/fib.f90 b/entries/ionathanch/fib.f90
new file mode 100644
index 0000000..3cf1850
--- /dev/null
+++ b/entries/ionathanch/fib.f90
@@ -0,0 +1,21 @@
+PROGRAM main
+ ! The 93rd Fibonacci number is the largest that fits in 64 bits anyway
+ CHARACTER(3) :: kth
+ INTEGER :: k
+ CALL get_command_argument(1, kth)
+ READ(kth, *) k
+ WRITE(*, *) fib(k)
+CONTAINS
+
+PURE RECURSIVE INTEGER*8 FUNCTION fib(k) RESULT(n)
+ INTEGER, INTENT (IN) :: k
+ IF (k == 0) THEN
+ n = 0
+ ELSE IF (k == 1) THEN
+ n = 1
+ ELSE
+ n = fib(k - 1) + fib(k - 2)
+ END IF
+END FUNCTION fib
+
+END PROGRAM
--
cgit v1.2.3-70-g09d2
From 5a918f5a59e0e3b3af1ef75b5251b9f7ae7a15e8 Mon Sep 17 00:00:00 2001
From: Perry Liao
Date: Sun, 23 Oct 2022 20:17:53 -0700
Subject: Create Jenkins groovy pipeline for fib
---
entries/perryliao/fib.groovy | 48 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 entries/perryliao/fib.groovy
diff --git a/entries/perryliao/fib.groovy b/entries/perryliao/fib.groovy
new file mode 100644
index 0000000..af1c4df
--- /dev/null
+++ b/entries/perryliao/fib.groovy
@@ -0,0 +1,48 @@
+pipeline {
+ agent any
+
+ parameters {
+ string defaultValue: '2', description: 'Number to compute in the Fibonacci Sequence', name: 'num', trim: true
+ }
+
+ stages {
+ stage('Create Cache') {
+ steps {
+ script {
+ if (!fileExists("fibbonacciCache")) {
+ sh 'echo "0\n1" > fibbonacciCache'
+ }
+ }
+ }
+ }
+ stage('Validate Parameter') {
+ steps {
+ script {
+ assert params.num.isInteger()
+ }
+ }
+ }
+ stage('Get Fibbonacci') {
+ steps {
+ script {
+ result = fib(params.num.toInteger())
+ println("The result is F(${params.num}) = ${result}")
+ }
+ }
+ }
+ }
+}
+
+int fib(int n, cache = 'fibbonacciCache') {
+ nComputed = sh(returnStdout: true, script: "wc -l < ${cache}").trim().toInteger()
+ if (n >= nComputed) {
+ // Need to do more recursion
+ result = fib(n - 2, cache) + fib(n - 1, cache)
+ sh "echo '${result}' >> ${cache}"
+ return result
+ } else {
+ // Already have what we need, so read from cache
+ return sh(returnStdout: true, script: "sed -n '${n + 1}p' ${cache}").trim().toInteger()
+ }
+}
+
--
cgit v1.2.3-70-g09d2
From f426d8a9b0b17336838b8840a4e5374f34949383 Mon Sep 17 00:00:00 2001
From: Megha Singhania
Date: Sun, 23 Oct 2022 20:29:52 -0700
Subject: bash: add fib function
---
entries/meghasinghania22/bash/script.sh | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 entries/meghasinghania22/bash/script.sh
diff --git a/entries/meghasinghania22/bash/script.sh b/entries/meghasinghania22/bash/script.sh
new file mode 100644
index 0000000..0cbba4d
--- /dev/null
+++ b/entries/meghasinghania22/bash/script.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+int_regex='^[0-9]+$'
+function fib(){
+ if [ "$1" -le 1 ]; then
+ echo $1
+ else
+ echo $[`fib $[$1 - 1]` + `fib $[$1 - 2]` ]
+ fi
+}
+
+function main(){
+ echo -n "Enter a whole number: "
+ read num
+
+ if [ -z "$num" ]; then
+ echo "Uh oh! Argument required!"
+ elif ! [[ "$num" =~ $int_regex ]]; then
+ echo "Uh oh! Argument must be a number :|"
+ elif [ "$num" -lt 0 ]; then
+ echo "Uh oh! Argument must be a whole number :|"
+ else
+ fib $num
+ fi
+
+}
+
+main
\ No newline at end of file
--
cgit v1.2.3-70-g09d2
From 1df988400399d3147514cf42a132141b7f5d8194 Mon Sep 17 00:00:00 2001
From: Perry Liao
Date: Sun, 23 Oct 2022 20:46:17 -0700
Subject: make only 1 wc call
---
entries/perryliao/fib.groovy | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/entries/perryliao/fib.groovy b/entries/perryliao/fib.groovy
index af1c4df..168913f 100644
--- a/entries/perryliao/fib.groovy
+++ b/entries/perryliao/fib.groovy
@@ -9,8 +9,8 @@ pipeline {
stage('Create Cache') {
steps {
script {
- if (!fileExists("fibbonacciCache")) {
- sh 'echo "0\n1" > fibbonacciCache'
+ if (!fileExists("fibCache")) {
+ sh 'echo "0\n1" > fibCache'
}
}
}
@@ -25,6 +25,7 @@ pipeline {
stage('Get Fibbonacci') {
steps {
script {
+ nComputed = sh(returnStdout: true, script: "wc -l < fibCache").trim().toInteger()
result = fib(params.num.toInteger())
println("The result is F(${params.num}) = ${result}")
}
@@ -33,16 +34,17 @@ pipeline {
}
}
-int fib(int n, cache = 'fibbonacciCache') {
- nComputed = sh(returnStdout: true, script: "wc -l < ${cache}").trim().toInteger()
+def nComputed
+
+int fib(int n, cache = 'fibCache') {
if (n >= nComputed) {
// Need to do more recursion
result = fib(n - 2, cache) + fib(n - 1, cache)
+ nComputed++
sh "echo '${result}' >> ${cache}"
return result
} else {
// Already have what we need, so read from cache
- return sh(returnStdout: true, script: "sed -n '${n + 1}p' ${cache}").trim().toInteger()
+ return sh(returnStdout: true, script: "sed -n '${n + 1}p' ${cache}").toInteger()
}
}
-
--
cgit v1.2.3-70-g09d2
From 2f4fab9864a91d69d2b705430f6633bdfe7f5dd5 Mon Sep 17 00:00:00 2001
From: Perry Liao
Date: Sun, 23 Oct 2022 20:56:25 -0700
Subject: validation should probably come first lol
---
entries/perryliao/fib.groovy | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/entries/perryliao/fib.groovy b/entries/perryliao/fib.groovy
index 168913f..d625d68 100644
--- a/entries/perryliao/fib.groovy
+++ b/entries/perryliao/fib.groovy
@@ -6,19 +6,19 @@ pipeline {
}
stages {
- stage('Create Cache') {
+ stage('Validate Parameter') {
steps {
script {
- if (!fileExists("fibCache")) {
- sh 'echo "0\n1" > fibCache'
- }
+ assert params.num.isInteger()
}
}
}
- stage('Validate Parameter') {
+ stage('Create Cache') {
steps {
script {
- assert params.num.isInteger()
+ if (!fileExists("fibCache")) {
+ sh 'echo "0\n1" > fibCache'
+ }
}
}
}
--
cgit v1.2.3-70-g09d2
From 383b5fe9374f580ef2d1eb3a450cb8b755ad54d4 Mon Sep 17 00:00:00 2001
From: braxtonhall
Date: Sun, 23 Oct 2022 21:08:22 -0700
Subject: Migrate contributors to static html
---
README.md | 43 ---------------
index.html | 93 ++++++++++++++++++++++++++++++++
people.json | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 265 insertions(+), 43 deletions(-)
create mode 100644 index.html
create mode 100644 people.json
diff --git a/README.md b/README.md
index 0fcbc53..738eae3 100644
--- a/README.md
+++ b/README.md
@@ -4,49 +4,6 @@ Can you please give me a Fibonacci function? Ideally (but not necessarily) one t
For a submission to the upcoming "Reclaim your space" exhibition at [Hatch Art Gallery](https://www.instagram.com/hatch_artgallery).
-### [`adirar111`](https://github.com/adirar111)
-- [`y86`](./entries/adirar111/y86/fib.s)
-
-### [`braxtonhall`](https://github.com/braxtonhall)
-- [`adam`](./entries/braxtonhall/adam/main.py) (WIP)
-- [`express`](./entries/braxtonhall/express/index.js)
-- [`homework`](./entries/braxtonhall/homework/fib.cpp)
-- [`types`](./entries/braxtonhall/types/index.ts)
-
-
-
-### [`ionathanch`](https://github.com/ionathanch)
-- [`agda`](./entries/ionathanch/Fib.agda)
-- [`fortran`](./entries/ionathanch/fib.f90)
-
-### [`funemy`](https://github.com/funemy)
-- [`agda`](./entries/funemy/agda/fib1.agda)
-- [`z3`](./entries/funemy/z3/z3fib.sh)
-
-### [`jyoo980`](https://github.com/jyoo980)
-- [`scala`](./entries/jyoo980/scala/Fib.scala)
-
-### [`margoseltzer`](https://github.com/margoseltzer)
-- [`efficiency`](./entries/margoseltzer/efficiency.c)
-
-### [`Metroxe`](https://github.com/Metroxe)
-- [`html`](./entries/Metroxe/index.html)
-
-### [`nritschel`](https://github.com/nritschel)
-- [`fib-java`](./entries/nritschel/fib-java/src)
-
-### [`rtholmes`](https://github.com/rtholmes)
-- [`stack-overflow`](./entries/rtholmes/Fibonacci%20series%20in%20JavaScript%20-%20Stack%20Overflow.webloc)
-
-### [`shayanh`](https://github.com/shayanh)
-- [`matrix`](./entries/shayanh/matrix.go)
-
-### [`Tarcisio-Teixeira`](https://github.com/Tarcisio-Teixeira)
-- [`logn?`](./entries/Tarcisio-Teixeira/fib.py)
-
-### [`wilbowma`](https://github.com/wilbowma)
-- [`fib-lang`](https://github.com/wilbowma/fib-lang/tree/2ec2d1dfd141220882d824cf3dac5b374ed291f3)
-
## Contributing
To contribute just make a PR into the `main` branch!
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..3755c55
--- /dev/null
+++ b/index.html
@@ -0,0 +1,93 @@
+
+
+
+
+ fib
+
+
+
+
+ fib
+ Can you please give me a Fibonacci function? Ideally (but not necessarily) one that only you would give me.
+
+ For a submission to the upcoming "Reclaim your space" exhibition at Hatch Art Gallery.
+
+
+
+
+
diff --git a/people.json b/people.json
new file mode 100644
index 0000000..cc5e8e3
--- /dev/null
+++ b/people.json
@@ -0,0 +1,172 @@
+[
+ {
+ "github": "adirar111",
+ "name": "Aymen Dirar",
+ "title": "BSc Student, UBC",
+ "entries": [
+ {
+ "name": "y86",
+ "link": "./entries/adirar111/y86/fib.s"
+ }
+ ]
+ },
+ {
+ "github": "braxtonhall",
+ "name": "Braxton Hall",
+ "title": "MSc, UBC",
+ "entries": [
+ {
+ "name": "express",
+ "link": "./entries/braxtonhall/express/index.js"
+ },
+ {
+ "name": "homework",
+ "link": "./entries/braxtonhall/homework/fib.cpp"
+ },
+ {
+ "name": "types",
+ "link": "./entries/braxtonhall/types/index.ts"
+ }
+ ]
+ },
+ {
+ "github": "ionathanch",
+ "name": "Jonathan Chan",
+ "title": "MSc, UBC",
+ "entries": [
+ {
+ "name": "agda",
+ "link": "./entries/ionathanch/Fib.agda"
+ },
+ {
+ "name": "fortran",
+ "link": "./entries/ionathanch/fib.f90"
+ }
+ ]
+ },
+ {
+ "github": "funemy",
+ "name": "Yanze Li",
+ "title": "PhD Student, UBC",
+ "entries": [
+ {
+ "name": "agda",
+ "link": "./entries/funemy/agda/fib1.agda"
+ },
+ {
+ "name": "z3",
+ "link": "./entries/funemy/z3/z3fib.sh"
+ }
+ ]
+ },
+ {
+ "github": "jyoo980",
+ "name": "James Yoo",
+ "title": "MSc, UBC",
+ "entries": [
+ {
+ "name": "scala",
+ "link": "./entries/jyoo980/scala/Fib.scala"
+ }
+ ]
+ },
+ {
+ "github": "margoseltzer",
+ "name": "Margo Seltzer",
+ "title": "Professor of Computer Science, UBC",
+ "entries": [
+ {
+ "name": "efficiency",
+ "link": "./entries/margoseltzer/efficiency.c"
+ }
+ ]
+ },
+ {
+ "github": "meghasinghania22",
+ "name": "Megha Singhania",
+ "title": "BSc, UBC",
+ "entries": [
+ {
+ "name": "bash",
+ "link": "./entries/meghasinghania22/bash/script.sh"
+ }
+ ]
+ },
+ {
+ "github": "Metroxe",
+ "name": "Christopher Powroznik",
+ "title": "BCom, UBC",
+ "entries": [
+ {
+ "name": "html",
+ "link": "./entries/Metroxe/index.html"
+ }
+ ]
+ },
+ {
+ "github": "nritschel",
+ "name": "Nico Ritschel",
+ "title": "PhD Student, UBC",
+ "entries": [
+ {
+ "name": "fib-java",
+ "link": "./entries/nritschel/fib-java/src"
+ }
+ ]
+ },
+ {
+ "github": "perryliao",
+ "name": "Perry Liao",
+ "title": "BSc, UBC",
+ "entries": [
+ {
+ "name": "groovy",
+ "link": "./entries/perryliao/fib.groovy"
+ }
+ ]
+ },
+ {
+ "github": "rtholmes",
+ "name": "Reid Holmes",
+ "title": "Associate Professor of Computer Science, UBC",
+ "entries": [
+ {
+ "name": "stack-overflow",
+ "link": "./entries/rtholmes/Fibonacci%20series%20in%20JavaScript%20-%20Stack%20Overflow.webloc"
+ }
+ ]
+ },
+ {
+ "github": "shayanh",
+ "name": "Shayan Hosseini",
+ "title": "MSc Student, UBC",
+ "entries": [
+ {
+ "name": "matrix",
+ "link": "./entries/shayanh/matrix.go"
+ }
+ ]
+ },
+ {
+ "github": "Tarcisio-Teixeira",
+ "name": "Tarcísio Teixeira",
+ "title": "MSc Student, UBC",
+ "entries": [
+ {
+ "name": "logn?",
+ "link": "./entries/Tarcisio-Teixeira/fib.py"
+ }
+ ]
+ },
+ {
+ "github": "wilbowma",
+ "name": "William Bowman",
+ "title": "Assistant Professor of Computer Science, UBC",
+ "entries": [
+ {
+ "name": "fib-lang",
+ "link": "https://github.com/wilbowma/fib-lang/tree/2ec2d1dfd141220882d824cf3dac5b374ed291f3"
+ }
+ ]
+ }
+]
\ No newline at end of file
--
cgit v1.2.3-70-g09d2
From 21d4b1499fbbb5dc6f2c91c7a2e525d0c7a1a599 Mon Sep 17 00:00:00 2001
From: braxtonhall
Date: Sun, 23 Oct 2022 21:16:20 -0700
Subject: Sort entries, use correct URL for people
---
index.html | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/index.html b/index.html
index 3755c55..9bf65f9 100644
--- a/index.html
+++ b/index.html
@@ -45,11 +45,11 @@
@@ -44,8 +45,10 @@
Contributors
+
+ Want to contribute?