<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by abanoub wagih on Medium]]></title>
        <description><![CDATA[Stories by abanoub wagih on Medium]]></description>
        <link>https://medium.com/@abanoubwagih?source=rss-8cc56899957c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qdhOY1DYIAdbZIw1m6YvTQ.jpeg</url>
            <title>Stories by abanoub wagih on Medium</title>
            <link>https://medium.com/@abanoubwagih?source=rss-8cc56899957c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 03:20:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abanoubwagih/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding Cassandra Primary Keys: Partition Key, Clustering Columns, and Data Distribution…]]></title>
            <link>https://medium.com/@abanoubwagih/understanding-cassandra-primary-keys-partition-key-clustering-columns-and-data-distribution-c61289d5289d?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c61289d5289d</guid>
            <category><![CDATA[cassandra-database]]></category>
            <category><![CDATA[cassandra]]></category>
            <category><![CDATA[nosql]]></category>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Sun, 11 May 2025 09:39:42 GMT</pubDate>
            <atom:updated>2025-05-11T09:39:42.217Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding Cassandra Primary Keys: Partition Key, Clustering Columns, and Data Distribution Explained Simply</h3><p>If you’re starting with <strong>Apache Cassandra</strong>, one of the first things you’ll run into is its unique way of defining <strong>primary keys</strong>. Unlike traditional SQL databases, Cassandra’s primary key is <strong>more than just a row identifier</strong> — it controls <strong>where</strong> your data lives and <strong>how</strong> it’s stored and sorted.</p><p>In this post, we’ll break down the primary key structure in Cassandra and explain <strong>Partition Keys</strong>, <strong>Clustering Columns</strong>, and <strong>how they affect data distribution</strong>, with easy examples and analogies.</p><blockquote>🧠 What Is a Primary Key in Cassandra?</blockquote><p>In Cassandra, a <strong>Primary Key</strong> consists of:</p><ul><li><strong>Partition Key</strong>: tells Cassandra <strong>where to store</strong> the row.</li><li><strong>Clustering Columns</strong> <em>(optional)</em>: control <strong>how rows are sorted and grouped</strong> inside the partition.</li></ul><pre>PRIMARY KEY ((partition_key), clustering_column1, clustering_column2, ...)</pre><p>You <strong>must</strong> understand this to design efficient and scalable data models in Cassandra.</p><blockquote>Partition Key — Where the Data Goes</blockquote><p>The <strong>Partition Key</strong> is the most important part of your primary key. It tells Cassandra <strong>which node</strong> in the cluster should store the row.</p><p>Cassandra uses a <strong>hashing algorithm</strong> on the partition key to distribute data <strong>evenly across nodes</strong>, preventing bottlenecks or overloaded servers.</p><pre>CREATE TABLE orders (<br>  order_id UUID,<br>  customer_id UUID,<br>  date TEXT,<br>  amount DECIMAL,<br>  PRIMARY KEY ((customer_id))<br>);</pre><p>In this table:</p><ul><li>customer_id is the <strong>partition key</strong></li><li>All orders from the same customer are stored together</li><li>No sorting yet — just grouping by customer</li></ul><blockquote>📦 Analogy:</blockquote><p>Think of a <strong>library network</strong>. Each <strong>partition key</strong> is like a <strong>ZIP code</strong> that determines which <strong>branch</strong> receives a set of books. All books (rows) with the same ZIP code (partition key) go to the same branch (node).</p><blockquote>Clustering Columns —How the Data is Organized Inside the Partition</blockquote><p>Clustering columns <strong>sort</strong> the data within each partition. If multiple rows share the same partition key, clustering columns control <strong>the order they’re stored and retrieved</strong>.</p><pre>CREATE TABLE orders_by_customer (<br>  customer_id UUID,<br>  order_id UUID,<br>  order_date TIMESTAMP,<br>  amount DECIMAL,<br>  PRIMARY KEY ((customer_id), order_date)<br>);</pre><ul><li>customer_id: Partition Key → decides <em>where</em> to store data</li><li>order_date: Clustering Column → decides <em>how</em> to order the rows inside that partition</li></ul><p>Now you can efficiently get all orders for a customer sorted by date:</p><pre>SELECT * FROM orders_by_customer<br>WHERE customer_id = ?<br>ORDER BY order_date DESC;</pre><blockquote>📚 Analogy:</blockquote><p>Inside the library branch, the clustering column determines <strong>how books are arranged on the shelf</strong>. Maybe by author, by year, or by genre.</p><blockquote>Composite Partition Keys</blockquote><p>You can use <strong>multiple columns</strong> together as the partition key:</p><pre>PRIMARY KEY ((store_id, product_id), date)</pre><p>Here:</p><ul><li>store_id + product_id = <strong>Composite Partition Key</strong></li><li>date = Clustering column</li></ul><p>All sales for a specific product in a store will be <strong>grouped and sorted</strong> in one partition.</p><h4>Rules to Remember</h4><ul><li>Filter using the full <strong>partition key</strong></li><li>Sort or filter using <strong>clustering columns</strong> after filtering by partition</li><li>Use UUIDs or logical IDs as partition keys</li></ul><pre>-- ✅ Good<br>SELECT * FROM messages WHERE chat_id = ? ORDER BY sent_at DESC;<br><br>-- ❌ Bad: Missing partition key<br>SELECT * FROM messages WHERE sent_at &gt; &#39;2024-01-01&#39;;</pre><blockquote>Sorting with Clustering Order</blockquote><p>You can define <strong>how clustering columns are sorted</strong>:</p><pre>CREATE TABLE page_visits (<br>  user_id UUID,<br>  visited_at TIMESTAMP,<br>  url TEXT,<br>  PRIMARY KEY ((user_id), visited_at)<br>) WITH CLUSTERING ORDER BY (visited_at DESC);</pre><p>Now when you query user_id, you get their visits from <strong>most recent to oldest</strong>.</p><h4>🕸 Cassandra Architecture in Simple Terms</h4><ul><li><strong>Node: </strong>A <strong>single Cassandra instance</strong> (A single server running Cassandra)</li><li><strong>Cluster: </strong>A <strong>collection of nodes</strong> that store your data.</li><li><strong>Partition: </strong>A group of rows that share the same partition key</li><li>Partition Key: <strong>Chooses the node</strong> storing the data</li><li><strong>Token Ring : </strong>The algorithm that assigns partitions to nodes</li><li>Clustering Column: <strong>Sorts the rows</strong> inside that node</li><li>Row: The actual data being stored</li></ul><blockquote>Thanks for reading! 👋</blockquote><p>Understanding <strong>Cassandra’s primary key structure</strong> — especially the role of <strong>partition keys</strong> and <strong>clustering columns</strong> — is the foundation of designing efficient, scalable data models.</p><p>Cassandra may seem different from traditional databases at first, but once you get the hang of its data model, it becomes a powerful ally for building distributed, high-performance systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c61289d5289d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mediator Design Pattern in Java]]></title>
            <link>https://medium.com/@abanoubwagih/mediator-design-pattern-in-java-f3be68914b06?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3be68914b06</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[mediator]]></category>
            <category><![CDATA[mediator-design-pattern]]></category>
            <category><![CDATA[java-design-pattern]]></category>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Mon, 05 May 2025 05:34:54 GMT</pubDate>
            <atom:updated>2025-05-05T05:34:54.925Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever worked on a project where many classes talk to each other, and it starts to feel messy? Imagine a group of friends where everyone is calling or texting everyone else — pretty chaotic, right?</p><p>That’s exactly where the <strong>Mediator design pattern</strong> comes in handy. It’s like creating a <strong>group chat</strong> where everyone sends their message to one place, and the group chat handles sharing it with others.</p><p>In this post, I’ll explain the mediator pattern in <strong>simple terms</strong> and walk you through a <strong>step-by-step Java example</strong>. Let’s go!</p><blockquote>What Is the Mediator Pattern?</blockquote><p>The <strong>Mediator</strong> pattern <strong>reduces direct communication</strong> between objects. Instead of talking to each other <strong>directly</strong>, objects communicate through a <strong>central mediator</strong>.</p><p><strong>In simple words:</strong></p><ul><li>Without Mediator ➔ Everyone talks to everyone (messy ).</li><li>With Mediator ➔ Everyone talks to one thing (clean ✅).</li></ul><blockquote>Real-Life Example: Group Chat</blockquote><ul><li>Imagine 5 friends in a group chat.</li><li>Without a group chat: Everyone calls each friend one by one to share news.</li><li>With a group chat: You send your message once to the chat, and it shares it with everyone.</li></ul><p><strong>The group chat = The Mediator.</strong></p><h3>🛠️ Let’s Build a Java Example</h3><p>We’re going to build a <strong>simple chat room</strong> where people can send messages, and the chat room (our mediator) will handle delivering the messages.</p><blockquote>Step 1: Create the Mediator Interface</blockquote><p>This is just the <strong>blueprint</strong> of the chat room.</p><pre>public interface ChatMediator {<br>    void sendMessage(String message, Person sender);<br>}</pre><blockquote>Step 2: Create the Concrete Mediator</blockquote><p>This is the <strong>real chat room</strong> that knows how to deliver messages.</p><pre>import java.util.ArrayList;<br>import java.util.List;<br><br>public class ChatRoom implements ChatMediator {<br>    private List&lt;Person&gt; people = new ArrayList&lt;&gt;();<br><br>    public void addPerson(Person person) {<br>        people.add(person);<br>    }<br><br>    @Override<br>    public void sendMessage(String message, Person sender) {<br>        for (Person p : people) {<br>            if (p != sender) {<br>                p.receive(message);<br>            }<br>        }<br>    }<br>}</pre><blockquote>Step 3: Create the Person Class</blockquote><p>Each person can <strong>send</strong> and <strong>receive</strong> messages through the chat room.</p><pre>public class Person {<br>    private ChatMediator mediator;<br>    private String name;<br><br>    public Person(ChatMediator mediator, String name) {<br>        this.mediator = mediator;<br>        this.name = name;<br>    }<br><br>    public void send(String message) {<br>        System.out.println(name + &quot; sends: &quot; + message);<br>        mediator.sendMessage(message, this);<br>    }<br><br>    public void receive(String message) {<br>        System.out.println(name + &quot; receives: &quot; + message);<br>    }<br>}</pre><blockquote>Step 4: Let’s Test It!</blockquote><p>Now we bring it all together in the main method.</p><pre>public class MediatorDemo {<br>    public static void main(String[] args) {<br>        ChatRoom chatRoom = new ChatRoom();<br><br>        Person ali = new Person(chatRoom, &quot;Ali&quot;);<br>        Person sara = new Person(chatRoom, &quot;Sara&quot;);<br>        Person mona = new Person(chatRoom, &quot;Mona&quot;);<br><br>        chatRoom.addPerson(ali);<br>        chatRoom.addPerson(sara);<br>        chatRoom.addPerson(mona);<br><br>        ali.send(&quot;Hello everyone!&quot;);<br>    }<br>}</pre><blockquote>Output:</blockquote><pre>Ali sends: Hello everyone!<br>Sara receives: Hello everyone!<br>Mona receives: Hello everyone!</pre><p>Boom! 🎉 The chat room (mediator) handled sending the message to everyone except Ali.</p><blockquote>Why Use the Mediator Pattern?</blockquote><ul><li><strong>Reduces mess:</strong> No need for every object to know about all others.</li><li><strong>Easy to change:</strong> You can add or remove users without breaking things.</li><li><strong>Central control:</strong> The mediator can <strong>filter</strong>, <strong>log</strong>, or <strong>modify</strong> messages easily.</li></ul><p>The Mediator pattern <strong>simplifies communication</strong> between objects by letting them talk through a <strong>central point</strong> instead of directly with each other.</p><h3>Final Thoughts</h3><p>The Mediator pattern is a <strong>lifesaver</strong> when your code starts getting too tangled because of lots of objects interacting. Next time you feel things are getting messy, think about introducing a <strong>mediator</strong>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3be68914b06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build and Use a Custom RedisCacheManager in Spring Boot]]></title>
            <link>https://medium.com/@abanoubwagih/how-to-build-and-use-a-custom-rediscachemanager-in-spring-boot-44e8e3c761ae?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/44e8e3c761ae</guid>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Sun, 04 May 2025 07:38:38 GMT</pubDate>
            <atom:updated>2025-05-04T07:38:38.061Z</atom:updated>
            <content:encoded><![CDATA[<p>Spring Boot makes caching a breeze, especially with its tight integration with Redis. But sometimes, the <strong>default RedisCacheManager</strong> isn’t enough. You may need <strong>fine-grained control over serialization, TTL (Time-to-Live), or per-cache configurations</strong>.</p><p>In this tutorial, we’ll learn <strong>how to build a custom RedisCacheManager</strong> and configure it properly in your Spring Boot app.</p><blockquote>✨ What You’ll Learn:</blockquote><ul><li>How to add Redis dependencies.</li><li>How to create a <strong>custom RedisCacheManager</strong>.</li><li>How to configure <strong>different TTLs per cache</strong>.</li><li>How to <strong>customize serialization</strong> (JSON vs. default JDK serialization).</li><li>How to <strong>test caching</strong> with a simple service.</li></ul><blockquote>🔧 Add Dependencies</blockquote><p>First, include the necessary Redis starter. If you’re using <strong>Maven</strong>, add this:</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-boot-starter-data-redis&lt;/artifactId&gt;<br>&lt;/dependency&gt;<br><br>&lt;!-- (Optional) for Spring Cache abstraction --&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-boot-starter-cache&lt;/artifactId&gt;<br>&lt;/dependency&gt;<br><br>&lt;!-- (Optional) for JSON serialization with Jackson --&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;<br>    &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><blockquote>⚙️ Enable Caching</blockquote><p>In your main application class (or any config class), add:</p><pre>@EnableCaching<br>@SpringBootApplication<br>public class RedisCacheDemoApplication {<br>    public static void main(String[] args) {<br>        SpringApplication.run(RedisCacheDemoApplication.class, args);<br>    }<br>}</pre><blockquote>🛠️ Create the Custom RedisCacheManager Bean</blockquote><p>Here’s where the magic happens.</p><pre>@Configuration<br>public class CacheConfig {<br><br>    @Bean<br>    public RedisCacheManager cacheManager(RedisConnectionFactory connectionFactory) {<br>        // 👇 Default config (TTL 60 minutes)<br>        RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig()<br>                .entryTtl(Duration.ofMinutes(60))<br>                .serializeValuesWith(<br>                        RedisSerializationContext.SerializationPair.fromSerializer(<br>                                new GenericJackson2JsonRedisSerializer()<br>                        )<br>                );<br><br>        // 👇 Custom configs per cache name<br>        Map&lt;String, RedisCacheConfiguration&gt; cacheConfigs = new HashMap&lt;&gt;();<br><br>        cacheConfigs.put(&quot;shortLivedCache&quot;, defaultCacheConfig.entryTtl(Duration.ofMinutes(5)));<br>        cacheConfigs.put(&quot;longLivedCache&quot;, defaultCacheConfig.entryTtl(Duration.ofHours(12)));<br><br>        return RedisCacheManager.builder(connectionFactory)<br>                .cacheDefaults(defaultCacheConfig)<br>                .withInitialCacheConfigurations(cacheConfigs)<br>                .build();<br>    }<br>}</pre><h4>💡 <strong>What’s happening here:</strong></h4><ul><li>We define a <strong>default cache configuration</strong> (TTL = 60 mins).</li><li>We override specific caches:</li><li>shortLivedCache: 5 minutes TTL.</li><li>longLivedCache: 12 hours TTL.</li><li>We use GenericJackson2JsonRedisSerializer to serialize/deserialize values as JSON (human-readable &amp; cross-platform).</li></ul><blockquote>🧪 Create a Cacheable Service</blockquote><p>Let’s test caching with a simple service.</p><pre>@Service<br>public class DemoService {<br><br>    @Cacheable(value = &quot;shortLivedCache&quot;, key = &quot;#param&quot;)<br>    public String getShortLivedData(String param) {<br>        System.out.println(&quot;Fetching short-lived data for: &quot; + param);<br>        return &quot;Short-lived data for &quot; + param;<br>    }<br><br>    @Cacheable(value = &quot;longLivedCache&quot;, key = &quot;#param&quot;)<br>    public String getLongLivedData(String param) {<br>        System.out.println(&quot;Fetching long-lived data for: &quot; + param);<br>        return &quot;Long-lived data for &quot; + param;<br>    }<br>}</pre><blockquote>🚀 Test It Out</blockquote><p>You can test via a <strong>controller</strong> or <strong>unit tests</strong>.</p><p><strong>Example controller:</strong></p><pre>@RestController<br>@RequestMapping(&quot;/cache&quot;)<br>public class DemoController {<br><br>    private final DemoService demoService;<br><br>    public DemoController(DemoService demoService) {<br>        this.demoService = demoService;<br>    }<br><br>    @GetMapping(&quot;/short/{param}&quot;)<br>    public String shortCache(@PathVariable String param) {<br>        return demoService.getShortLivedData(param);<br>    }<br><br>    @GetMapping(&quot;/long/{param}&quot;)<br>    public String longCache(@PathVariable String param) {<br>        return demoService.getLongLivedData(param);<br>    }<br>}</pre><blockquote>Hit the endpoints</blockquote><pre>GET /cache/short/test123<br>GET /cache/long/test123</pre><h3>Wrapping Up</h3><p>Caching is one of the easiest ways to boost your application’s performance, but you need flexibility to do it right. In this guide, we saw how to move beyond the defaults by building a <strong>custom RedisCacheManager</strong> that lets you fine-tune things like TTL and serialization per cache. This approach ensures your app’s caching is <strong>both efficient and maintainable</strong>.</p><p>Whether you’re caching API responses, database queries, or heavy computations, <strong>customizing your cache manager</strong> helps you stay in control as your application grows.</p><p>If you found this tutorial helpful, feel free to leave a comment or share your thoughts. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44e8e3c761ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ PillReminder: Building a SwiftUI iOS App]]></title>
            <link>https://medium.com/@abanoubwagih/pillreminder-building-a-swiftui-ios-app-648f8093ef1c?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/648f8093ef1c</guid>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[pill-reminder-app]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Fri, 02 May 2025 09:46:08 GMT</pubDate>
            <atom:updated>2025-05-02T09:46:08.886Z</atom:updated>
            <content:encoded><![CDATA[<p>Building a SwiftUI iOS App to Help People Never Miss a Pill Again</p><p>Taking medications on time can be a challenge, especially when juggling multiple prescriptions or irregular schedules. As someone deeply interested in simplifying lives through tech, I built <strong>PillReminder</strong>, a SwiftUI-based iOS app to help users track and get notified about their medications with ease.</p><p>In this blog, I’ll walk you through the journey of developing <strong>PillReminder</strong> — from idea to implementation — highlighting key SwiftUI techniques, local notifications, custom ringtones, image support, and more.</p><blockquote>💡 The Idea Behind PillReminder</blockquote><p>Like many, I’ve seen people in my circle forget medications, skip doses, or mismanage complex schedules. I wanted to create something minimal, functional, and fully offline that doesn’t require an account or cloud sync — just a simple daily assistant you can trust.</p><blockquote>⚙️ Core Features</blockquote><p>Here’s what PillReminder offers:</p><ul><li>📝 <strong>Add/Edit/Delete medications</strong></li><li>🔔 <strong>Customizable local notifications with repeat schedules</strong></li><li>📷 <strong>Attach photos to medications</strong></li><li>🎵 <strong>Choose from 13 relaxing ringtones</strong></li><li>🚨 <strong>“Urgent” badge for critical meds</strong></li><li>📱 <strong>Offline storage using UserDefaults</strong></li><li>🌗 <strong>Full Dark Mode support</strong></li><li>📅 <strong>Smart sorting (urgent meds first, then by date)</strong></li></ul><blockquote>🧱 Tech Stack</blockquote><ul><li><strong>Language:</strong> Swift</li><li><strong>UI Framework:</strong> SwiftUI</li><li><strong>Notifications:</strong> UserNotifications</li><li><strong>Audio Playback:</strong> AVFoundation</li><li><strong>Image Picker:</strong> UIKit bridge using UIViewControllerRepresentable</li><li><strong>Persistence:</strong> Codable with UserDefaults</li></ul><h3>🖼 UI Overview</h3><p>The app uses a clean navigation-based structure.</p><blockquote>🗂 Home Screen</blockquote><p>The main ContentView.Swift displays all your medications in a List, sorted to show urgent ones first. You can:</p><ul><li>Tap to edit</li><li>Swipe to delete (with confirmation)</li><li>Use the context menu to stop alarms or edit/delete</li><li>See a mini dashboard with dosage, schedule, and time left for the next dose</li></ul><blockquote>➕ Add/Edit Medication</blockquote><p>The AddMedicationView.swift lets you:</p><ul><li>Add a name, dosage, start date/time</li><li>Pick a schedule from the options (from every 2 minutes to weekly)</li><li>Toggle urgency</li><li>Choose a ringtone and preview it</li><li>Upload an image using the camera or gallery</li></ul><blockquote>🔔 Notifications</blockquote><p>Notifications are triggered using UNNotificationRequest, supporting:</p><ul><li><strong>TimeInterval triggers</strong> for most schedules</li><li><strong>Calendar triggers</strong> for once or twice a week</li><li><strong>Custom ringtones</strong> bundled inside the app (.wav)</li></ul><p>Twice-weekly reminders are scheduled manually for selected weekdays.</p><blockquote>💾 Offline Storage</blockquote><p>All medications are encoded using JSONEncoder and stored in UserDefaults. On app launch, data is decoded back via JSONDecoder.</p><p>Image references are saved to disk with unique filenames using UUIDs and loaded via UIImage(contentsOfFile:).</p><blockquote>🎵 Built-in Ringtones</blockquote><p>I bundled 13 calming .wav files, including:</p><p>bellattack, CoolRelaxing, DayBreak, Melody, Scott, marimba, and more.</p><p>Users can preview sounds before saving-built using AVAudioPlayer.</p><blockquote>🌙 Dark Mode Support</blockquote><p>Every view is SwiftUI-based, and since I use native Form, NavigationView, and system colors, Dark Mode works out of the box.</p><h3>📁 Project Structure</h3><pre>.<br>├── PillReminderApp.swift         # App entry point<br>├── ContentView.swift             # Main screen with list<br>├── AddMedicationView.swift       # View for adding/editing<br>├── Medication.swift              # Medication model + Schedule enum<br>├── [13 ringtone WAVs]<br>├── [ImagePicker]<br>├── Assets.xcassets               # App icons, accent color<br>└── PillReminder.xcodeproj</pre><blockquote>💬 Final Thoughts</blockquote><p>PillReminder is a fully functional, offline SwiftUI app built with simplicity and reliability in mind. It’s my take on using iOS technologies like SwiftUI, local notifications, and AVFoundation to make something meaningful from scratch.</p><p>I plan to add more features like:</p><ul><li>iCloud backup</li><li>Widgets</li><li>Better accessibility support</li><li>Siri integration</li></ul><p>If you’re exploring SwiftUI or want to build a real-world utility app, I hope this inspires you!</p><h3>🚀 Source Code &amp; Demo</h3><p>Currently, the app is on GitHub while I refine a few details and prepare for TestFlight. If you’re interested in contributing or testing it out, feel free to do so.<br><a href="https://github.com/abanoubwagih/PillReminder.git">https://github.com/abanoubwagih/PillReminder.git</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=648f8093ef1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install Docker on Debian 12 (Bookworm) Without Errors]]></title>
            <link>https://medium.com/@abanoubwagih/how-to-install-docker-on-debian-12-bookworm-without-errors-0092674257d8?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0092674257d8</guid>
            <category><![CDATA[docker-installation]]></category>
            <category><![CDATA[docker-installation-guide]]></category>
            <category><![CDATA[debain]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Wed, 19 Mar 2025 09:06:20 GMT</pubDate>
            <atom:updated>2025-03-19T09:06:20.012Z</atom:updated>
            <content:encoded><![CDATA[<p>Docker is an essential tool for developers and DevOps engineers, allowing containerized application deployment and management.</p><p>However, installing Docker on <strong>Debian 12 (Bookworm)</strong> can sometimes result in frustrating errors, particularly the dreaded <strong>“NO_PUBKEY 7EA0A9C3F273FCD8”</strong> issue when adding the Docker repository.</p><p>If you’ve faced this problem, don’t worry! This guide provides a <strong>clean, step-by-step installation process that works.</strong></p><h3>Why This Guide?</h3><p>Many tutorials overlook key details when installing Docker on Debian 12, leading to issues like:</p><ul><li><strong>GPG key errors preventing repository verification</strong></li><li><strong>Package installation failures</strong></li><li><strong>Untrusted repositories and security risks</strong></li></ul><p>This guide ensures a <strong>100% working, secure, and future-proof installation</strong> of Docker on Debian 12.</p><blockquote>Remove Any Existing Docker Installation &amp; Old KeysTo start clean, remove old installations and repository keys:</blockquote><p>To avoid conflicts, remove any previously installed Docker versions and delete any outdated keys</p><pre>sudo apt-get remove -y docker docker-engine docker.io containerd runc<br>sudo rm -rf /var/lib/docker /var/lib/containerd<br>sudo rm -rf /etc/apt/keyrings/docker.gpg<br>sudo rm -rf /etc/apt/sources.list.d/docker.list</pre><p>This ensures that no conflicting repositories or packages interfere with the new installation.</p><blockquote>Update System Packages</blockquote><p>Before installing Docker, make sure your system is up-to-date</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -yb</pre><blockquote>Install Required Dependencies</blockquote><p>install essential packages that will allow you to add repositories securely:</p><pre>sudo apt install -y ca-certificates curl gnupg</pre><blockquote>Add the Correct Docker GPG Key 🔑</blockquote><p>One of the most common issues is using an outdated or incorrectly formatted GPG key. The following command <strong>adds the correct key securely</strong></p><pre>sudo install -m 0755 -d /etc/apt/keyrings<br>curl -fsSL https://download.docker.com/linux/debian/gpg | sudo tee /etc/apt/keyrings/docker.asc &gt; /dev/null<br>sudo chmod a+r /etc/apt/keyrings/docker.asc</pre><p>This step ensures the repository key is correctly stored and accessible.</p><blockquote>Add the Docker Repository</blockquote><p>Now, we configure the APT source list correctly for Debian 12</p><pre>echo &quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(lsb_release -cs) stable&quot; | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null</pre><blockquote>Update APT Again (To Apply Changes)</blockquote><p>Run the update command to fetch package lists from the newly added repository</p><pre>sudo apt update</pre><p><strong>At this point, you should no longer see the NO_PUBKEY error!</strong> If you do, double-check that the Docker GPG key was added correctly</p><h3>Install Docker</h3><p>Now that everything is set up, install Docker and its components</p><pre>sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin</pre><p>This installs the latest version of Docker and its related tools</p><blockquote>Start and Enable Docker Service</blockquote><p>Ensure Docker starts automatically on boot</p><pre>sudo systemctl enable --now docker<br>sudo systemctl status docker</pre><p><strong>If Docker is running without errors, you’re good to go!</strong> 🎉</p><blockquote>Verify Installation</blockquote><ul><li>Check Docker version</li></ul><pre>docker --version</pre><ul><li>Run a test container</li></ul><pre>docker run hello-world</pre><h4>This method <strong>will work</strong> on Debian 12 and (And Fixes Common Issues) Why?</h4><ul><li>We completely removed old conflicting configurations.</li><li>We used the correct method to add the GPG key (docker.asc instead of docker.gpg).</li><li>We ensured the repository is correctly signed and trusted by APT.</li><li><strong>The update step (</strong><strong>sudo apt update) should now work without errors before installation</strong></li></ul><h3>Final Thoughts</h3><p>With these steps, you can install Docker <strong>without errors</strong> on Debian 12. This guide ensures a clean, secure, and future-proof installation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0092674257d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Push Design Pattern in Nutshell]]></title>
            <link>https://medium.com/@abanoubwagih/push-design-pattern-in-nutshell-0c2cae6b7c00?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c2cae6b7c00</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[push]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 13:01:51 GMT</pubDate>
            <atom:updated>2024-07-14T13:01:51.216Z</atom:updated>
            <content:encoded><![CDATA[<p>which is a popular approach for back-end execution. The push pattern is useful when you want to send responses immediately to the client, such as in real-time notification systems. The lesson explains how the push pattern works, its pros and cons, and provides an example of a chat app that uses push notifications.</p><blockquote><strong>What is the push pattern?</strong></blockquote><p>The push pattern is a design pattern where the server sends data to the client without the client requesting it. This is in contrast to the request-response pattern, where the client sends a request and the server responds.</p><blockquote><strong>How does the push pattern work?</strong></blockquote><p>The client establishes a connection with the server, and the server sends data to the client without the client requesting it. This requires a bidirectional protocol, such as TCP, to establish a connection between the client and server.</p><blockquote><strong>Pros</strong></blockquote><ul><li>Real-time notifications: The push pattern is useful for real-time notification systems, such as chat apps or social media platforms.</li><li>Immediate responses: The push pattern allows the server to send responses immediately to the client, without the client having to request them.</li></ul><blockquote><strong>Cons</strong></blockquote><ul><li>Clients must be online: The client must be online and connected to the server to receive push notifications.</li><li>Load handling: The client must be able to handle the load of push notifications, which can be a problem if the server is sending a large volume of data.</li><li>Requires bidirectional protocol: The push pattern requires a bidirectional protocol, such as TCP, to establish a connection between the client and server.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c2cae6b7c00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Synchronous vs Asynchronous in Nutshell]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Synchronous execution: the caller sends a request and blocks, waiting for the response. The caller cannot do anything else until the&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@abanoubwagih/synchronous-vs-asynchronous-in-nutshell-7853d39a6cc0?source=rss-8cc56899957c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@abanoubwagih/synchronous-vs-asynchronous-in-nutshell-7853d39a6cc0?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7853d39a6cc0</guid>
            <category><![CDATA[nutshell]]></category>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[async]]></category>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 11:37:42 GMT</pubDate>
            <atom:updated>2024-07-14T11:37:42.755Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Request-Response Pattern]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">The request-response pattern is a fundamental communication design pattern in backend development. It involves a client sending a request&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@abanoubwagih/the-request-response-pattern-1aec0666bff2?source=rss-8cc56899957c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@abanoubwagih/the-request-response-pattern-1aec0666bff2?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1aec0666bff2</guid>
            <category><![CDATA[request-response]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Sat, 13 Jul 2024 09:39:37 GMT</pubDate>
            <atom:updated>2024-07-13T09:39:37.012Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Level Up Your Java: A Beginner’s Guide to Design Patterns]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@abanoubwagih/level-up-your-java-a-beginners-guide-to-design-patterns-6b3de91f590a?source=rss-8cc56899957c------2"><img src="https://cdn-images-1.medium.com/max/1024/1*ao1y0DYX48TlL5sCs2nPwQ.png" width="1024"></a></p><p class="medium-feed-snippet">Java is a powerful and versatile programming language, but like any tool, it has its complexities. As your projects grow, you&#x2019;ll encounter&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@abanoubwagih/level-up-your-java-a-beginners-guide-to-design-patterns-6b3de91f590a?source=rss-8cc56899957c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@abanoubwagih/level-up-your-java-a-beginners-guide-to-design-patterns-6b3de91f590a?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b3de91f590a</guid>
            <category><![CDATA[adapter-design-pattern]]></category>
            <category><![CDATA[factory-design-pattern]]></category>
            <category><![CDATA[observer-design-pattern]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Sat, 04 May 2024 20:24:50 GMT</pubDate>
            <atom:updated>2024-05-04T20:24:50.540Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Understanding HTTP, HTTPS, and Status Codes: A Comprehensive Guide]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@abanoubwagih/understanding-http-https-and-status-codes-a-comprehensive-guide-1aa3802e98fd?source=rss-8cc56899957c------2"><img src="https://cdn-images-1.medium.com/max/1024/1*vAacu_48nTZXFE-QyRST8w.png" width="1024"></a></p><p class="medium-feed-snippet">Demystifying the Web: HTTP, HTTPS, Status, and Response Code</p><p class="medium-feed-link"><a href="https://medium.com/@abanoubwagih/understanding-http-https-and-status-codes-a-comprehensive-guide-1aa3802e98fd?source=rss-8cc56899957c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@abanoubwagih/understanding-http-https-and-status-codes-a-comprehensive-guide-1aa3802e98fd?source=rss-8cc56899957c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1aa3802e98fd</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[http-response]]></category>
            <category><![CDATA[http-status-code]]></category>
            <dc:creator><![CDATA[abanoub wagih]]></dc:creator>
            <pubDate>Sat, 04 May 2024 19:31:25 GMT</pubDate>
            <atom:updated>2024-05-04T19:31:25.323Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
        </item>
    </channel>
</rss>