<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zacchaeus Bolaji</title>
    <description>The latest articles on DEV Community by Zacchaeus Bolaji (@djunehor).</description>
    <link>https://dev.to/djunehor</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F264997%2F8866c5d9-39d5-45c5-ba21-90fe4ae0448d.png</url>
      <title>DEV Community: Zacchaeus Bolaji</title>
      <link>https://dev.to/djunehor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/djunehor"/>
    <language>en</language>
    <item>
      <title>Performance Optimization: The Basics That Scale</title>
      <dc:creator>Zacchaeus Bolaji</dc:creator>
      <pubDate>Tue, 11 Nov 2025 14:20:15 +0000</pubDate>
      <link>https://dev.to/djunehor/performance-optimization-the-basics-that-scale-386n</link>
      <guid>https://dev.to/djunehor/performance-optimization-the-basics-that-scale-386n</guid>
      <description>&lt;p&gt;Most developers wait until performance becomes a problem before doing anything about it. By then, you're firefighting instead of building. Here are the optimizations you should implement from day one - they cost almost nothing upfront but save you from major headaches later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Database &amp;amp; Queries
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Add indexes on columns you query frequently.&lt;/strong&gt; Your database has to scan every row without them, and that gets slower as your data grows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Select only what you need.&lt;/strong&gt; &lt;code&gt;SELECT *&lt;/code&gt; pulls data you don't use, wastes bandwidth, and makes your queries slower.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid N+1 queries.&lt;/strong&gt; If you're fetching data in a loop, you're probably making one database call per iteration when you could make just one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Paginate early.&lt;/strong&gt; Don't wait until you have thousands of records to add pagination. Implement it when you have ten.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Caching Strategy
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cache what's unavoidably complex&lt;/strong&gt;. If a query or request takes time and the result doesn't change often, cache it. Don't cache just because you can.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use a CDN for static assets.&lt;/strong&gt; Images, CSS, and JavaScript files should be served from edge locations close to your users, not from your application server.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Network &amp;amp; Infrastructure
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Put your application close to users.&lt;/strong&gt; Deploy to regions where your users are - latency matters more than most developers think.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Put services close to each other.&lt;/strong&gt; If your API and database are in different regions, every request crosses continents unnecessarily.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fail fast.&lt;/strong&gt; Set appropriate timeouts so slow operations don't block everything else. If something's going to fail, let it fail quickly.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Application Architecture
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Process heavy work asynchronously.&lt;/strong&gt; Sending emails, generating reports, or processing uploads shouldn't happen in the request-response cycle—use queues.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Measure before you optimize.&lt;/strong&gt; You can't fix what you don't measure. Track response times and error rates from day one.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
These aren't premature optimization. They're sensible defaults that prevent problems before they start.&lt;/p&gt;

&lt;p&gt;The time to implement them is now, when your application is small and changes are easy. Trying to retrofit them into a large codebase under production load is significantly harder.&lt;/p&gt;

&lt;p&gt;Do it right from the start, and you won't have to do it again later.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>database</category>
      <category>performance</category>
      <category>redis</category>
    </item>
    <item>
      <title>Why Your Bank App Asks for PIN (And Why Some Online Shopping Gets Complicated)</title>
      <dc:creator>Zacchaeus Bolaji</dc:creator>
      <pubDate>Mon, 18 Aug 2025 10:23:21 +0000</pubDate>
      <link>https://dev.to/djunehor/why-your-bank-app-asks-for-pin-and-why-some-online-shopping-gets-complicated-5gp1</link>
      <guid>https://dev.to/djunehor/why-your-bank-app-asks-for-pin-and-why-some-online-shopping-gets-complicated-5gp1</guid>
      <description>&lt;p&gt;You've probably ever wondered why your bank app asks for a PIN when you want to send money even after you logged in. Or why buying something online sometimes brings you to a different page asking for a text message code? Let's break this down simply.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Your Bank App Has Two Different "Passwords"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of your bank account as your house. You possess a key to access your house (that's your login password), but you might also have a safe inside which has another combination (that's your transaction PIN).&lt;/p&gt;

&lt;p&gt;Your login password is the first key to entering the banking app - you can view your balance, your transaction history, basically "browse around your house." But if you're going to do something serious like transfer money to someone, the bank insists that you must enter your transaction PIN. This is similar to cracking open that safe and removing your goodies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why This Double Protection Exists&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's say your friend holds your phone when you're still connected to your bank app. They'll be aware of how much money you have, but they won't be able to transfer your money anywhere as they don't have your transaction PIN. Sharp, right?&lt;/p&gt;

&lt;p&gt;This also protects you in case someone is able to obtain your login details. Maybe they overheard you entering your password, or maybe hackers gained entry into the database of the bank and got login details. Even then, they cannot steal your money without that extra transaction PIN. That transaction PIN cannot be changed without knowing the old one. Guess why.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, Let's Talk About Shopping Online&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you buy something online using debit/credit card, you typically have to enter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your card number (the long 16-digit one)&lt;/li&gt;
&lt;li&gt;Expiry date&lt;/li&gt;
&lt;li&gt;CVV (3-digit number in the back)&lt;/li&gt;
&lt;li&gt;Your name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But for Nigerian cards, something else is done which will shock foreign visitors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Nigerian Way: Extra Security&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After you've entered the card details of your Nigeria issued card, two extra things happen:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;PIN Request&lt;/strong&gt;: The page asks for your card PIN - the same 4-digit number that you use at cash machines&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OTP (One-Time Password)&lt;/strong&gt;: You get a text message with a code that you must enter to complete the purchase&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This means that in order to buy something online with your Nigerian, you need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your card number (which could be stolen from the internet)&lt;/li&gt;
&lt;li&gt;Your PIN (which is only supposed to be known to you)&lt;/li&gt;
&lt;li&gt;Your phone (to receive the text message)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Nigeria and some other countries do this&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is where it is interesting. If you have ever shopped on American or European websites, you would have known you just have to provide your card number - no PIN, no text message code. Card number, expiry date, CVV, and away you go. The risk here is that stolen card can be used for online payment easily. But that risk is mitigated with the ease of reporting stolen card and getting your money back,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem Nigerian Merchants Face&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Suppose a person in Nigeria has an online shop that sells clothing. A "customer" orders clothes using an Australian credit card, but the shipping address is in Nigeria. Something doesn't smell right - why would someone in Australia purchase from a little Nigerian shop and have it shipped to Nigeria?&lt;/p&gt;

&lt;p&gt;What probably transpired: A thief has stolen the credit card information of an Australian and is shopping with it. Because some Australian cards do not use PINs or text messages as codes to verify purchases on the internet, the thief can shop freely.&lt;/p&gt;

&lt;p&gt;Worst of all: If the actual Australian card owner sees the purchase and reports it as not authorized, or if the thief themselves contacts the bank reporting that the purchase was unauthorized, the Nigerian store owner loses thrice:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;They forfeit the money from the sale&lt;/li&gt;
&lt;li&gt;They forfeit the shipped clothes they had already sent&lt;/li&gt;
&lt;li&gt;The bank charges them a "chargeback" (dispute) fee&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;What's a Chargeback?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A chargeback is like a refund, but the bank forces you to do it. When you see that there's some charge on your card for which you didn't spend any money, you can call your bank and say "I didn't buy this." The bank will get the money back from the merchant and refund it to you. This is quite easy to do in most countries - sometimes you just need to press a button on your banking app.&lt;/p&gt;

&lt;p&gt;The system exists to protect customers, and that's a positive. But it also makes it easy to abuse by fraudsters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Nigerian Banks Make It Hard to Process Chargebacks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unlike other countries where you can simply dispute charges with clicks of a button, most Nigerian banks prefer for you to physically go to the bank in order to process a chargeback. That makes it harder for honest customers as well as scammers to dispute charges.&lt;/p&gt;

&lt;p&gt;This may be a hassle, but it keeps Nigerian businesses safe from fraudulent chargeback claims.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution: Why Those Extra Steps Matter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Recall the extra steps when making online purchases in Nigeria - the PIN and text message code? They eliminate the fraud issue entirely.&lt;/p&gt;

&lt;p&gt;Even if a thief obtains your card information, they won't be able to make a purchase because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They don't know your PIN&lt;/li&gt;
&lt;li&gt;They don't possess your phone to get the text message code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is why it's common among most Nigerian payment processors (like Paystack) to have the "disable international payments" feature. They're essentially allowing the merchant to decide whether to accept payment from international non-nigerian cards with added risk, or refuse to accept those kind of payments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What This Means for You&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You are actually safer when you shop online with your Nigerian debit card than consumers in most other countries. Yes, entering your PIN and waiting for a text message is annoying, but it means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your funds are so much safer should an intruder steal your card details&lt;/li&gt;
&lt;li&gt;Nigerian online stores can buy and sell with confidence&lt;/li&gt;
&lt;li&gt;You're less likely to fall victim to card fraud&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The next time your banking app asks for that transaction PIN, or an online store asks for a text message code, remember: it's not red tape - it's a highly sophisticated security system protecting your funds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Global Picture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Other nations tip the balance between convenience and security in different directions. Some prefer speedy, easy purchases and accept that fraud will inevitably happen. Others, like Nigeria, prefer security even if it makes transactions take longer.&lt;/p&gt;

&lt;p&gt;Neither is wrong - it's all about what each culture desires most. But being aware of these differences helps to explain why online shopping is viewed differently in different countries, and why Nigerian sellers sometimes don't want to have foreign buyers.&lt;/p&gt;

&lt;p&gt;Finance is more complex than it appears, but once you have the correct information, you will learn to comprehend it and protect yourself from it.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The AI Illusion: Why It's Not Scaling, Not Helping, and Not Worth the Hype (Yet)</title>
      <dc:creator>Zacchaeus Bolaji</dc:creator>
      <pubDate>Wed, 30 Jul 2025 07:24:08 +0000</pubDate>
      <link>https://dev.to/djunehor/the-ai-illusion-why-its-not-scaling-not-helping-and-not-worth-the-hype-yet-5230</link>
      <guid>https://dev.to/djunehor/the-ai-illusion-why-its-not-scaling-not-helping-and-not-worth-the-hype-yet-5230</guid>
      <description>&lt;p&gt;For the past three years, AI has promised a revolution. Autonomous agents. Superhuman copilots. Instant content and code generation. But as the dust settles, we're seeing a different story:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI isn't scaling.&lt;/li&gt;
&lt;li&gt;It's not solving meaningful problems at scale.&lt;/li&gt;
&lt;li&gt;And the cost — in money, compute, carbon, and credibility — is often far too high.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. AI Is Too Expensive to Scale
&lt;/h2&gt;

&lt;p&gt;Running large language models (LLMs) isn't cheap — not even for small workloads. Even with tiny models like LLaMA 3 8B or Mistral 7B, the infrastructure cost to serve just 10 users concurrently can exceed 3GB of RAM, plus expensive GPUs or quantization tricks. Once you move to high-end models like GPT-4 or Claude Opus, you're talking 30–60 GB per instance, per batch of users.&lt;/p&gt;

&lt;p&gt;$0.10 per query isn't sustainable when users burn through 1000+ queries/month doing things like writing, debugging, or content generation. That's $100/month per user. Who's paying that?&lt;/p&gt;

&lt;h2&gt;
  
  
  2. AI Agents Are a Dead End (For Now)
&lt;/h2&gt;

&lt;p&gt;The hype around AI agents — self-running, goal-seeking LLMs that plan and act autonomously — has mostly fizzled out. Tools like AutoGPT, BabyAGI, Devin, and LangChain agents make for flashy demos but collapse in production.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They hallucinate tools and API calls&lt;/li&gt;
&lt;li&gt;They can't reason about real-world constraints&lt;/li&gt;
&lt;li&gt;They loop endlessly or freeze on edge cases&lt;/li&gt;
&lt;li&gt;They misinterpret vague goals like "book a trip under $2,000"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Giving AI agency doesn't make it smart. It just makes it faster at making mistakes.&lt;/p&gt;

&lt;p&gt;Trying to build reliable autonomous agents on top of a stochastic text predictor is like training cats to code — amusing, chaotic, and entirely unproductive.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Copilots Create as Many Problems as They Solve
&lt;/h2&gt;

&lt;p&gt;GitHub Copilot, CodeWhisperer, and others were marketed as productivity boosters. But many developers are realizing they:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Suggest incorrect or outdated code&lt;/li&gt;
&lt;li&gt;Distract from the actual thought process&lt;/li&gt;
&lt;li&gt;Increase keystrokes as you constantly delete wrong completions&lt;/li&gt;
&lt;li&gt;Burn massive compute resources per suggestion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Traditional autocomplete (IntelliSense, TabNine-classic, etc.):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is more predictable&lt;/li&gt;
&lt;li&gt;Runs locally&lt;/li&gt;
&lt;li&gt;Has near-zero latency&lt;/li&gt;
&lt;li&gt;Doesn't try to outguess your logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For many developers, Copilot is just noisy autocomplete with worse UX and a bigger carbon footprint.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. AI Customer Support Is Backfiring
&lt;/h2&gt;

&lt;p&gt;Companies like Klarna, Air Canada, and Frontier Airlines rushed to replace human agents with AI chatbots. What followed?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer frustration&lt;/li&gt;
&lt;li&gt;Lawsuits from AI hallucinations&lt;/li&gt;
&lt;li&gt;PR disasters&lt;/li&gt;
&lt;li&gt;Quiet reversals to bring humans back&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI might answer basic FAQs, but once a conversation requires empathy, context, or escalation, it fails — often spectacularly.&lt;/p&gt;

&lt;p&gt;Saving a few cents per interaction isn't worth losing a customer's trust forever.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What Are We Actually Gaining?
&lt;/h2&gt;

&lt;p&gt;We already had Stack Overflow for debugging. Grammarly for writing. Zapier for automation. Static analysis for code. What's new with AI?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's faster — when it works.&lt;/li&gt;
&lt;li&gt;But it's wrong — often.&lt;/li&gt;
&lt;li&gt;And it's wasteful — always.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many users spend more time correcting hallucinated code, rewriting clunky blog drafts, or debugging broken workflows than if they'd just done it manually.&lt;/p&gt;

&lt;p&gt;AI promises to save time, but usually shifts the labor from creation to correction.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. The Feedback Loop of Doom
&lt;/h2&gt;

&lt;p&gt;If AI-generated content keeps flooding the internet:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Future models will be trained on synthetic, low-quality data&lt;/li&gt;
&lt;li&gt;This leads to degradation in quality (known as model collapse)&lt;/li&gt;
&lt;li&gt;Which further reduces trust in AI outputs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When AI learns from AI, the whole ecosystem begins to rot.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR: The AI Boom Is Hitting a Wall
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;AI isn't scaling because the compute cost and unreliability are too high&lt;/li&gt;
&lt;li&gt;AI agents are glorified toys — not task solvers&lt;/li&gt;
&lt;li&gt;Copilots distract more than they help&lt;/li&gt;
&lt;li&gt;Customer support bots are making things worse&lt;/li&gt;
&lt;li&gt;The content explosion is setting us up for self-sabotage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We're not against AI. But we're against pretending that it's already the solution.&lt;/p&gt;

&lt;p&gt;It's not.&lt;/p&gt;

&lt;p&gt;At least, not yet.&lt;/p&gt;

&lt;p&gt;If you're looking for real productivity, sometimes a traditional tool — or a human — still wins.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What Traffic Lights Can Teach Us About Computer Deadlocks</title>
      <dc:creator>Zacchaeus Bolaji</dc:creator>
      <pubDate>Fri, 25 Jul 2025 23:39:40 +0000</pubDate>
      <link>https://dev.to/djunehor/what-traffic-lights-can-teach-us-about-computer-deadlocks-19ok</link>
      <guid>https://dev.to/djunehor/what-traffic-lights-can-teach-us-about-computer-deadlocks-19ok</guid>
      <description>&lt;h2&gt;
  
  
  From red lights to frozen apps, the rules that keep traffic — and your computer — moving smoothly.
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Ever been stuck at a red light forever? Your computer has the same issue with its programs!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Problem: Everyone Wants the Same Thing
&lt;/h3&gt;

&lt;p&gt;Picture this: You're at a busy intersection. Cars from all four directions want to go through at the same time. If everyone just floors it, you get a massive crash. &lt;/p&gt;

&lt;p&gt;Now imagine your computer: Multiple programs all want to use the printer at the same time. If they all try to print simultaneously, you get a mess.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Same problem, different scale.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Deadlock?
&lt;/h3&gt;

&lt;p&gt;Deadlock happens when everyone is waiting for everyone else, and nobody can move. It's like this classic scenario:&lt;/p&gt;

&lt;p&gt;🚗 &lt;strong&gt;Traffic Version:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;North-bound cars are waiting for East-bound cars to clear the intersection&lt;/li&gt;
&lt;li&gt;East-bound cars are waiting for South-bound cars
&lt;/li&gt;
&lt;li&gt;South-bound cars are waiting for West-bound cars&lt;/li&gt;
&lt;li&gt;West-bound cars are waiting for North-bound cars&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result&lt;/strong&gt;: Nobody moves. Ever.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💻 &lt;strong&gt;Computer Version:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Program A has the printer, wants the scanner&lt;/li&gt;
&lt;li&gt;Program B has the scanner, wants the hard drive
&lt;/li&gt;
&lt;li&gt;Program C has the hard drive, wants the printer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Result&lt;/strong&gt;: All programs freeze. Forever.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Four Rules of Deadlock
&lt;/h3&gt;

&lt;p&gt;Computer scientists figured out that deadlock happens when these four things are all true:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Resources can't be shared&lt;/strong&gt; (only one car can be in the intersection center)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hold and wait&lt;/strong&gt; (you keep what you have while waiting for more)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No takebacks&lt;/strong&gt; (you can't force someone to give up what they have)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Circular waiting&lt;/strong&gt; (everyone waits for someone else in a circle)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Break any one of these rules, and deadlock becomes impossible!&lt;/p&gt;

&lt;h3&gt;
  
  
  How Cities Solve Traffic Deadlock
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Traffic Lights = Resource Schedulers
&lt;/h3&gt;

&lt;p&gt;Traffic lights are basically &lt;strong&gt;schedulers&lt;/strong&gt; that prevent deadlock by breaking rule #4 (circular waiting). They say "North-South, you go first. East-West, you wait your turn."&lt;/p&gt;

&lt;h4&gt;
  
  
  Smart Traffic Systems
&lt;/h4&gt;

&lt;p&gt;Modern cities use crazy smart systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SCOOT&lt;/strong&gt; (used in 350+ cities): Adjusts light timing in real-time&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SCATS&lt;/strong&gt; (used in 55,000+ intersections): Detects traffic and adapts instantly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These systems work like advanced computer schedulers, constantly analyzing traffic patterns and preventing gridlock before it happens.&lt;/p&gt;

&lt;h4&gt;
  
  
  "Don't Block the Box"
&lt;/h4&gt;

&lt;p&gt;Ever see those yellow grid markings at intersections? That's &lt;strong&gt;deadlock prevention 101&lt;/strong&gt;. The rule is simple: Don't enter the intersection unless you can completely exit it. This prevents the circular waiting that causes gridlock.&lt;/p&gt;

&lt;p&gt;Fun fact: In NYC, blocking the box gets you a $90 ticket!&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/djune-hor/embed/RNWGrwa?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Computers Solve Program Deadlock
&lt;/h3&gt;

&lt;h4&gt;
  
  
  The Banker's Algorithm
&lt;/h4&gt;

&lt;p&gt;Computers use something called the &lt;strong&gt;Banker's Algorithm&lt;/strong&gt; - imagine a banker who only loans money if they're sure everyone can pay it back. The computer only gives resources to programs if it can guarantee no deadlock will happen.&lt;/p&gt;

&lt;h4&gt;
  
  
  Resource Ordering
&lt;/h4&gt;

&lt;p&gt;Just like traffic lights give green to one direction at a time, computers can require programs to request resources in a specific order. No cutting in line = no deadlock.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Ostrich Algorithm
&lt;/h4&gt;

&lt;p&gt;Sometimes the solution is... ignore it! If deadlock is super rare, some systems just restart when it happens. It's like how most intersections don't have traffic lights - crashes are rare enough that stop signs work fine.&lt;/p&gt;

&lt;h3&gt;
  
  
  See It in Action
&lt;/h3&gt;

&lt;p&gt;Want to see this in action? Check out traffic intersections during rush hour, or look up videos of cities like London or Sydney where smart traffic systems prevent gridlock in real-time. It's basically watching a massive distributed computer system manage thousands of moving resources!&lt;/p&gt;

&lt;h3&gt;
  
  
  The Cool Connection
&lt;/h3&gt;

&lt;p&gt;Next time you're at a red light, remember: you're experiencing the same fundamental computer science problem that happens inside your phone, laptop, and every computer system. The traffic light above you is running the same type of algorithms that prevent your apps from freezing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Traffic engineers and computer scientists are solving the exact same puzzle - just with different pieces.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Want to learn more? Look up &lt;a href="https://en.wikipedia.org/wiki/Dining_philosophers_problem" rel="noopener noreferrer"&gt;"dining philosophers problem"&lt;/a&gt; - it's another classic example of the same deadlock challenge, but with hungry philosophers and chopsticks!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>algorithms</category>
      <category>deadlock</category>
      <category>beginners</category>
    </item>
    <item>
      <title>DIARY OF THE TWITTER BOT TWEEPBLOCKER</title>
      <dc:creator>Zacchaeus Bolaji</dc:creator>
      <pubDate>Sun, 12 Jan 2020 12:06:51 +0000</pubDate>
      <link>https://dev.to/djunehor/diary-of-the-twitter-bot-tweepblocker-50fo</link>
      <guid>https://dev.to/djunehor/diary-of-the-twitter-bot-tweepblocker-50fo</guid>
      <description>&lt;h2&gt;
  
  
  BACKGROUND
&lt;/h2&gt;

&lt;p&gt;When I set out to create the twitter tweep blocker bot, I was open to using any stack. I learn by doing, so even if Perl is the most efficient solution, I’ll learn Perl for the purpose of the project.&lt;/p&gt;

&lt;p&gt;After hours of googling and tweets from folks like &lt;a href="https://twitter.com/theshalvah" rel="noopener noreferrer"&gt;@theshalvah&lt;/a&gt;, I understood that in order to be able to block on behalf of a user, the user has to grant the bot authentication and it’s a 3-legged process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 1 - Getting a sample implementation
&lt;/h3&gt;

&lt;p&gt;Some parts of Twitter API Docs were probably written for geniuses and I’m not one, so I needed an example implementation of the 3-legged authentication. That’s the hardest part of the bot I’m building (or so I thought).&lt;br&gt;
I searched google and Github, including twitter-dev GitHub repositories until I eventually found a Python implementation on Github. I quickly cloned the repo for testing (I used keys generated from my personal account). After a few trials and errors (you know Python), it worked. Problem solved, isn’t it? No! I was faced with challenge 2&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 2 - Impersonating User
&lt;/h3&gt;

&lt;p&gt;I’ve used Python Tweepy before for tweeting (text and media), not so sure it covers blocking. So, I googled python package for blocking and I found python-twitter package. That means I’ll be using 2 twitter packages at once. I was able to easily impersonate after getting the package&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 3 - Deploying streaming and app
&lt;/h3&gt;

&lt;p&gt;I’d decided to deploy to Heroku. Heroku uses gunicorn to start a flask app and I need the streaming to start when the flask app starts too. The Procfile only allows one command as far as I know. After some head “cracking”, I decided to start the streaming as a thread when the flask app starts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 4 - Getting twitter to approve bot
&lt;/h3&gt;

&lt;p&gt;So, I created a new twitter account for the bot and applied for a developer account. While waiting for twitter to approve, I decided to go update the bot profile. Saw dob field and decided to indicate the dob of the bot December 2019 so users can know when it started.&lt;br&gt;
Guess what. Twitter suspended the account immediately on grounds that they only allow users above the age of 13 (and I’m claiming to be few days old!).&lt;/p&gt;

&lt;p&gt;I’ve had suspension issue with twitter before, and I know it’s almost never resolved. So after waiting a few hours and no response, I decided to go use a bot account I created some months back for an experiment.&lt;/p&gt;

&lt;h2&gt;
  
  
  INTERMISSION
&lt;/h2&gt;

&lt;p&gt;So, all is set. The bot is ready and deployed to Heroku. I shared the new development on twitter and it was well-received. Suddenly, the bot began to reply itself and @theshalvah called my attention to the fact that since the bot is not listening for any keyword, it’ll keep getting triggered anytime it’s quoted/mentioned.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 5  - Getting bot to stop replying itself
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://twitter.com/dara_tobi" rel="noopener noreferrer"&gt;@dara_tobi&lt;/a&gt; suggested a few fixes too. After trying different combinations, I realised it’s best the bot listens for a keyword (as do most twitter bots I’ve seen). I deployed this fix and it fixed that issue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 6 - Twitter callback URL
&lt;/h3&gt;

&lt;p&gt;Even though people were trying to use the bot, they couldn’t authenticate cos the app was breaking. &lt;a href="https://twitter.com/bigbrutha_" rel="noopener noreferrer"&gt;@bigbrutha_&lt;/a&gt; called my attention to the auth issue. Turns out I forgot to set the Heroku URL as a callback. So, I decided to the Heroku URL on the twitter app as well as my environment variable.&lt;br&gt;
However, the problem persisted. Then I saw that I used HTTP in my environment variable, but https in the callback URL set on twitter app. I decided to leave both the HTTP and https version on twitter app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 7 - Persist data with SQLite
&lt;/h3&gt;

&lt;p&gt;I used SQLite for saving data on the app since it’s a file. But I noticed that each time I deploy the app, it asks me to authenticate again. Meaning the previous authentication is lost. Then &lt;a href="https://twitter.com/dara_tobi" rel="noopener noreferrer"&gt;@dara_tobi&lt;/a&gt;  called my attention to a limitation of using SQLite on Heroku i.e DB gets flushed regularly. &lt;a href="https://twitter.com/theshalvah" rel="noopener noreferrer"&gt;@theshalvah&lt;/a&gt; suggested I used PostgreSQL as there’s a free tier on Heroku. In my own search, I found that MySQL is supported and there’s a free tier too. So, MySQL it is! Had to modify the queries a little bit since there are slight differences in how you write SQLite queries and MySQL queries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 8 - Persist DB Connection
&lt;/h3&gt;

&lt;p&gt;So, MySQL is up and running. There shouldn’t be any data loss, isn’t it? I wish! I noticed the app keeps breaking on step 2 and it’s MySQL error. The error was saying MySQL is unavailable. After googling, realised it’s because the connection has been lost. I had created a single connection and use that connection throughout the app. Turns out, the connection is gone after it’s used the first time. This issue made me realise why I love frameworks (Laravel comes to mind).&lt;/p&gt;

&lt;p&gt;After some trials and errors, I realised the working solution is to connect to the DB each time I need to interact with the database. So, I created a DB connection function and called it before any SQL query. There might be a more efficient fix, but my current fix works, so…&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 9 - Duplicate post error
&lt;/h3&gt;

&lt;p&gt;The bot was working fine but at a point, twitter started returning an error that the tweet I’m trying to post is duplicate. Then I remembered a time &lt;a href="https://twitter.com/theshalvah" rel="noopener noreferrer"&gt;@theshalvah&lt;/a&gt; and someone was discussing using random texts when bot tweets. So, I googled “hello in various languages” to use randomize the texts. Ended up with 10 randomized texts to use each time the bot needs to post.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 10 - Tweet no reply error
&lt;/h3&gt;

&lt;p&gt;I wanted the bot to reply to the tweet that mentioned it, without mentioning the user. Turns out it’s not possible (with tweepy at least). When I tried it the bot started posting tweets that are not replies to any tweet, so the user that mentioned the bot can’t see the reply (cos it’s a tweet, not a reply)&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 11 - Double Posting
&lt;/h3&gt;

&lt;p&gt;This issue frustrated me a lot. Every other thing on the app works fine, but when the bot will reply a tweet, it’ll post 2 replies instead of one. Checking the logs, I also saw that the server starts streaming twice.&lt;br&gt;
I tried is to wrap the streaming call in a try, and when the exception is that streaming had already started, it should exit the script. This didn’t solve the problem.&lt;br&gt;
Since I noticed that the server creates 2 processes whenever the flask app launches and googling informed me that the second process is for auto-refresh. I added a check to not start the streaming if it’s a reload. Didn’t work.&lt;br&gt;
I added a sleep to the tweet function maybe it’ll prevent duplicate tweet. Didn’t work.&lt;br&gt;
Tried finding all processes and deleting before creating a new one. Didn’t work.&lt;br&gt;
Tried calling the script in Procfile, didn’t work (error)&lt;br&gt;
Tried saving the process ID (PID) of the streaming in a file and check if that file exists before launching streaming.&lt;br&gt;
What worked, for now, is creating a lock file that when streaming starts and refuse to start streaming if a file already exists.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenge 12 - Idling of Heroku Dyno
&lt;/h3&gt;

&lt;p&gt;So, I noticed inactivity with the bot and realised that the dyno (server) sleeps after some minutes of inactivity. So, if the bot is mentioned during sleep, it doesn’t respond. The quick fix for this is to ping the website intermittently to keep the server alive. Heroku says free dynos sleep after 30 minutes of inactivity, so I set up an external cronjob to ping the server every 15 minutes.&lt;/p&gt;

</description>
      <category>twitter</category>
      <category>bot</category>
      <category>diary</category>
    </item>
    <item>
      <title>Twitter Blocker Bot</title>
      <dc:creator>Zacchaeus Bolaji</dc:creator>
      <pubDate>Fri, 03 Jan 2020 21:52:07 +0000</pubDate>
      <link>https://dev.to/djunehor/twitter-blocker-bot-3m57</link>
      <guid>https://dev.to/djunehor/twitter-blocker-bot-3m57</guid>
      <description>&lt;p&gt;Recently, someone on twitter suggested a twitter bot that helps block a user. The idea is that most times we block users later, but may not be able to remember exactly why we blocked them later. The @TweepBlock is bot here to solve that tiny problem.&lt;/p&gt;

&lt;p&gt;How It works&lt;br&gt;
Comment on the user's post and mention @TweepBlocker. If you've authorized the bot before, it'll block the user for you and reply when it's done.&lt;/p&gt;

&lt;p&gt;If you haven't authorized the bot before, it replies with a link for you to authenticate. Once authentication is done, it blocks the user.&lt;/p&gt;

&lt;p&gt;You can view a list of users you've blocked with the bot by visiting &lt;a href="https://twitter-please-block.herokuapp.com/user/" rel="noopener noreferrer"&gt;https://twitter-please-block.herokuapp.com/user/&lt;/a&gt; where  should be replaced with your twitter username.&lt;/p&gt;

&lt;p&gt;The source code can be found here &lt;a href="https://github.com/djunehor/twitter-blocker" rel="noopener noreferrer"&gt;https://github.com/djunehor/twitter-blocker&lt;/a&gt; in case you need to see the inner workings and maybe suggest an improvement.&lt;/p&gt;

&lt;p&gt;As a side feature: the bot keeps a log of tweets that caused the block. So even if the user deletes the tweet, you can still dig it up&lt;/p&gt;

</description>
      <category>twitter</category>
      <category>bot</category>
    </item>
    <item>
      <title>Eyowo-php: A PHP Wrapper for Eyowo API</title>
      <dc:creator>Zacchaeus Bolaji</dc:creator>
      <pubDate>Mon, 09 Dec 2019 10:01:30 +0000</pubDate>
      <link>https://dev.to/djunehor/eyowo-php-a-php-wrapper-for-eyowo-api-3d</link>
      <guid>https://dev.to/djunehor/eyowo-php-a-php-wrapper-for-eyowo-api-3d</guid>
      <description>&lt;p&gt;Over the weekend, I decided to go through &lt;a href="https://eyowo.com/" rel="noopener noreferrer"&gt;eyowo&lt;/a&gt; API docs. I attempted to consume the APIs using PHP.&lt;/p&gt;

&lt;p&gt;The API docs include sample codes for curl, javascript, kotlin, ruby and java. No sample codes for PHP yet.&lt;/p&gt;

&lt;p&gt;So, I went ahead to create a PHP wrapper for the API, for those who might want to use the API in their PHP application. The package named eyowo-php is framework-agnostic, meaning it can work in any PHP framework or application.&lt;/p&gt;

&lt;p&gt;Go ahead and check it out here &lt;a href="https://github.com/djunehor/eyowo-php" rel="noopener noreferrer"&gt;https://github.com/djunehor/eyowo-php&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>eyowo</category>
      <category>api</category>
    </item>
  </channel>
</rss>
