<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sam Afshari&#39;s Notes</title>
    <link>https://afshari.lu/</link>
    <description>Recent content on Sam Afshari&#39;s Notes</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 17 Apr 2026 12:00:00 +0000</lastBuildDate>
    <atom:link href="https://afshari.lu/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Docking a C# app to a screen edge with the Windows AppBar API</title>
      <link>https://afshari.lu/post/220-csharp-appbar-api/</link>
      <pubDate>Fri, 17 Apr 2026 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/220-csharp-appbar-api/</guid>
      <description>&lt;p&gt;The Windows taskbar is an &lt;em&gt;AppBar&lt;/em&gt;: a window that sits glued to a screen edge and tells the rest of the desktop, &amp;ldquo;this strip is mine, don&amp;rsquo;t maximize over me.&amp;rdquo;&lt;/p&gt;&#xA;&lt;p&gt;Any app can do the same thing using a single shell API: &lt;code&gt;SHAppBarMessage&lt;/code&gt;. This post walks through a minimal C# example that registers itself, docks to any of the four edges, and cleanly tears down.&lt;/p&gt;&#xA;&lt;p&gt;The full sample is ~120 lines of code split between the AppBar wrapper and a tiny UI. The wrapper has zero dependencies beyond &lt;code&gt;user32&lt;/code&gt; and &lt;code&gt;shell32&lt;/code&gt;, so the same code drops into WinForms, WPF, MAUI, Unity, or any other host with only the HWND-fetch line changing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Extracting OSM POIs</title>
      <link>https://afshari.lu/post/219-osm-pois/</link>
      <pubDate>Sun, 01 Jun 2025 01:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/219-osm-pois/</guid>
      <description>&lt;p&gt;The aim of these notes is to take the OSM planet PBF file, process it, and create an indexed SQLite database of all the POIs and tags.&lt;/p&gt;&#xA;&lt;p&gt;During the process I will also demonstrate how to split the PBF file into chunks for parallel processing. WSL2 Ubuntu RAM disks will be used to speed up the processing. &lt;code&gt;osm&lt;/code&gt; and &lt;code&gt;osm.bz2&lt;/code&gt; files are created for each chunk and all chunks merged as well.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ed 2.23 is out</title>
      <link>https://afshari.lu/post/218-moose-ed-2-23/</link>
      <pubDate>Fri, 20 Sep 2024 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/218-moose-ed-2-23/</guid>
      <description>&lt;p&gt;Ed 2.23 is out on &lt;a href=&#34;https://store.steampowered.com/app/2974260/Ed/&#34;&gt;Steam&lt;/a&gt;. These are the new features and changelog for this build. I started writing changes on Post-its and I plan to collect them for every release to compile a changelog. Old school methods seem faster than loading Trello/Jira&amp;rsquo;s JavaScript!&lt;/p&gt;&#xA;&lt;h2 id=&#34;changelog&#34;&gt;Changelog&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CameraTarget flag: Make camera move and focus on this tile*.&lt;/li&gt;&#xA;&lt;li&gt;TileDef list sort: Sort by Ref, Handle or default.&lt;/li&gt;&#xA;&lt;li&gt;Draw borders around tiles of the current board (CTRL+G to toggle)&lt;/li&gt;&#xA;&lt;li&gt;Duplicate Ref finder assistant: Find assets with the same Ref and quickly rename them to unique values&lt;/li&gt;&#xA;&lt;li&gt;Fix bugs related to Rule Brush, Folder and TileDef management&lt;/li&gt;&#xA;&lt;li&gt;Fix undo drawing making the camera jump to 0,0.^&lt;/li&gt;&#xA;&lt;li&gt;Make undo drawing faster.^&lt;/li&gt;&#xA;&lt;li&gt;Make zooming in and out with scroll wheel smoother.&lt;/li&gt;&#xA;&lt;li&gt;Zoom and move the camera to cursor.&lt;/li&gt;&#xA;&lt;li&gt;Circle brush with size 3 is + instead of a square.&lt;/li&gt;&#xA;&lt;li&gt;Fix issues with animations and optimize drawing performance.&lt;/li&gt;&#xA;&lt;li&gt;Announcer UI and chimes&lt;/li&gt;&#xA;&lt;li&gt;IsPlayer TileDef flag&lt;/li&gt;&#xA;&lt;li&gt;Performance improvement: Don&amp;rsquo;t run polish on tiles that are being drawn&lt;/li&gt;&#xA;&lt;li&gt;Refactor renderer&lt;/li&gt;&#xA;&lt;li&gt;Pan camera with space bar&lt;/li&gt;&#xA;&lt;li&gt;CTRL+D to deselect&lt;/li&gt;&#xA;&lt;li&gt;Export animations to Unity and play them*&lt;/li&gt;&#xA;&lt;li&gt;Export collisions to Unity*&lt;/li&gt;&#xA;&lt;li&gt;Flag to clone TileDef per tile on runtime or use static (shared) data&lt;/li&gt;&#xA;&lt;li&gt;New animation code in Editor and Unity*&lt;/li&gt;&#xA;&lt;li&gt;CTRL+S to save&lt;/li&gt;&#xA;&lt;li&gt;Annotation TileDef flag: Ignore exporting/spawning sprites in game*&lt;/li&gt;&#xA;&lt;li&gt;Unity tile Become()*&lt;/li&gt;&#xA;&lt;li&gt;Unity tile Mimic()*&lt;/li&gt;&#xA;&lt;li&gt;Tile-level collision inheritance*&lt;/li&gt;&#xA;&lt;li&gt;Board-level collision override*&lt;/li&gt;&#xA;&lt;li&gt;Draw colliders*&lt;/li&gt;&#xA;&lt;li&gt;Duplicating assets assigns unique Refs&lt;/li&gt;&#xA;&lt;li&gt;Gravity multiplier*&lt;/li&gt;&#xA;&lt;li&gt;Rotation and position locks*&lt;/li&gt;&#xA;&lt;li&gt;Physics simulation mode per TileDef (with export to Unity RigidBody2D)*&lt;/li&gt;&#xA;&lt;li&gt;Propagate colliders to all TileDefs of a Rule Brush&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;(*Unity Experimental)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ed - The Level Editor</title>
      <link>https://afshari.lu/post/217-mooseed/</link>
      <pubDate>Wed, 10 Jan 2024 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/217-mooseed/</guid>
      <description>&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;&#xA;      &lt;iframe allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen&#34; loading=&#34;eager&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; src=&#34;https://www.youtube-nocookie.com/embed/rBMWr99lh_Y?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; title=&#34;YouTube video&#34;&gt;&lt;/iframe&gt;&#xA;    &lt;/div&gt;&#xA;&#xA;&lt;p&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve been working on a level editor for tile based games for quite some time now. Initially, it started as a tool to quickly design level for my Toy Box Jam submission, as I already had the gameplay code in place and needed to make some levels and swap sprites.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Playing Sound Effects in Avalonia UI</title>
      <link>https://afshari.lu/post/216-avalonia-play-sound/</link>
      <pubDate>Mon, 10 Apr 2023 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/216-avalonia-play-sound/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re looking for a way to develop cross-platform desktop-oriented applications, &lt;a href=&#34;https://avaloniaui.net/&#34;&gt;Avalonia UI&lt;/a&gt; might just be the framework for you. However, the documentation and third-party libraries can still be a bit immature. In this post, I&amp;rsquo;ll be sharing my experience developing an application that required playing audio files on different platforms, and how I managed to get it to work.&lt;/p&gt;&#xA;&lt;h2 id=&#34;goal&#34;&gt;Goal&lt;/h2&gt;&#xA;&lt;p&gt;Our goal is to play audio files from a local file or a URL. To achieve this, the cross-platform code calls a function pointer that is defined separately on each platform as &lt;code&gt;Func&amp;lt;string, Task&amp;gt;&lt;/code&gt;, where the input is the path/URL to the audio file. You can set this up with interfaces and dependency injection, but I chose to keep it old school.&lt;/p&gt;</description>
    </item>
    <item>
      <title>This Is Neat-O!</title>
      <link>https://afshari.lu/post/215-tbj3/</link>
      <pubDate>Sun, 13 Feb 2022 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/215-tbj3/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://afshari.lu/images/215-neat-o.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Check out my submission for Toy Box Jam 3, &lt;a href=&#34;https://thisisneat.itch.io/this-is-neat-o&#34;&gt;This Is Neat-O&lt;/a&gt;!&lt;/p&gt;&#xA;&lt;p&gt;Thirty years ago, Captain Neat-O lost his way home after entering a doomed trans-dimensional portal somewhere around Mars.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s up to you to help him find his way back home, before his parents find out&amp;hellip;&lt;/p&gt;&#xA;&lt;p&gt;Easy Mode: Collect all Neat Coins in each level to open the exit portal. Go to the portal to get to the next level.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unity Tilemap Collision Detection</title>
      <link>https://afshari.lu/post/214-tilemap/</link>
      <pubDate>Tue, 25 Jan 2022 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/214-tilemap/</guid>
      <description>&lt;p&gt;While working on a 2D platformer on Unity, I decided to implement ladders with tile maps with a specific layer designated for ladders. I added a &lt;strong&gt;Tilemap Collider 2D&lt;/strong&gt; component to it with &lt;strong&gt;Is Trigger&lt;/strong&gt; set to &lt;code&gt;true&lt;/code&gt;. The plan was to detect the overlap of player and a ladder tile using Unity&amp;rsquo;s &lt;code&gt;OnTriggerEnter2D(Collider2D)&lt;/code&gt; and &lt;code&gt;OnTriggerExit2D(Collider2D)&lt;/code&gt; methods.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;code&gt;Collider2D&lt;/code&gt; object refer to the collider attached to the tilemap. I thought &lt;code&gt;collider2D.transform&lt;/code&gt; or &lt;code&gt;.bounds&lt;/code&gt; properties would return the position of the actual overlapping tile, but I was wrong.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Talking to a Bluetooth (BLE) ELM327 Dongle</title>
      <link>https://afshari.lu/post/213-elm/</link>
      <pubDate>Tue, 14 Sep 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/213-elm/</guid>
      <description>&lt;p&gt;I have an ELM327 OBD2 BLE dongle that shows up as &lt;code&gt;IOS-Vlink&lt;/code&gt;. To communicate with it, the service ID is: &lt;code&gt;E7810A71-73AE-499D-8C15-FAA9AEF0C3F2&lt;/code&gt; and both read and write is done using the characteristic &lt;code&gt;BEF8D6C9-9C21-4C9E-B632-BD58C1009F9F&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Once the car (ECU) is on and the Bluetooth is connected, we need to initialize the dongle, by sending:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;AT E0\r&#xD;&#xA;AT L0\r&#xD;&#xA;AT SP 00\r&#xD;&#xA;01 00\r&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;AT E0&lt;/code&gt; is to turn echo off. &lt;code&gt;AT SP 00&lt;/code&gt; searches for the right protocol to use to communicate with the ECU.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Talking to a Bluetooth (BLE) Pulse Oximeter - Part II</title>
      <link>https://afshari.lu/post/212-oximeter2/</link>
      <pubDate>Thu, 29 Jul 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/212-oximeter2/</guid>
      <description>&lt;p&gt;These oximeters also continuously record oxygen, heart rate, motion and other values in their internal memory as files. Files are stored in a binary format that can be decoded as described in this note.&lt;/p&gt;&#xA;&lt;p&gt;The first 40 bytes are the header:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;00 int16   version (2 bytes)&#xD;&#xA;02 int16   year&#xD;&#xA;04 byte    month&#xD;&#xA;05 byte    day&#xD;&#xA;06 byte    hour&#xD;&#xA;07 byte    minute&#xD;&#xA;08 byte    second&#xD;&#xA;09 int16   file size   &#xD;&#xA;13 int16   duration in seconds&#xD;&#xA;17 byte    average O2&#xD;&#xA;18 byte    minimum O2&#xD;&#xA;19 byte    3pct O2&#xD;&#xA;20 byte    4pct O2&#xD;&#xA;22 int16   O2 &amp;lt; 90% seconds&#xD;&#xA;24 byte    events under 90%&#xD;&#xA;25 byte    score&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Take the total length of the file (number of bytes), remove 40 (i.e. the length of the header). Divide by 5 (i.e. the length of a record). You&amp;rsquo;ll get the total number of records in the file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Talking to a Bluetooth (BLE) Pulse Oximeter</title>
      <link>https://afshari.lu/post/211-oximeter/</link>
      <pubDate>Sun, 04 Jul 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/211-oximeter/</guid>
      <description>&lt;p&gt;I was playing around with a Viatom SleepU Pulse Oximeter the past few days. It&amp;rsquo;s a device with a ring-shaped sensor that you wear on your finger and it monitors and continuously records your blood oxygen percentage and heart rate.&lt;/p&gt;&#xA;&lt;p&gt;To communicate with this device over BLE, you need to look for the service with UUID &lt;code&gt;14839ac4-7d7e-415c-9a42-167340cf2339&lt;/code&gt;. This service has two characteristics that interest us:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For Reading: &lt;code&gt;0734594a-a8e7-4b1a-a6b1-cd5243059a57&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;For Writing: &lt;code&gt;8b00ace7-eb0b-49b0-bbe9-9aee0a26e1a3&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;We write to the second characteristic and monitor the value update of the first characteristic for reading.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Virtualization and Surface Book 3</title>
      <link>https://afshari.lu/post/209-virtualization-surface-book-3/</link>
      <pubDate>Mon, 17 May 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/209-virtualization-surface-book-3/</guid>
      <description>&lt;p&gt;I recently bought a Surface Book 3 and installed a VMWare virtual machine on it. It was running super slow. Some Googling around lead me to this discussion, and the solution worked for me. Leaving it here for future use.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;1. Turn off Hyper-V.  Run the &amp;#34;Turn Windows features on or off&amp;#34; applet and uncheck the entire &amp;#34;Hyper-V&amp;#34; tree&#xA;&#xA;2. Disable Credential Guard: Run the &amp;#34;Edit group policy&amp;#34; applet, and navigate to the Local Computer Policy &amp;gt; Computer Configuration &amp;gt; Administrative Templates &amp;gt; System &amp;gt; Device Guard group.  For the &amp;#34;Turn On Virtualization Based Security&amp;#34;, set it to &amp;#34;Disabled&amp;#34;&#xA;&#xA;3. Turn off hypervisor in the boot loader: in PowerShell as Administrator, type &#xA;&#xA;bcdedit /set hypervisorlaunchtype off&#xA;&#xA;4. Disable DeviceGuard: run the &amp;#34;Registry Editor&amp;#34; applet and navigate to Computer &amp;gt; HKEY_LOCAL_MACHINE &amp;gt; SYSTEM &amp;gt; CurrentControlSet &amp;gt; Control &amp;gt; DeviceGuard group.  set the &amp;#34;EnableVirtualizationBasedSecurity&amp;#34; to 0, set &amp;#34;RequireMicrosoftSignedBootChain&amp;#34; to 0.  Then navigate further to ... Scenarios &amp;gt; HyperVisorEnforcedCodeIntegrity and set &amp;#34;Enabled&amp;#34; to 0&#xA;&#xA;5. Disable Memory Integrity: in the Settings Applet, navigate to Update &amp;amp; Security &amp;gt; Windows Security &amp;gt; Device Security &amp;gt; Core Isolation.  Turn the Memory Integrity option &amp;#34;Off&amp;#34;&#xA;&#xA;When you reboot, you should have &amp;#34;Virtualization Based Security: not enabled&amp;#34; and the Intel utility will show VT-x enabled.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Source: &lt;a href=&#34;https://answers.microsoft.com/en-us/surface/forum/all/how-to-enable-vt-x-on-surface-book-3/b9057c59-eb8a-4221-85c4-90a3d44edd55&#34;&gt;https://answers.microsoft.com/en-us/surface/forum/all/how-to-enable-vt-x-on-surface-book-3/b9057c59-eb8a-4221-85c4-90a3d44edd55&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>RedCorners.Forms Changes</title>
      <link>https://afshari.lu/post/207-redcorners-forms/</link>
      <pubDate>Sat, 20 Feb 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/207-redcorners-forms/</guid>
      <description>&lt;p&gt;The following classes are renamed in &lt;a href=&#34;https://redcorners.com/forms&#34;&gt;RedCorners.Forms&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;TitledContentView&lt;/code&gt; to &lt;code&gt;TitledGroup&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;TabbedContentView&lt;/code&gt; to &lt;code&gt;TabGroup&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;HiddenEntryView&lt;/code&gt; to &lt;code&gt;HiddenEntry&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Some unnecessary &lt;code&gt;TwoWay&lt;/code&gt; bindings in &lt;code&gt;TitledGroup&lt;/code&gt;, &lt;code&gt;TitleBar&lt;/code&gt; and &lt;code&gt;TabGroup&lt;/code&gt; have been changed to &lt;code&gt;OneWay&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Demos are updated.&lt;/p&gt;&#xA;&lt;p&gt;Android SDK version is changed to &lt;code&gt;10&lt;/code&gt; from &lt;code&gt;9&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The following control templates are added to &lt;code&gt;TitledGroup&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;TitleViewTemplate&lt;/code&gt;: assigns the control template of &lt;code&gt;TitleView&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;BodyTemplate&lt;/code&gt;: assigns the control template of the body (&lt;code&gt;Content&lt;/code&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;TitleBarTemplate&lt;/code&gt;: assigns the control templates of the title bar.&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>RedCorners.Forms.GoogleMaps Breaking Changes</title>
      <link>https://afshari.lu/post/208-redcorners-forms-map/</link>
      <pubDate>Sat, 20 Feb 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/208-redcorners-forms-map/</guid>
      <description>&lt;p&gt;Android zoom buttons are hidden by default.&lt;/p&gt;&#xA;&lt;p&gt;Android SDK version is changed to &lt;code&gt;10&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Map objects are moved to the &lt;code&gt;Neat.Map.Models&lt;/code&gt; namespace in the &lt;code&gt;Neat.Map.Models&lt;/code&gt; NuGet. This package has to be installed in the projects that use &lt;code&gt;RedCorners.Forms.GoogleMaps&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Notes on Uno Platform</title>
      <link>https://afshari.lu/post/206-uno/</link>
      <pubDate>Wed, 17 Feb 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/206-uno/</guid>
      <description>&lt;p&gt;I wanted to port &lt;a href=&#34;https://docs.replicate.ee/docs/resync&#34;&gt;Replicate Resync&lt;/a&gt; to MacOS. Resync is originally written in WPF, and I chose Uno Platform for porting it to MacOS.&lt;/p&gt;&#xA;&lt;p&gt;Uno Platform&amp;rsquo;s XAML is more UWP style, so the first thing I did was translating the WPF XAML to UWP. The UWP XAML worked almost perfectly on Uno Platform. The biggest issue I had was with the menu bar. The implementation of regular UWP menu bar looks very glitchy on MacOS at the moment, and the native style menu keeps vanishing items once they have a &lt;code&gt;Click&lt;/code&gt; or &lt;code&gt;Command&lt;/code&gt; handler assigned to them.&lt;/p&gt;</description>
    </item>
    <item>
      <title>POIWorld Windows App</title>
      <link>https://afshari.lu/post/205-poiworld/</link>
      <pubDate>Mon, 08 Feb 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/205-poiworld/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://poiworld.com&#34;&gt;POIWorld&lt;/a&gt; now has a Windows app to demonstrate the index. You can download it from &lt;a href=&#34;https://www.microsoft.com/en-us/p/poiworld/9mvq68wj5j5t&#34;&gt;Microsoft Store&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;images/205.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;For mobile devices, &lt;a href=&#34;https://whereseek.com&#34;&gt;Whereseek&lt;/a&gt; is an implementation which uses the POIWorld data.&lt;/p&gt;</description>
    </item>
    <item>
      <title>World Time Lookup</title>
      <link>https://afshari.lu/post/204-worldtime/</link>
      <pubDate>Sun, 07 Feb 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/204-worldtime/</guid>
      <description>&lt;p&gt;I usually have meetings across multiple time zones, so I made this little tool with which I can quickly look up time in other time zones on a table. It&amp;rsquo;s available on &lt;a href=&#34;https://www.microsoft.com/store/productId/9P4WDV86XW01&#34;&gt;Microsoft Store for Windows&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;images/204.png&#34; alt=&#34;World Time&#34;&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Replicate</title>
      <link>https://afshari.lu/post/203-replicate/</link>
      <pubDate>Sat, 06 Feb 2021 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/203-replicate/</guid>
      <description>&lt;p&gt;I released &lt;a href=&#34;https://replicate.ee&#34;&gt;Replicate&lt;/a&gt; which is a suite of products designed to make it faster to manage the Resources folders when working on cross-platform iOS and Android projects.&lt;/p&gt;&#xA;&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;&#xA;      &lt;iframe allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen&#34; loading=&#34;eager&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; src=&#34;https://www.youtube-nocookie.com/embed/WZ20_Rn9rog?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; title=&#34;YouTube video&#34;&gt;&lt;/iframe&gt;&#xA;    &lt;/div&gt;&#xA;&#xA;&lt;p&gt;The current suite contains:&lt;/p&gt;&#xA;&lt;h3 id=&#34;replicate-resync&#34;&gt;&lt;a href=&#34;https://docs.replicate.ee/docs/resync&#34;&gt;Replicate Resync&lt;/a&gt;&lt;/h3&gt;&#xA;&lt;p&gt;Automatically synchronize your &lt;code&gt;Resources&lt;/code&gt; folders when developing cross-platform mobile applications for iOS and Android. Available stand-alone &lt;a href=&#34;https://www.microsoft.com/store/productId/9MZXRJLQ57F7&#34;&gt;for Windows&lt;/a&gt; or as a Visual Studio 2019 extension.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Creating Icon Sets for Xamarin.Forms</title>
      <link>https://afshari.lu/post/202-appiconmaker/</link>
      <pubDate>Sun, 01 Sep 2019 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/202-appiconmaker/</guid>
      <description>&lt;p&gt;My &lt;a href=&#34;https://github.com/samafshari/AppIconMaker&#34;&gt;AppIconMaker&lt;/a&gt; project lets you resize a large icon to all the different dimensions needed by the iOS App Store, as well as three sizes for Android, with the push of a button. If you&amp;rsquo;ve used the &lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=NeatCapitalOU.RedCornersFormsTemplates&#34;&gt;RedCorners.Forms template&lt;/a&gt; to create your projects, you can simply drag and drop the output files into your projects and &lt;em&gt;replace&lt;/em&gt; the files. Everything fits perfectly!&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;h3 id=&#34;ios-icons&#34;&gt;iOS Icons&lt;/h3&gt;&#xA;&lt;p&gt;The following files are generated for the iOS target:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Xamarin.Forms and Notch</title>
      <link>https://afshari.lu/post/201-fixpadding/</link>
      <pubDate>Fri, 23 Aug 2019 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/201-fixpadding/</guid>
      <description>&lt;p&gt;Since the release of iPhone X, we have to deal with devices with notches and make sure our UI elements don&amp;rsquo;t overlap with the notifications bar, the notch and the task switching bar on the bottom of the screen. However, we can&amp;rsquo;t just add a fixed padding to everything to resolve this issue, because devices without notch and with smaller safe areas also exist, and we have to support them as well.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Customizing Xamarin.Forms Frame Shadow</title>
      <link>https://afshari.lu/post/200-frame-shadow/</link>
      <pubDate>Sun, 18 Aug 2019 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/200-frame-shadow/</guid>
      <description>&lt;p&gt;The latest version of &lt;a href=&#34;https://www.nuget.org/packages/RedCorners.Forms/&#34;&gt;&lt;code&gt;RedCorners.Forms&lt;/code&gt;&lt;/a&gt; introduces &lt;code&gt;Frame2&lt;/code&gt;, an extended version of &lt;code&gt;Xamarin.Forms.Frame&lt;/code&gt; which provides additional bindable properties to adjust the shadow radius (aka distance or elevation) and color:&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;&#xA;&lt;p&gt;To use &lt;code&gt;Frame2&lt;/code&gt;, first you have to include the &lt;code&gt;RedCorners.Forms&lt;/code&gt; namespace in your XAML:&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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-c#&#34; data-lang=&#34;c#&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;xmlns:rf=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;clr-namespace:RedCorners.Forms;assembly=RedCorners.Forms&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Afterwards, you can use a &lt;code&gt;rf:Frame2&lt;/code&gt; tag and set its &lt;code&gt;ShadowRadius&lt;/code&gt; and &lt;code&gt;ShadowColor&lt;/code&gt; properties to adjust the shadows:&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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-c#&#34; data-lang=&#34;c#&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;rf:Frame2 &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    HasShadow=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;True&amp;#34;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ShadowRadius=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;20&amp;#34;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ShadowColor=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Red&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    BackgroundColor=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;White&amp;#34;&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &amp;lt;Grid HorizontalOptions=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Fill&amp;#34;&lt;/span&gt; HeightRequest=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;100&amp;#34;&lt;/span&gt;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &amp;lt;Label HorizontalOptions=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Center&amp;#34;&lt;/span&gt; VerticalOptions=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Center&amp;#34;&lt;/span&gt; Text=&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Hello, World&amp;#34;&lt;/span&gt; /&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &amp;lt;/Grid&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&amp;lt;/rf:Frame2&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;One issue I experienced was setting high values for &lt;code&gt;ShadowRadius&lt;/code&gt; made the whole iOS system crash! So make sure you know what you&amp;rsquo;re doing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Read and Write GPS coordinates with RedCorners.ExifLibrary</title>
      <link>https://afshari.lu/post/199-read-write-gps-exif/</link>
      <pubDate>Sun, 28 Apr 2019 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/199-read-write-gps-exif/</guid>
      <description>&lt;p&gt;I recently published RedCorners.ExifLibrary, a NuGet that lets you read and write EXIF metadata in image files. This is basically a fork of the ExifLibrary project by oozcitak, with four minor changes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It removes dependencies to System.Drawing, making the library work across all .net Standard 2.0 compatible runtimes, including Xamarin.iOS and Xamarin.Android.&lt;/li&gt;&#xA;&lt;li&gt;It adds a conversion helper method for going back and forth between floating point or Degrees/Minutes/Seconds representations for coordinates.&lt;/li&gt;&#xA;&lt;li&gt;It adds helper methods to quickly read and write GPS coordinates in the image files.&lt;/li&gt;&#xA;&lt;li&gt;Everything is moved to the RedCorners.ExifLibrary namespace, in order to make it possible to use both the original library and my version of it simultaneously.&lt;/li&gt;&#xA;&lt;li&gt;It has been tested on Xamarin.iOS, Xamarin.Android, .NET Core and .NET Framework on JPEG images.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can get the NuGet from here: &lt;a href=&#34;https://www.nuget.org/packages/RedCorners.ExifLibrary&#34;&gt;https://www.nuget.org/packages/RedCorners.ExifLibrary&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Lines in Unity</title>
      <link>https://afshari.lu/post/198-lines-in-unity/</link>
      <pubDate>Fri, 22 Feb 2019 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/198-lines-in-unity/</guid>
      <description>&lt;h3 id=&#34;tldr-download-neatline-from-httpsgithubcomsamafsharineatline&#34;&gt;TL;DR: Download NeatLine from &lt;a href=&#34;https://github.com/samafshari/NeatLine&#34;&gt;https://github.com/samafshari/NeatLine&lt;/a&gt;!&lt;/h3&gt;&#xA;&lt;p&gt;It is sometimes amazing how you want to do a very simple task, but you cannot find a simple and to-the-point library that does it for you. A few of my games require basic 2D lines, and Unity itself does not have the functionality to create 2D lines. There are a few complex assets on the Asset Store, but their licensing is not quite obvious, and I hesitate to open source my projects when using those assets.&lt;/p&gt;</description>
    </item>
    <item>
      <title>USB devices won’t show up on VMware’s list</title>
      <link>https://afshari.lu/post/197-usb-vmware/</link>
      <pubDate>Tue, 27 Nov 2018 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/197-usb-vmware/</guid>
      <description>&lt;p&gt;I just had an issue where some of my USB devices (e.g. an iPhone) were not showing up on VMware’s VM&amp;gt;Removable Devices menu.&lt;/p&gt;&#xA;&lt;p&gt;The reason was, for some reason, the &lt;strong&gt;VMware USB Arbitration Service&lt;/strong&gt; was stopped. Starting it manually solved the issue.&lt;/p&gt;</description>
    </item>
    <item>
      <title>RestSharp returns 0 for custom ASP.NET Core middleware response</title>
      <link>https://afshari.lu/post/196-restsharp-0-middleware/</link>
      <pubDate>Sun, 26 Aug 2018 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/196-restsharp-0-middleware/</guid>
      <description>&lt;p&gt;A normal behavior of RestSharp is to return &lt;code&gt;StatusCode = 0&lt;/code&gt; for responses that won’t go through (e.g. unreachable server). However, a tricky behavior of RestSharp is to also return 0 if the response has content, but the &lt;code&gt;Content-Length&lt;/code&gt; is undefined.&lt;/p&gt;&#xA;&lt;p&gt;If you are confused why your RestSharp is returning 0 while Postman and Chrome work fine, make sure you are setting the response &lt;code&gt;Content-Length&lt;/code&gt; to the actual content length.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Change Image Format in C#</title>
      <link>https://afshari.lu/post/195-change-image-format-cs/</link>
      <pubDate>Mon, 23 Jul 2018 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/195-change-image-format-cs/</guid>
      <description>&lt;p&gt;&lt;strong&gt;SkiaSharp&lt;/strong&gt; is a Xamarin-friendly NuGet that lets you do powerful image processing and rendering tasks. You can use it to quickly resize, compress or re-encode your images (i.e. change their format). This example shows how to change a JPEG file to PNG with SkiaSharp:&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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-c#&#34; data-lang=&#34;c#&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;using&lt;/span&gt; (&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; istream = File.OpenRead(originalPath))&#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;using&lt;/span&gt; (&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; skBitmap = SKBitmap.Decode(istream))&#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;using&lt;/span&gt; (&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; image = SKImage.FromBitmap(skBitmap))&#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;using&lt;/span&gt; (&lt;span style=&#34;color:#66d9ef&#34;&gt;var&lt;/span&gt; ostream = File.OpenWrite(newPath))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                image.Encode(SKEncodedImageFormat.Png, &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                    .SaveTo(ostream);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Images captured by iOS show up rotated on Android</title>
      <link>https://afshari.lu/post/194-images-ios-android-rotated/</link>
      <pubDate>Mon, 23 Jul 2018 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/194-images-ios-android-rotated/</guid>
      <description>&lt;p&gt;When you capture a photo with &lt;code&gt;TakePhotoAsync&lt;/code&gt; on the iOS, regardless of the &lt;code&gt;SaveMetaData&lt;/code&gt; flag or &lt;code&gt;RotateImage&lt;/code&gt;, it might be stored rotated. However, you won’t notice it on the iOS itself, or on Windows, since the orientation information is stored in the EXIF metadata of the captured JPEG file.&lt;/p&gt;&#xA;&lt;p&gt;iOS or Windows show the image correctly because they take into account the EXIF orientation, but the Image view of Xamarin.Forms on Android ignores this flag, thus making the image show up as-is, i.e. rotated.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Checking whether a DLL is 32-bit or 64-bit</title>
      <link>https://afshari.lu/post/193-dll-32-64-bit-check/</link>
      <pubDate>Thu, 07 Jun 2018 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/193-dll-32-64-bit-check/</guid>
      <description>&lt;p&gt;A very easy method to check whether a particular DLL is x86-64 compatible or not is by using the file command in Linux. If you have bash installed on your Windows, you can type:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;file MY_DLL.dll&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If it’s a 64-bit DLL, you will see:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PE32+ executable (DLL) (GUI) x86-64, for MS Windows&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Otherwise, it prints:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PE32 executable (DLL) (GUI) Intel 80386, for MS Windows&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>mpc.exe outputs an empty Resolver</title>
      <link>https://afshari.lu/post/192-mpc-empty-resolver/</link>
      <pubDate>Wed, 30 May 2018 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/192-mpc-empty-resolver/</guid>
      <description>&lt;p&gt;In order to use &lt;code&gt;MessagePack&lt;/code&gt; on the iOS or in general with AOT, you need to use mpc.exe to generate a resolver before building your main projects. Since Xamarin and ASP.NET are all about code sharing, usually a good practice is to create a shared project or a library containing model definitions, and referencing it in both server and client projects.&lt;/p&gt;&#xA;&lt;p&gt;This raises the question as where to embed the script to run mpc.exe in order to facilitate the automatic generation and updating the resolver class.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Resetting Windows 10 bash user password</title>
      <link>https://afshari.lu/post/191-resetting-windows-10-bash-password/</link>
      <pubDate>Tue, 29 May 2018 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/191-resetting-windows-10-bash-password/</guid>
      <description>&lt;p&gt;If you have forgotten your bash user password on Windows 10, there is a way to log in as root to reset that user’s password using &lt;code&gt;passwd&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;First, make sure all bash windows are closed. This is important as if one bash instance is open, this may not work:&lt;/p&gt;&#xA;&lt;p&gt;Open a Command Prompt as Administrator. You can do that by typing cmd in the Start menu and pressing &lt;code&gt;CTRL+Shift+Enter&lt;/code&gt;.&#xA;Run: &lt;code&gt;ubuntu config --default-user root&lt;/code&gt;&#xA;The previous command tells bash to log in as root the next time it’s started. So you can now run a rooted bash by typing &lt;code&gt;bash&lt;/code&gt;.&#xA;Now you can reset any user’s password by entering &lt;code&gt;passwd myuser&lt;/code&gt;&#xA;Finally, exit bash, and in the elevated Command Prompt, type &lt;code&gt;ubuntu config --default-user myuser&lt;/code&gt; to change the default bash login to your bash user.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Solve &#34;The &#34;User7ZipPath&#34; parameter is not supported&#34;</title>
      <link>https://afshari.lu/post/189-solve-the-user7zippath/</link>
      <pubDate>Sun, 27 May 2018 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/189-solve-the-user7zippath/</guid>
      <description>&lt;p&gt;This can happen when building a Xamarin project while using certain libraries. What can help is:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Update or install the latest version of &lt;code&gt;Xamarin.Build.Download&lt;/code&gt; NuGet.&lt;/li&gt;&#xA;&lt;li&gt;Close all Visual Studio windows.&lt;/li&gt;&#xA;&lt;li&gt;Delete all the &lt;code&gt;obj&lt;/code&gt;, &lt;code&gt;bin&lt;/code&gt;, &lt;code&gt;.vs&lt;/code&gt; folders, as well as the local packages folder in your solution root.&lt;/li&gt;&#xA;&lt;li&gt;Delete the global NuGet cache from &lt;code&gt;~\.nuget&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Load the Solution again, Rebuild, and hopefully the problem will go away!&lt;/li&gt;&#xA;&lt;/ol&gt;</description>
    </item>
    <item>
      <title>Solving &#34;Native linking failed&#34; issues running Xamarin.iOS on Simulator</title>
      <link>https://afshari.lu/post/190-solving-native-linking-failed-ios/</link>
      <pubDate>Sun, 27 May 2018 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/190-solving-native-linking-failed-ios/</guid>
      <description>&lt;p&gt;Some external libraries will cause the project fail to build on the iPhoneSimulator (e.g. &lt;code&gt;x86_64&lt;/code&gt;) target. The resulting errors can be:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Native linking failed. Please review the build log.&#xD;&#xA;Native linking error: 1 duplicate symbol for architecture x86_64&#xD;&#xA;Duplicate symbol in: /Users/admin/Library/Caches/Xamarin/mtbs/builds/.../obj/iPhoneSimulator/Debug/mtouch-cache/x86_64/main.o (Location related to previous error)&#xD;&#xA;Duplicate symbol in: /Users/admin/Library/Caches/Xamarin/mtbs/builds/.../obj/iPhoneSimulator/Debug/mtouch-cache/leveldb-library(leveldb_main.o) (Location related to previous error)&#xD;&#xA;Native linking failed, duplicate symbol: &amp;#39;_main&amp;#39;.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Sometimes you can make the build work by adding &lt;code&gt;--registrar:static&lt;/code&gt; in the Additional mtouch arguments (&lt;code&gt;MtouchExtraArgs&lt;/code&gt;) setting of the iOS project properties.&lt;/p&gt;</description>
    </item>
    <item>
      <title>EF / SQL Server writes too slow?</title>
      <link>https://afshari.lu/post/188-ef-sql-server-writes-slow/</link>
      <pubDate>Thu, 11 May 2017 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/188-ef-sql-server-writes-slow/</guid>
      <description>&lt;p&gt;I was using Entity Framework Core on a project which required a large amount of writes (inserts and updates) to a SQL Server 2017 database. The operation was extremely slow, in the order of several hours/half a day. I figured out that it was due to the EF overhead for tracking changes. Setting the following boolean to false saves a lot of time, if you have to do a lot of writes:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Xamarin.Android Rounded Corners Masked Layout</title>
      <link>https://afshari.lu/post/187-xamarin-android-rounded-corners/</link>
      <pubDate>Sat, 20 Aug 2016 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/187-xamarin-android-rounded-corners/</guid>
      <description>&lt;p&gt;If you want to create a &lt;code&gt;FrameLayout&lt;/code&gt; that has real rounded corners and clips its children beyond its corners, you can use the following class, which is a port of an answer on StackOverflow. You should replace &lt;code&gt;Constants.PackageName&lt;/code&gt; with your Android package name, e.g. &lt;code&gt;com.mycompany.myapp&lt;/code&gt;.&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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-c#&#34; data-lang=&#34;c#&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;using&lt;/span&gt; Android.Content;&#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;using&lt;/span&gt; Android.Graphics;&#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;using&lt;/span&gt; Android.Runtime;&#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;using&lt;/span&gt; Android.Util;&#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;using&lt;/span&gt; Android.Widget;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;namespace&lt;/span&gt; UIWidgets.Android&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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:#a6e22e&#34;&gt;    [Register(Constants.PackageName + &amp;#34;.UIWidgets.Android.RoundedCornerLayout&amp;#34;)]&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;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;RoundedCornerLayout&lt;/span&gt; : FrameLayout&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;const&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;float&lt;/span&gt; CornerRadius = &lt;span style=&#34;color:#ae81ff&#34;&gt;20.0f&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Bitmap maskBitmap;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Paint paint, maskPaint;&#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;float&lt;/span&gt; cornerRadius;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;public&lt;/span&gt; RoundedCornerLayout(Context context) : &lt;span style=&#34;color:#66d9ef&#34;&gt;base&lt;/span&gt;(context)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Init(context);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;public&lt;/span&gt; RoundedCornerLayout(Context context, IAttributeSet attrs) : &lt;span style=&#34;color:#66d9ef&#34;&gt;base&lt;/span&gt;(context, attrs)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Init(context, attrs);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;public&lt;/span&gt; RoundedCornerLayout(Context context, IAttributeSet attrs, &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt; defStyle) : &lt;span style=&#34;color:#66d9ef&#34;&gt;base&lt;/span&gt;(context, attrs, defStyle)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Init(context, attrs, defStyle);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;void&lt;/span&gt; Init(Context context, IAttributeSet attrs = &lt;span style=&#34;color:#66d9ef&#34;&gt;null&lt;/span&gt;, &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt; defStyle = &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            DisplayMetrics metrics = Context.Resources.DisplayMetrics;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            cornerRadius = TypedValue.ApplyDimension(ComplexUnitType.Dip, CornerRadius, metrics);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            paint = &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; Paint(PaintFlags.AntiAlias);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            maskPaint = &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; Paint(PaintFlags.AntiAlias | PaintFlags.FilterBitmap);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            maskPaint.SetXfermode(&lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; PorterDuffXfermode(PorterDuff.Mode.Clear));&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            SetWillNotDraw(&lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;override&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;void&lt;/span&gt; Draw(Canvas canvas)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Bitmap offscreenBitmap = Bitmap.CreateBitmap(canvas.Width, canvas.Height, Bitmap.Config.Argb8888);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Canvas offscreenCanvas = &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; Canvas(offscreenBitmap);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;base&lt;/span&gt;.Draw(offscreenCanvas);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            maskBitmap = maskBitmap ?? CreateMask(canvas.Width, canvas.Height);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            offscreenCanvas.DrawBitmap(maskBitmap, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0f&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0f&lt;/span&gt;, maskPaint);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            canvas.DrawBitmap(offscreenBitmap, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0f&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0f&lt;/span&gt;, paint);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        Bitmap CreateMask(&lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt; width, &lt;span style=&#34;color:#66d9ef&#34;&gt;int&lt;/span&gt; height)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Bitmap mask = Bitmap.CreateBitmap(width, height, Bitmap.Config.Alpha8);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Canvas canvas = &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; Canvas(mask);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Paint paint = &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; Paint(PaintFlags.AntiAlias);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            paint.Color = Color.White;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            canvas.DrawRect(&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;, width, height, paint);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            paint.SetXfermode(&lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; PorterDuffXfermode(PorterDuff.Mode.Clear));&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            canvas.DrawRoundRect(&lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; RectF(&lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;, width, height), cornerRadius, cornerRadius, paint);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;return&lt;/span&gt; mask;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And to use it in your AXML:&lt;/p&gt;</description>
    </item>
    <item>
      <title>REST requests with Xamarin and RestSharp</title>
      <link>https://afshari.lu/post/186-rest-xamarin-restsharp/</link>
      <pubDate>Fri, 08 Jul 2016 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/186-rest-xamarin-restsharp/</guid>
      <description>&lt;p&gt;RestSharp (available on NuGet) is a clean way to send HTTP requests and handle their response. As a portable package, you can use it in your Xamarin.iOS and Xamarin.Android applications. The following example, POSTs a serialized JSON body, created automatically from a C# class, to an endpoint located at &lt;code&gt;https://myserver.com/api/messages/message&lt;/code&gt;. It also sends a token parameter inside the query string:&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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-c#&#34; data-lang=&#34;c#&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;MessageDTO&lt;/span&gt; : DTO&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt; Sender { &lt;span style=&#34;color:#66d9ef&#34;&gt;get&lt;/span&gt;; &lt;span style=&#34;color:#66d9ef&#34;&gt;set&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;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt; Recipient { &lt;span style=&#34;color:#66d9ef&#34;&gt;get&lt;/span&gt;; &lt;span style=&#34;color:#66d9ef&#34;&gt;set&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;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt; Body { &lt;span style=&#34;color:#66d9ef&#34;&gt;get&lt;/span&gt;; &lt;span style=&#34;color:#66d9ef&#34;&gt;set&lt;/span&gt;; }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;static&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;PinHelper&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;async&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;void&lt;/span&gt; SendMessage(MessageDTO dto)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;const&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt; ApiPath = &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;https://myserver.com/api/&amp;#34;&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;var&lt;/span&gt; client = &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; RestClient (ApiPath);&#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;var&lt;/span&gt; request = &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; RestRequest (&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;messages/message&amp;#34;&lt;/span&gt;, Method.POST);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        request.AddQueryParameter (&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;token&amp;#34;&lt;/span&gt;, Settings.Token);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        request.AddJsonBody (dto);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;try&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;var&lt;/span&gt; result = &lt;span style=&#34;color:#66d9ef&#34;&gt;await&lt;/span&gt; client.ExecuteTaskAsync(request);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Debug.WriteLine(&lt;span style=&#34;color:#e6db74&#34;&gt;$&amp;#34;Result Status Code: {result.StatusCode} - {result.Content}&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&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;catch&lt;/span&gt; (Exception e) {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            Debug.WriteLine (&lt;span style=&#34;color:#e6db74&#34;&gt;$&amp;#34;Error: {e.Message}&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On an ASP.NET WebApi controller with EntityFramework, this request can be received and stored using a function that looks like this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tips and Tricks on Using SQLite-Net with Xamarin.iOS</title>
      <link>https://afshari.lu/post/185-tips-sqlite-net/</link>
      <pubDate>Fri, 24 Jun 2016 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/185-tips-sqlite-net/</guid>
      <description>&lt;p&gt;&lt;strong&gt;SQLite-Net&lt;/strong&gt; is a nice library compatible with Xamarin that lets you create and use a SQLite database as the local data source of your application. It is ultra portable as it comes in only two C# files, one of which is for asynchronous operations. You can easily get it from NuGet and get started with it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;creating-a-database-if-not-exists&#34;&gt;Creating a database (if not exists)&lt;/h2&gt;&#xA;&lt;p&gt;The first step in using SQLite-Net is creating a database, and its tables. This is automatically done by creating a &lt;code&gt;SQLiteAsyncConnection&lt;/code&gt; and calling its &lt;code&gt;CreateTableAsync&amp;lt;T&amp;gt;&lt;/code&gt; method, in which &lt;code&gt;T&lt;/code&gt; is your model class. This method checks for the existence of a table with the same name as the model class, and creates it if it does not exist. For example, if we want to make a database named &lt;code&gt;map.db&lt;/code&gt; containing a table based on the model class &lt;code&gt;Pin&lt;/code&gt;, we can do the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Batch resizing images with Python and Pillow</title>
      <link>https://afshari.lu/post/184-batch-resizing-python/</link>
      <pubDate>Wed, 24 Feb 2016 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/184-batch-resizing-python/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://pillow.readthedocs.org/en/3.1.x/installation.html&#34;&gt;Pillow&lt;/a&gt; is a fork of PIL (Python Imaging Library) which works on Python 3. It provides convenient methods to manipulate and convert image files with just a few lines of code. Usually every mobile application platform requires the same image to be provided in multiple sizes, and since resizing these images manually can be cumbersome, Pillow and Python can come to save the day by automating these processes.&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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-py&#34; data-lang=&#34;py&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; PIL &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; Image&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;inputName &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;image.png&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sizes &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; (&lt;span style=&#34;color:#ae81ff&#34;&gt;512&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;256&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;128&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;64&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;32&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;img &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; Image&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;open(inputName)&#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;for&lt;/span&gt; size &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; sizes:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    name &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;.png&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;format(inputName, size)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    resizedImage &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; img&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;resize((size, size), Image&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;ANTIALIAS)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    resizedImage&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;save(name)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To install Pillow using &lt;code&gt;pip&lt;/code&gt;, you can simply execute:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Traces of Love Random Development Notes</title>
      <link>https://afshari.lu/post/183-tol/</link>
      <pubDate>Tue, 16 Feb 2016 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/183-tol/</guid>
      <description>&lt;p&gt;Last week we released a new Neat Games title: Traces of Love, with a romantic theme aimed for Valentine’s day. This was a remake of BLAMMO: Trace of Love that we published in 2013, with new levels, new gameplay mechanics, and of course, a different game engine. You can download Traces of Love from the App Store, or if you have an Android device, from the Play Store. A version with limited features is also available on the Windows Store, if you prefer to try that one.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Exporting Unity frames as Animated GIFs</title>
      <link>https://afshari.lu/post/182-exporting-unity-frames-gif/</link>
      <pubDate>Sat, 13 Feb 2016 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/182-exporting-unity-frames-gif/</guid>
      <description>&lt;p&gt;Recently I discovered a Unity-compatible library that allows exporting Unity textures into animated GIFs. This library is extremely easy to use and platform independent. It is called &lt;code&gt;GifEncoder&lt;/code&gt;, which is based on &lt;code&gt;NGif&lt;/code&gt;, an older C# based project for encoding GIFs.&lt;/p&gt;&#xA;&lt;p&gt;To use it, just copy the &lt;code&gt;GifEncoder&lt;/code&gt; folder to your Assets directory, point a camera at what you would like to record, and in each frame send the pixels from the camera’s render target to the encoder:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Accessing Vimeo and YouTube APIs with Xamarin.iOS</title>
      <link>https://afshari.lu/post/181-accessing-vimeo-youtube-ios/</link>
      <pubDate>Thu, 24 Sep 2015 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/181-accessing-vimeo-youtube-ios/</guid>
      <description>&lt;p&gt;The Uptred Source library allows you to build C# based applications for iOS that use Vimeo and YouTube APIs. You can easily authorize a Vimeo or YouTube account, and afterwards query data from the server or even have resumable uploads. This post covers the basics of using Uptred Source to build an application that communicates with Vimeo Advanced API and YouTube API using Xamarin.iOS.&lt;/p&gt;&#xA;&lt;p&gt;First, you need to create a blank Xamarin.iOS project and add Uptred as a component. You can get Uptred Source either from the Xamarin Component Store, or from the Uptred website. Modify the &lt;code&gt;AppDelegate.cs&lt;/code&gt; file to create a new view of type &lt;code&gt;MainViewController&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>First wave of Uptred products released!</title>
      <link>https://afshari.lu/post/180-first-wave-uptred-products/</link>
      <pubDate>Thu, 24 Sep 2015 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/180-first-wave-uptred-products/</guid>
      <description>&lt;p&gt;During the past few weeks, my team has been working on Uptred, a highly ambitious project that aims to give its users a set of tools that help them to manage and upload their videos from any of their devices to their favorite online providers. The first stage of this project finished last month with the releases of the first versions of &lt;strong&gt;Uptred Source&lt;/strong&gt; and &lt;strong&gt;Uptred Shell&lt;/strong&gt; on the &lt;a href=&#34;https://components.xamarin.com/view/uptred&#34;&gt;Xamarin Component Store&lt;/a&gt; and on the &lt;a href=&#34;http://uptred.com&#34;&gt;Uptred website&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;!-- raw HTML omitted --&gt;</description>
    </item>
    <item>
      <title>Mono Frustrations: &#34;The authentication or decryption has failed.&#34;</title>
      <link>https://afshari.lu/post/179-mono-authentication-decryptions-failed/</link>
      <pubDate>Wed, 01 Jul 2015 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/179-mono-authentication-decryptions-failed/</guid>
      <description>&lt;p&gt;Often calling the &lt;code&gt;AuthenticateAsClient&lt;/code&gt; method of an &lt;code&gt;SslStream&lt;/code&gt; results in the &lt;em&gt;&amp;ldquo;The authentication or decryption has failed.&amp;rdquo;&lt;/em&gt; error, because Mono cannot verify the certificate. As a last resort, the error can be circumvented by disabling the certificate validation by adding the following line to the 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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-c#&#34; data-lang=&#34;c#&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;ServicePointManager.ServerCertificateValidationCallback += (o, certificate, chain, errors) =&amp;gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you are creating the &lt;code&gt;SslStream&lt;/code&gt; in a using block, you can do this instead:&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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-c#&#34; data-lang=&#34;c#&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;using&lt;/span&gt; (SslStream s = &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; SslStream(tcpClient.GetStream(), &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;, &lt;span style=&#34;color:#66d9ef&#34;&gt;new&lt;/span&gt; RemoteCertificateValidationCallback((o, certificate, chain, errors) =&amp;gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;)))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    s.AuthenticateAsClient(uri.Host, &lt;span style=&#34;color:#66d9ef&#34;&gt;null&lt;/span&gt;, SslProtocols.Tls, &lt;span style=&#34;color:#66d9ef&#34;&gt;false&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ...&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Mono Frustrations: JSON Deserializer and Booleans</title>
      <link>https://afshari.lu/post/177-mono-json-deserializer/</link>
      <pubDate>Wed, 01 Jul 2015 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/177-mono-json-deserializer/</guid>
      <description>&lt;p&gt;The &lt;code&gt;JavaScriptSerializer&lt;/code&gt; of Mono requires boolean values to be surrounded with quotes in order for the JSON strings to be deserialized; which is not the case in .NET framework.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;isDefault&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;true&lt;/span&gt;} &lt;span style=&#34;color:#75715e&#34;&gt;//Invalid in Mono. Valid in .NET&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;{&lt;span style=&#34;color:#f92672&#34;&gt;&amp;#34;isDefault&amp;#34;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;true&amp;#34;&lt;/span&gt;} &lt;span style=&#34;color:#75715e&#34;&gt;//Valid in Mono.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Mono Frustrations: WebRequest</title>
      <link>https://afshari.lu/post/178-mono-webrequest/</link>
      <pubDate>Wed, 01 Jul 2015 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/178-mono-webrequest/</guid>
      <description>&lt;p&gt;The &lt;code&gt;WebRequest&lt;/code&gt; class has many issues, especially in Mono. A major problem occurs when the response code is an HTTP error (e.g. 4xx), for which the class throws an &lt;code&gt;Exception&lt;/code&gt;, causing a Runtime Error if it goes unhandled. This is not a big deal in .NET, because the &lt;code&gt;request.GetResponse()&lt;/code&gt; call can be surrounded by a try/catch block that catches the thrown &lt;code&gt;WebException&lt;/code&gt;, which still contains the response in its &lt;code&gt;Response&lt;/code&gt; property. However, a bug in Mono makes it impossible to retrieve the response from a &lt;code&gt;WebException&lt;/code&gt;, as the &lt;code&gt;Response&lt;/code&gt; property is always null.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Collaborative Whiteboard Tutorial, Part One</title>
      <link>https://afshari.lu/post/175-collaborative-whiteboard-1/</link>
      <pubDate>Sun, 15 Feb 2015 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/175-collaborative-whiteboard-1/</guid>
      <description>&lt;p&gt;This tutorial aims to demonstrate how to build a real-time communication channel between one server and multiple clients (i.e. browsers), simply by using JavaScript. This project uses Node.js for its server-side backend, and targets Google Chrome for the client side. However, the outcome also works well on other browsers, including Internet Explorer. We call this application &lt;strong&gt;QuickDraw&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The end result is supposed to be a web service that stores multiple whiteboards in different rooms, and each client can simply type in a room name and observe or modify the contents of the whiteboard. In case a room does not exist, it will be created automatically.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Collaborative Whiteboard Tutorial, Part Two</title>
      <link>https://afshari.lu/post/176-collaborative-whiteboard-2/</link>
      <pubDate>Sun, 15 Feb 2015 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/176-collaborative-whiteboard-2/</guid>
      <description>&lt;p&gt;Part one of this tutorial focused on the description of the project and the server-side code. In this part, we write the client side code that is supposed to handle the drawing operations on an HTML &lt;code&gt;canvas&lt;/code&gt; element.&lt;/p&gt;&#xA;&lt;p&gt;As previously discussed, our web service is supposed to handle multiple separate whiteboards (which we call rooms). Therefore the client needs to know which room it is working on. To specify this, we pass the room name via a query string parameter, room. This parameter can then be read using a simple function (taken from the web via a quick Google search) that extracts the value of a parameter in the query string:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Relocating Outlook Data Files</title>
      <link>https://afshari.lu/post/174-relocating-outlook-data-files/</link>
      <pubDate>Tue, 23 Dec 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/174-relocating-outlook-data-files/</guid>
      <description>&lt;p&gt;Outlook 2013 data files (ost, pst) can be really huge, especially if you use emails too much, or have a lot of attachments in your accounts. By default, Outlook keeps these files in the &lt;code&gt;APPDATA&lt;/code&gt; folder, and even if you move your home folder to another drive, it still uses the old folder in the original &lt;code&gt;APPDATA&lt;/code&gt; path. There is no direct way to move this folder, and this can be quite annoying if the files are saved on a low capacity SSD.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Magnetic Interaction with Mobile Games</title>
      <link>https://afshari.lu/post/173-magnetic-interaction-mobile-games/</link>
      <pubDate>Wed, 17 Dec 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/173-magnetic-interaction-mobile-games/</guid>
      <description>&lt;p&gt;I have been working on this for a while now, but now it’s time to finally reveal it.&lt;/p&gt;&#xA;&lt;p&gt;In these videos, you can see the novel mobile interaction method I invented, called the “Magnetic Joystick”. The algorithm allows different objects to be used to wirelessly control mobile games like a joystick. For details, you can refer to our publication at NORDICHI 2014: &lt;a href=&#34;http://dl.acm.org/citation.cfm?id=2670186&#34;&gt;http://dl.acm.org/citation.cfm?id=2670186&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;[embed]https://www.youtube.com/watch?v=ykfMi4W83MI[/embed]&lt;/p&gt;&#xA;&lt;p&gt;[embed]https://www.youtube.com/watch?v=vFnE_MRCyAQ[/embed]&lt;/p&gt;</description>
    </item>
    <item>
      <title>VimeoDotNet 3 on GitHub</title>
      <link>https://afshari.lu/post/172-vimeodotnet-3-github/</link>
      <pubDate>Tue, 19 Aug 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/172-vimeodotnet-3-github/</guid>
      <description>&lt;p&gt;Concerning this new Vimeo API version 3, I have managed to implement the functionality that allows you to:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Generate an authorization URL.&lt;/li&gt;&#xA;&lt;li&gt;Get an access token.&lt;/li&gt;&#xA;&lt;li&gt;Call an API method and get a deserialized JSON response in form of a &lt;code&gt;Dictionary&amp;lt;string,object&amp;gt;&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The source code is available under MIT license on GitHub. For more information on using it, take a look at the &lt;code&gt;Readme.txt&lt;/code&gt; file in the project. Meanwhile I will be working on implementing some straightforward upload functionality like the previous version of &lt;code&gt;VimeoDotNet&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>MELODIE is available for iOS and Android!</title>
      <link>https://afshari.lu/post/171-melodie-available/</link>
      <pubDate>Tue, 05 Aug 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/171-melodie-available/</guid>
      <description>&lt;p&gt;Remember the game of Simon? MELODIE is a similar but more challenging game of sound and memory, in which you have to memorize an expanding sequence of tiles in the correct order, and tap on them when it’s your turn. Your high scores will be stored on a Game Center leaderboard and you can show the world how awesome your memory is!&lt;/p&gt;&#xA;&lt;p&gt;Download from App Store: &lt;a href=&#34;https://itunes.apple.com/us/app/melodie/id903654811?ls=1&amp;amp;mt=8&#34;&gt;https://itunes.apple.com/us/app/melodie/id903654811?ls=1&amp;amp;mt=8&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Download from Google Play: &lt;a href=&#34;https://play.google.com/store/apps/details?id=com.neatgames.melodie&#34;&gt;https://play.google.com/store/apps/details?id=com.neatgames.melodie&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Conversion to Dalvik error while Exporting APK</title>
      <link>https://afshari.lu/post/170-conversion-dalvik-error-apk/</link>
      <pubDate>Thu, 31 Jul 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/170-conversion-dalvik-error-apk/</guid>
      <description>&lt;p&gt;Sometimes while trying to export an APK using Eclipse, it gives the error “Conversion to Dalvik format failed with error 1.” However meanwhile if you try to run the project normally on a debug device, it launches just fine. For example, this often happens when you try to make an APK out of a Cocos2d-x project.&lt;/p&gt;&#xA;&lt;p&gt;This error is due to the crapball design of Eclipse (let’s pile more crap on a crap to increase functionality), but fortunately, there’s an easy solution to fix this problem: All you need to do to fix this problem is to disable automatic build from the Project menu, clean everything and retry exporting the APK.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Game of Drones Released!</title>
      <link>https://afshari.lu/post/169-game-of-drones-released/</link>
      <pubDate>Thu, 10 Jul 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/169-game-of-drones-released/</guid>
      <description>&lt;p&gt;I am pleased to announce that Game of Drones is now out on the App Store for free! In this addictive puzzle-based game, you have to lure the hungry Noise-Activated Drones into black holes and collect the items in each level.&lt;/p&gt;&#xA;&lt;p&gt;There are three episodes, each with unique game items and mechanics that you will discover along the way, plus two different game modes! If that won’t still satisfy you, there are six mini-games built-in that you can unlock by progressing in the story mode!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gotchas: Using Cocos2d-x libExtensions and libNetwork</title>
      <link>https://afshari.lu/post/168-gotchas-cocos2dx-libextensions/</link>
      <pubDate>Sun, 06 Jul 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/168-gotchas-cocos2dx-libextensions/</guid>
      <description>&lt;p&gt;&lt;em&gt;This tutorial is compatible with Cocos2d-x 3.0.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Some features of Cocos2d-x such as EditBox and HttpClient are not in the main libCocos2d project and in order to access them, other projects should be imported to the solution first. In this post, I am going to explain how to import and link external projects to the main game project. This post can also help people with general problems regarding referencing C++ projects in Visual Studio.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gotchas: Post shader effects in Cocos2d-x</title>
      <link>https://afshari.lu/post/166-gotchas-post-shader-effects-cocos2dx/</link>
      <pubDate>Fri, 04 Jul 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/166-gotchas-post-shader-effects-cocos2dx/</guid>
      <description>&lt;p&gt;&lt;em&gt;This tutorial is compatible with Cocos2d-x v3.1.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;There might be times that you want to apply an effect to the whole scene and not just an object. For example, you might want to make your scene black and white or add a noise, vignette or glow to your game. In such cases, setting the same &lt;code&gt;GLProgram&lt;/code&gt; to each single node in the game probably wouldn’t give you the desired outcome, because for each different node, the effect will run independently and is limited to the edges of the node, and thus you can detect a non-homogeneity in the resulting image.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gotchas: Repeating textures in Cocos2d-x</title>
      <link>https://afshari.lu/post/167-gotchas-repeating-textures-cocos2dx/</link>
      <pubDate>Fri, 04 Jul 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/167-gotchas-repeating-textures-cocos2dx/</guid>
      <description>&lt;p&gt;&lt;em&gt;This tutorial is compatible with Cocos2d-x v3.1.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Repeating textures can be used to make tiled backgrounds, floors, and for many other purposes. The stars in the image shown above are an example of this. The easiest way to repeat a texture is to put it in a separate file with power-of-two dimensions (also known as a POT texture), and display it using a &lt;code&gt;Sprite&lt;/code&gt; with its &lt;code&gt;wrapS&lt;/code&gt; and &lt;code&gt;wrapT&lt;/code&gt; &lt;code&gt;TexParams&lt;/code&gt; values set to &lt;code&gt;GL_REPEAT&lt;/code&gt;. This is how to do that:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Neat Bundle Released!</title>
      <link>https://afshari.lu/post/165-neat-bundle-released/</link>
      <pubDate>Sat, 21 Jun 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/165-neat-bundle-released/</guid>
      <description>&lt;p&gt;I am happy to announce that Neat Bundle is released on iTunes App Store and is available for iPhones and iPads for free! So what are you waiting for, go grab your own version and start playing!&lt;/p&gt;&#xA;&lt;p&gt;Also in other news, Naturals 2 is also available now for free from the App Store!&lt;/p&gt;&#xA;&lt;p&gt;Neat Bundle is a collection of super-fun casual games in an arcade-like environment. Optimized for Retina iPad, it gives you a great high quality arcade experience on your tablet. Whether you play it on your phone or your tablet, you will get a nice challenging experience!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gotchas! Shaders in Cocos2d-x</title>
      <link>https://afshari.lu/post/164-gotchas-shaders-cocos2dx/</link>
      <pubDate>Fri, 20 Jun 2014 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/164-gotchas-shaders-cocos2dx/</guid>
      <description>&lt;p&gt;I am planning to write quick tutorials about features in Cocos2d-x that are a bit tricky to use and are rarely (or not at all) discussed in tutorials and forums around the Internet. Basically these come from personal experience gained after not finding any good resources on the Internet. The first bunch of tutorials are going to be around the topic of shader effects (Fragment shaders), render targets and post effects.&lt;/p&gt;</description>
    </item>
    <item>
      <title>New titles published on Google Play!</title>
      <link>https://afshari.lu/post/163-new-titles-google-play/</link>
      <pubDate>Tue, 01 Oct 2013 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/163-new-titles-google-play/</guid>
      <description>&lt;p&gt;My new game “Naturals” which is a set of brain teasing puzzles based on natural numbers is now available on Google Play Store free of charge! This version of the game contains fifteen puzzles, and more puzzles will come in future updates. For more information about Naturals, visit its own page on my blog.&lt;/p&gt;&#xA;&lt;p&gt;In addition, the first Quickie title, “Ball Fall” is also available on Google Play. More information about Ball Fall is available here.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fixing Cocos2D-x exe crash</title>
      <link>https://afshari.lu/post/162-fixing-cocos2dx-exe-crash/</link>
      <pubDate>Fri, 06 Sep 2013 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/162-fixing-cocos2dx-exe-crash/</guid>
      <description>&lt;p&gt;During my cocos2D-x development with Visual Studio, I noticed that I can run my games pretty fine when I execute them via Visual Studio (F5 or Shift+F5,) but when I try to run the .exe file directly, it crashes.&lt;/p&gt;&#xA;&lt;p&gt;After some trial and errors, I figured out that this crash is due to the .exe not being able to find game resources. To fix this crash just copy whatever’s inside your Resources folder to your Debug.win32 or Release.win32 folder and everything will run fine.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fixing Doom3 BFG Edition on multi-display setups</title>
      <link>https://afshari.lu/post/161-fixing-doom3/</link>
      <pubDate>Sat, 20 Jul 2013 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/161-fixing-doom3/</guid>
      <description>&lt;p&gt;I have a triple display setup with two 1080p monitors and a third 4:3 one, and I had some free time to kill, so I decided to give Doom3 BFG edition a try. The problem is that, for me it started full screen in a display that I didn’t want to play on, and in a screwed up resolution. As there are no helpful options in the settings menu, it was tricky to solve this issue, but finally I managed to fix it. So if you have this problem, here is the way to solve it:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Improved Auto-complete in Neat Console</title>
      <link>https://afshari.lu/post/160-improved-autocomplete-neat-console/</link>
      <pubDate>Mon, 23 Jul 2012 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/160-improved-autocomplete-neat-console/</guid>
      <description>&lt;p&gt;While working on my next project “Lumi,” I felt the need to improve the auto-complete feature of Neat game engine’s console. I fixed some bugs in the console and added a “custom auto-complete” feature that allows each command to have its own algorithm for TAB auto-complete. The Console.AddCommand now takes a third optional parameter which is the method that returns the auto-complete results for each command based on the arguments the user entered in the console.&lt;/p&gt;</description>
    </item>
    <item>
      <title>VimeoDotNet, available now for Metro!</title>
      <link>https://afshari.lu/post/159-vimeodotnet-metro/</link>
      <pubDate>Sun, 01 Jul 2012 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/159-vimeodotnet-metro/</guid>
      <description>&lt;p&gt;After lots of struggling, I managed to port the VimeoDotNet code to Windows Runtime and Metro platform. Developing Metro style applications is very frustrating for a long time .net developer and needs a lot of time to get used to it. Most of the familiar classes in .net that we were used to, are replaced with Windows Runtime classes in the Windows namespace. The old .net namespaces are still there, but are filled with nonsense.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Available Now: Vimeo for Windows Advanced Uploader</title>
      <link>https://afshari.lu/post/158-available-now-vfw-advanced-uploader/</link>
      <pubDate>Tue, 19 Jun 2012 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/158-available-now-vfw-advanced-uploader/</guid>
      <description>&lt;p&gt;Vimeo for Windows Advanced Uploader is now available as a free download. Some of its features are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Manual control over chunk size and the number of chunks, so users with fast and reliable connections can upload fewer and larger chunks and users with slow and unreliable connections can upload in smaller chunks.&lt;/li&gt;&#xA;&lt;li&gt;Parallel chunk uploading: Chunks can be uploaded in parallel to increase the upload speed.&lt;/li&gt;&#xA;&lt;li&gt;Control over the order of chunks for uploading&lt;/li&gt;&#xA;&lt;li&gt;Supports replacing existing videos&lt;/li&gt;&#xA;&lt;li&gt;Resume support&lt;/li&gt;&#xA;&lt;li&gt;Proxy support&lt;/li&gt;&#xA;&lt;li&gt;Multi-user support: OAuth Tokens and Upload Tickets can be stored in individual files and used when needed.&lt;/li&gt;&#xA;&lt;li&gt;Open source: You can download its source code and use it in your own applications&lt;/li&gt;&#xA;&lt;li&gt;It’s free!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Check out this page for more information.&lt;/p&gt;</description>
    </item>
    <item>
      <title>VimeoDotNet Updated</title>
      <link>https://afshari.lu/post/157-vimeodotnet-updated/</link>
      <pubDate>Fri, 15 Jun 2012 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/157-vimeodotnet-updated/</guid>
      <description>&lt;p&gt;The process of uploading videos to Vimeo might be a little confusing. The updated version of VimeoDotNet contains two new methods that take care of all upload steps. With these methods you can just tell them what file you want to upload, and they take care of the rest.&lt;/p&gt;&#xA;&lt;p&gt;To upload a file in a single part, you can use the &lt;code&gt;VimeoClient.Upload&lt;/code&gt; method:&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;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-c#&#34; data-lang=&#34;c#&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;string&lt;/span&gt; video_id = vc.Upload(&lt;span style=&#34;color:#e6db74&#34;&gt;@&amp;#34;D:\myvideo.mp4&amp;#34;&lt;/span&gt;);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the file is too big to fit entirely in the memory, you can use the second method &lt;code&gt;VimeoClient.UploadInChunks&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Introducing Kintouch</title>
      <link>https://afshari.lu/post/156-kintouch/</link>
      <pubDate>Tue, 29 May 2012 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/156-kintouch/</guid>
      <description>&lt;p&gt;I began adding Kinect skeletal tracking and speech helpers to Neat Game Engine since Kinect SDK Beta 2 came out. These helpers were made available under the KinectEngine class in the Neat.Components namespace. After the release of SDK v1.0, I began having troubles with using my Kinect, and I don’t know yet why these problems are happening. Often times when I’m trying to execute my code I get Low Bandwidth errors from the SDK, even with all my other USB devices disconnected. Maybe Kinect still doesn’t work fine on Windows 8 (I’m using Build 8250) or maybe it’s because I’m using an XBOX 360 Kinect hardware. Anyways, because of these annoying development problems I got bored of playing with Kinect until Kinect SDK v1.5 was released and I learned that it has facial tracking tools. Awesome. So I started playing with Kinect again and updated the Kinect code of Neat Game Engine to be compatible with SDK v1.5.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Speech and Skeletal Tracking in River Raid X</title>
      <link>https://afshari.lu/post/154-speech-skeletal-tracking/</link>
      <pubDate>Fri, 23 Dec 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/154-speech-skeletal-tracking/</guid>
      <description>&lt;p&gt;I’ve been experimenting with Speech SDK lately and was trying to find a way to control games with sounds. In this video, you can see me control River Raid X with Kinect skeletal tracking and voice.&lt;/p&gt;&#xA;&lt;p&gt;[vimeo http://www.vimeo.com/34110392 w=549&amp;amp;h=309]&lt;/p&gt;&#xA;&lt;p&gt;Helper classes for both Speech SDK and NUI (Kinect Natural User Interface) are implemented in the latest changeset of Neat Game Engine’s source code. Implementing voice commands in games for simple tasks such as starting the game, pausing and resuming it, etc. is not a difficult task, because Speech SDK easily handles these stuff with Grammars and other classes. What’s really interesting in controlling games with sounds is finding a natural place for them inside games. Things like finding the position of the sound source in 3D and finding use for “meaningless” voices inside the game is what makes voice integration in games really fun.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kinect SDK and XNA</title>
      <link>https://afshari.lu/post/153-kinect-sdk-xna/</link>
      <pubDate>Tue, 06 Dec 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/153-kinect-sdk-xna/</guid>
      <description>&lt;p&gt;It seems many people are looking for the way to draw skeletons and store the RGB camera data into Texture2Ds. The KinectEngine class which is included in Neat game engine does all these stuff, but here’s the direct way to do these in XNA:&lt;/p&gt;&#xA;&lt;h2 id=&#34;1-initialization&#34;&gt;1. Initialization&lt;/h2&gt;&#xA;&lt;p&gt;First we have to initialize the Nui Runtime. Assuming we are going to use the first available Kinect device connected to our system, we can write:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Kinectoid</title>
      <link>https://afshari.lu/post/152-kinectoid/</link>
      <pubDate>Wed, 23 Nov 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/152-kinectoid/</guid>
      <description>&lt;p&gt;The first Kinect-based sample for Neat game engine is available at &lt;a href=&#34;http://kinectoid.codeplex.com&#34;&gt;http://kinectoid.codeplex.com&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;To be able to build this sample, first you have to install the official Kinect SDK Beta 2 and obtain the latest version of the Neat source code and build it with the KINECT directive.&lt;/p&gt;&#xA;&lt;p&gt;Neat currently supports Kinect through a component class named KinectEngine. To begin using Kinect in your Neat based XNA games, you have to follow these simple steps:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Integrating Kinect into Neat Game Engine</title>
      <link>https://afshari.lu/post/151-integrating-kinect-into-neat/</link>
      <pubDate>Tue, 22 Nov 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/151-integrating-kinect-into-neat/</guid>
      <description>&lt;p&gt;I’ve been playing with the Kinect SDK lately and I managed to add Kinect support to Neat. Here’s a video of me, controlling the camera in Sectors with the Kinect sensor.&lt;/p&gt;&#xA;&lt;p&gt;[vimeo http://vimeo.com/32176359 w=549&amp;amp;h=309]&lt;/p&gt;</description>
    </item>
    <item>
      <title>New Releases</title>
      <link>https://afshari.lu/post/150-new-releases/</link>
      <pubDate>Wed, 16 Nov 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/150-new-releases/</guid>
      <description>&lt;p&gt;A few days ago I uploaded the final build of my Atari 2600’s River Raid clone to CodePlex and because it’s based on Neat game engine, I updated the Neat project as well. You can read more about the River Raid X project in its own page, so I’ll just talk about the new features of Neat in this new release right now.&lt;/p&gt;&#xA;&lt;p&gt;It has been a slow year and I didn’t have much time to work on games, so there aren’t that many new features in the new release of Neat Engine, however the code is much more polished and stable. Some of the new additions to Neat Engine are:&lt;/p&gt;</description>
    </item>
    <item>
      <title>VimeoDotNet just got cooler.</title>
      <link>https://afshari.lu/post/149-vimeodotnet-just-got-cooler/</link>
      <pubDate>Sat, 20 Aug 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/149-vimeodotnet-just-got-cooler/</guid>
      <description>&lt;p&gt;VimeoDotNet by far is the easiest and most complete Vimeo Advanced API wrapper for .NET. You could set it up to make your app communicate with Vimeo Advanced API in under five minutes. But since some of its OAuth code was based on another wrapper, it had some junk attached to itself, so to be able to use it you had to add two additional weird projects to your solution, which was unpleasant since they contained stuff that were practically useless.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Loading Transparent PNGs in OpenGL for Dummies!</title>
      <link>https://afshari.lu/post/148-loading-transparent-pngs/</link>
      <pubDate>Thu, 30 Jun 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/148-loading-transparent-pngs/</guid>
      <description>&lt;p&gt;I’m writing this because as far as I can remember,  nothing has taken my time this much. I woke up yesterday and began working on a PNG Importer for my new OpenGL/C++ based side scroller game engine which I’m going to use to make my first iOS games, and after tons of research I realized it’s three in the morning and I haven’t yet figured out how to load transparent PNGs in my game.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Download Vimeo for Windows</title>
      <link>https://afshari.lu/post/147-downloading-vimeo-for-windows/</link>
      <pubDate>Thu, 05 May 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/147-downloading-vimeo-for-windows/</guid>
      <description>&lt;p&gt;[vimeo http://www.vimeo.com/7032484 w=549&amp;amp;h=309]&lt;/p&gt;&#xA;&lt;p&gt;Vimeo for Windows 2.0 is now available for download. Check out this page for more details!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Vimeo Upload API</title>
      <link>https://afshari.lu/post/146-vimeo-upload-api/</link>
      <pubDate>Sat, 23 Apr 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/146-vimeo-upload-api/</guid>
      <description>&lt;p&gt;After playing with the Upload API for about two days, I managed to get all methods working and upload videos successfully to vimeo.&lt;/p&gt;&#xA;&lt;p&gt;The VimeoDotNet project is updated and contains all the code needed to upload videos to vimeo: &lt;a href=&#34;http://vimeodotnet.codeplex.com/&#34;&gt;http://vimeodotnet.codeplex.com/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;new-methods&#34;&gt;New Methods:&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;videos.upload&lt;/li&gt;&#xA;&lt;li&gt;videos.upload.checkTicket&lt;/li&gt;&#xA;&lt;li&gt;videos.upload.complete&lt;/li&gt;&#xA;&lt;li&gt;videos.upload.getQuota&lt;/li&gt;&#xA;&lt;li&gt;videos.upload.getTicket&lt;/li&gt;&#xA;&lt;li&gt;videos.upload.verifyChunks&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Vimeo for Windows 2.0 Update</title>
      <link>https://afshari.lu/post/145-vfw-2-update/</link>
      <pubDate>Tue, 12 Apr 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/145-vfw-2-update/</guid>
      <description>&lt;p&gt;A milestone is reached. I’m almost ready to publish the next version of Vimeo for Windows, and the engine that drives this application is available for download right now from &lt;a href=&#34;http://vimeodotnet.codeplex.com&#34;&gt;http://vimeodotnet.codeplex.com&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Vimeo API</title>
      <link>https://afshari.lu/post/144-vimeo-api/</link>
      <pubDate>Mon, 28 Mar 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/144-vimeo-api/</guid>
      <description>&lt;p&gt;About two years ago, I wrote “Vimeo for Windows” which was a Windows based client that allowed users to browse, watch and upload videos on vimeo.com.&lt;/p&gt;&#xA;&lt;p&gt;[vimeo http://www.vimeo.com/7032484]&lt;/p&gt;&#xA;&lt;p&gt;Few mounts later, Vimeo changed their authentication method to oAuth which made my application unusable. I didn’t have the time to implement oAuth back then, so I stopped working on the project.&lt;/p&gt;&#xA;&lt;p&gt;Now, I decided it’s time to move back to the project and make a version 2. I implemented almost every method there is in Vimeo’s Advanced API.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sectors World Designer</title>
      <link>https://afshari.lu/post/143-sectors-world-designer/</link>
      <pubDate>Mon, 07 Mar 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/143-sectors-world-designer/</guid>
      <description>&lt;p&gt;I’ve been working on a 2.5D game engine named Sectors for the last couple of months. The graphics are almost done and I’m coding the designer tool right now.&lt;/p&gt;&#xA;&lt;p&gt;Creating the level designer tool is taking more time that I thought. But it is definitely worth it to put more effort in perfecting the designer.&lt;/p&gt;&#xA;&lt;p&gt;The main part that creates and modifies sectors’ properties is functioning, and I’m going to work on the Walls. Right now a basic level can be created and previewed using this tool.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Neat Update</title>
      <link>https://afshari.lu/post/142-neat-update/</link>
      <pubDate>Sat, 29 Jan 2011 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/142-neat-update/</guid>
      <description>&lt;p&gt;Yesterday I published a new version of Neat game engine on it’s codeplex site. It has a bunch of cool new features including:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Improved auto-complete in the console&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Loading scripts into memory&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Scripts can be loaded into memory using the load script as … command and can be treated as dynamic commands&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Allowing different colors to be shown on the console&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Console output color can be changed by defining a special character as the color changer (Neat uses the @ character by default) and entering the specific color code after that. Custom colors can be defined in the run-time using c_setcolorcode command.&#xA;Colorful Console!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stand Alone Neat Console</title>
      <link>https://afshari.lu/post/141-stand-alone-neat-console/</link>
      <pubDate>Tue, 14 Dec 2010 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/141-stand-alone-neat-console/</guid>
      <description>&lt;p&gt;Today I made a few changes in Neat Console that allows it to be used outside a NeatGame class, as a stand alone component.&lt;/p&gt;&#xA;&lt;p&gt;So, here’s how you can use Neat Console independently:&lt;/p&gt;&#xA;&lt;p&gt;Create a regular Windows Game project.&lt;/p&gt;&#xA;&lt;p&gt;Add a reference to Neat. (you can either do that by adding Neat project to your solution or just using the binary file. you don’t need to add any of Neat’s content files to your game.)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Loops in Neat Script</title>
      <link>https://afshari.lu/post/140-loops-in-neat-script/</link>
      <pubDate>Fri, 10 Dec 2010 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/140-loops-in-neat-script/</guid>
      <description>&lt;p&gt;I recently implemented a bunch of new features in Neat Script and Console. Among these features are expression evaluation and conditions. These features make it possible to create loops in Neat Script files. here’s an example of a loop in Neat Script:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;echo off &#xD;&#xA;echo Testing loop &#xD;&#xA;dv l 1 &#xD;&#xA;:loop &#xD;&#xA;   echo (l)*(l)=((l)*(l)) &#xD;&#xA;   inc l &#xD;&#xA;if ((l)&amp;lt;=10) goto loop &#xD;&#xA;echo Done! &#xD;&#xA;echo on &#xD;&#xA;end&#xD;&#xA;&#xD;&#xA;neatloop&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;So basically this is how you can create loops in Neat Script:&lt;/p&gt;</description>
    </item>
    <item>
      <title>River Raid X</title>
      <link>https://afshari.lu/post/139-river-raid-x/</link>
      <pubDate>Mon, 22 Nov 2010 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/139-river-raid-x/</guid>
      <description>&lt;p&gt;Using XNA Game Studio and Neat Game engine, I managed to clone the classic River Raid game for Windows. You can download an almost-playable version of the game from it’s codeplex project page.&lt;/p&gt;&#xA;&lt;p&gt;Read on to learn how I did it…&lt;/p&gt;&#xA;&lt;p&gt;When I got started with XNA, I wanted to clone some of my favorite classic games. I made a list of games I wanted to clone, and in that list there was River Raid, an Atari 2600 game written by Carol Shaw, the first female video game designer.&lt;/p&gt;</description>
    </item>
    <item>
      <title>This is Neat!</title>
      <link>https://afshari.lu/post/138-this-is-neat/</link>
      <pubDate>Thu, 18 Nov 2010 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/138-this-is-neat/</guid>
      <description>&lt;p&gt;Each time XNA People release a new version of XNA Game Studio, I have to perform a massive change in my code to make it compatible with the latest version of the framework, and I decide to change the name of my little game engine. So what I used to call RedBulb has became XNA 4.0 compatible, and is cleaner than ever, and from now on It’s going to be called “Neat”.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Separating Axis Theorem (SAT)</title>
      <link>https://afshari.lu/post/137-sat/</link>
      <pubDate>Tue, 02 Nov 2010 12:00:00 +0000</pubDate>
      <guid>https://afshari.lu/post/137-sat/</guid>
      <description>&lt;p&gt;In the past few weeks I was working on a Rigid-Body 2D Physics Simulator, and I came across many problems in the Collision Detection part. Collision Detection is one of the most important things in any physics engine so it must work perfectly.&lt;/p&gt;&#xA;&lt;p&gt;After doing some research, I found the perfect algorithm to do the Collision Detection and Resolution for me, which is called SAT (short for Separating Axis Theorem)…&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
