From dcda1a50dee51dea51fa2ebf667c67a464e6f50e Mon Sep 17 00:00:00 2001 From: Matthew Thomas Date: Fri, 4 Oct 2019 17:11:57 +0100 Subject: [PATCH 01/74] Add AWK and a simple temperature convertor Remove other branch code --- CONTRIBUTORS.md | 5 ----- awk/temperature_convertor.awk | 1 + bash/fizzbuzz.sh | 2 -- bash/machin-pi-approximation.sh | 4 ---- 4 files changed, 1 insertion(+), 11 deletions(-) create mode 100644 awk/temperature_convertor.awk delete mode 100644 bash/fizzbuzz.sh delete mode 100644 bash/machin-pi-approximation.sh diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 545ae634..081b91a0 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -365,8 +365,3 @@ Name: [BenjaminUrquhart](https://github.com/BenjaminUrquhart)
Coding Experience: Discord Bot Developer (Java) + misc. wrappers.
Programming Languages: Python 2/3, Java 8
Email: benjamin@ericsart.com - -Name: [pbootly](https://github.com/pbootly)
-Place: Southampton, United Kingdom
-Coding Experience: System administrator. Bash, Node and some C.
-Email: mthomas@polybit.io
diff --git a/awk/temperature_convertor.awk b/awk/temperature_convertor.awk new file mode 100644 index 00000000..0401ae00 --- /dev/null +++ b/awk/temperature_convertor.awk @@ -0,0 +1 @@ +BEGIN {printf "Enter a temperature of format ##f or ##c to get the opposing value\n"; getline < "-"} BEGIN { if ( $1 ~ /f/ ) { print (((substr($1, 1, length($1)-1) - 32) * 5/9))"C"} else if ( $1 ~ /c/ ) { print (substr($1, 1, length($1)-1) * 9 / 5 + 32"F")} else {print "Usage: ##f to convert to celcius ##c to convert to fahrenheit"}} diff --git a/bash/fizzbuzz.sh b/bash/fizzbuzz.sh deleted file mode 100644 index 70c42930..00000000 --- a/bash/fizzbuzz.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -seq 100 | awk '$0=NR%15?NR%5?NR%3?$0:"fizz":"buzz":"fizzbuzz"' diff --git a/bash/machin-pi-approximation.sh b/bash/machin-pi-approximation.sh deleted file mode 100644 index f91b663e..00000000 --- a/bash/machin-pi-approximation.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Machin approximation of pi in bash with 100 terms -echo $(scale=100; seq 1 2 200 | xargs -n1 -I{} echo '16*(1/5)^{}/{}-4*(1/239)^{}/{}' | paste -sd-+) | bc -l From 65e8838f80cd7fe24e5d04eb854ca2fa0a50d4a2 Mon Sep 17 00:00:00 2001 From: U3X Date: Sun, 6 Oct 2019 15:16:49 +0530 Subject: [PATCH 02/74] Added code that checks if the number is a square number --- cplusplus/check_square.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cplusplus/check_square.cpp diff --git a/cplusplus/check_square.cpp b/cplusplus/check_square.cpp new file mode 100644 index 00000000..16aa09ac --- /dev/null +++ b/cplusplus/check_square.cpp @@ -0,0 +1,14 @@ +#include + +using namespace std; + +void issquare(long long int a){ +int flag=1; for(long long i=1;i<=a/2+1;i++){ if(i*i==a) {cout<<"it is a square number\n";flag=0;} }if(flag==1) cout<<"Not a square number\n"; +} + +int main(){ +long long int a; +cin>>a; +issquare(a); +return 0; +} From 5caef3ab3acdce9004547ea41908ee0bf94789e9 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Mon, 7 Oct 2019 09:18:41 +0530 Subject: [PATCH 03/74] swap two numbers in C. --- CONTRIBUTORS.md | 6 ++++++ c/swap/shubhamdpatil_swap.c | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 c/swap/shubhamdpatil_swap.c diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 081b91a0..7ea118cb 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -365,3 +365,9 @@ Name: [BenjaminUrquhart](https://github.com/BenjaminUrquhart)
Coding Experience: Discord Bot Developer (Java) + misc. wrappers.
Programming Languages: Python 2/3, Java 8
Email: benjamin@ericsart.com + +Name: [Shubham Patil](https://github.com/shubhamdpatil) +Place: Pune, India +Coding Experience: C, python +Email: shubhampatil.patil@gmail.com + diff --git a/c/swap/shubhamdpatil_swap.c b/c/swap/shubhamdpatil_swap.c new file mode 100644 index 00000000..216c9bae --- /dev/null +++ b/c/swap/shubhamdpatil_swap.c @@ -0,0 +1,19 @@ +/* + * @file: shubhamdpatil_swap.c + */ + +#include + +#define swap(x, y) ((x ^= y), (y ^= x), (x ^= y)) + +int main() +{ + int a, b; + scanf("%d %d", &a, &b); + printf("Before swap: %d, %d\n", a, b); + + swap(a, b); + printf("After swap: %d, %d\n", a, b); + return 0; +} + From d037f36ecf36214f64b0842a687100da1dd90872 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Mon, 7 Oct 2019 09:36:24 +0530 Subject: [PATCH 04/74] Calculate GCD of two numbers in C --- c/gcd/shubhamdpatil_gcd.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 c/gcd/shubhamdpatil_gcd.c diff --git a/c/gcd/shubhamdpatil_gcd.c b/c/gcd/shubhamdpatil_gcd.c new file mode 100644 index 00000000..edfd4407 --- /dev/null +++ b/c/gcd/shubhamdpatil_gcd.c @@ -0,0 +1,18 @@ +/* + * @file: shubhamdpatil_gcd.c + */ + +#include + +int gcd(int x, int y) +{ + return (y == 0) ? x : gcd(y, x % y); +} + +int main() +{ + int a, b; + scanf("%d %d", &a, &b); + printf("GCD of %d and %d: %d\n", a, b, gcd(a, b)); + return 0; +} From c1481db91af6010b34282e4938f76ef455b13a89 Mon Sep 17 00:00:00 2001 From: Kazuko Kannagi <43587695+kannagikazuko@users.noreply.github.com> Date: Fri, 18 Oct 2019 00:25:46 -0400 Subject: [PATCH 05/74] Rename temperature_convertor.awk to pbootly_temperature_convertor.awk --- ...emperature_convertor.awk => pbootly_temperature_convertor.awk} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename awk/{temperature_convertor.awk => pbootly_temperature_convertor.awk} (100%) diff --git a/awk/temperature_convertor.awk b/awk/pbootly_temperature_convertor.awk similarity index 100% rename from awk/temperature_convertor.awk rename to awk/pbootly_temperature_convertor.awk From 5fe7c7d313fd0c2d6a4b9e4e339d21e80c896874 Mon Sep 17 00:00:00 2001 From: Manish Patel <44387583+mspatel927@users.noreply.github.com> Date: Sun, 20 Oct 2019 00:09:15 -0400 Subject: [PATCH 06/74] Create Greater Than --- python/Greater Than | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 python/Greater Than diff --git a/python/Greater Than b/python/Greater Than new file mode 100644 index 00000000..4e0c6544 --- /dev/null +++ b/python/Greater Than @@ -0,0 +1,3 @@ +# Returns a positive number if x is > y, 0 if they are equal, or a negative number if x is < y +def greaterThan(x, y): + return (x-y) From a10bb313bfd8eafe65b190084681dc52a9781597 Mon Sep 17 00:00:00 2001 From: Manish Patel <44387583+mspatel927@users.noreply.github.com> Date: Sun, 20 Oct 2019 00:41:53 -0400 Subject: [PATCH 07/74] Create Mean --- python/Mean | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 python/Mean diff --git a/python/Mean b/python/Mean new file mode 100644 index 00000000..e9dbb9ce --- /dev/null +++ b/python/Mean @@ -0,0 +1,3 @@ +def mean(list): + return sum(list)/len(list) + From 153b8347da3589bdbb5c1786832b5fee0d378905 Mon Sep 17 00:00:00 2001 From: predator21x Date: Sun, 20 Oct 2019 12:11:54 +0530 Subject: [PATCH 08/74] adds to python --- CONTRIBUTORS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c1b7b34b..68e81970 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -439,3 +439,7 @@ Name: [Antonio](https://github.com/toluwalope19)
Place: Nigeria
Coding Experience: Python and javaScript.
Email: tolubarca01@gmail.com
+Name: [Abhay yadav](https://github.com/predator21x)
+place: India.
+Coding Experience: a newbie in this field. Programming language: C, python.
+Email: ry694356@gmail.com
From d09fd09645398e90eaa69b5dcb95940ae35dec5d Mon Sep 17 00:00:00 2001 From: predator21x Date: Sun, 20 Oct 2019 12:14:34 +0530 Subject: [PATCH 09/74] new line --- python/The-largest_number_that_can_be_represented_by_8_Byte.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 python/The-largest_number_that_can_be_represented_by_8_Byte.py diff --git a/python/The-largest_number_that_can_be_represented_by_8_Byte.py b/python/The-largest_number_that_can_be_represented_by_8_Byte.py new file mode 100644 index 00000000..28b095aa --- /dev/null +++ b/python/The-largest_number_that_can_be_represented_by_8_Byte.py @@ -0,0 +1 @@ +print '\n'.join("%i Byte = %i Bit = largest number: %i" % (j, j*8, 256**j-1) for j in (1 << i for i in xrange(8))) \ No newline at end of file From 426aa301d1b2c7ba61fd0ef248c8bcb0a6c51e98 Mon Sep 17 00:00:00 2001 From: predator21x Date: Sun, 20 Oct 2019 12:34:29 +0530 Subject: [PATCH 10/74] decimal conversion new to python --- python/decimal_conversion.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 python/decimal_conversion.py diff --git a/python/decimal_conversion.py b/python/decimal_conversion.py new file mode 100644 index 00000000..41d19560 --- /dev/null +++ b/python/decimal_conversion.py @@ -0,0 +1,6 @@ +dec = 344 + +print("The decimal value of",dec,"is:") +print(bin(dec),"in binary.") +print(oct(dec),"in octal.") +print(hex(dec),"in hexadecimal.") \ No newline at end of file From f29cdf72e21f0f9c25c3196fe6f8bb622baa8b1b Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Tue, 22 Oct 2019 04:03:41 +0530 Subject: [PATCH 11/74] added basic Hello World Code in C --- CONTRIBUTORS.md | 6 ++++++ c/hello/n6wbi6_hello_world.c | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 c/hello/n6wbi6_hello_world.c diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c1b7b34b..652380b5 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -439,3 +439,9 @@ Name: [Antonio](https://github.com/toluwalope19)
Place: Nigeria
Coding Experience: Python and javaScript.
Email: tolubarca01@gmail.com
+ +Name: [Abhishek Singh](https://github.com/n6wbi6)
+Place: India
+Coding Experience: 2 years of coding experience in C.
+Email: abhisheksingh.g07@gmail.com
+ diff --git a/c/hello/n6wbi6_hello_world.c b/c/hello/n6wbi6_hello_world.c new file mode 100644 index 00000000..314f1165 --- /dev/null +++ b/c/hello/n6wbi6_hello_world.c @@ -0,0 +1,8 @@ +#include + +int main() { + + printf("Hello, world!"); + return 0; + +} From f64df6faca1a5f85a456cf5894277f034176c0ec Mon Sep 17 00:00:00 2001 From: Yash Agarwal Date: Tue, 22 Oct 2019 09:27:21 +0530 Subject: [PATCH 12/74] Solved #162 #96 #78 #323 --- ...sum_of_consecutive_numbers_in_an_array.cpp | 31 +++++++++++++++++++ .../yashagarwal1999_countingValley.cpp | 30 ++++++++++++++++++ .../yashagarwal1999_get_Approximate_Pi.py | 3 ++ python/unique/yashagarwal1999_unique_array.py | 11 +++++++ 4 files changed, 75 insertions(+) create mode 100644 honorary-one-line-wonders/cplusplus/yashagarwal1999_Largest _sum_of_consecutive_numbers_in_an_array.cpp create mode 100644 honorary-one-line-wonders/cplusplus/yashagarwal1999_countingValley.cpp create mode 100644 python/approximate_pi/yashagarwal1999_get_Approximate_Pi.py create mode 100644 python/unique/yashagarwal1999_unique_array.py diff --git a/honorary-one-line-wonders/cplusplus/yashagarwal1999_Largest _sum_of_consecutive_numbers_in_an_array.cpp b/honorary-one-line-wonders/cplusplus/yashagarwal1999_Largest _sum_of_consecutive_numbers_in_an_array.cpp new file mode 100644 index 00000000..5c4b9674 --- /dev/null +++ b/honorary-one-line-wonders/cplusplus/yashagarwal1999_Largest _sum_of_consecutive_numbers_in_an_array.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; +typedef long long int ll; +pair maxsum(ll arr[],ll n) +{ +ll sum=0; +ll max=0; +pairp; +ll x=0,y=0; +for(ll i=0;imax){max=sum;y=i;} +if(sum<0){sum=0;x=i+1;} + +} +p.first=x; +p.second=y; +return p; +} + +int main() +{ +int n; +cin>>n; +ll arr[n]; +for(ll i=0;i>arr[i]; +pairp=maxsum(arr,n); +cout< +using namespace std; +typedef long long int ll; +int countingValleys(int n, string s) { + + +int sum=0; +if(s[0]=='U')sum++; +else sum--; +int count=0; +if(sum<0)count++; +for(int i=1;i>n; +string s; +cin>>s; +cout< Date: Tue, 22 Oct 2019 20:39:04 -0400 Subject: [PATCH 13/74] Rename Greater Than to mspatel927_Greater_Than.py --- python/{Greater Than => mspatel927_Greater_Than.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{Greater Than => mspatel927_Greater_Than.py} (100%) diff --git a/python/Greater Than b/python/mspatel927_Greater_Than.py similarity index 100% rename from python/Greater Than rename to python/mspatel927_Greater_Than.py From 22d1a973235eee799efeb730cfdaf3dba438cbf1 Mon Sep 17 00:00:00 2001 From: Manish Patel <44387583+mspatel927@users.noreply.github.com> Date: Tue, 22 Oct 2019 20:41:35 -0400 Subject: [PATCH 14/74] Rename Mean to mspatel927_Random_Card_Draw.py --- python/{Mean => mspatel927_Random_Card_Draw.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{Mean => mspatel927_Random_Card_Draw.py} (100%) diff --git a/python/Mean b/python/mspatel927_Random_Card_Draw.py similarity index 100% rename from python/Mean rename to python/mspatel927_Random_Card_Draw.py From 9f1b24aef29f54b6d1313b2fc40f580be540d0be Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Thu, 24 Oct 2019 14:07:41 +0530 Subject: [PATCH 15/74] added one-line factorial lambda function --- python/factorial/factorial_n6wbi6.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 python/factorial/factorial_n6wbi6.py diff --git a/python/factorial/factorial_n6wbi6.py b/python/factorial/factorial_n6wbi6.py new file mode 100644 index 00000000..120f16c7 --- /dev/null +++ b/python/factorial/factorial_n6wbi6.py @@ -0,0 +1,3 @@ +fact = lambda x: 1 if x == 0 else x * fact(x-1) +#testing it +print(fact(25)) \ No newline at end of file From dc045e93ab3b5e10552aae92f28375ab1eaaa2f6 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Thu, 24 Oct 2019 14:15:40 +0530 Subject: [PATCH 16/74] added experience in python --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 652380b5..534158db 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -442,6 +442,6 @@ Email: tolubarca01@gmail.com
Name: [Abhishek Singh](https://github.com/n6wbi6)
Place: India
-Coding Experience: 2 years of coding experience in C.
+Coding Experience: 2 years of coding experience in C and python.
Email: abhisheksingh.g07@gmail.com
From 5ed7701d280f6a200b19c3647566a2371521631f Mon Sep 17 00:00:00 2001 From: Yash Agarwal <38498671+yashagarwal1999@users.noreply.github.com> Date: Fri, 25 Oct 2019 17:40:11 +0530 Subject: [PATCH 17/74] Solved unique array using list comprehension --- python/unique/yashagarwal1999_unique_array.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/python/unique/yashagarwal1999_unique_array.py b/python/unique/yashagarwal1999_unique_array.py index ab118aa9..92aa7e27 100644 --- a/python/unique/yashagarwal1999_unique_array.py +++ b/python/unique/yashagarwal1999_unique_array.py @@ -1,9 +1,7 @@ -def getunique(arr): - finallist=[] - for i in arr: - if(i not in finallist): - finallist.append(i); - return finallist +def uni(arr): + li=[] + [li.append(i) for i in arr if not li.count(i)] + return li list1 = [10, 20, 10, 30, 40, 40] print(getunique(list1)) From e004a3fceb498a3dd3b97fc96bbd376d45b6877f Mon Sep 17 00:00:00 2001 From: HarshitaArun <51452962+HarshitaArun@users.noreply.github.com> Date: Sat, 26 Oct 2019 19:32:35 +0530 Subject: [PATCH 18/74] Create Swap.c This code swaps two numbers in one line and it doesn't use 3rd variable --- c/Swap.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 c/Swap.c diff --git a/c/Swap.c b/c/Swap.c new file mode 100644 index 00000000..799d6785 --- /dev/null +++ b/c/Swap.c @@ -0,0 +1,9 @@ +#include +void main() +{ + int a,b; + printf("enter a and b\n"); + scanf("%d%d",&a,&b); + a=(a+b)-(b=a); // one line code + printf("a=%d and b=%d",a,b); +} From 56bb7d7bc77532841c0a3c083f938fe1ad0e42c5 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 27 Oct 2019 17:47:01 -0400 Subject: [PATCH 19/74] Create wzhouwzhou_unique_values.js --- javascript/unique/wzhouwzhou_unique_values.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 javascript/unique/wzhouwzhou_unique_values.js diff --git a/javascript/unique/wzhouwzhou_unique_values.js b/javascript/unique/wzhouwzhou_unique_values.js new file mode 100644 index 00000000..4a83f7ef --- /dev/null +++ b/javascript/unique/wzhouwzhou_unique_values.js @@ -0,0 +1,3 @@ +const values = [1, 2, 3, 4, 5, 1, 1, 1, 3]; + +const unique = [void(0)].map((e, i, arr) => new Set(values).forEach(v => arr.push(v)) || arr)[0].slice(1) From 6bda45d8c6c95fe58a0005a1156e9fd7275d86e8 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 27 Oct 2019 17:47:36 -0400 Subject: [PATCH 20/74] Update wzhouwzhou_unique_values.js --- javascript/unique/wzhouwzhou_unique_values.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/unique/wzhouwzhou_unique_values.js b/javascript/unique/wzhouwzhou_unique_values.js index 4a83f7ef..c6bcc469 100644 --- a/javascript/unique/wzhouwzhou_unique_values.js +++ b/javascript/unique/wzhouwzhou_unique_values.js @@ -1,3 +1,3 @@ const values = [1, 2, 3, 4, 5, 1, 1, 1, 3]; -const unique = [void(0)].map((e, i, arr) => new Set(values).forEach(v => arr.push(v)) || arr)[0].slice(1) +const unique = [void(0)].map((e, i, arr) => new Set(values).forEach(v => arr.push(v)) || arr)[0].slice(1); From ab62c8cb0a05fade029072e561adf0c6a82beec9 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 27 Oct 2019 19:14:17 -0400 Subject: [PATCH 21/74] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 534158db..09a44454 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -444,4 +444,3 @@ Name: [Abhishek Singh](https://github.com/n6wbi6)
Place: India
Coding Experience: 2 years of coding experience in C and python.
Email: abhisheksingh.g07@gmail.com
- From e085e0c4ae9606349bd51aca90fd1bbd1bf2bbc9 Mon Sep 17 00:00:00 2001 From: Abhishek <46007024+n6wbi6@users.noreply.github.com> Date: Mon, 28 Oct 2019 16:07:36 +0530 Subject: [PATCH 22/74] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 09a44454..061c94ac 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -442,5 +442,5 @@ Email: tolubarca01@gmail.com
Name: [Abhishek Singh](https://github.com/n6wbi6)
Place: India
-Coding Experience: 2 years of coding experience in C and python.
+Coding Experience: C and python.
Email: abhisheksingh.g07@gmail.com
From 36ccb9f66aa76b3c078414b5e1ead7d523c8bc83 Mon Sep 17 00:00:00 2001 From: Renata Miranda <30598706+mirandars@users.noreply.github.com> Date: Mon, 28 Oct 2019 12:02:11 -0300 Subject: [PATCH 23/74] Add par perfect squares --- python/par-perfect-squares.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 python/par-perfect-squares.py diff --git a/python/par-perfect-squares.py b/python/par-perfect-squares.py new file mode 100644 index 00000000..38c1f72d --- /dev/null +++ b/python/par-perfect-squares.py @@ -0,0 +1 @@ +[elemento**2 for elemento in range(11) if elemento%2==0] From d36517b5f4d14e301f7b323049aba4fdc9df7b22 Mon Sep 17 00:00:00 2001 From: Renata Miranda <30598706+mirandars@users.noreply.github.com> Date: Mon, 28 Oct 2019 12:27:37 -0300 Subject: [PATCH 24/74] Add one line parity test --- python/parity-test.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 python/parity-test.py diff --git a/python/parity-test.py b/python/parity-test.py new file mode 100644 index 00000000..16dd5803 --- /dev/null +++ b/python/parity-test.py @@ -0,0 +1 @@ +par = lambda x:True if x%2==0 else False From e7eaff90be12cc741ce6b2985545daba4bda18a5 Mon Sep 17 00:00:00 2001 From: ngweihow Date: Thu, 31 Oct 2019 01:08:29 +1100 Subject: [PATCH 25/74] Added rust one liner for area of circle --- rust/maths/ngweihow_areacircle.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 rust/maths/ngweihow_areacircle.rs diff --git a/rust/maths/ngweihow_areacircle.rs b/rust/maths/ngweihow_areacircle.rs new file mode 100644 index 00000000..65e11812 --- /dev/null +++ b/rust/maths/ngweihow_areacircle.rs @@ -0,0 +1,24 @@ +/** + Simple Rust One Liner to calculate area of circle. + Made to have fun and learn Rust. This is my first time writing working code in Rust. + + Requires Cargo. + @author: github.com/ngweihow +*/ +use std::io; +use std::f32::consts::PI; + +fn main() { + println!("Enter the radius of the circle you want to calculate the area of: "); + + let mut input = String::new(); + io::stdin().read_line(&mut input) + .expect("Failed to read line!"); + + let float_input = input.trim().parse::().expect("Invalid Input!"); + + println!("The area of your circle is {} unit squared!", area_of_circle(float_input)); +} + +// Area of circle one liner. +fn area_of_circle(r: f32) -> f32 { r.powf(2.0) * PI } From c555145a7c574fb20bc6caa3c16715bf69634da5 Mon Sep 17 00:00:00 2001 From: ZombieChibiXD <43260238+ZombieChibiXD@users.noreply.github.com> Date: Wed, 30 Oct 2019 22:30:59 +0800 Subject: [PATCH 26/74] Added ZombieChibiXD_Palindrome.js --- CONTRIBUTORS.md | 6 ++++++ javascript/ZombieChibiXD_Palindrome.js | 1 + 2 files changed, 7 insertions(+) create mode 100644 javascript/ZombieChibiXD_Palindrome.js diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 09a44454..d36783c4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -444,3 +444,9 @@ Name: [Abhishek Singh](https://github.com/n6wbi6)
Place: India
Coding Experience: 2 years of coding experience in C and python.
Email: abhisheksingh.g07@gmail.com
+ +Name: [Sazeim Saheem](https://github.com/ZombieChibiXD)
+Place: Bali, Indonesia
+Field Experience: System Administrator, Junior web developer, beta-tester, and debugger
+Coding Experience: 3 years of learning & coding experience in C++, Java, Javascript/NodeJS, PHP, Vue.js, Laravel Framework, GoLang and python.
+Email: chibisd10@gmail.com
diff --git a/javascript/ZombieChibiXD_Palindrome.js b/javascript/ZombieChibiXD_Palindrome.js new file mode 100644 index 00000000..f184bdb4 --- /dev/null +++ b/javascript/ZombieChibiXD_Palindrome.js @@ -0,0 +1 @@ +const palindrome = (text) => text.toLowerCase() == text.toLowerCase().split("").reverse().join(""); \ No newline at end of file From c5dc8257cea5b9701b7f588ee83364122daa3382 Mon Sep 17 00:00:00 2001 From: ZombieChibiXD <43260238+ZombieChibiXD@users.noreply.github.com> Date: Wed, 30 Oct 2019 22:35:28 +0800 Subject: [PATCH 27/74] Added ZombieChibiXD_Palindrome.js --- CONTRIBUTORS.md | 6 ++++++ cplusplus/ZombieChibiXD_Palindrome.cpp | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 cplusplus/ZombieChibiXD_Palindrome.cpp diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 09a44454..d36783c4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -444,3 +444,9 @@ Name: [Abhishek Singh](https://github.com/n6wbi6)
Place: India
Coding Experience: 2 years of coding experience in C and python.
Email: abhisheksingh.g07@gmail.com
+ +Name: [Sazeim Saheem](https://github.com/ZombieChibiXD)
+Place: Bali, Indonesia
+Field Experience: System Administrator, Junior web developer, beta-tester, and debugger
+Coding Experience: 3 years of learning & coding experience in C++, Java, Javascript/NodeJS, PHP, Vue.js, Laravel Framework, GoLang and python.
+Email: chibisd10@gmail.com
diff --git a/cplusplus/ZombieChibiXD_Palindrome.cpp b/cplusplus/ZombieChibiXD_Palindrome.cpp new file mode 100644 index 00000000..252b67e9 --- /dev/null +++ b/cplusplus/ZombieChibiXD_Palindrome.cpp @@ -0,0 +1,13 @@ +#include +#include + +bool isPalindrome(std::string input) { return input == std::string(input.rbegin(), input.rend()); } + +int main() +{ + std::string input = "able was I ere I saw elba" ; + //std::cout << "Input : "; + //getline (std::cin, input); + std::cout << "It is " << (isPalindrome(input) ? "" : "not ") << "a palindrome"; +} + From 078ab6c2a53bc6efb6f64d5a905832daed023ccb Mon Sep 17 00:00:00 2001 From: Antonio32A <32272859+Antonio32A@users.noreply.github.com> Date: Wed, 30 Oct 2019 20:30:22 +0100 Subject: [PATCH 28/74] Create antonio32a_world.py --- python/antonio32a_world.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 python/antonio32a_world.py diff --git a/python/antonio32a_world.py b/python/antonio32a_world.py new file mode 100644 index 00000000..c91772d4 --- /dev/null +++ b/python/antonio32a_world.py @@ -0,0 +1 @@ +import __hello__ From 7a0860b79d05e74744944ab76663f4b73becb8c4 Mon Sep 17 00:00:00 2001 From: Kazuko Kannagi <43587695+kannagikazuko@users.noreply.github.com> Date: Wed, 30 Oct 2019 16:47:37 -0400 Subject: [PATCH 29/74] Rename cplusplus/check_square.cpp to honorary-one-line-wonders/cplusplus/U3X_check_square.cpp --- .../cplusplus/U3X_check_square.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cplusplus/check_square.cpp => honorary-one-line-wonders/cplusplus/U3X_check_square.cpp (100%) diff --git a/cplusplus/check_square.cpp b/honorary-one-line-wonders/cplusplus/U3X_check_square.cpp similarity index 100% rename from cplusplus/check_square.cpp rename to honorary-one-line-wonders/cplusplus/U3X_check_square.cpp From eeb143abd69b44d42736112c30ef0e18d987323f Mon Sep 17 00:00:00 2001 From: Kazuko Kannagi <43587695+kannagikazuko@users.noreply.github.com> Date: Wed, 30 Oct 2019 16:56:24 -0400 Subject: [PATCH 30/74] Create kannagikazuko_hello_world.js --- javascript/hello/kannagikazuko_hello_world.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 javascript/hello/kannagikazuko_hello_world.js diff --git a/javascript/hello/kannagikazuko_hello_world.js b/javascript/hello/kannagikazuko_hello_world.js new file mode 100644 index 00000000..96859410 --- /dev/null +++ b/javascript/hello/kannagikazuko_hello_world.js @@ -0,0 +1 @@ +void(process.stdout.write('Hello, world!\r\n\0')); From 60e420297ac6261bdfe4a373b688e2b48be878ee Mon Sep 17 00:00:00 2001 From: Kazuko Kannagi <43587695+kannagikazuko@users.noreply.github.com> Date: Wed, 30 Oct 2019 16:57:21 -0400 Subject: [PATCH 31/74] Rename javascript/hello/kannagikazuko_hello_world.js to nodejs/hello/kannagikazuko_hello_world.js --- {javascript => nodejs}/hello/kannagikazuko_hello_world.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {javascript => nodejs}/hello/kannagikazuko_hello_world.js (100%) diff --git a/javascript/hello/kannagikazuko_hello_world.js b/nodejs/hello/kannagikazuko_hello_world.js similarity index 100% rename from javascript/hello/kannagikazuko_hello_world.js rename to nodejs/hello/kannagikazuko_hello_world.js From 98f8224878adf1d187cc31bdacc1d2e599b4a032 Mon Sep 17 00:00:00 2001 From: ngweihow Date: Thu, 31 Oct 2019 22:50:03 +1100 Subject: [PATCH 32/74] One liner for Hypotenuse using Pythagoras --- rust/maths/ngweihow_pythagoras.rs | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 rust/maths/ngweihow_pythagoras.rs diff --git a/rust/maths/ngweihow_pythagoras.rs b/rust/maths/ngweihow_pythagoras.rs new file mode 100644 index 00000000..60f496b6 --- /dev/null +++ b/rust/maths/ngweihow_pythagoras.rs @@ -0,0 +1,33 @@ +/** + Simple Rust One Liner to calculate length of hypotenuse. + + Requires Cargo. + @author: github.com/ngweihow +*/ + +use std::io; +use std::f32; + +fn main() { + + // I gave up using an array/vector input lol. Rust is hard. + println!("Enter the length of the adjacent and opposite to find out the length of the hypotenuse!"); + println!("Adjacent: "); + let mut input1 = String::new(); + io::stdin().read_line(&mut input1) + .expect("Failed to read line!"); + + let float1 = input1.trim().parse::().expect("Invalid Input!"); + + println!("Opposite: "); + let mut input2 = String::new(); + io::stdin().read_line(&mut input2) + .expect("Failed to read line!"); + + let float2 = input2.trim().parse::().expect("Invalid Input!"); + + println!("The length of the hypotenuse is {} units!", length_hypotenuse(float1, float2)); +} + +// Calculation function. +fn length_hypotenuse(a: f32, b: f32) -> f32 { (a.powf(2.0) + b.powf(2.0)).sqrt() } \ No newline at end of file From c94c809aa66a86a4ec7ad32a498b945c24ef8574 Mon Sep 17 00:00:00 2001 From: ngweihow Date: Thu, 31 Oct 2019 23:55:03 +1100 Subject: [PATCH 33/74] Bogosort in python --- python/sorting/ngweihow_bogosort.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 python/sorting/ngweihow_bogosort.py diff --git a/python/sorting/ngweihow_bogosort.py b/python/sorting/ngweihow_bogosort.py new file mode 100644 index 00000000..df98dfd8 --- /dev/null +++ b/python/sorting/ngweihow_bogosort.py @@ -0,0 +1,11 @@ +''' +Bogosort created using lambda. + +@author: ngweihow (github.com/ngweihow) +''' +from random import sample + +b_sort = lambda ls: ls if all(ls[i] <= ls[i+1] for i in range(len(ls)-1)) else b_sort(sample(ls, len(ls))) + +# Tests (PLEASE DO NOT TEST WITH LARGE LIST INPUT, BOGOSORT IS HIGHLY INEFFICIENT) +print(b_sort([4,3,2,1])) \ No newline at end of file From 0abfcaba5557e7a35edc2ee66a707c9909379bbd Mon Sep 17 00:00:00 2001 From: Isak Rabin Date: Thu, 31 Oct 2019 23:53:09 +0800 Subject: [PATCH 34/74] Add Find Maximum between 2 Digits in Java --- CONTRIBUTORS.md | 5 +++++ java/sgirabin_Max2Digit.java | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 java/sgirabin_Max2Digit.java diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index b4463cd0..b23f9bb9 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -280,3 +280,8 @@ Name: [Ramiro Batista da Luz](https://github.com/ramiroluz)
Place: Curitiba, PR, Brazil
Coding Experience: Python
Email: ramiroluz@gmail.com
+ +Name: [Isak Rabin](https://github.com/sgirabin) +Place: Singapore +Coding Experience: Java +Email: isak_r@yahoo.com diff --git a/java/sgirabin_Max2Digit.java b/java/sgirabin_Max2Digit.java new file mode 100644 index 00000000..5a378a35 --- /dev/null +++ b/java/sgirabin_Max2Digit.java @@ -0,0 +1,13 @@ + + +class Max2Digit { + + public static int max(int a, int b) { + return Math.max(a,b); + } + + public static void main(String[] args) { + System.out.println(Max2Digit.max(5,10)); + } + +} From eda8a80bea307ea97b871ba095f4f1361e9fa7db Mon Sep 17 00:00:00 2001 From: Ra Inta Date: Thu, 31 Oct 2019 17:04:53 -0500 Subject: [PATCH 35/74] Added actual one-liner in Python for unique list --- python/unique/RaInta_unique_array.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 python/unique/RaInta_unique_array.py diff --git a/python/unique/RaInta_unique_array.py b/python/unique/RaInta_unique_array.py new file mode 100644 index 00000000..f93e0775 --- /dev/null +++ b/python/unique/RaInta_unique_array.py @@ -0,0 +1,3 @@ +list1 = [1,10,7,1,4] + +[x for idx, x in enumerate(list1) if x not in list1[:idx]] From 473eb5b08b86a362f34a4e43b2725673a68e9d9f Mon Sep 17 00:00:00 2001 From: zylatis Date: Sat, 2 Nov 2019 10:06:13 +1100 Subject: [PATCH 36/74] Add /python/unique/Gossel_uncommon_elements.py --- python/unique/Gossel_uncommon_elements.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 python/unique/Gossel_uncommon_elements.py diff --git a/python/unique/Gossel_uncommon_elements.py b/python/unique/Gossel_uncommon_elements.py new file mode 100644 index 00000000..316f4073 --- /dev/null +++ b/python/unique/Gossel_uncommon_elements.py @@ -0,0 +1,7 @@ +# Given two lists, find elements not present in both +# Effectively, a join + delete duplicates. Conversion to set means it nukes repeated elements +s1 = [1,9,23,4] +s2 = [1,4,8,3,7] + +# XOR operation on sets +print(set(s1) ^ set(s2)) \ No newline at end of file From 48c6c72924c42e76cf013b62c55508accf063a51 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Fri, 10 Jul 2020 09:17:59 -0400 Subject: [PATCH 37/74] Rename decimal_conversion.py to predator21x_decimal_conversion.py --- ...{decimal_conversion.py => predator21x_decimal_conversion.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename python/{decimal_conversion.py => predator21x_decimal_conversion.py} (72%) diff --git a/python/decimal_conversion.py b/python/predator21x_decimal_conversion.py similarity index 72% rename from python/decimal_conversion.py rename to python/predator21x_decimal_conversion.py index 41d19560..773e4ef8 100644 --- a/python/decimal_conversion.py +++ b/python/predator21x_decimal_conversion.py @@ -3,4 +3,4 @@ print("The decimal value of",dec,"is:") print(bin(dec),"in binary.") print(oct(dec),"in octal.") -print(hex(dec),"in hexadecimal.") \ No newline at end of file +print(hex(dec),"in hexadecimal.") From 1d03df23ac217d2efa360899dbcefb776745d8a8 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Fri, 10 Jul 2020 09:18:40 -0400 Subject: [PATCH 38/74] Rename The-largest_number_that_can_be_represented_by_8_Byte.py to predator21x_The-largest_number_that_can_be_represented_by_8_Byte.py --- ...21x_The-largest_number_that_can_be_represented_by_8_Byte.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename python/{The-largest_number_that_can_be_represented_by_8_Byte.py => predator21x_The-largest_number_that_can_be_represented_by_8_Byte.py} (55%) diff --git a/python/The-largest_number_that_can_be_represented_by_8_Byte.py b/python/predator21x_The-largest_number_that_can_be_represented_by_8_Byte.py similarity index 55% rename from python/The-largest_number_that_can_be_represented_by_8_Byte.py rename to python/predator21x_The-largest_number_that_can_be_represented_by_8_Byte.py index 28b095aa..9f917e79 100644 --- a/python/The-largest_number_that_can_be_represented_by_8_Byte.py +++ b/python/predator21x_The-largest_number_that_can_be_represented_by_8_Byte.py @@ -1 +1 @@ -print '\n'.join("%i Byte = %i Bit = largest number: %i" % (j, j*8, 256**j-1) for j in (1 << i for i in xrange(8))) \ No newline at end of file +print '\n'.join("%i Byte = %i Bit = largest number: %i" % (j, j*8, 256**j-1) for j in (1 << i for i in xrange(8))) From 676b4c58770cd576bb21b900109aa86f6bfbb634 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Fri, 10 Jul 2020 09:24:07 -0400 Subject: [PATCH 39/74] Rename Swap.c to HarshitaArun_Swap.c --- c/{Swap.c => HarshitaArun_Swap.c} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename c/{Swap.c => HarshitaArun_Swap.c} (100%) diff --git a/c/Swap.c b/c/HarshitaArun_Swap.c similarity index 100% rename from c/Swap.c rename to c/HarshitaArun_Swap.c From d48ff77b8bb3ffe9ddcec88b9f0cfd3fe61c4fc7 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sat, 19 Sep 2020 16:06:36 -0400 Subject: [PATCH 40/74] Rename python/antonio32a_world.py to python/hello/antonio32a_world.py --- python/{ => hello}/antonio32a_world.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{ => hello}/antonio32a_world.py (100%) diff --git a/python/antonio32a_world.py b/python/hello/antonio32a_world.py similarity index 100% rename from python/antonio32a_world.py rename to python/hello/antonio32a_world.py From 18f8c838530762b797f53a989e634cf22e942e9f Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sat, 26 Sep 2020 08:54:03 -0400 Subject: [PATCH 41/74] Rename Gossel_uncommon_elements.py to Zylatis_uncommon_elements.py --- ...Gossel_uncommon_elements.py => Zylatis_uncommon_elements.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename python/unique/{Gossel_uncommon_elements.py => Zylatis_uncommon_elements.py} (89%) diff --git a/python/unique/Gossel_uncommon_elements.py b/python/unique/Zylatis_uncommon_elements.py similarity index 89% rename from python/unique/Gossel_uncommon_elements.py rename to python/unique/Zylatis_uncommon_elements.py index 316f4073..1bc9fa6b 100644 --- a/python/unique/Gossel_uncommon_elements.py +++ b/python/unique/Zylatis_uncommon_elements.py @@ -4,4 +4,4 @@ s2 = [1,4,8,3,7] # XOR operation on sets -print(set(s1) ^ set(s2)) \ No newline at end of file +print(set(s1) ^ set(s2)) From cc2a0f3cf945e8756baa7618acf3e35c5df1a834 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sat, 26 Sep 2020 09:56:20 -0400 Subject: [PATCH 42/74] Rename par-perfect-squares.py to mirandars_par-perfect-squares.py --- .../{par-perfect-squares.py => mirandars_par-perfect-squares.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{par-perfect-squares.py => mirandars_par-perfect-squares.py} (100%) diff --git a/python/par-perfect-squares.py b/python/mirandars_par-perfect-squares.py similarity index 100% rename from python/par-perfect-squares.py rename to python/mirandars_par-perfect-squares.py From 684109cc8c6fe39f84db7c8d5aa4a1d1dae99624 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Thu, 1 Oct 2020 10:40:48 -0400 Subject: [PATCH 43/74] Rename parity-test.py to mirandars_parity-test.py --- python/{parity-test.py => mirandars_parity-test.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{parity-test.py => mirandars_parity-test.py} (100%) diff --git a/python/parity-test.py b/python/mirandars_parity-test.py similarity index 100% rename from python/parity-test.py rename to python/mirandars_parity-test.py From 5e251a189ab84001a48f933b7ddd1c33ab2cb1a4 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Thu, 1 Oct 2020 23:10:35 -0400 Subject: [PATCH 44/74] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4df1a07a..29ea71b9 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Have some fun with coding every once in a while, and see how you can abuse the s ### Contributing Anyone can contribute to this repo by opening a PR, your contribution will be open-source on Github. Don't know what to make? Try coding something that logs "Hello, world!" to the console! -### Hacktoberfest 2019 +### Hacktoberfest 2020 Celebrate [Hacktoberfest](https://hacktoberfest.digitalocean.com/) together with a diverse community of developers from around the world! ### PRs not marked as spam will be counted towards **4** PRs in the month of October for your **free Hacktoberfest T-Shirt!** From bc59151512fe3024edc7f04c1c0179775b93b626 Mon Sep 17 00:00:00 2001 From: rpstester <32249806+rpstester@users.noreply.github.com> Date: Mon, 12 Oct 2020 20:23:38 -0400 Subject: [PATCH 45/74] Get list of people in space via open API. --- powershell/Astronaut/ListOfPeopleInSpace.ps1 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 powershell/Astronaut/ListOfPeopleInSpace.ps1 diff --git a/powershell/Astronaut/ListOfPeopleInSpace.ps1 b/powershell/Astronaut/ListOfPeopleInSpace.ps1 new file mode 100644 index 00000000..67016f88 --- /dev/null +++ b/powershell/Astronaut/ListOfPeopleInSpace.ps1 @@ -0,0 +1,2 @@ +(Invoke-WebRequest "http://api.open-notify.org/astros.json" | ConvertFrom-Json).people +#note, I got the idea from PowerShell.com a while ago, but I cannot find it now. \ No newline at end of file From 46fee0885ad9a308185386a49746f17c8f6724fa Mon Sep 17 00:00:00 2001 From: rpstester <32249806+rpstester@users.noreply.github.com> Date: Mon, 12 Oct 2020 20:29:17 -0400 Subject: [PATCH 46/74] Add myself to contributors --- CONTRIBUTORS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c1b7b34b..7a192c9b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -439,3 +439,8 @@ Name: [Antonio](https://github.com/toluwalope19)
Place: Nigeria
Coding Experience: Python and javaScript.
Email: tolubarca01@gmail.com
+ +Name: [Roger Seekell](https://github.com/rpstester)
+Place: Earth
+Coding Experience: C++, C#, Java, PowerShell
+Email: rogerseek1@gmail.com
\ No newline at end of file From ecf7e5fb7beb0935156c1e728df3c4999df5ebf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Nilsen?= Date: Wed, 14 Oct 2020 07:54:28 +0200 Subject: [PATCH 47/74] added oneliner for generating strong passwords in powershell --- CONTRIBUTORS.md | 6 ++++++ powershell/turbosnute_strongpassword.ps1 | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 powershell/turbosnute_strongpassword.ps1 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 61520605..a77f69d9 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -460,3 +460,9 @@ Place: Bali, Indonesia
Field Experience: System Administrator, Junior web developer, beta-tester, and debugger
Coding Experience: 3 years of learning & coding experience in C++, Java, Javascript/NodeJS, PHP, Vue.js, Laravel Framework, GoLang and python.
Email: chibisd10@gmail.com
+ +Name: [Øyvind Nilsen](https://github.com/turbosnute)
+Place: Trondheim, Norway +Field Experience: System Admin +Coding Experience: 10 years of Powershell scripting. Also some experience with Java, Js, PHP, Python and C#. +Email: oyvind.nilsen@gmail.com \ No newline at end of file diff --git a/powershell/turbosnute_strongpassword.ps1 b/powershell/turbosnute_strongpassword.ps1 new file mode 100644 index 00000000..e22dcf30 --- /dev/null +++ b/powershell/turbosnute_strongpassword.ps1 @@ -0,0 +1,3 @@ +# Generates a random strong 20 chars long password. +# If you want to change the length of the password you can cange 20 inside the brackets before the -join to somethin else. +([char[]]([char]33..[char]95) + ([char[]]([char]97..[char]126)) + 0..9 | Sort-Object {Get-Random})[0..20] -join '' \ No newline at end of file From 273ffde949083d844a3602c939ee446d38fa8a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Nilsen?= Date: Wed, 14 Oct 2020 08:01:50 +0200 Subject: [PATCH 48/74] added powershell oneliner for generating random strong passwords --- CONTRIBUTORS.md | 10 +++++----- powershell/turbosnute_strongpassword.ps1 | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a77f69d9..6d6c2e29 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -461,8 +461,8 @@ Field Experience: System Administrator, Junior web developer, beta-tester, and d Coding Experience: 3 years of learning & coding experience in C++, Java, Javascript/NodeJS, PHP, Vue.js, Laravel Framework, GoLang and python.
Email: chibisd10@gmail.com
-Name: [Øyvind Nilsen](https://github.com/turbosnute)
-Place: Trondheim, Norway -Field Experience: System Admin -Coding Experience: 10 years of Powershell scripting. Also some experience with Java, Js, PHP, Python and C#. -Email: oyvind.nilsen@gmail.com \ No newline at end of file +Name: [Oyvind Nilsen](https://github.com/turbosnute)
+Place: Trondheim, Norway
+Field Experience: System Admin
+Coding Experience: 10 years of Powershell scripting. Also some experience with Java, Js, PHP, Python and C#.
+Email: oyvind.nilsen@gmail.com
\ No newline at end of file diff --git a/powershell/turbosnute_strongpassword.ps1 b/powershell/turbosnute_strongpassword.ps1 index e22dcf30..66b4a7c8 100644 --- a/powershell/turbosnute_strongpassword.ps1 +++ b/powershell/turbosnute_strongpassword.ps1 @@ -1,3 +1,3 @@ # Generates a random strong 20 chars long password. # If you want to change the length of the password you can cange 20 inside the brackets before the -join to somethin else. -([char[]]([char]33..[char]95) + ([char[]]([char]97..[char]126)) + 0..9 | Sort-Object {Get-Random})[0..20] -join '' \ No newline at end of file +([char[]]([char]33..[char]95) + ([char[]]([char]97..[char]126)) + 0..9 | Sort-Object {Get-Random})[0..20] -join '' From ebf0f8f09e4e0a651dd5365a31fa310889b7944e Mon Sep 17 00:00:00 2001 From: kkulma Date: Sat, 24 Oct 2020 22:57:59 +0100 Subject: [PATCH 49/74] added find-prime-number to R/ --- .gitignore | 1 + r/prime/KKulma-find-prime-number.R | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 r/prime/KKulma-find-prime-number.R diff --git a/.gitignore b/.gitignore index 777a35f8..923d0591 100644 --- a/.gitignore +++ b/.gitignore @@ -253,3 +253,4 @@ Module.symvers Mkfile.old dkms.conf /.vs +.Rproj.user diff --git a/r/prime/KKulma-find-prime-number.R b/r/prime/KKulma-find-prime-number.R new file mode 100644 index 00000000..fd7b0c42 --- /dev/null +++ b/r/prime/KKulma-find-prime-number.R @@ -0,0 +1,5 @@ +is.prime <- function(n) n == 2L || all(n %% 2L:ceiling(sqrt(n)) != 0) + +# test +test_vec <- 0:10 +sapply(test_vec, is.prime) From 89d8ae6180caac813687a4e7ad2eeac4cd7d7332 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 25 Oct 2020 15:24:46 -0400 Subject: [PATCH 50/74] Create wzhouwzhou_delay.js --- nodejs/wzhouwzhou_delay.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 nodejs/wzhouwzhou_delay.js diff --git a/nodejs/wzhouwzhou_delay.js b/nodejs/wzhouwzhou_delay.js new file mode 100644 index 00000000..16438584 --- /dev/null +++ b/nodejs/wzhouwzhou_delay.js @@ -0,0 +1 @@ +(t = 1000) && Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, t) From ebb5ce26de73c0fb0cfcc3c773e5bbdcb4d50ed1 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 25 Oct 2020 15:28:38 -0400 Subject: [PATCH 51/74] Rename ListOfPeopleInSpace.ps1 to rpstester_ListOfPeopleInSpace.ps1 --- ...istOfPeopleInSpace.ps1 => rpstester_ListOfPeopleInSpace.ps1} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename powershell/Astronaut/{ListOfPeopleInSpace.ps1 => rpstester_ListOfPeopleInSpace.ps1} (89%) diff --git a/powershell/Astronaut/ListOfPeopleInSpace.ps1 b/powershell/Astronaut/rpstester_ListOfPeopleInSpace.ps1 similarity index 89% rename from powershell/Astronaut/ListOfPeopleInSpace.ps1 rename to powershell/Astronaut/rpstester_ListOfPeopleInSpace.ps1 index 67016f88..12c459c1 100644 --- a/powershell/Astronaut/ListOfPeopleInSpace.ps1 +++ b/powershell/Astronaut/rpstester_ListOfPeopleInSpace.ps1 @@ -1,2 +1,2 @@ (Invoke-WebRequest "http://api.open-notify.org/astros.json" | ConvertFrom-Json).people -#note, I got the idea from PowerShell.com a while ago, but I cannot find it now. \ No newline at end of file +#note, I got the idea from PowerShell.com a while ago, but I cannot find it now. From 84bef4ebfd28a88597bd7ef6c098426cd2b6a11a Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 25 Oct 2020 15:30:02 -0400 Subject: [PATCH 52/74] Rename KKulma-find-prime-number.R to KKulma_find-prime-number.R --- .../{KKulma-find-prime-number.R => KKulma_find-prime-number.R} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename r/prime/{KKulma-find-prime-number.R => KKulma_find-prime-number.R} (100%) diff --git a/r/prime/KKulma-find-prime-number.R b/r/prime/KKulma_find-prime-number.R similarity index 100% rename from r/prime/KKulma-find-prime-number.R rename to r/prime/KKulma_find-prime-number.R From 5719cb1059f35a615b36f3f2d16f20a11e3c7818 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 25 Oct 2020 15:57:27 -0400 Subject: [PATCH 53/74] Create wzhouwzhou_check_brackets.js --- javascript/wzhouwzhou_check_brackets.js | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 javascript/wzhouwzhou_check_brackets.js diff --git a/javascript/wzhouwzhou_check_brackets.js b/javascript/wzhouwzhou_check_brackets.js new file mode 100644 index 00000000..1e6bac14 --- /dev/null +++ b/javascript/wzhouwzhou_check_brackets.js @@ -0,0 +1,4 @@ +const b=['()','[]','{}'],d=b.reduce((o,e)=>Object.defineProperty(o,e[0],{value:e[1]}),{}),c=b.map((e,i)=>Object.defineProperty(Object.defineProperty({},[]+e[0],{value:[i,1],enumerable:!0}),[]+e[1],{value:[i,-1],enumerable:!0})).reduce((a,b)=>Object.assign(a,b),{}),check_brackets=str=>str.split``.filter(e=>'()[]{}'.includes(e)).reduce((a,n)=>(a.some(e=>e<0)?a[3]=!0:c[n][1]==-1&&a[4]&&n!=d[a[4]]?a[3]=!0:(a[c[n][0]]+=c[n][1]),c[n][1]==1?a[4]=n:a[4]='',a),[0,0,0,!1]).filter((e,i)=>i<4).every(e=>!e); + +check_brackets('Some [awesome (string)] to {check}'); +check_brackets('Less [awesome (string}] to {check}'); From 823708b89847919c7abb97f4e2771657be2b18ab Mon Sep 17 00:00:00 2001 From: TacticalTechJay Date: Tue, 29 Dec 2020 14:54:50 -0800 Subject: [PATCH 54/74] commit message --- nodejs/tacticaltechjay_coinFlip.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 nodejs/tacticaltechjay_coinFlip.js diff --git a/nodejs/tacticaltechjay_coinFlip.js b/nodejs/tacticaltechjay_coinFlip.js new file mode 100644 index 00000000..c889d24b --- /dev/null +++ b/nodejs/tacticaltechjay_coinFlip.js @@ -0,0 +1 @@ +Math.floor(Math.random() * 2) === 1 ? console.log('Heads!') : console.log('Tails!') From 350dd43b1d0dd3a950eb2c4eae94d0dde18d4d54 Mon Sep 17 00:00:00 2001 From: TacticalTechJay Date: Tue, 29 Dec 2020 15:02:56 -0800 Subject: [PATCH 55/74] Commit Dos, the Sequel --- CONTRIBUTORS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index b81dec19..446e0aa4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -465,3 +465,8 @@ Place: Bali, Indonesia
Field Experience: System Administrator, Junior web developer, beta-tester, and debugger
Coding Experience: 3 years of learning & coding experience in C++, Java, Javascript/NodeJS, PHP, Vue.js, Laravel Framework, GoLang and python.
Email: chibisd10@gmail.com
+ +Name: [Jay](https://github.com/TacticalTechJay)
+Place: Milky Way Galaxy
+Coding Experience: Semi-noob in JS.
+Email: tacticaltechjay@gmail.com
From 78dce45f25bacaeab33d045fb9264a5a07064cfa Mon Sep 17 00:00:00 2001 From: Prathima Kadari Date: Tue, 25 May 2021 13:52:59 +0530 Subject: [PATCH 56/74] Added ordered prepend string number --- python/ordered_prepend_string_num.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 python/ordered_prepend_string_num.py diff --git a/python/ordered_prepend_string_num.py b/python/ordered_prepend_string_num.py new file mode 100644 index 00000000..bdbafc0b --- /dev/null +++ b/python/ordered_prepend_string_num.py @@ -0,0 +1,16 @@ +#Consider the program that takes in a string and a list of numbers. +#It will prepend the string to each of the numbers and return a string of this new list separated by commas. +#For example, foo('$', range(5)) would return '$0, $1, $2, $3, $4'. +#A naive coder will do this- +# +#def foo(string, numbers): +# output = '' +# for i in range(len(numbers)): +# if i > 0: +# output += ', ' +# output += string + str(numbers[i]) +# return output +# +# Here is an elegant way with Output $0, $1, $2, $3, $4- + +def foo(string, numbers): return ', '.join(map(lambda s,n:s+str(n), [string for i in numbers], numbers)) From 489e0687a2501426570b6811bc017dc4800c04cf Mon Sep 17 00:00:00 2001 From: Zombie Chibi XD <43260238+ZombieChibiXD@users.noreply.github.com> Date: Sun, 18 Jul 2021 07:32:24 +0800 Subject: [PATCH 57/74] SEO Privacy breach change. I don't want my real name exposed on google, so I'd rather change the name listed here. --- CONTRIBUTORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 446e0aa4..8f66b8fb 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -460,7 +460,7 @@ Place: India
Coding Experience: C and python.
Email: abhisheksingh.g07@gmail.com
-Name: [Sazeim Saheem](https://github.com/ZombieChibiXD)
+Name: [Zombie Chibi XD](https://github.com/ZombieChibiXD)
Place: Bali, Indonesia
Field Experience: System Administrator, Junior web developer, beta-tester, and debugger
Coding Experience: 3 years of learning & coding experience in C++, Java, Javascript/NodeJS, PHP, Vue.js, Laravel Framework, GoLang and python.
From 5df8746254900eef3dee6341c483c5a3cd874074 Mon Sep 17 00:00:00 2001 From: Jack Reiker Date: Sat, 2 Oct 2021 16:25:18 -0600 Subject: [PATCH 58/74] readme: change year to 2021 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 29ea71b9..7c8aaf9f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Have some fun with coding every once in a while, and see how you can abuse the s ### Contributing Anyone can contribute to this repo by opening a PR, your contribution will be open-source on Github. Don't know what to make? Try coding something that logs "Hello, world!" to the console! -### Hacktoberfest 2020 +### Hacktoberfest 2021 Celebrate [Hacktoberfest](https://hacktoberfest.digitalocean.com/) together with a diverse community of developers from around the world! ### PRs not marked as spam will be counted towards **4** PRs in the month of October for your **free Hacktoberfest T-Shirt!** From b74b679df6b134665f9bddd21045dd93b5716e68 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sat, 2 Oct 2021 18:37:52 -0400 Subject: [PATCH 59/74] Rename ordered_prepend_string_num.py to prathimacode-hub_ordered_prepend_string_num.py --- ...ring_num.py => prathimacode-hub_ordered_prepend_string_num.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{ordered_prepend_string_num.py => prathimacode-hub_ordered_prepend_string_num.py} (100%) diff --git a/python/ordered_prepend_string_num.py b/python/prathimacode-hub_ordered_prepend_string_num.py similarity index 100% rename from python/ordered_prepend_string_num.py rename to python/prathimacode-hub_ordered_prepend_string_num.py From b599c7cf7d75036f3e3ca498b6c3b974a3209107 Mon Sep 17 00:00:00 2001 From: Jack Reiker Date: Sat, 2 Oct 2021 16:38:36 -0600 Subject: [PATCH 60/74] Create rpxs_add.js --- javascript/rpxs_add.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 javascript/rpxs_add.js diff --git a/javascript/rpxs_add.js b/javascript/rpxs_add.js new file mode 100644 index 00000000..3acb4f90 --- /dev/null +++ b/javascript/rpxs_add.js @@ -0,0 +1 @@ +const add = (a, b) => a + b; From fbde06a530b38e6644514498a36b6fca8e1e7522 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sat, 2 Oct 2021 18:45:03 -0400 Subject: [PATCH 61/74] Create wzhouwzhou_add.coffee --- coffeescript/wzhouwzhou_add.coffee | 1 + 1 file changed, 1 insertion(+) create mode 100644 coffeescript/wzhouwzhou_add.coffee diff --git a/coffeescript/wzhouwzhou_add.coffee b/coffeescript/wzhouwzhou_add.coffee new file mode 100644 index 00000000..13be9866 --- /dev/null +++ b/coffeescript/wzhouwzhou_add.coffee @@ -0,0 +1 @@ +add = (a, b) -> a + b From 6142a0611915a70bf25eefbfc3500b86e6fa9d00 Mon Sep 17 00:00:00 2001 From: Jack Reiker Date: Sat, 2 Oct 2021 16:49:08 -0600 Subject: [PATCH 62/74] Create rpxs_subtract.js --- javascript/rpxs_subtract.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 javascript/rpxs_subtract.js diff --git a/javascript/rpxs_subtract.js b/javascript/rpxs_subtract.js new file mode 100644 index 00000000..efcec866 --- /dev/null +++ b/javascript/rpxs_subtract.js @@ -0,0 +1 @@ +const subtract = (a, b) => a - b From 8c1c3b4162595b3c6d2dd00d528fcec5a6ddd10c Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sat, 2 Oct 2021 19:08:50 -0400 Subject: [PATCH 63/74] Create wzhouwzhou_subtract.coffee --- coffeescript/wzhouwzhou_subtract.coffee | 1 + 1 file changed, 1 insertion(+) create mode 100644 coffeescript/wzhouwzhou_subtract.coffee diff --git a/coffeescript/wzhouwzhou_subtract.coffee b/coffeescript/wzhouwzhou_subtract.coffee new file mode 100644 index 00000000..a558f02b --- /dev/null +++ b/coffeescript/wzhouwzhou_subtract.coffee @@ -0,0 +1 @@ +subtract = (a, b) -> +a - +b From 7dcea631f3cfd8a21e60e0627da7e09903eb0017 Mon Sep 17 00:00:00 2001 From: Vetlix Date: Sun, 3 Oct 2021 01:09:43 +0200 Subject: [PATCH 64/74] feat(js): empty array fn --- javascript/vetlix_empty_array.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 javascript/vetlix_empty_array.js diff --git a/javascript/vetlix_empty_array.js b/javascript/vetlix_empty_array.js new file mode 100644 index 00000000..4e4c866f --- /dev/null +++ b/javascript/vetlix_empty_array.js @@ -0,0 +1 @@ +const empty = arr => arr.length = 0; \ No newline at end of file From 8e2ce8bfa0fff0dcdbbd0d951068e25868836adb Mon Sep 17 00:00:00 2001 From: Vetlix Date: Sun, 3 Oct 2021 01:19:35 +0200 Subject: [PATCH 65/74] feat(js): deepflat array fn --- javascript/vetlix_deepflat_array.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 javascript/vetlix_deepflat_array.js diff --git a/javascript/vetlix_deepflat_array.js b/javascript/vetlix_deepflat_array.js new file mode 100644 index 00000000..3df5f15e --- /dev/null +++ b/javascript/vetlix_deepflat_array.js @@ -0,0 +1 @@ +const deepFlat = arr => arr.flat(Infinity); \ No newline at end of file From 112bb314d02f3de3d9b7cc5626c80ab040203a8a Mon Sep 17 00:00:00 2001 From: Vetlix Date: Sun, 3 Oct 2021 01:38:12 +0200 Subject: [PATCH 66/74] feat(js): honorary map array fn --- honorary-one-line-wonders/javascript/vetlix_array_map.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 honorary-one-line-wonders/javascript/vetlix_array_map.js diff --git a/honorary-one-line-wonders/javascript/vetlix_array_map.js b/honorary-one-line-wonders/javascript/vetlix_array_map.js new file mode 100644 index 00000000..463e90e5 --- /dev/null +++ b/honorary-one-line-wonders/javascript/vetlix_array_map.js @@ -0,0 +1,5 @@ +const map = (arr, cb) => { + let i = arr.length, result = Array(i); + while (i--) result[i] = cb(arr[i], i, arr); + return result; +}; \ No newline at end of file From 9c59fc97dd66670c5a45376882f943168910dc98 Mon Sep 17 00:00:00 2001 From: Xandrrrr Date: Sun, 3 Oct 2021 11:32:49 +0200 Subject: [PATCH 67/74] Create xander_convert_number_to_one_or_bigger.js --- javascript/xander_convert_number_to_one_or_bigger.js | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 javascript/xander_convert_number_to_one_or_bigger.js diff --git a/javascript/xander_convert_number_to_one_or_bigger.js b/javascript/xander_convert_number_to_one_or_bigger.js new file mode 100644 index 00000000..28636997 --- /dev/null +++ b/javascript/xander_convert_number_to_one_or_bigger.js @@ -0,0 +1,2 @@ +// This will check if a number is 0 or smaller and then converts it. If 0, to 1. If n < 0, to -n +const convert = (n) => { return (-(~(n ^ 0))) < 0 ? (-(~(n ^ 0))) != -1 ? (-(-(~(n ^ 0)))) + 1 : (-(-(~(n ^ 0)))) : (-(~(n ^ 0))) != 1 ? (-(~(n ^ 0))) - 1 : (-(~(n ^ 0))); } From 5d40ede69f84486ab13de364df96d30b9ea54daf Mon Sep 17 00:00:00 2001 From: Xandrrrr Date: Sun, 3 Oct 2021 11:53:19 +0200 Subject: [PATCH 68/74] Create collatz_conjecture.js --- javascript/collatz_conjecture.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 javascript/collatz_conjecture.js diff --git a/javascript/collatz_conjecture.js b/javascript/collatz_conjecture.js new file mode 100644 index 00000000..5dac24ab --- /dev/null +++ b/javascript/collatz_conjecture.js @@ -0,0 +1 @@ +const collatz = (x) => { if (x > 1) { return collatz((x % 2) === 0 ? x / 2 : x * 3 + 1) } else return x } From 19dc872b9146df6aa8d429f35159ca3846dd5772 Mon Sep 17 00:00:00 2001 From: Xandrrrr Date: Sun, 3 Oct 2021 12:02:53 +0200 Subject: [PATCH 69/74] Add me to the contributor list --- CONTRIBUTORS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 60ce1fb8..540f7185 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -475,3 +475,8 @@ Name: [Jay](https://github.com/TacticalTechJay)
Place: Milky Way Galaxy
Coding Experience: Semi-noob in JS.
Email: tacticaltechjay@gmail.com
+ +Name: [David](https://github.com/Xander1233)
+Place: Frankfurt, Germany
+Coding Experience: TS, JS/NodeJS, Java, C, C++, C#, Assembly, React +Email: david.neidhart@gmx.net
From fe56d1f78c5dd8df4c5e64d3d1c845b803d9f61e Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 3 Oct 2021 12:07:51 -0400 Subject: [PATCH 70/74] Create add.go --- go/add.go | 1 + 1 file changed, 1 insertion(+) create mode 100644 go/add.go diff --git a/go/add.go b/go/add.go new file mode 100644 index 00000000..610176bf --- /dev/null +++ b/go/add.go @@ -0,0 +1 @@ +func add(a, b int) int { return a + b } From 8724a5faec5e46ae9327aacbef2150bb7238a0a4 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 3 Oct 2021 12:11:12 -0400 Subject: [PATCH 71/74] Update and rename collatz_conjecture.js to Xander1233_collatz_conjecture.js --- javascript/ Xander1233_collatz_conjecture.js | 1 + javascript/collatz_conjecture.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 javascript/ Xander1233_collatz_conjecture.js delete mode 100644 javascript/collatz_conjecture.js diff --git a/javascript/ Xander1233_collatz_conjecture.js b/javascript/ Xander1233_collatz_conjecture.js new file mode 100644 index 00000000..5e505906 --- /dev/null +++ b/javascript/ Xander1233_collatz_conjecture.js @@ -0,0 +1 @@ +const collatz = x => x > 1 ? collatz((x % 2) === 0 ? x / 2 : x * 3 + 1) : x; diff --git a/javascript/collatz_conjecture.js b/javascript/collatz_conjecture.js deleted file mode 100644 index 5dac24ab..00000000 --- a/javascript/collatz_conjecture.js +++ /dev/null @@ -1 +0,0 @@ -const collatz = (x) => { if (x > 1) { return collatz((x % 2) === 0 ? x / 2 : x * 3 + 1) } else return x } From 1b2153f9c7630aa24a6d86346a632e419ce66256 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 3 Oct 2021 12:14:46 -0400 Subject: [PATCH 72/74] Update and rename Xander1233_collatz_conjecture.js to Xander1233_collatzConjecture.js --- javascript/ Xander1233_collatz_conjecture.js | 1 - javascript/Xander1233_collatzConjecture.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 javascript/ Xander1233_collatz_conjecture.js create mode 100644 javascript/Xander1233_collatzConjecture.js diff --git a/javascript/ Xander1233_collatz_conjecture.js b/javascript/ Xander1233_collatz_conjecture.js deleted file mode 100644 index 5e505906..00000000 --- a/javascript/ Xander1233_collatz_conjecture.js +++ /dev/null @@ -1 +0,0 @@ -const collatz = x => x > 1 ? collatz((x % 2) === 0 ? x / 2 : x * 3 + 1) : x; diff --git a/javascript/Xander1233_collatzConjecture.js b/javascript/Xander1233_collatzConjecture.js new file mode 100644 index 00000000..af823b3f --- /dev/null +++ b/javascript/Xander1233_collatzConjecture.js @@ -0,0 +1 @@ +const collatz = x => x <= 1 ? x : collatz((x % 2) === 0 ? x / 2 : x * 3 + 1); From 4f2f4422fd965ffb7c5060c2121f8a506a3ba8d3 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 3 Oct 2021 12:15:29 -0400 Subject: [PATCH 73/74] Rename add.go to wzhouwzhou_add.go --- go/{add.go => wzhouwzhou_add.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename go/{add.go => wzhouwzhou_add.go} (100%) diff --git a/go/add.go b/go/wzhouwzhou_add.go similarity index 100% rename from go/add.go rename to go/wzhouwzhou_add.go From b79d9585e9e3e4a16fc25bac1961f3f7f184f155 Mon Sep 17 00:00:00 2001 From: William Zhou Date: Sun, 3 Oct 2021 12:24:26 -0400 Subject: [PATCH 74/74] Rename xander_convert_number_to_one_or_bigger.js to Xander1233_convert_number_to_one_or_bigger.js --- ...or_bigger.js => Xander1233_convert_number_to_one_or_bigger.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename javascript/{xander_convert_number_to_one_or_bigger.js => Xander1233_convert_number_to_one_or_bigger.js} (100%) diff --git a/javascript/xander_convert_number_to_one_or_bigger.js b/javascript/Xander1233_convert_number_to_one_or_bigger.js similarity index 100% rename from javascript/xander_convert_number_to_one_or_bigger.js rename to javascript/Xander1233_convert_number_to_one_or_bigger.js