โ ๏ธ "Energy flows where attention goes" โ T.R.
How much of your attention is going where you want it to when you're on a computer?
We're getting that figured on this week's coding challenge!
๐ฅ Goal: To make a simple active window tracking program to determine the most used apps.
โ๏ธ Recommended Learning:
-
-
-
๐ฆถ Get started: Here's a starting code with the JNA library included in the 'code' folder. It contains a function to get title of the focused window.
๐พ Steps: Start by obtaining the current title of the active window. Check if the title has been stored before. If it is new, count it as one. If old, increment the prev count by 1. Sort the stored item values (counts) and get the keys (titles).
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions here.
@WeeklyCoder | Week 29
How much of your attention is going where you want it to when you're on a computer?
We're getting that figured on this week's coding challenge!
๐ฅ Goal: To make a simple active window tracking program to determine the most used apps.
โ๏ธ Recommended Learning:
-
Intict, key, value-
set (), size (), get (), hasKey ()-
increment operator๐ฆถ Get started: Here's a starting code with the JNA library included in the 'code' folder. It contains a function to get title of the focused window.
๐พ Steps: Start by obtaining the current title of the active window. Check if the title has been stored before. If it is new, count it as one. If old, increment the prev count by 1. Sort the stored item values (counts) and get the keys (titles).
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions here.
@WeeklyCoder | Week 29
๐ฅ1๐จโ๐ป1
๐ 8.764868, 38.999322
Feather light coding challenge for y'all this week.
๐ฅ Goal: Calculate the distance between two points on the Earth's surface given two coordinates as latitude and longitude.
โ๏ธ Recommended Learning:
- Haversine Formula
-
-
๐พ Steps: Start by studying Haversine Formula. Then convert each equation to programmatic expression.
โ Testing coordinates:
Point 1: [8.76484622069578, 38.99934027941346]
Point 2: [8.945679343541766, 39.20198679710532]
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 30
Feather light coding challenge for y'all this week.
๐ฅ Goal: Calculate the distance between two points on the Earth's surface given two coordinates as latitude and longitude.
โ๏ธ Recommended Learning:
- Haversine Formula
-
asin (), sin (), cos (),-
sqrt (), pow (), radians ()๐พ Steps: Start by studying Haversine Formula. Then convert each equation to programmatic expression.
โ Testing coordinates:
Point 1: [8.76484622069578, 38.99934027941346]
Point 2: [8.945679343541766, 39.20198679710532]
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 30
๐จโ๐ป1
โก๏ธCounting Flashes
Digital electric meters have an LED that flashes with each pulse, allowing for visual monitoring of energy consumption in real time.
*pulse here is a small and fixed amount of energy passing through the meter.
Pulse Rate is a common metric found on such meters [Unit imp/kWh].
โ๏ธ Example: 3200 imp/kWh would indicate that for every kilowatt-hour (kWh) of electricity consumed, the meter will produce 3200 pulses (impulses).
๐ฅ Goal: Write a program to calculate the total energy consumed in kWh given number of pulses and the imp/kWh of a meter.
๐ผ Example photo of such a meter here.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 31
Digital electric meters have an LED that flashes with each pulse, allowing for visual monitoring of energy consumption in real time.
*pulse here is a small and fixed amount of energy passing through the meter.
Pulse Rate is a common metric found on such meters [Unit imp/kWh].
โ๏ธ Example: 3200 imp/kWh would indicate that for every kilowatt-hour (kWh) of electricity consumed, the meter will produce 3200 pulses (impulses).
๐ฅ Goal: Write a program to calculate the total energy consumed in kWh given number of pulses and the imp/kWh of a meter.
๐ผ Example photo of such a meter here.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 31
๐จโ๐ป1
๐ Recursion Time
Let's do this math together. It's simple, add the digits in the numbers:
- 456381901
- 342999002
- 304072023
If you added the digits of each and the obtained result's digits iteratively until you get just a single digit, you'll notice the sums are: 1, 2, and 3 respectively.
Eg: 4567295
4+5+6+7+2+9+5 = 38
3+8 = 11
1+1= 2
Here's the neat thing. If you removed all 9's and all numbers that add up to 9, the sum of the digits will remain the same.
Eg: 4567295
Remove 9
Remove 4 & 5 because 4+5= 9
Remove 7 & 2 because 7+2=9
That leaves: 6 and 5
6+5 = 11
1+1 = 2
๐ฅ Goal: Write a program to calculate the sum of each digit within a given integer iteratively/recursively until the sum of the resulting sum itself is a single digit.
โ๏ธ Recommend Learning:
- Recursion
โก Bring the thunder:
- Remove numbers adding up to 9 and all 9's from the number before adding and see where that takes you.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 32
Let's do this math together. It's simple, add the digits in the numbers:
- 456381901
- 342999002
- 304072023
If you added the digits of each and the obtained result's digits iteratively until you get just a single digit, you'll notice the sums are: 1, 2, and 3 respectively.
Eg: 4567295
4+5+6+7+2+9+5 = 38
3+8 = 11
1+1= 2
Here's the neat thing. If you removed all 9's and all numbers that add up to 9, the sum of the digits will remain the same.
Eg: 4567295
Remove 9
Remove 4 & 5 because 4+5= 9
Remove 7 & 2 because 7+2=9
That leaves: 6 and 5
6+5 = 11
1+1 = 2
๐ฅ Goal: Write a program to calculate the sum of each digit within a given integer iteratively/recursively until the sum of the resulting sum itself is a single digit.
โ๏ธ Recommend Learning:
- Recursion
โก Bring the thunder:
- Remove numbers adding up to 9 and all 9's from the number before adding and see where that takes you.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 32
๐จโ๐ป1
๐คช Tongue Twisters Time
Tongue twisters are playful phrases designed to challenge pronunciation by featuring repetitive sounds or combinations of words that are difficult to articulate quickly and accurately.
No actual tongue twists following from tongue twisters is probably a tender twist of tongue twisters.
๐ฅ Goal: Given a tongue twister as a String, determine a word that's most likely responsible for the phrase being a tongue twister.
๐ Example:
Given this: If Kantie can tie a tie and untie a tie, why canโt I tie a tie and untie a tie like Kantie can.
Output would be: 'tie'
โ๏ธ Recommended Learning:
-
-
)
-
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 33
Tongue twisters are playful phrases designed to challenge pronunciation by featuring repetitive sounds or combinations of words that are difficult to articulate quickly and accurately.
No actual tongue twists following from tongue twisters is probably a tender twist of tongue twisters.
๐ฅ Goal: Given a tongue twister as a String, determine a word that's most likely responsible for the phrase being a tongue twister.
๐ Example:
Given this: If Kantie can tie a tie and untie a tie, why canโt I tie a tie and untie a tie like Kantie can.
Output would be: 'tie'
โ๏ธ Recommended Learning:
-
StringDict-
Levenshtein distance (org.apache.commons.text.similarity.LevenshteinDistance)
-
Nested loops๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 33
๐จโ๐ป1
โ๏ธ Icy Mudballs
The last apperance of the comet Hale-Bopp (called Hale Comet for short) was back in April 1, 1997. The orbital period of Hale is approximately 2,533 years.
It's next appearance would thus be: 1997 + 2533 = 4530.
๐ฅ Goal: Write a program to determine how many times the Hale Comet would appear in a Megannum (a 1,000,000 years).
โ๏ธ Recommended Learning:
-
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 34
The last apperance of the comet Hale-Bopp (called Hale Comet for short) was back in April 1, 1997. The orbital period of Hale is approximately 2,533 years.
It's next appearance would thus be: 1997 + 2533 = 4530.
๐ฅ Goal: Write a program to determine how many times the Hale Comet would appear in a Megannum (a 1,000,000 years).
โ๏ธ Recommended Learning:
-
operators: modulo, division๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 34
๐จโ๐ป1
๐ช So, how much do you weigh?
๐ฅ Goal: Given the g (acceleration due to gravity in m/sยฒ) of the planets in our solar system, write a computer program that takes in weight on Earth and calculates weight on all other planets.
๐ Gravity Values (in m/sยฒ):
Mercury: 3.7 | Venus: 8.87 | Earth: 9.81
Mars: 3.71 | Jupiter: 24.79 | Saturn: 10.44
Uranus: 8.69 | Neptune: 11.15 | Pluto (though not really a planet): 0.62
โ๏ธ Recommended Learning:
-
-
โก๏ธ Bring the thunder:
- Spice this up by getting creative and adding in some graphics to it.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 35
๐ฅ Goal: Given the g (acceleration due to gravity in m/sยฒ) of the planets in our solar system, write a computer program that takes in weight on Earth and calculates weight on all other planets.
๐ Gravity Values (in m/sยฒ):
Mercury: 3.7 | Venus: 8.87 | Earth: 9.81
Mars: 3.71 | Jupiter: 24.79 | Saturn: 10.44
Uranus: 8.69 | Neptune: 11.15 | Pluto (though not really a planet): 0.62
โ๏ธ Recommended Learning:
-
operators: division-
PImage, loadImage (), image ()โก๏ธ Bring the thunder:
- Spice this up by getting creative and adding in some graphics to it.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 35
๐จโ๐ป1
๐ฉ + ๐ฉ = โฌ๏ธ + ๐ฆ [3min challenge]
This week's challenge is so easy, you could solve it in just a single line of code!
Students are to be paired for a group work. The idea is to have optimal pairs of proficient students in different subjects.
The assumption is that, a student proficient in one subject isn't necessarily proficient in another. Meaning having a pair of students both proficient in the same subject is undesirable.
Output it like this:
Pair 1: Diana - Dalton
Pair 2: Lisa - Ford
...
โก๏ธ Bring the thunder
- Though you have access to the above two String Arrays, you are to use the following alphabetically ordered version to make the pairs. [Here's the Array]
Green on Green Makes Black and Blue
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 36
This week's challenge is so easy, you could solve it in just a single line of code!
Students are to be paired for a group work. The idea is to have optimal pairs of proficient students in different subjects.
The assumption is that, a student proficient in one subject isn't necessarily proficient in another. Meaning having a pair of students both proficient in the same subject is undesirable.
String phy_pro_students [] = {"Diana", "Lisa", "Margaret", "Monica", "John"};
String bio_pro_students [] = {"Dalton", "Ford", "Homer", "Tina", "Mia"};Output it like this:
Pair 1: Diana - Dalton
Pair 2: Lisa - Ford
...
โก๏ธ Bring the thunder
- Though you have access to the above two String Arrays, you are to use the following alphabetically ordered version to make the pairs. [Here's the Array]
Green on Green Makes Black and Blue
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 36
๐จโ๐ป1
๐ Zhhnoa Frghu!
It's Caesar's Cipher time!
Inspired by Julius Caesar, who used this method to protect his private messages, the challenge for this week is is to create a program that shifts each letter in a given String by 3 places.
Eg: If the shift is 3,
a becomes d | b > e | c > f | e > g | ... z > c
Can you crack the code and reveal the hidden title above?
โก๏ธBring the thunder!
Click here for 3 increasingly difficult versions of the challenge.
๐Though maybe not the clearest at first glance, it* surely can be done in just one line of code. If you do, and are the first of three (unique) implementations to do and post it in the comments, something ๐ may await you.
*Either the encryption or decryption of the bare minimum of the challenge.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 37
It's Caesar's Cipher time!
Inspired by Julius Caesar, who used this method to protect his private messages, the challenge for this week is is to create a program that shifts each letter in a given String by 3 places.
Eg: If the shift is 3,
a becomes d | b > e | c > f | e > g | ... z > c
Can you crack the code and reveal the hidden title above?
โก๏ธBring the thunder!
Click here for 3 increasingly difficult versions of the challenge.
๐
*Either the encryption or decryption of the bare minimum of the challenge.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 37
๐ It's JSON time!
This week's challenge brings you a stage to work with APIs. Head over to openexchangerates.org/signup/free and sign up and get your API Key.
Extract rates desired (eg. USD (base) to ETB). Use the data you obtained to:
- convert from one currency to another
- create a digital currency exchange board
๐ฑ Get started with these two barebones.
Example 1 | Example 2
๐ Prizes of last week will be delivered at the Book Club Meetup this Saturday, Jul 6.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 38
This week's challenge brings you a stage to work with APIs. Head over to openexchangerates.org/signup/free and sign up and get your API Key.
Extract rates desired (eg. USD (base) to ETB). Use the data you obtained to:
- convert from one currency to another
- create a digital currency exchange board
๐ฑ Get started with these two barebones.
Example 1 | Example 2
๐ Prizes of last week will be delivered at the Book Club Meetup this Saturday, Jul 6.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 38
๐1
๐ฌ But can you validate an email?
Something super simple for you this week.
Let's implement a program that takes an email address as input and displays whether it is valid or not.
An email is considered valid if is in the format: username@domain.extension
โก๏ธ Bring the thunder!
- Introduce a user interface and add in animations too
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 39
Something super simple for you this week.
Let's implement a program that takes an email address as input and displays whether it is valid or not.
An email is considered valid if is in the format: username@domain.extension
โก๏ธ Bring the thunder!
- Introduce a user interface and add in animations too
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 39
๐ช Reminiscence time!
Let's recreate a very old game called Magic Paper this week.
The game is simple. You pick any two-digit number. You then add the two digits together. You then subtract the result from the original number.
Example: Let's say you picked 32
3 + 2 = 5
32 - 5 = 27
You then take this result and look for a symbol labeled 27.
Now, the point of the game is to, 'Magically' predict what sign you landed on.
So after you have picked your two-digit number, the game would let you see the list of symbols. And without any input form you whatsoever, it'll show you the symbol you saw.
Check out the screenshots of the original game here.
โก๏ธ Could you crack the "Magic" powering this game and recreate it?
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 40
Let's recreate a very old game called Magic Paper this week.
The game is simple. You pick any two-digit number. You then add the two digits together. You then subtract the result from the original number.
Example: Let's say you picked 32
3 + 2 = 5
32 - 5 = 27
You then take this result and look for a symbol labeled 27.
Now, the point of the game is to, 'Magically' predict what sign you landed on.
So after you have picked your two-digit number, the game would let you see the list of symbols. And without any input form you whatsoever, it'll show you the symbol you saw.
Check out the screenshots of the original game here.
โก๏ธ Could you crack the "Magic" powering this game and recreate it?
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 40
๐ S is for Secure
This week, let's make a password strength checker to evaluate the security of a password.
Unauthorized access can come in forms of: brute force attacks, dictionary attacks, and guessing attacks
A strong password typically includes a mix of different character types (uppercase, lowercase, digits, special characters) and avoids common patterns or easily guessable information
๐ฅ Goal: Let a user input their password and output its strength basing this list of evaluation criteria (as many as possible).
โก๏ธ Bring the thunder!
- How many of the evaluation criteria can you implement?
- Provide feedback on how to make the password stronger?
- Introduce some descent User Interface to make this more engaging and real-time interactive?
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 41
This week, let's make a password strength checker to evaluate the security of a password.
Unauthorized access can come in forms of: brute force attacks, dictionary attacks, and guessing attacks
A strong password typically includes a mix of different character types (uppercase, lowercase, digits, special characters) and avoids common patterns or easily guessable information
๐ฅ Goal: Let a user input their password and output its strength basing this list of evaluation criteria (as many as possible).
โก๏ธ Bring the thunder!
- How many of the evaluation criteria can you implement?
- Provide feedback on how to make the password stronger?
- Introduce some descent User Interface to make this more engaging and real-time interactive?
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 41
๐1
๐ Last seen 42minutes ago
Quick one for ya this week.
๐ฅ Goal: Given the number of milliseconds that have passed since the last time a user was active on an app, display their last seen.
Examples:
- 5000 -> Just now
- 62000 -> A minute ago
- 300000 -> 5 minutes ago
- 7200000 -> 2 hours ago
- +
โก๏ธ Bring the thunder!
A UNIX epoch time is the number of seconds* which have passed since 00:00:00 UTC โ Jan 1, 1970.
As of writing this, it's 1722623321000. Supposing that's the last time a user was on the app, how long ago would their be their last seen?
* Excluding leap seconds
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 42
Quick one for ya this week.
๐ฅ Goal: Given the number of milliseconds that have passed since the last time a user was active on an app, display their last seen.
Examples:
- 5000 -> Just now
- 62000 -> A minute ago
- 300000 -> 5 minutes ago
- 7200000 -> 2 hours ago
- +
โก๏ธ Bring the thunder!
A UNIX epoch time is the number of seconds* which have passed since 00:00:00 UTC โ Jan 1, 1970.
As of writing this, it's 1722623321000. Supposing that's the last time a user was on the app, how long ago would their be their last seen?
* Excluding leap seconds
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 42
๐บ But do you see art?
Let's see how creative and artistic you can get this week!
๐ฅ Goal: Base the given image of the world map in just two colors (0 - Black, and 255 - White) to create some form of art โ any kind.
โ๏ธ Recommended Learning:
-
-
-
-
// Image of this post was created using these above
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 43
Let's see how creative and artistic you can get this week!
๐ฅ Goal: Base the given image of the world map in just two colors (0 - Black, and 255 - White) to create some form of art โ any kind.
โ๏ธ Recommended Learning:
-
PImage, resize ()-
strokeCap ()-
.get (x, y) // for PImage-
saveFrame ()๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 43
๐ฒ Lucky? Prove it!
Let's play craps!
Craps is a fast-paced dice game where players bet on the outcome of rolls. The main goal is to predict whether the shooter will win or lose based on the numbers rolled.
One of the main bets you can make in the game of Craps is Pass Line Bet. Here's how to play it [Simplified]:
๐ฅ Goal: Recreate the Pass Line Bet based on the description.
โ๏ธ Recommended Learning:
-
-
-
โก๏ธ Bring the Thunder!
- Use images images of dice to reveal a roll than just numbers in a console
- Use image of a casino or Craps table in the background to make it more appealing
- Add in rolling sounds of dice
- Include other types of bets than just Pass Line Bet
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 44
Let's play craps!
Craps is a fast-paced dice game where players bet on the outcome of rolls. The main goal is to predict whether the shooter will win or lose based on the numbers rolled.
One of the main bets you can make in the game of Craps is Pass Line Bet. Here's how to play it [Simplified]:
๐ฅ Goal: Recreate the Pass Line Bet based on the description.
โ๏ธ Recommended Learning:
-
PImage-
random ()-
casting, loopsโก๏ธ Bring the Thunder!
- Use images images of dice to reveal a roll than just numbers in a console
- Use image of a casino or Craps table in the background to make it more appealing
- Add in rolling sounds of dice
- Include other types of bets than just Pass Line Bet
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments.
@WeeklyCoder | Week 44
๐งฉ Unscrambling time!
Another game for ya this week!
๐ฅ Goal: is to take a scrambled set of words and piece them back together into a meaningful sentence.
In this game, the computer will scramble words of a random sentence, and players win if they rearrange the words in the right order.
โ๏ธ Recommended Learning:
-
-
-
โก๏ธ Bring the Thunder!
- Introduce a non binary scoring system. Use Levenshtein's distance perhaps?
- Add a count down timer to turn the heat up on a player.
- Let the scoring system factor in time โ the shorter the time the better.
- Use a hint system to reveal a word in the correct position .
- Include a bank of sentences to increase difficulty as you progress.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments!
@WeeklyCoder | Week 45
Another game for ya this week!
๐ฅ Goal: is to take a scrambled set of words and piece them back together into a meaningful sentence.
In this game, the computer will scramble words of a random sentence, and players win if they rearrange the words in the right order.
โ๏ธ Recommended Learning:
-
loadStrings ()-
split(), random()-
loops and conditionalsโก๏ธ Bring the Thunder!
- Introduce a non binary scoring system. Use Levenshtein's distance perhaps?
- Add a count down timer to turn the heat up on a player.
- Let the scoring system factor in time โ the shorter the time the better.
- Use a hint system to reveal a word in the correct position .
- Include a bank of sentences to increase difficulty as you progress.
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments!
@WeeklyCoder | Week 45
๐ซ Your nearest airport!
We're revisiting Haversine to calculate the distance between two points on the Earth's surface given two coordinates as latitude and longitude.
๐ฅ Goal: To build a program that takes a userโs current location (latitude and longitude) and displays a list of the top 5 nearest airports, showing their IATA codes and names.
๐ Resource: Here's a JSON file listing details of airports of the world. [Details here]
โ๏ธ Recommended Learning:
- Haversine Formula
-
-
๐พ Steps: Start by studying Haversine Formula. Then convert each equation to programmatic expression.
โ Testing coordinate:
8.764846, 38.999340
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments!
@WeeklyCoder | Week 46
We're revisiting Haversine to calculate the distance between two points on the Earth's surface given two coordinates as latitude and longitude.
๐ฅ Goal: To build a program that takes a userโs current location (latitude and longitude) and displays a list of the top 5 nearest airports, showing their IATA codes and names.
๐ Resource: Here's a JSON file listing details of airports of the world. [Details here]
โ๏ธ Recommended Learning:
- Haversine Formula
-
asin (), sin (), cos (),-
sqrt (), pow (), radians ()๐พ Steps: Start by studying Haversine Formula. Then convert each equation to programmatic expression.
โ Testing coordinate:
8.764846, 38.999340
๐ Submissions: Sunday Morning, 2:00 LT
๐ช Send your submissions in the comments!
@WeeklyCoder | Week 46
๐ช What zone you workn'?
Threshold Heart Rate (THR) is the highest heart rate an athlete can sustain for a sustained period of time โ typically 30-75mins. Knowing THR helps to optimize training.
๐ฅ Goal: Given the age of a person and their current heart rate (in bpm) calculate the 5 zones of their THR.
MHR = Maximum Heart Rate
MHR = 220 - age (approx.)
Zone 1: 50-60% of MHR (Very Light)
Zone 2: 60-70% of MHR (Light)
Zone 3: 70-80% of MHR (Moderate)
Zone 4: 80-90% of MHR (Hard)
Zone 5: Above 90% of MHR (Max. Effort)
โ๏ธ Recommended Learning:
- Selection statements
โก๏ธ Bring the thunder!
- Instead of approximating maximum heart rate from age, take that as input from a user as well to refine your zone calculations.
- Get creative with this real workout log from a fitness tracker watch.
๐ช Send your submissions in the comments!
@WeeklyCoder | Week 47
Threshold Heart Rate (THR) is the highest heart rate an athlete can sustain for a sustained period of time โ typically 30-75mins. Knowing THR helps to optimize training.
๐ฅ Goal: Given the age of a person and their current heart rate (in bpm) calculate the 5 zones of their THR.
MHR = Maximum Heart Rate
MHR = 220 - age (approx.)
Zone 1: 50-60% of MHR (Very Light)
Zone 2: 60-70% of MHR (Light)
Zone 3: 70-80% of MHR (Moderate)
Zone 4: 80-90% of MHR (Hard)
Zone 5: Above 90% of MHR (Max. Effort)
โ๏ธ Recommended Learning:
- Selection statements
โก๏ธ Bring the thunder!
- Instead of approximating maximum heart rate from age, take that as input from a user as well to refine your zone calculations.
- Get creative with this real workout log from a fitness tracker watch.
๐ช Send your submissions in the comments!
@WeeklyCoder | Week 47
๐ฎ How good are you at predictin'?
Some run fast. Some run slow. And for this week's challenge, let's build a program that predicts users' potential finish times for race distances (5k, 10k, half-marathon 21k, marathon 42k) based on their best pace per kilometer.
๐ฅ Goal: Given the best pace per kilometer (in minutes per kms), calculate predicted best finish times for:
5km, 10km, 21km, and 42km.
One could sprint through a 1km run with a pace of 2:50min/km but doing the same consistently for a marathon is nearly impossible. Use then, Riegel Formula, to account for the performance decay.
โ๏ธ Recommended Learning:
-
-
โก๏ธ Bring the thunder!
- Instead of taking 1.06 as a fixed decay rate, customize it using these figures.
- Take in an actual marathon finish time, obtain the pace, then use the Riegel Formula in reverse to classify a runner's fitness level like this.
๐ช Send your submissions in the comments!
@WeeklyCoder | Week 48
Some run fast. Some run slow. And for this week's challenge, let's build a program that predicts users' potential finish times for race distances (5k, 10k, half-marathon 21k, marathon 42k) based on their best pace per kilometer.
๐ฅ Goal: Given the best pace per kilometer (in minutes per kms), calculate predicted best finish times for:
5km, 10km, 21km, and 42km.
One could sprint through a 1km run with a pace of 2:50min/km but doing the same consistently for a marathon is nearly impossible. Use then, Riegel Formula, to account for the performance decay.
โ๏ธ Recommended Learning:
-
arithmetic operators-
pow (,), log ()โก๏ธ Bring the thunder!
- Instead of taking 1.06 as a fixed decay rate, customize it using these figures.
- Take in an actual marathon finish time, obtain the pace, then use the Riegel Formula in reverse to classify a runner's fitness level like this.
๐ช Send your submissions in the comments!
@WeeklyCoder | Week 48
๐1๐จโ๐ป1