<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Amin Benarieb&#39;s Blog</title>
    <link>https://amin.benarieb.com/</link>
    <description>Recent content on Amin Benarieb&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <copyright>&amp;copy; Copyright 2024, Amin Benarieb</copyright>
    <lastBuildDate>Sat, 30 Aug 2025 18:11:49 +0500</lastBuildDate>
    <atom:link href="https://amin.benarieb.com/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Turning the iPhone into a Laboratory Microscope with AI and BLE</title>
      <link>https://amin.benarieb.com/posts/iphone-laboratory-microscope-ai-ble/</link>
      <pubDate>Sat, 30 Aug 2025 18:11:49 +0500</pubDate>
      <guid>https://amin.benarieb.com/posts/iphone-laboratory-microscope-ai-ble/</guid>
      <description>&lt;p&gt;I recently shared an exciting project where we transformed an iPhone into a fully functional laboratory microscope by combining hardware innovation with AI, if you&amp;rsquo;re working on similar hardware + AI/BLE projects or interested in the technical details, check out the complete write-up on HackerNoon:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;a href=&#34;https://hackernoon.com/how-we-turned-the-iphone-into-a-laboratory-microscope-with-ai-and-ble&#34;&gt;How We Turned the iPhone into a Laboratory Microscope with AI and BLE&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Dealing with Floating-Point Precision in Swift</title>
      <link>https://amin.benarieb.com/posts/floating-precision/</link>
      <pubDate>Sun, 05 Jan 2025 18:57:18 +0500</pubDate>
      <guid>https://amin.benarieb.com/posts/floating-precision/</guid>
      <description>&lt;p&gt;During my junior years at university, we had a course dedicated to data structures and algorithms. One of the first tasks was working with large numbers, particularly floating-point numbers. At the time, I completed the task successfully. However, I eventually forgot the key lesson about the pitfalls of floating-point numbers and their rounding errors.&lt;/p&gt;&#xA;&lt;p&gt;Take a look at the following Swift code:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; a = &lt;span style=&#34;color:#ae81ff&#34;&gt;12.31&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;let&lt;/span&gt; b = &lt;span style=&#34;color:#ae81ff&#34;&gt;8.2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(a &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; b)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// Output: 20.509999999999998&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Surprisingly, instead of 20.51, you’re more likely to get &lt;code&gt;20.509999999999998&lt;/code&gt;.&#xA;And if you print values of &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; you also get something strange:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Debug Faster With Processinfo</title>
      <link>https://amin.benarieb.com/posts/how-to-debug-faster-with-processinfo/</link>
      <pubDate>Wed, 30 Oct 2024 16:19:20 +0500</pubDate>
      <guid>https://amin.benarieb.com/posts/how-to-debug-faster-with-processinfo/</guid>
      <description>&lt;h1 id=&#34;how-to-debug-faster-without-rebuilding-your-ios-app&#34;&gt;How to Debug Faster Without Rebuilding Your iOS App&lt;/h1&gt;&#xA;&lt;h2 id=&#34;problem&#34;&gt;Problem&lt;/h2&gt;&#xA;&lt;p&gt;Building an iOS app can be time-consuming, especially for large projects with complex dependencies. Waiting for the app to rebuild every time you make a minor change or need to test with different data can significantly slow down your development process.&lt;/p&gt;&#xA;&lt;h2 id=&#34;solution&#34;&gt;Solution&lt;/h2&gt;&#xA;&lt;p&gt;To speed up debugging without rebuilding your app, you can leverage &lt;code&gt;ProcessInfo.processInfo.environment&lt;/code&gt; and &lt;code&gt;ProcessInfo.processInfo.arguments&lt;/code&gt;. These allow you to inject data and control app behavior at runtime, making it easier to test different scenarios quickly.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to debug iOS deeplinks with local server</title>
      <link>https://amin.benarieb.com/posts/how-to-debug-ios-deeplinks-with-local-server/</link>
      <pubDate>Thu, 29 Jun 2023 14:27:48 +0100</pubDate>
      <guid>https://amin.benarieb.com/posts/how-to-debug-ios-deeplinks-with-local-server/</guid>
      <description>&lt;h1 id=&#34;how-to-debug-ios-deep-links-with-a-local-server&#34;&gt;How to Debug iOS Deep Links with a Local Server&lt;/h1&gt;&#xA;&lt;h2 id=&#34;problem&#34;&gt;Problem&lt;/h2&gt;&#xA;&lt;p&gt;Testing interactions within your iOS app that require a custom web page—such as engaging with payment options in a pop-up browser via universal links or deep links—can be challenging. Capturing and modifying URLs, handling deep links that close pop-up browsers, and ensuring that various types of links work seamlessly within your app can be time-consuming without the right tools.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
