Skip to content

Instantly share code, notes, and snippets.

View claeusdev's full-sized avatar
🏠
Working from home

Nana Adjei Manu claeusdev

🏠
Working from home
View GitHub Profile
@claeusdev
claeusdev / commit_format.txt
Created January 15, 2025 12:34 — forked from mutewinter/commit_format.txt
My commit message format.
feat: add hat wobble
^--^ ^------------^
| |
| +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.

Level 0 ( basic programming )

  1. https://rutracker.org/forum/viewtopic.php?t=6333909 ( Python Programming Language )
  2. https://rutracker.org/forum/viewtopic.php?t=4857295 ( Intro to C++ )
  3. https://rutracker.org/forum/viewtopic.php?t=5635544 ( Rust programming language )
  4. https://www.youtube.com/playlist?list=PLre5AT9JnKShBOPeuiD9b-I4XROIJhkIU ( Ocaml "Functional Programming" )
  5. https://www.youtube.com/playlist?list=PLe7Ei6viL6jGp1Rfu0dil1JH1SHk9bgDV ( Haskell "Functional Programming" )

Level 1 ( Math & Computing ) 1 & 2, highly recommended then any of the algorithms, choose which is easiest, Sedgewick

  1. https://academictorrents.com/details/2b5e5cc8c7414bc3b0f6974190065bc8c2f629dc ( intro to math thinking )

Scenario: A User Draws on the Whiteboard

  1. Client Layer:

    • User Action: A user draws a line on the whiteboard using the client application (browser or mobile app).
    • Local State Management: The client's local state (in the browser or app) captures the drawing action immediately, providing a smooth user experience.
    • WebSocket Connection: The client uses a WebSocket connection to send drawing events (like mouse positions or strokes) to the backend server. This connection ensures low-latency, real-time communication.
  2. Load Balancer:

  • The Cloud Load Balancer receives the incoming WebSocket request from the client and forwards it to one of the available WebSocket servers.
set relativenumber
set tabstop=4
set termguicolors
set nobackup
set nowritebackup
set encoding=utf-8
set nocompatible
filetype off
filetype plugin indent on

To address Problem B as described in your document, we'll start by identifying a counterexample to the provided greedy algorithm ("largest increment in mark"), then design an efficient algorithm to solve the homework allocation problem optimally, and finally analyze its time and space complexity.

Counterexample to the Greedy Algorithm

Let's consider the greedy algorithm provided in the problem statement, which prioritizes homework assignments based on the largest increase in marks for each additional hour spent. We need to find a scenario where this approach does not yield the maximum total marks when the total available hours (T) are limited, with (n \leq 2) and (T \leq 3).

Given:

  • (n = 2) homework assignments.
  • (T = 3) hours available.
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
import java.util.Objects;
public class RoutePlannerAdapter implements IDUServiceRoutePlanner {
private final String apiKey;
import java.util.ArrayList;
import java.util.List;
public interface Address {
String getStreet();
String getCity();
String getPostalCode();
String getCountry();
}
function generateCode(){
return Math.floor(10000000 + Math.random() * 90000000)
// // Generate a version 4 (random) UUID
// const uuid = uuidv4();
// // Extract the first 8 characters to get an 8-digit ID
// const studentId = uuid.substring(0, 8);
// // call .toString() if you need it as a string.
}