Weekly Coder
95 subscribers
84 photos
6 videos
1 file
73 links
Byte sized weekly coding challenges to hone your problem-solving prowess.
Download Telegram
📞 DTMF Tones!

The Dual-Tone Multi-Frequency (DTMF) system is how phones dialers send signals to dial numbers.

These signals are commonly heard on telephone dial pads. Each tone is simply the sum of two sine waves — one from a low-frequency group and one from a high-frequency group.

🎵 Listen to a sample dial tone here.

🌐 Click here and interact with an online DMTF generator.

🥅 Goal: create a program that accepts a phone number as input and produces tones for each digit as if it were pressed on a physical phone keypad. Include pauses between tones for clarity.

🦶 Get started

⚙️ Recommended Learning:
- Array/ArrayList
- Minim Library — for sound generation using oscillators like Oscil
- PVector — for paired digits
- .toCharArray (), .indexOf (), str (), — for String manipulation
- delay () — add pauses between tones

👌 This is the first part of a two-part challenge for an epic project we'll complete next week. Can you guess what part 2 will be?

🪁 Submit your code in the comments!

@WeeklyCoder | Week 66
📞 DTMF Tones 2!

In the TV series Fringe (Season 1 Episode 19 - 36:00-36:44), Olivia hears dialing tones from an abduction's recording and uses an app to decode them into the phone number that was called. By tracing this number, she identifies the perpetrator, pushing the investigation forward.

Let's continue on last week's challenge and create a similar tool this time.

🎵 Listen to a sample dial tone here.

🥅 Goal: create a program that accepts dialing tones as an input (.wav file or other) and outputs the numbers decoded.

⚙️ Recommended Learning:
- Array/ArrayList
- Minim Library — for sound generation using oscillators like Oscil

🪁 Submit your code in the comments!

@WeeklyCoder | Week 67
🖥 It's your turn, again.

Let's have an open projects submission this week. What projects have you been working on since last time?

Whether that's a small one hour project or one that took weeks to finish, let you submit your best (max. of 3) projects here.

Share your works in the comments.

@WeeklyCoder | Week 68
🎧 M is for Music and L is for Lyrics

Let's use the Genius API to create a lyrics fetching project this week.

🥅 Goal: Create a program that, given the name of a song, fetches its lyrics and displays it.

⚙️ It takes < 1min to authorize Genius and obtain your Access Token. You may benefit from using the PY library lyricsgenius or you could just do HTTP.

🪁 Submit your code in the comments!

@WeeklyCoder | Week 69
👍1
Weekly Coder
Photo
📍 Near Ping

Case: After boarding the taxi and a few kilometers away, your friend calls to check if you bought the phone case they asked for while you were near the market—🤦‍♀️, you forgot, and now you feel bad. If only something had reminded you when you were near the phone center!


We’re re-revisiting the Haversine formula to calculate the distance between two points on Earth’s surface using latitude and longitude coordinates.

🥅 Goal:
To build an app that allows users to add reminders tied to specific locations (lat & lng) and reminders them when their current location is within 1 kilometer of a reminder’s location.

To keep it simple, store your data in a local file where each reminder has a task (string) and coordinates (latitude, longitude as floats).

🐾 Steps:
- Allow user to enter reminders and store them (e.g., task, latitude, longitude)
- Let user enter their current location
- Check current location against all reminders and display tasks if within 1 km.


Testing coordinates:
Reminder: Buy phone case
Shop: 9.020274156181737, 38.801150775048335
Your Location: 9.020383152979795, 38.800234352160246


✏️ Recommended Learning:
- Haversine Formula
- asin(), sin(), cos()
- sqrt(), pow(), radians()
- lists, dictionaries


⚡️ Bring the thunder!
As with many of the challenges here, nothing's stopping you from making this a full-fledged mobile app.
- Fetch current location from device's GPS
- Push notifications when near a reminder spot
- Allow custom distance for nearness calculation
- Use your friend's live location so that you don't unknowingly pass by a friend you've been meaning to meet next time

🪁 Send your submissions in the comments!

@WeeklyCoder | Week 70
Weekly Coder
📍 Near Ping Case: After boarding the taxi and a few kilometers away, your friend calls to check if you bought the phone case they asked for while you were near the market—🤦‍♀️, you forgot, and now you feel bad. If only something had reminded you when you…
🌔 What did the Moon look like on your birthday?

The Moon cycles through phases—new, waxing, full, and waning—each altering its glow and shadow over about 29.5 days.

With the AstronomyAPI, you can reveal the Moon’s appearance for any specific day and location.

🥅 Goal: Given a date (YYYY-MM-DD) and coordinates (LAT, LNG), write a program to fetch and display the Moon’s image for that moment.

⚙️ Sign up (takes < 2 minutes) to create your Application and get its ID and Secret—check this guide for details.

✏️ Recommended Learning:
- http.requests
- java.util.base64
- JSONObject, .setString (), .setJSONObject (), .getJSONObject ()
- loadImage (), image ()

🪁 Submit your code in the comments!

@WeeklyCoder | Week 71
👟 Kids' Shoe Fit Finder

Kids’ feet grow fast—up to 1-2 sizes a year—making online shoe shopping a guessing game, with over 30% of returns due to fit issues.

To help with this, let's make a program where parents input their child’s age and foot length (cm) and get instant US, UK, and EU sizes.

We'll use Adidas's Kids Shoes Size Chart as a reference.

🥅 Goal: Given age of a child and their foot length (cm), write a program to output shoe size (in US, UK, and EU).

✏️ Recommended Learning:
- arrays
- selection statements
- logical & relational operators
- loadJSONObject, JSONObject, JSON

🪁 Submit your code in the comments!

@WeeklyCoder | Week 72
🥧 Happy Pi Day!

Let's return to visual coding challenges and tackle Circle Packing this week.

In geometry, circle packing is the study of the arrangement of circles (of equal or varying sizes) on a given surface such that no overlapping occurs and so that all circles touch one another.

There are different variations of CP. What kind would you come up with? Excited to see.

✏️ Recommended Learning:
- random (), translate (), circle ()
- PI, TWO_PI
- constrain (), cos (), sin (), dist ()
- List, class, functions, methods

🪁 Submit your code in the comments!

@WeeklyCoder | Week 73
This media is not supported in your browser
VIEW IN TELEGRAM
⌨️ Case Shifter

What do you do to fix the casing of an already written text? Probably rewrite it properly. This wastes time when you need it polished fast.

To tackle this, let’s build a program where you highlight text, press the Shift key, and cycle through lowercase, uppercase, or title case like in this video.

🥅 Goal: Given highlighted text, write a program to cycle through case options and replace the highlighted text.

✏️ Recommended Learning:
- .lower(), .upper(), .title()
- conditionals & loops
- libraries: pyperclip, keyboard

🪁 Submit your code in the comments!

@WeeklyCoder | Week 74
👍1
⌨️ Withholding Calculator

Better late than never — this week 🙈

It's not rare that you find tools that apply for other countries but none exist for Ethiopian contexts. Such is the case with this week's challenge.

When dealing with financial transactions, manually calculating VAT and withholding tax can be tedious and error-prone.

This week, let’s create a program that takes a post-VAT or pre-VAT price, calculates the pre-VAT/post-VAT amount, and applies withholding tax if thresholds are met (10,000 for products, 3,000 for services), displaying then both the net payable amount and the withheld amount.

🥅 Goal: Given a price, provide selection for pre/post VAT and product/service options. Then calculate the post/pre VAT, withholding amount and net amount. See example calculation here or make a copy of this Sheets template.

✏️ Recommended Learning:
- arithmetic operators
- selection statements (if/else statements)
- functions for reusability

🪁 Submit your code in the comments!

@WeeklyCoder | Week 75
🕰 Pendulum Swings

In many scientific and engineering scenarios, especially when dealing with larger swings, the basic formula for a pendulum's period isn't accurate enough. This week, let's use a more precise calculation that takes into account the initial angle of release.

🥅 Goal: Create a program that calculates the period of a simple pendulum, incorporating a correction for large initial angles using the expansion series for the complete elliptic integral of the first kind (K(k)).

The program should take the pendulum's length and the initial release angle as input and output the more accurate period.

Here's the formula for K(k) we'll use.

✏️ Recommended Learning:
- Arithmetic operators
- Math functions (sqrt, sin, pow)
- Loops
- Functions

🪁 Submit your code in the comments!

@WeeklyCoder | Week 76
This media is not supported in your browser
VIEW IN TELEGRAM
🎮 It's Brick Breaker time!

The Brick Game is a dedicated handheld game that displays games in 10 x 20 grid screen. It was popularized in the early 1990s after being introduced in China in 1989.

🥅 Goal: Create a mini clone of the game Block Breaker but in the theme of Brick Games.

You may build on top of this barebones.
Grab a fitting font from here.
Download the Android app from here.

✏️ Recommended Learning:
- text, rectMode
- keyPressed, mousePressed
- loops, selection statements
- functions

🪁 Submit your code in the comments!

@WeeklyCoder | Week 77
🤖 It's Machine Learning time!

Let's get a glimpse of the world of computer vision this week — through a practical application with a problem that hits close to home.

Manually cropping faces from photos using photo editing software is time-consuming. The task this week is, to automate this process using machine learning-based face detection to produce square, face-centered images for an ID-making software.

⚙️ Task breakdown:
- Detect faces in each photo using OpenCV
- Crop each face into a square image, ensuring the face is centered with a padding
- Output square images suitable for ID-making software

This streamlines ID photo preparation, saving time and ensuring consistent output.

🎒 Resources:
- OpenCV for Processing
- Get started with this code

✏️ Recommended Learning:
- loadImage (), image (), save ()
- mask (), copy (), PGraphics

⚡️ Bring the Thunder!
- support for slightly rotated photos
- support for mass photo processing

🪁 Submit your code in the comments!

@WeeklyCoder | Week 78
🩺 Symptom-Based Disease Predictor

Let's use oral exam data to make predictions.

Given this CSV file that maps diseases to symptoms on a severity scale, build a program that asks users to input their symptom severities and returns the most likely disease from the table.

Each row is a disease, each column is a symptom (rated 0–3). Scale-Meaning.
0 - Absent
1 - Mild
2 - Moderate
3 - Severe

🥅 Goal:
Build a program that interacts with users to guess the most likely disease from their reported symptoms.

🦶 Steps:
- load and parse the CSV file
- prompt the user to enter their severity for each symptom (0–3)
- compare the user's input against all diseases
- output the most likely disease

✏️ Recommended Learning:
- Table, loadTable ()
- getRowCount (), getColumnCount ()
- getString (), getInt ()
- sortKeys (), sortValues ()
- .keyArray ()
- similarity/distance calculation (sum of absolute differences)

🪁 Submit your code in the comments!

@WeeklyCoder | Week 79
😁1
Weekly Coder
🤖 It's Machine Learning time! Let's get a glimpse of the world of computer vision this week — through a practical application with a problem that hits close to home. Manually cropping faces from photos using photo editing software is time-consuming. The…
👉 Read this first: Tough-Love

📸 Manual Photo Crop Tool


Last time, we stepped into the world of computer vision — building a tool to automatically detect and crop faces from photos for ID-making purposes. It works great ... except when ML didn’t.

Not every photo played nice with automated face detection. Sometimes it missed the face or cropped poorly.

So this week, we’re flipping the script — let's build the user custom and manual control to crop faces from photos.

🥅 Goal: Build a Manual Crop Tool where a user can manually position the photo behind a fixed square frame to get the perfect crop.

🦶 Steps: here

⚙️ Key Features:
- Panning: on the image (click-drag or arrow keys)
- Zooming: in/out using mouse wheel or +/-

⚡️ Bring the Thunder: here

✏️ Recommended Learning:
- loadImage(), image(), translate(), scale(), rotate()
- mask (), copy(), save()
- mouseDragged(), mouseWheel(), keyPressed()
- PGraphics

🪁 Submit your code in the comments!

@WeeklyCoder | Week 80
Weekly Coder
Photo
📊 Fuel Theft Detection

This week, let's analyze vehicle telemetry to tackle a critical problem: detecting fuel theft. By processing GPS and fuel data, we can identify suspicious fuel level changes.

🥅 Goal: Build a Fuel Theft Detector that processes a CSV of vehicle telemetry data to identify stops and flag fuel changes as theft or fillings.

We'll use this real-world data as input.

Real life is messy. Sensors can give readings that are all over the place when a vehicle is moving uphill or down hill or when it changes.

So to do this, we'll only consider fuel level changes as either thefts/fillings if they happen while the vehicle is stationary (speed = 0 kph). We'll take as a stop a duration of ≥ 3 minutes.

Filling if Fuel Diff > 1.0 and stop duration ≥ 3 minutes and Theft if Fuel Diff < -1.0

⚡️ Bring the Thunder:
- Output a summary report (events and amounts) to a csv file.
- Include the associated GPS coordinates to indicate where theft or fillings may have happened.

✏️ Recommended Learning:
- loadTable(), saveTable(), nf
- SimpleDateFormat
- Loops and conditionals
- .replace (), .contains ()

🪁 Submit your code in the comments!

@WeeklyCoder | Week 81
📋 BetterClip: Clipboard Bank
Weekly Coder
📋 BetterClip: Clipboard Bank
Ever found yourself copying something useful, only to accidentally overwrite it with something else seconds later?

I've been there. Windows has a clipboard history feature built in — BUT it's limited, buggy, and doesn't quite do enough for real-world use.

👎 The built-in Windows clipboard:
- Stores only 25 items
- Clears everything on restart
- No search or categorization
- No support for files
- Misses to record things sometimes
- Does not have searchability
- Does not have categorization
- and a lot more

But we can do better — and we will.

🥅 Goal: To build a better clipboard manager. BetterClip will have:
- Unlimited history
- Searchability
- Persistent storage across reboots
- Auto-deletion of old records
- Restore on startup
- Support for text, images, files, URLs
- Tabs for categorization [All | Texts | Images | Files | URLs | +]
- Option to pin
- Global hotkey to launch
- Incognito mode to temporarily disable recording


✏️ Recommended Learning:
- java.awt.Toolkit | pyperclip
- JIntellitype for Global Hotkeys
- the object Object and DataFlavor
- saveStrings ()
- List, LinkedHashMap

🪁 Submit your code in the comments!

@WeeklyCoder | Week 82
DJ Robot

Music in factories boosts morale, productivity, and focus. But manual playlist management often leads to forgotten starts, missed pauses, and repetitive songs.

🥅 Goal: This week, let's build a customizable, offline music scheduler for factory Bluetooth PA systems — with the following features:

- automated start/stop at clock-in/out
- pause during lunch breaks (or custom lunch playlist)
- day-specific playlists
- easy way to add/remove songs in playlists

⚡️ Bring the Thunder:
- schedule overrides no playback on Sundays or specific dates (religious holidays or during no work days)
- bluetooth PA system integration such that it looks for the PA system before playing music
- song rotation to avoid repetition

✏️ Recommended Learning:
- Minim library for audio playback
- java.util.Timer for scheduling automation
- java.io.File for playlist/file management
- List, HashMap, +
- JIntellitype for special media keys (Play, Pause, Stop, +)

🪁 Submit your code in the comments!

@WeeklyCoder | Week 83