<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Posts on yozy//NET</title>
    <link>https://yozy.net/posts/</link>
    <description>Recent content in Posts on yozy//NET</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 02 Apr 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://yozy.net/posts/feed.xml" rel="self" type="application/rss" />
    <item>
      <title>NeoVim plugin for visualising sentence length</title>
      <link>https://yozy.net/2026/04/neovim-plugin-for-visualising-sentence-length/</link>
      <pubDate>Thu, 02 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://yozy.net/2026/04/neovim-plugin-for-visualising-sentence-length/</guid>
      <description>&lt;div class=&#34;cw&#34;&gt;I used an LLM to generate the code for this plugin.&lt;/div&gt;&#xA;&lt;p&gt;I am trying to get better at writing. One of the recommendations I&amp;rsquo;ve read is&#xA;that varying the sentence length makes reading more enjoyable. Naturally, I&#xA;wanted to visualise this while writing. Coloring each sentence according to its&#xA;length, would make it possible to detect long blocks of same-length sentences;&#xA;they would be large uniformly colored blobs. Optionally also show the lengths&#xA;in a sidebar column.&lt;/p&gt;&#xA;&lt;p&gt;Since I use NeoVim for all of my writing, a Lua plugin would do just fine. So I&#xA;made one.&lt;/p&gt;&#xA;&lt;p&gt;Here is how it looks like, when ran on the source code for this very post:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/vim-prose-flow.png&#34; alt=&#34;Screenshot of vim-prose-flow&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Find it on GitHub&#xA;&lt;a href=&#34;https://github.com/jlegeny/vim-prose-flow&#34;&gt;jlegeny/vim-prose-flow&lt;/a&gt;&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;Although I use Source Hut for all of my code, for Lazy plugins it is&#xA;much easier to default to GitHub. You can also find the plugin at&#xA;&lt;a href=&#34;https://git.sr.ht/~yozy/vim-prose-flow/&#34;&gt;sr.ht&lt;/a&gt;.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Journaling on iOS With Shortcuts</title>
      <link>https://yozy.net/2026/03/journaling-on-ios-with-shortcuts/</link>
      <pubDate>Wed, 25 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://yozy.net/2026/03/journaling-on-ios-with-shortcuts/</guid>
      <description>&lt;p&gt;I want to keep a journal, I have three requirements:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The data must be stored as plain text and plain images on disk, that I own.&lt;/li&gt;&#xA;&lt;li&gt;The entries must be labelled with their creation timestamp, location, and&#xA;ideally weather information.&lt;/li&gt;&#xA;&lt;li&gt;I want to be able to create a journal entry from an image. The above&#xA;metadata should be loaded from the image.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;I started journaling with &lt;em&gt;Day One&lt;/em&gt;&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;. After it got sold I have lost faith&#xA;in its future. They also use a proprietary database with limited export options&#xA;which fails my condition &lt;strong&gt;1&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Apple&amp;rsquo;s Journal looked interesting, but it does not satisfy my conditions &lt;strong&gt;1&lt;/strong&gt;&#xA;and &lt;strong&gt;3&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I looked into self-hosted options:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Journiv&lt;/em&gt;&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt; — has a terrible frontend, uses a database instead of&#xA;markdown, has asinine features like &amp;ldquo;reflect now&amp;rdquo; that can not be turned off.&lt;/li&gt;&#xA;&lt;li&gt;Obsidian — would be great but does not support &lt;strong&gt;3&lt;/strong&gt; and requires their paid&#xA;sync service on iOS.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;diar---ios-shortcuts-for-authoring-journal-entries&#34;&gt;Diar - iOS shortcuts for authoring journal entries&lt;/h2&gt;&#xA;&lt;p&gt;When I squinted at my requirements I realized that what I need is a Hugo&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;&#xA;blog with a login and different syntax + some goodies, and a couple of iOS&#xA;shortcuts.&lt;/p&gt;&#xA;&lt;p&gt;I always start programming by defining my data structures. First, I&amp;rsquo;ve decided on the syntax of my entries:&lt;/p&gt;&#xA;&lt;p&gt;Since the only mandatory metadata is the timestamp, the obvious format is a&#xA;markdown file with the timestamp as filename and the entry in the text.&lt;/p&gt;&#xA;&lt;p&gt;For the other metadata I wanted something human readable and editable. I didn&amp;rsquo;t want to use a preamble like Hugo does.&lt;/p&gt;&#xA;&lt;p&gt;My solution is to add a footer using the &lt;code&gt;---&lt;/code&gt; markdown syntax for a horizontal&#xA;rule. Then use hashtags for tags, lines starting with &lt;code&gt;/images/&lt;/code&gt; for images,&#xA;location prefixed by @ and a simply parsed weather. If there is a line that&#xA;matches neither, it is interpreted as plain text location.&lt;/p&gt;&#xA;&lt;p&gt;E.g.: in a file named &lt;code&gt;2006-01-02T150405.md&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-markdown&#34; data-lang=&#34;markdown&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;This is an entry inside my journal, as you can observe it just starts as a plain text.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;You can use markdown. I only really use emphasis and blockquotes.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;---&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;/images/a-nice-illustration.jpg&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;#rhea #journaling&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gh&#34;&gt;&lt;/span&gt;Home, France&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;ni&#34;&gt;@48&lt;/span&gt;.8687162,2.2219584&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;17°C, Cloudy&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;All of the footer entries are optional.&lt;/p&gt;&#xA;&lt;p&gt;It was easy to create two shortcuts in iOS to:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Grab the current location, weather and address and write a new note with&#xA;current timestamp as filename with this information. Then open the file&#xA;immediately with &lt;em&gt;iA Writer&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Receive an image, use it&amp;rsquo;s exif to get the time and location. If the date is&#xA;today, grab the weather. Copy the image into the desired location, create&#xA;the note and open it in &lt;em&gt;iA Writer&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The advantage of handling images this way is that &lt;em&gt;iA Writer&lt;/em&gt; supports&#xA;displaying them in preview mode.&lt;/p&gt;&#xA;&lt;p&gt;For the first use case the shortcut looks like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/diar-text.png#@2x&#34; alt=&#34;Create a text entry using Diar&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;rhea---go-server-to-render-the-journal-in-a-nice-way&#34;&gt;Rhea - Go server to render the journal in a nice way&lt;/h2&gt;&#xA;&lt;p&gt;Since I knew Hugo was almost what I wanted, I decided to learn Go and write my&#xA;server.&lt;/p&gt;&#xA;&lt;p&gt;My design goes roughly this way:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Fully server-rendered html page.&lt;/li&gt;&#xA;&lt;li&gt;No static rendering, live-running server only.&lt;/li&gt;&#xA;&lt;li&gt;Single user, the login credentials are passed through environment.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The program should do the following.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;On startup look into the directory that contains the entries.&lt;/li&gt;&#xA;&lt;li&gt;Iterate over the entries.&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If the entry contains an image, generate a thumbnail for it if it hasn&amp;rsquo;t&#xA;been done and store it in a cache directory.&lt;/li&gt;&#xA;&lt;li&gt;If the entry contains a location, use MapBox to fetch the map, and store&#xA;it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Start watching the entries directory and update the in-memory representation&#xA;if anything is added or changed.&lt;/li&gt;&#xA;&lt;li&gt;Start a web server that serves:&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;/&lt;/code&gt; - At root show list of the first page of entries, show the location&#xA;map if the location changed from previous entry by more than 50km. Show&#xA;images as thumbnails.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;/after/TIMESTAMP&lt;/code&gt; and &lt;code&gt;/before/TIMESTAMP&lt;/code&gt; to serve a next/previous page.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;/memories/TIMESTAMP&lt;/code&gt; - Show a detailed entry with full size images and a&#xA;more detailed location map.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;/images&lt;/code&gt;, &lt;code&gt;/thumbails&lt;/code&gt;, &lt;code&gt;/tiles-ZOOM&lt;/code&gt;, &lt;code&gt;static&lt;/code&gt; -  Just serve the files.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;/login&lt;/code&gt; - Render this page if there is no valid session cookie set.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;And that&amp;rsquo;s about it. Cook this with some nice templates and a bit of CSS and we&#xA;have a journaling app.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/rhea.png#@2x&#34; alt=&#34;Rhea Screenshot&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you would like the source code feel free to ask, I am no longer publishing&#xA;my repositories publicly.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://dayoneapp.com/&#34;&gt;https://dayoneapp.com/&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.journiv.com/&#34;&gt;https://www.journiv.com/&lt;/a&gt; - looked promising but the setup is too&#xA;cumbersome.&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:3&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://gohugo.io&#34;&gt;https://gohugo.io&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:3&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>90&#39;s Hacker Movies Were Right</title>
      <link>https://yozy.net/2026/02/90s-hacker-movies-were-right/</link>
      <pubDate>Thu, 05 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://yozy.net/2026/02/90s-hacker-movies-were-right/</guid>
      <description>&lt;p&gt;Finally some good new has come out of the AI world.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://xcancel.com/steipete/status/2018073426720674137#m&#34;&gt;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/2026/openclaw-fiasco.png#@2x&#34; alt=&#34;&#34;&gt;&lt;figcaption&gt;Screenshot of a&#xA;conversation on Twitter, where OpenClaw&amp;rsquo;s developer whines about not being able&#xA;to stop malicious actors uploading malware to his&#xA;store.&lt;/figcaption&gt;&lt;/figure&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you thought piping curl to shell was bad, the AI crowd has decided to turn&#xA;the knob to 11.&lt;/p&gt;&#xA;&lt;p&gt;Thanks to the likes of Openclaw&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;, we will soon be able to hack anything and&#xA;everything, the way 90&amp;rsquo;s movies convinced us we could.&lt;/p&gt;&#xA;&lt;p&gt;And we will be able to do it basking in bespoke vibecoded UIs, as Operation&#xA;Swordfish has intended.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://openclaw.ai&#34;&gt;OpenClaw&lt;/a&gt; is a trojan horse you willingly install&#xA;on your computer so you (and everybody else) can control it using plain&#xA;language.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Swolog</title>
      <link>https://yozy.net/2026/01/swolog/</link>
      <pubDate>Fri, 02 Jan 2026 00:00:00 +0000</pubDate>
      <guid>https://yozy.net/2026/01/swolog/</guid>
      <description>&lt;p&gt;I started lifting 10 years ago using the Starting Strength 5x5 iOS app&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;. I&#xA;would still recommend it for beginners.&lt;/p&gt;&#xA;&lt;p&gt;Then when I switched programs to 6 day Push/Pull/Legs &lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;, I switched to a&#xA;paper notepad with just handwritten weights and reps like so:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/swolog/workout-log.jpg&#34; alt=&#34;Oldschool log&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Since my progression solely depended on the last time and the goal was to do&#xA;&amp;ldquo;moar&amp;rdquo;, with a 6 day split it was easy, just flip 3 pages before and compare.&lt;/p&gt;&#xA;&lt;p&gt;Eventually I started using multiple gyms, and didn&amp;rsquo;t have the notebook with me,&#xA;so I switched to a long note in the Notes.app on iOS. There the comparison to&#xA;previous time was more tedious, one had to scroll up and down.&lt;/p&gt;&#xA;&lt;p&gt;Naturally I made an app. I started by making it an iOS app, but quickly&#xA;abandoned that since I realized nobody will ever use it and I do not want to go&#xA;through the review process.&lt;/p&gt;&#xA;&lt;p&gt;Then I made it into a progressive web app.&lt;/p&gt;&#xA;&lt;p&gt;You can find it here: &lt;a href=&#34;https://apps.yozy.net/swolog/web&#34;&gt;https://apps.yozy.net/swolog/web&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note that I made this app for me. I am sharing it with the world since it is&#xA;based on many open source contributions. I am licensing it under AGPLv3, but I&#xA;provide no support, or would answer for any feature requests.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;I have used the &lt;a href=&#34;https://stronglifts.com/stronglifts-5x5/&#34;&gt;Stronglifts&lt;/a&gt;&#xA;app back around 2016, so I can&amp;rsquo;t say how it has evolved.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;I really like the 6 day split, even though these days I usually do it&#xA;over 2 weeks rather than a single one.&#xA;&lt;a href=&#34;https://www.muscleandstrength.com/workouts/6-day-powerbuilding-split-meal-plan&#34;&gt;Link&lt;/a&gt;&#xA;&lt;a href=&#34;https://web.archive.org/web/20251220134738/https://www.muscleandstrength.com/workouts/6-day-powerbuilding-split-meal-plan&#34;&gt;Archive&lt;/a&gt;&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Postmortem of Oral-B iO Series 8s Electric Toothbrush</title>
      <link>https://yozy.net/2025/12/postmortem-of-oral-b-io-series-8s-electric-toothbrush/</link>
      <pubDate>Mon, 08 Dec 2025 00:00:00 +0000</pubDate>
      <guid>https://yozy.net/2025/12/postmortem-of-oral-b-io-series-8s-electric-toothbrush/</guid>
      <description>&lt;p&gt;I bought this toothbrush almost exactly 4 years ago. It replaced my then 4 and&#xA;a half years old Oral-B PRO 3000 toothbrush. Today, the Series 8s is dead, due&#xA;to failed battery. This article is a little post-mortem, a review after the&#xA;whole lifetime of the product.&lt;/p&gt;&#xA;&lt;p&gt;Let us start with the good parts:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The toothbrush cleans teeth well.&lt;/li&gt;&#xA;&lt;li&gt;The best feature is that the pressure sensor not only indicates when too much&#xA;pressure is applied (all decent electric toothbrushes do this), but also&#xA;indicates when you do not apply enough pressure.&lt;/li&gt;&#xA;&lt;li&gt;You can customize the color of the LED and it has RGB, which is always great.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;However this is where the good parts end. The main problems with the device&#xA;are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It is expensive, and so are the replacement brushes.&lt;/li&gt;&#xA;&lt;li&gt;Its smart features are pure gimmick: the position tracking does not work and&#xA;&lt;em&gt;nobody&lt;/em&gt; needs to track their brushing frequency.&lt;/li&gt;&#xA;&lt;li&gt;The travel pocket is way too small to actually fit the toothbrush properly.&lt;/li&gt;&#xA;&lt;li&gt;It gunks up easily.&lt;/li&gt;&#xA;&lt;li&gt;Too many brushing modes make the menu tedious to use.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The battery is so bad it merits its own paragraph. The toothbrush became&#xA;unreliable after maybe two years of use. Randomly, in the morning it would drop&#xA;charge from 100% to 0, suggesting faulty electronics. Even at its best it would&#xA;not last through a 10 day trip.&lt;/p&gt;&#xA;&lt;h1 id=&#34;verdict&#34;&gt;Verdict&lt;/h1&gt;&#xA;&lt;p&gt;Do not buy this, and steer away from the iO line in general. Myself, I bought a&#xA;newer model from the PRO series for two reasons:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The battery in my old one still work and I use it when I go visit my&#xA;parents.&lt;/li&gt;&#xA;&lt;li&gt;You can now get off-brand cheap (and ecological) brushes for the from The&#xA;Humble Co.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
    </item>
    <item>
      <title>Re-evaluating Sports Science</title>
      <link>https://yozy.net/2025/10/re-evaluating-sports-science/</link>
      <pubDate>Thu, 16 Oct 2025 00:00:00 +0000</pubDate>
      <guid>https://yozy.net/2025/10/re-evaluating-sports-science/</guid>
      <description>&lt;p&gt;The last couple of weeks have been a whirl.&lt;/p&gt;&#xA;&lt;h1 id=&#34;recap&#34;&gt;Recap&lt;/h1&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Solomon Nelson&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; has published a &lt;a href=&#34;https://www.youtube.com/watch?v=elLI9PRn1gQ&#34;&gt;video essay tearing down Mike&#xA;Israetel&amp;rsquo;s PhD thesis&lt;/a&gt;&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Using Milo Wolf&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt; as a mouthpiece, Mike has made a &lt;a href=&#34;https://www.youtube.com/watch?v=qyahzQX7R6Q&#34;&gt;response video&#xA;&lt;/a&gt;. Mike claims that Solomon&#xA;has reviewed an old draft of the document. This draft was allegedly—by no&#xA;one&amp;rsquo;s mistake— uploaded &lt;em&gt;by Mike&lt;/em&gt; to the University&amp;rsquo;s servers. Milo has&#xA;read an alleged &amp;ldquo;much later version&amp;rdquo; where most of the mistakes were&#xA;corrected.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Jeff Nippard&lt;sup id=&#34;fnref:4&#34;&gt;&lt;a href=&#34;#fn:4&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;4&lt;/a&gt;&lt;/sup&gt; commented on Solomon&amp;rsquo;s critique with a truly ignorant&#xA;comment:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Bro was out here adding semicolons to mikes rough draft from 13 years&#xA;ago thinking he did something&lt;/p&gt;&#xA;&lt;p&gt;&amp;ndash; Jeff Nippard&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Greg Doucette&lt;sup id=&#34;fnref:5&#34;&gt;&lt;a href=&#34;#fn:5&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;5&lt;/a&gt;&lt;/sup&gt; has chimed in (because of course he did) &lt;a href=&#34;https://www.youtube.com/watch?v=_eG-BM9fmi8&#34;&gt;suspecting&#xA;that the &amp;ldquo;much later draft&amp;rdquo; was a&#xA;forgery&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;It turned out that the &amp;ldquo;much later version&amp;rdquo; was indeed a forgery and was&#xA;even older than the version that Solomon has reviewed. Mike Israetel&#xA;admitted this himself in an Instagram post.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;why-does-this-matter&#34;&gt;Why does this matter&lt;/h1&gt;&#xA;&lt;p&gt;We could dismiss what is happening here as your Tuesday YouTube drama. However,&#xA;I think that it has some larger impact.&lt;/p&gt;&#xA;&lt;p&gt;Sports science peer review is bottom of the barrel tier. The field is already&#xA;criticised for poor studies due to small sample sizes and bad methodology,&#xA;while needing to deal with extreme inter and intra subject variance Adding&#xA;abysmal review standards and the &amp;ldquo;science&amp;rdquo; label evaporates.&lt;/p&gt;&#xA;&lt;p&gt;Jeff Nippard&amp;rsquo;s behavior also makes it clear that scientific method plays a&#xA;second fiddle to the protection of the group.&lt;/p&gt;&#xA;&lt;p&gt;What I&amp;rsquo;m saying that &lt;em&gt;sports science is useless&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;h1 id=&#34;what-im-going-to-do&#34;&gt;What I&amp;rsquo;m going to do&lt;/h1&gt;&#xA;&lt;p&gt;With more studies are being published&lt;sup id=&#34;fnref:6&#34;&gt;&lt;a href=&#34;#fn:6&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;6&lt;/a&gt;&lt;/sup&gt; disproving previously touted&#xA;methods for optimizing training&lt;sup id=&#34;fnref:7&#34;&gt;&lt;a href=&#34;#fn:7&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;7&lt;/a&gt;&lt;/sup&gt;, I am going back to the tried and tested&#xA;methods of bros. Yes, bros have won.&lt;/p&gt;&#xA;&lt;h1 id=&#34;the-new-revised-training-recommendations&#34;&gt;The new, revised, training recommendations&lt;/h1&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Consistency&lt;/strong&gt; – Showing up day after day, month after month, year after&#xA;year is the only way to build reasonable amount of muscle.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Technique&lt;/strong&gt; – Can&amp;rsquo;t lift if you hurt yourself.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Close to Failure&lt;/strong&gt; – In order to grow muscle, the training &lt;em&gt;has to&lt;/em&gt; be&#xA;challenging.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Volume&lt;/strong&gt; – The more you train, the better the results. No &lt;em&gt;top end&lt;/em&gt; has&#xA;been found, keep your technique in check so you don&amp;rsquo;t get hurt.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;That&amp;rsquo;s it. Everything else (e.g.: progressive overload) is corollary of these&#xA;four basic steps&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;Solomon Nelson is a fitness coach and influencer, he is in cahoots&#xA;with Lyle Mcdonald.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;Dr. Mike Israetel is a sports science fitness influencer with a very&#xA;large following.&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:3&#34;&gt;&#xA;&lt;p&gt;Dr. Milo Wolf is a sports science based fitness influencer that often&#xA;works with Mike.&amp;#160;&lt;a href=&#34;#fnref:3&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:4&#34;&gt;&#xA;&lt;p&gt;Jeff Nippard is the most influential &lt;em&gt;natural&lt;/em&gt; sports-science-based&#xA;influencer.&amp;#160;&lt;a href=&#34;#fnref:4&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:5&#34;&gt;&#xA;&lt;p&gt;Greg Doucette is a supplement peddler, fitness coach and IFBB Pro that&#xA;likes to scream a lot. He hates Mike Israetel.&amp;#160;&lt;a href=&#34;#fnref:5&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:6&#34;&gt;&#xA;&lt;p&gt;The irony of using scientific studies to dump on science is not lost&#xA;to me.&amp;#160;&lt;a href=&#34;#fnref:6&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:7&#34;&gt;&#xA;&lt;p&gt;Recently a study has show that time under tension does not matter.&#xA;Which means that slow eccentrics are no better than quick ones.&amp;#160;&lt;a href=&#34;#fnref:7&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Caesar Salad</title>
      <link>https://yozy.net/2023/12/caesar-salad/</link>
      <pubDate>Wed, 27 Dec 2023 01:03:59 +0100</pubDate>
      <guid>https://yozy.net/2023/12/caesar-salad/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/caesar-salad/caesar-salad@2x.jpg#+right+margin&#34; alt=&#34;salad&#34; title=&#34;Photo of a caesar salad serving.&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Years ago there was this iPad app called &amp;ldquo;The Best Ceasar&amp;rdquo;, some bloke thought it was a good idea to make one whole app just about one recipe&amp;hellip; he was right. The app is long gone but here is the gist of the recipe as far as I remember it.&lt;/p&gt;&#xA;&lt;h1 id=&#34;dressing&#34;&gt;Dressing&lt;/h1&gt;&#xA;&lt;h2 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Anchovies&lt;/li&gt;&#xA;&lt;li&gt;Garlic&lt;/li&gt;&#xA;&lt;li&gt;Worcestershire Sauce&lt;/li&gt;&#xA;&lt;li&gt;Red Wine Vinegar&lt;/li&gt;&#xA;&lt;li&gt;Olive Oil&lt;/li&gt;&#xA;&lt;li&gt;Parmesan Cheese&lt;/li&gt;&#xA;&lt;li&gt;Salt&lt;/li&gt;&#xA;&lt;li&gt;Pepper&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;preparation&#34;&gt;Preparation&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Smash the anchovies in a bowl into a fine paste.&lt;/li&gt;&#xA;&lt;li&gt;Press in 3 cloves of garlic.&lt;/li&gt;&#xA;&lt;li&gt;Add a dash of olive oil (depending on how oily your anchovies are).&lt;/li&gt;&#xA;&lt;li&gt;Add a table spoon of Worcestershire sauce.&lt;/li&gt;&#xA;&lt;li&gt;Add a table spoon of red wine vinegar.&lt;/li&gt;&#xA;&lt;li&gt;Add salt and pepper to taste.&lt;/li&gt;&#xA;&lt;li&gt;Mix it all together.&lt;/li&gt;&#xA;&lt;li&gt;Add in parmesan to obtain a thick-ish dressing.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;croutons&#34;&gt;Croutons&lt;/h1&gt;&#xA;&lt;h2 id=&#34;ingredients-1&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Bread&lt;/li&gt;&#xA;&lt;li&gt;Olive Oil&lt;/li&gt;&#xA;&lt;li&gt;Garlic&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;preparation-1&#34;&gt;Preparation&lt;/h2&gt;&#xA;&lt;p&gt;My current go-to recipe is to:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Press garlic into a bowl of olive oil.&lt;/li&gt;&#xA;&lt;li&gt;Baste bread slices with the garlic oil.&lt;/li&gt;&#xA;&lt;li&gt;Put the slices in an oven until crispy.&lt;/li&gt;&#xA;&lt;li&gt;Cut the toasted bread into croutons.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;chicken&#34;&gt;Chicken&lt;/h1&gt;&#xA;&lt;h2 id=&#34;ingredients-2&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Chicken Breast&lt;/li&gt;&#xA;&lt;li&gt;Salt&lt;/li&gt;&#xA;&lt;li&gt;Pepper&lt;/li&gt;&#xA;&lt;li&gt;Olive Oil&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;preparation-2&#34;&gt;Preparation&lt;/h2&gt;&#xA;&lt;p&gt;If the chicken breast is thicker than about 15mm, cut it in half (to make it thinner).&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Pre-heat the oven to 200ºC (or 180 with fan on).&lt;/li&gt;&#xA;&lt;li&gt;Salt and pepper the chicken.&lt;/li&gt;&#xA;&lt;li&gt;Put some olive oil in a pan and heat it at high temperature.&lt;/li&gt;&#xA;&lt;li&gt;Sear the chicken on all sides until golden on the outside.&lt;/li&gt;&#xA;&lt;li&gt;Put the chicken in the oven, cook until the inner temperature is a bit under 75ºC.&lt;/li&gt;&#xA;&lt;li&gt;Dice the chicken.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;serving&#34;&gt;Serving&lt;/h1&gt;&#xA;&lt;p&gt;Wash and dry (as much as you can) a couple of heads of romaine lettuce. Add the dressing and toss it properly. Mix in the chicken and croutons, toss it again, sprinkle with more grated parmesan.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to Get the Local IP Address of an Apple Watch</title>
      <link>https://yozy.net/2021/10/how-to-get-the-local-ip-address-of-an-apple-watch/</link>
      <pubDate>Tue, 12 Oct 2021 12:03:48 +0200</pubDate>
      <guid>https://yozy.net/2021/10/how-to-get-the-local-ip-address-of-an-apple-watch/</guid>
      <description>&lt;p&gt;The Apple Watch does not display its local IP address in the settings for some&#xA;reason. Here is one way to get it, if you have a second Mac on the network.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open terminal on the mac, run &lt;code&gt;python -m SimpleHTTPServer&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Get your Mac&amp;rsquo;s local IP address (option+click on the network icon in the&#xA;toolbar).&lt;/li&gt;&#xA;&lt;li&gt;Send yourself an iMessage with text &lt;code&gt;http://YOUR_MACS_IP:8000&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Turn WiFi off on your iPhone. This is important because the Apple Watch&#xA;can use your phone&amp;rsquo;s WiFi.&lt;/li&gt;&#xA;&lt;li&gt;Open Messages on your watch, find the message, tap on the link.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;In the terminal on your Mac you will see something like&#xA;&lt;code&gt;192.168.0.21 - - [12/Oct/2021 12:00:00] &amp;quot;GET / HTTP/1.1&amp;quot; 200 -&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;And there you have your Watch&amp;rsquo;s IP address.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Carrot Spice Muffins</title>
      <link>https://yozy.net/2021/05/carrot-spice-muffins/</link>
      <pubDate>Sat, 08 May 2021 17:09:24 +0200</pubDate>
      <guid>https://yozy.net/2021/05/carrot-spice-muffins/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been trying baking lately but making a large cake badly and then eating it isn&amp;rsquo;t much fun. Here is a recipe for a great muffin instead:&lt;/p&gt;&#xA;&lt;h1 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h1&gt;&#xA;&lt;p&gt;I&amp;rsquo;m using espresso cups for measurement, these doses are for four small muffins. Multiply as necessary.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/carrot-spice-muffins/ingredients.jpg&#34; alt=&#34;ingredients&#34; title=&#34;Required ingredients&#34;&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;One and half cup of plain wheat flour&lt;/li&gt;&#xA;&lt;li&gt;One cup of brown sugar&lt;/li&gt;&#xA;&lt;li&gt;One cup of grated carrots&lt;/li&gt;&#xA;&lt;li&gt;About 25g of unsalted butter, softened at room temperature&lt;/li&gt;&#xA;&lt;li&gt;A spoonful of apple sauce&lt;/li&gt;&#xA;&lt;li&gt;One teaspoon of cake spices—this one in particular is a mix of dried orange, cassia, ginger, nutmeg and caraway from M&amp;amp;S&lt;/li&gt;&#xA;&lt;li&gt;One large egg (separate yolk from white)&lt;/li&gt;&#xA;&lt;li&gt;One teaspoon of baking powder&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;preparation&#34;&gt;Preparation&lt;/h1&gt;&#xA;&lt;p&gt;Start by mixing the dry ingredients (flour, sugar, spices and baking powder) together.&lt;/p&gt;&#xA;&lt;aside class=&#34;note&#34;&gt;Note: I have noted that most recipes on the web are light on spices, saying you should use a teaspoon for a cake for 12 people. Don&#39;t do that—be generous.&lt;/aside&gt;&#xA;&lt;p&gt;Add butter, apple sauce, and egg yolk. Mix thoroughly together until you have a consistent batter.&lt;/p&gt;&#xA;&lt;p&gt;Whip up the egg whites into snow.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/carrot-spice-muffins/batter.jpg&#34; alt=&#34;batter&#34; title=&#34;Prepared batter and egg white snow&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Progressively add the snow into the batter, carefully mixing them together.&lt;/p&gt;&#xA;&lt;p&gt;Pour the mix into small muffin forms.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/carrot-spice-muffins/poured.jpg&#34; alt=&#34;poured&#34; title=&#34;Batter ready go to into the oven&#34;&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;cooking&#34;&gt;Cooking&lt;/h1&gt;&#xA;&lt;p&gt;Preheat the oven to 180°C. Bake for 20 minutes at 180ºC (with convection on).&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/carrot-spice-muffins/muffins.jpg&#34; alt=&#34;muffins&#34; title=&#34;Muffins ready to be eaten&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Abusing the SwiftUI Switch Statement</title>
      <link>https://yozy.net/2020/10/abusing-the-swiftui-switch-statement/</link>
      <pubDate>Wed, 28 Oct 2020 11:34:30 +0100</pubDate>
      <guid>https://yozy.net/2020/10/abusing-the-swiftui-switch-statement/</guid>
      <description>&lt;p&gt;My now preferred way of handling complex if/else statements inside a SwiftUI view:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;fileprivate&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;ReminderTime&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;View&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;date&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Date&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Reminder&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;some&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;View&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;switch&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dueDate&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Reminder.Time.Nil&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Calendar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;current&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;compare&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dueDate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;!,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;to&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;date&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;toGranularity&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;day&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;orderedAscending&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;isCompleted&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Reminder.Time.Done&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;  &lt;span class=&#34;s&#34;&gt;&amp;#34;Reminder.Time.Overdue&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;isAllDay&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Calendar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;current&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;isDate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;date&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;inSameDayAs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dueDate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;!):&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Reminder.Time.Today&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;isAllDay&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dueDate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;!,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;date&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;isCompleted&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;date&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dueDate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;!:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;HStack&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;Image&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;systemName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;exclamationmark.triangle&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dueDate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;!,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;Text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reminder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dueDate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;!,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At least until the &lt;code&gt;if let&lt;/code&gt; construct will work.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Storing Colors in Core Data—The Whole Story</title>
      <link>https://yozy.net/2020/10/storing-colors-in-core-datathe-whole-story/</link>
      <pubDate>Sun, 04 Oct 2020 01:46:42 +0200</pubDate>
      <guid>https://yozy.net/2020/10/storing-colors-in-core-datathe-whole-story/</guid>
      <description>&lt;p&gt;The task: Store colors (&lt;code&gt;Color&lt;/code&gt;, &lt;code&gt;UIColor&lt;/code&gt; and &lt;code&gt;CGColor&lt;/code&gt;) in Core Data, while remaining 100% compatible with the SwiftUI color picker.&lt;/p&gt;&#xA;&lt;h1 id=&#34;setting-up-the-core-data-model&#34;&gt;Setting Up the Core Data Model&lt;/h1&gt;&#xA;&lt;p&gt;In your model add an attribute to your entity and set its type to &lt;em&gt;Transformable&lt;/em&gt;. Select it and in the Data Model Inspector (right pane in Xcode, last tab) set the &lt;em&gt;Transformer&lt;/em&gt; to &amp;ldquo;SerializableColorTransformer&amp;rdquo; and &lt;em&gt;Custom Class&lt;/em&gt; to &amp;ldquo;SerializableColor&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;These two strings are magic values, and I&amp;rsquo;ll explain their origin later.&lt;/p&gt;&#xA;&lt;p&gt;The whole thing should look like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/core-data-colors-xcode.png&#34; alt=&#34;ss-xcode-data-model&#34;&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;code-implementation&#34;&gt;Code Implementation&lt;/h1&gt;&#xA;&lt;p&gt;Core Data has several requirements on what &lt;em&gt;can&lt;/em&gt; be stored. It has to be &lt;code&gt;NSCoding&lt;/code&gt; or &lt;code&gt;NSSecureCoding&lt;/code&gt;. This in turn means that it has to be an Obj-C class. This rules out both &lt;code&gt;CGColor&lt;/code&gt; (a non-Obj-c class) and &lt;code&gt;Color&lt;/code&gt; (a struct).&lt;/p&gt;&#xA;&lt;p&gt;In my case I don&amp;rsquo;t care about color spaces other than P3 and sRGB. Let us create a class that stores red, green, blue and alpha components and a color space. The class will transform any color space other than P3 into sRGB.&lt;/p&gt;&#xA;&lt;p&gt;Here is the whole listing for the class, which I called &lt;code&gt;SerializableColor&lt;/code&gt;. This is where the magic string for &lt;em&gt;Custom Class&lt;/em&gt; in the previous section comes from.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// SerializableColor.swift&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Foundation&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;CoreGraphics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;CGFloat&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;CoreGraphics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;CGColor&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;CoreGraphics&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;CGColorSpace&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;UIKit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;UIColor&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;SwiftUI&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;Color&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;SerializableColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSObject&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSCoding&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSSecureCoding&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;static&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;supportsSecureCoding&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Bool&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;enum&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;SerializableColorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Int&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sRGB&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;displayP3&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;colorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SerializableColorSpace&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;encode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;with&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSCoder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;encode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rawValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;colorSpace&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;encode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;red&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;encode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;green&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;encode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;blue&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;encode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;alpha&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;required&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSCoder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SerializableColorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rawValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;decodeInteger&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;colorSpace&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;??&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sRGB&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;r&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;decodeFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;red&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;g&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;decodeFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;green&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;decodeFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;blue&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;decodeFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;forKey&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;alpha&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SerializableColorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;red&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;green&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;r&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;red&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;g&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;green&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blue&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;convenience&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cgColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;colorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SerializableColorSpace&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sRGB&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;components&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// Transform the color into sRGB space&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cgColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGColorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;displayP3&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;p3components&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cgColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;components&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?.&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;         &lt;span class=&#34;n&#34;&gt;cgColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;numberOfComponents&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;displayP3&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;components&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;p3components&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;sRGB&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGColorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGColorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sRGB&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;         &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;sRGBColor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cgColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;converted&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;to&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sRGB&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;intent&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;defaultIntent&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;         &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;sRGBcomponents&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sRGBColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;components&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?.&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;         &lt;span class=&#34;n&#34;&gt;sRGBColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;numberOfComponents&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;components&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;sRGBcomponents&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;red&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;components&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;green&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;components&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;components&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;components&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;convenience&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;from&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;convenience&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;uiColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;from&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;uiColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cgColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;cgColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGColor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;uiColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cgColor&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Color&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;uiColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;uiColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIColor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;colorSpace&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;displayP3&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;displayP3Red&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;green&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;red&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;green&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;blue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;b&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// &lt;/span&gt;&lt;span class=&#34;cs&#34;&gt;MARK:&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt; Transformer Class&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// For CoreData compatibility.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;@objc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SerializableColorTransformer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;SerializableColorTransformer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSSecureUnarchiveFromDataTransformer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;allowedTopLevelClasses&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;AnyClass&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;super&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;allowedTopLevelClasses&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SerializableColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;allowsReverseTransformation&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Bool&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;transformedValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;_&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Any&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Any&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;guard&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;value&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;as&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Data&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;try&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;!&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSKeyedUnarchiver&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;unarchivedObject&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ofClass&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SerializableColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;from&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;reverseTransformedValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;_&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Any&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Any&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;guard&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;color&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;value&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;as&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SerializableColor&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;try&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;!&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSKeyedArchiver&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;archivedData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;withRootObject&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;requiringSecureCoding&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The important parts are described as follows.&lt;/p&gt;&#xA;&lt;p&gt;To register the transformer (explained below), add this line to the &lt;code&gt;init()&lt;/code&gt; method of your &lt;code&gt;@main&lt;/code&gt;. For example&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;main&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Eventail_v4App&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;App&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// ...&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;ValueTransformer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;setValueTransformer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;SerializableColorTransformer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;forName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSValueTransformerName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;rawValue&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;SerializableColorTransformer&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// ...&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;rawValue&lt;/code&gt; is where the &lt;em&gt;Transformer&lt;/em&gt; magic string in the model come from.&lt;/p&gt;&#xA;&lt;h2 id=&#34;deeper-dive&#34;&gt;Deeper dive&lt;/h2&gt;&#xA;&lt;p&gt;Instead of commenting the file excessively, here are explanations of details.&lt;/p&gt;&#xA;&lt;h3 id=&#34;nscoding-inheritance&#34;&gt;NSCoding inheritance&lt;/h3&gt;&#xA;&lt;p&gt;For this we implement &lt;code&gt;encode(with coder: NSCoder)&lt;/code&gt; and &lt;code&gt;init?(coder: NSCoder)&lt;/code&gt;. These methods will enable the class to be serialized and deserialized using any standard decoder/encoder.&lt;/p&gt;&#xA;&lt;p&gt;Note: As you can see this class will interpret any unknown color space as sRGB, this means that this is not backwards compatible.&lt;/p&gt;&#xA;&lt;h3 id=&#34;color-space-transformations&#34;&gt;Color space transformations&lt;/h3&gt;&#xA;&lt;p&gt;These happen in two places. When encoding the value, the class always passes through CGColor as this is the only color type that can be split into components.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Note: In init from &lt;code&gt;Color&lt;/code&gt; I bounce through init from &lt;code&gt;UIColor&lt;/code&gt;, this is because weirdly &lt;code&gt;Color.blue.cgColor == nil&lt;/code&gt; but &lt;code&gt;UIColor(Color.blue).cgColor&lt;/code&gt; has a value.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;For deserialization I always pass through &lt;code&gt;UIColor&lt;/code&gt; as this type has convenience initializers for both sRGB and P3 colorspaces.&lt;/p&gt;&#xA;&lt;h3 id=&#34;transformer&#34;&gt;Transformer&lt;/h3&gt;&#xA;&lt;p&gt;Core Data can write only a few basic types, including &lt;code&gt;NSData&lt;/code&gt;. Transformers are classes that can be registered for specific types and transform them into, and from &lt;code&gt;NSData&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In order to implement a transformer you need to do three things:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Write a class which inherits from &lt;code&gt;NSSecureUnarchiveFromDataTransformer&lt;/code&gt; and overrides the &lt;code&gt;allowedTopLevelClasses&lt;/code&gt; class variable adding your &lt;em&gt;class type&lt;/em&gt; to the list&lt;/li&gt;&#xA;&lt;li&gt;Override the &lt;code&gt;transformedValue&lt;/code&gt; and &lt;code&gt;reverseTransformedValue&lt;/code&gt; methods. These are named as seen from CoreData perspective.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;transformedValue&lt;/code&gt; transforms &lt;code&gt;NSData&lt;/code&gt; into your class, in this case &lt;code&gt;SerializableColor&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;reverseTransformedValue&lt;/code&gt; transforms the class into &lt;code&gt;NSData&lt;/code&gt;. You do not need to implement this method if you are never writing to CoreData yourself. In this case change the return value of &lt;code&gt;allowsReverseTransformation&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Register the transformer in your &lt;code&gt;@main&lt;/code&gt; somewhere.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;aside class=&#34;warning&#34;&gt;&#xA;Important: Do not forget to register the class!&#xA;&lt;/aside&gt;</description>
    </item>
    <item>
      <title>Creating Sf Symbols with Affinity Designer</title>
      <link>https://yozy.net/2020/07/creating-sf-symbols-with-affinity-designer/</link>
      <pubDate>Sat, 18 Jul 2020 19:54:10 +0200</pubDate>
      <guid>https://yozy.net/2020/07/creating-sf-symbols-with-affinity-designer/</guid>
      <description>&lt;p&gt;Creating SF Symbols is supposed to be easy. Create a template using SFSymbols app. Modify the SVG and import in Xcode. It is all documented &lt;a href=&#34;https://developer.apple.com/documentation/uikit/uiimage/creating_custom_symbol_images_for_your_app&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;SFSymbols template requires you to manually create and adjust images for all weights and sizes. This is fine if your image has lines that need to follow the weight. Many of them don&amp;rsquo;t or could auto scale.&lt;/p&gt;&#xA;&lt;p&gt;Nevertheless I&amp;rsquo;ve made this Affinity Designer template that you can use. Open it, edit the one symbol it contains (called Template) and you are all set.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/affinity-sfsymbols.png&#34; alt=&#34;ss-affinity&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/sfsymbol-template.afdesign&#34;&gt;⬇ sfsymbol-template.afdesign&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately although Affinity Designer produces a perfectly valid SVG—and it will get validated by SFSymbols—Xcode does not like it.&lt;/p&gt;&#xA;&lt;p&gt;This is what Affinity exports:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-xml&#34; data-lang=&#34;xml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;g&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;transform=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;matrix(1.22074,0,0,1.22074,498.674,600.389)&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nt&#34;&gt;&amp;lt;g&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Ultralight-S&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is what Xcode wants:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-xml&#34; data-lang=&#34;xml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;g&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;Ultralight-S&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;transform=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;matrix(1.22074,0,0,1.22074,498.674,600.389)&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;&amp;gt;&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Alright, let&amp;rsquo;s do Perl:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-perl&#34; data-lang=&#34;perl&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;ch&#34;&gt;#!/usr/bin/perl&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;my&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$file&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$ARGV&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;open&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FILE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$file&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;or&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;die&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Failed to open file: $!&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;vg&#34;&gt;$/&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;undef&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;my&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$xml&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;&amp;lt;FILE&amp;gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;close&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FILE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;my&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;@weight&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;s&#34;&gt;&amp;#34;Ultralight&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Thin&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Light&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Regular&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Medium&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;s&#34;&gt;&amp;#34;Semibold&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Bold&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Heavy&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Black&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;my&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;@size&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;S&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;M&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;L&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;my&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$w&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;@weight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;my&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$s&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;@size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$xml&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=~&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;s/&amp;lt;g (transform=[^&amp;gt;]+?)&amp;gt;\s+&amp;lt;g (id=&amp;#34;$w-$s&amp;#34;)&amp;gt;(.*?)&amp;lt;\/g&amp;gt;/&amp;lt;g \2 \1&amp;gt; \3/s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;print&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$xml&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;\n&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will finally transform the SVG into a format that Xcode will swallow.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/fix-sfsymbol.perl&#34;&gt;⬇ fix-sfsymbol.perl&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Tricking Programmers Into Being Helpful</title>
      <link>https://yozy.net/2020/05/tricking-programmers-into-being-helpful/</link>
      <pubDate>Fri, 08 May 2020 16:30:00 +0200</pubDate>
      <guid>https://yozy.net/2020/05/tricking-programmers-into-being-helpful/</guid>
      <description>&lt;p&gt;People&lt;a href=&#34;https://stackoverflow.blog/2018/04/26/stack-overflow-isnt-very-welcoming-its-time-for-that-to-change/&#34;&gt;[1]&lt;/a&gt; accuse Stack Overflow of being unwelcoming to newbies. Older programmers complain that the site quality has decreased because of the influx of low quality questions.&lt;/p&gt;&#xA;&lt;p&gt;I am part of the latter crowd. I expect that if I give out my time to help somebody, they will reciprocate and invest time into understanding the problem and redact a concise question. Unfortunately when one goes through review queues on Stack Overflow, a good portion of the asked question is copy pasted textbook exercises.&lt;/p&gt;&#xA;&lt;p&gt;Here is a thought:&lt;/p&gt;&#xA;&lt;p&gt;Even though answering computer puzzles is annoying on a Q/A website, there is a whole bunch of websites specializing in just that—interview preparation courses.&lt;/p&gt;&#xA;&lt;p&gt;What if we mixed the two? Imagine a service that gives you short programming challenges. Except these would be generated from low effort Stack Overflow questions&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;. Posted solutions would get sent to Stack Overflow until an answer is accepted. After that the question would stay up, but answers would no longer propagate as we don&amp;rsquo;t want to spam the Stack Overflow questions.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;Maybe only in part. Ideally the service would have more structured problems too.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Staying in Shape During Lockdown</title>
      <link>https://yozy.net/2020/05/staying-in-shape-during-lockdown/</link>
      <pubDate>Fri, 01 May 2020 15:00:00 +0200</pubDate>
      <guid>https://yozy.net/2020/05/staying-in-shape-during-lockdown/</guid>
      <description>&lt;p&gt;The thing I miss the most from times before the lockdown is my Gym. After years of not being able to stick to any sport I have managed to find my thing, and that was weight lifting with few exercises that don&amp;rsquo;t change often. This allowed me to concentrate on the form and most importantly: see the progression.&lt;/p&gt;&#xA;&lt;p&gt;Nowadays, I struggle to get motivated to move. At first I took up running but then they banned that too in normal hours. I took up &lt;a href=&#34;https://www.amazon.fr/Convict-Conditioning-Weakness-Using-Survival-Strength/dp/0938045768&#34;&gt;Convict Conditioning&lt;/a&gt; again a bit, which is an interesting book, and also got recommended the &lt;a href=&#34;https://darebee.com/no-equipment-workouts.html&#34;&gt;darebee&lt;/a&gt; site. But both of these have the same issue, the progression can only really be measured in the number of repetitions or sets, and that just does not really work for me. I still do the work, because one must, but not nearly enough to keep the blood pumping.&lt;/p&gt;&#xA;&lt;p&gt;So I took up a game I played &lt;em&gt;a lot&lt;/em&gt; 10-15 years ago—Stepmania.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/ddr-at-home/setup.jpg#+third+right+margin&#34; alt=&#34;ddr-setup&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Stepmania is the open source program that is compatible with data for Dance Dance Revolution, the first game in the genre. Back in the day I was one of the first members of the DDR.SK&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; organization that promoted machine dance games in Slovakia, and organised a few tournaments. Stepmania was also base of various commercial iterations such as In The Groove or Mungyodance. The great thing about all these is that the data is compatible, so it is now possible to shove it all into one program and play.&lt;/p&gt;&#xA;&lt;p&gt;The great thing about Stepmania is that the progression is clear: you either finished a song or not, and you have a score. The game itself is quite a bit more physical than your Sunday jog, so it&amp;rsquo;s also perfect for me.&lt;/p&gt;&#xA;&lt;p&gt;I am unsure if I will continue playing after the confinement, but I am glad that I still have the mat and a physical activity that is not a chore.&lt;/p&gt;&#xA;&lt;p&gt;I lost quite a bit of practice and speed but luckily it&amp;rsquo;s like biking, it eventually comes back.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/ddr-at-home/anthem.jpg&#34; alt=&#34;ddr-anthem&#34;&gt;&lt;/p&gt;&#xA;&lt;c-clear/&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;Since then it was bought and merged into another org.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>How to get into a junior position and keep it</title>
      <link>https://yozy.net/2020/04/how-to-get-into-a-junior-position-and-keep-it/</link>
      <pubDate>Wed, 29 Apr 2020 08:00:00 +0200</pubDate>
      <guid>https://yozy.net/2020/04/how-to-get-into-a-junior-position-and-keep-it/</guid>
      <description>&lt;p&gt;You are fresh out of school looking for your first job, maybe you have done an internship or have some other first experience. The most impressive thing on your resume is still sitting in the Education section. You might be asking yourself: &amp;ldquo;How do I stand out?&amp;rdquo;&lt;/p&gt;&#xA;&lt;h1 id=&#34;be-familiar-with-what-you-are-selling&#34;&gt;Be familiar with what you are selling&lt;/h1&gt;&#xA;&lt;p&gt;One thing people often do, is to pad their resume with every school project and tech they had a course on. This is understandable: what else should they be talking about, right? Not everybody has side projects that are in line with their career choices.&lt;/p&gt;&#xA;&lt;p&gt;Although I disrelish sifting through pages of resumes, I don&amp;rsquo;t get too worked up about it. Unless the position you are applying to is massively coveted and the company will receive hundreds or applications, people responsible for picking candidates will sit through it. I know I did.&lt;/p&gt;&#xA;&lt;p&gt;Now here is the principal thing:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Only mention projects and tech that you are confortable discussing &lt;strong&gt;at length&lt;/strong&gt;, and &lt;strong&gt;in detail&lt;/strong&gt;.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Reading a three page resume is a chore but can be done in a couple of minutes. A candidate in the room, however, deserves attention for at least half an hour. The job of the interviewer is to learn about the candidate and find out if they will fit the company and be productive. With nothing but the resume to grasp on, the conversation naturally gravitates towards the mentioned projects. So if I ask you what was your role during a particular project, what were the challenges, or what did you like or dislike when using a particular tech, you&amp;rsquo;d better have an answer ready.&lt;/p&gt;&#xA;&lt;h1 id=&#34;understand-things-before-tearing-them-apart&#34;&gt;Understand things before tearing them apart&lt;/h1&gt;&#xA;&lt;p&gt;There is a large chance you will be recruited as a part of a team. You may have read a lot about 10x developers but don&amp;rsquo;t pay too much attention to that. Most software is not written by superstars&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Personality is something that will be evaluated during the probation period. A good personality indicator for coders is the manner  how they approach an existing code base. Usually the first (and second&amp;hellip; probably the third too) impression is that the code &lt;em&gt;sucks&lt;/em&gt;. This is for two reasons: First is because it was written by people. Second is for you to discover. And I mean this quite literally.&lt;/p&gt;&#xA;&lt;p&gt;Before spewing expletives ask your colleagues to explain why the code works the way it does, why is it structured as it is and so on. Chances are there are reasons that may not make sense now but may have when the code was written.&lt;/p&gt;&#xA;&lt;p&gt;Some examples:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The code was written before a feature X in language even existed. Rewriting it is not a priority.&lt;/li&gt;&#xA;&lt;li&gt;The code originally depended on library X but it was refactored out.&lt;/li&gt;&#xA;&lt;li&gt;Implementing feature X was required to secure funding 10 years ago, it was never used since and there was no time to remove it.&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The first reflex is the urge to rewrite everything. I invite you to read this &lt;a href=&#34;https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/&#34;&gt;article by Joel Spolsky&lt;/a&gt; to find out why this is a really bad idea.&lt;/p&gt;&#xA;&lt;p&gt;Only once you have understood the reasons, you can start fuming and lamenting what a pile of garbage you have inherited. But this will keep you from making mistakes that could lead to disaster and lost time down the road. Example: Refactoring a library that ends up breaking some client&amp;rsquo;s plugin they depend on. It will also avoid being the obnoxious winger during lunch.&lt;/p&gt;&#xA;&lt;h1 id=&#34;a-homework-assignment&#34;&gt;A homework assignment&lt;/h1&gt;&#xA;&lt;p&gt;I challenge you to go through your resume and write notes about every project you chose to mention. Think about your role and contribution. Recall how you solved a particular problem, or at least how the final presentation went. I am sure you were not one of the freeloaders, so prove it.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;Also they probably don&amp;rsquo;t read recruiting advice on random blogs.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;My personal favorite.&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>System Shock</title>
      <link>https://yozy.net/2020/04/system-shock/</link>
      <pubDate>Tue, 28 Apr 2020 08:00:00 +0200</pubDate>
      <guid>https://yozy.net/2020/04/system-shock/</guid>
      <description>&lt;p&gt;First time I played System Shock was around 1998 but I have never managed to find one button so I never finished it. Two decades later, Night Dive studios released the Enhanced Edition current hardware and has &amp;ldquo;modern&amp;rdquo; controls. I started a game, completed several levels, and then real life started interfering so I shelved the game once again.&lt;/p&gt;&#xA;&lt;p&gt;In April of year 2020, the Dos Game Club selected System Shock as the game for the month. This time I decided to finish it.&lt;/p&gt;&#xA;&lt;p&gt;And finish it I did.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/system-shock/ss-end-screen.jpg&#34; alt=&#34;ss-end-screen&#34;&gt;&lt;/p&gt;&#xA;&lt;figure class=&#34;right half&#34;&gt;&lt;img src=&#34;https://yozy.net/images/system-shock/ss-architecture.jpg&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;After confined corridors, come massive halls.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;After completing it I felt the same void one does after having finished a book. The story is thrilling. Watching the fates of various protagonists unfold is fascinating. The game is technologically impressive for the time with varying environments, lightning and shading pushing the 256-color graphics to the limit and dynamic soundtrack seamlessly switching tracks depending on the situation. Although clearly aged the game has managed to completely pull me in.&lt;/p&gt;&#xA;&lt;c-clear/&gt;&#xA;&lt;p&gt;A very interesting technical achievement was security cameras that were rendering in-game spaces real time. At some point I wondered it it was possible to get two of the cameras display at the same time and it turns out that although it is possible, the authors tried to make this impossible. Observe:&lt;/p&gt;&#xA;&lt;video autoplay loop width=&#34;960&#34;&gt;&#xA;  &lt;source src=&#34;https://yozy.net/images/system-shock/ss-cameras-switch.mp4&#34; type=&#34;video/mp4&#34;&gt;&#xA;&lt;/video&gt;&#xA;&lt;p&gt;See how the screen on the right turns into static when the one in the left comes into field of view? That&amp;rsquo;s ingenious.&lt;/p&gt;&#xA;&lt;p&gt;I find that it still has the best kinds of puzzles. You know, actual puzzles, not some sort of dumbed down mini games, jumping puzzles or crafting. Jump scares often result in instant death so the player needs to stay alert all the time, making them even worse.&lt;/p&gt;&#xA;&lt;p&gt;There are other features of the game I still miss in modern games, for example the possibility to take notes on the map. This has come very handy to keep track of various objects I kept lying around for later. Come to think of it, since most modern story based games are laid out as one long hallways they probably don&amp;rsquo;t need the notes.&lt;/p&gt;&#xA;&lt;p&gt;Level design is a masterpiece too, although it is required to go back and forth, the game always opens a shortcut once a sector is cleared so it makes it easier to navigate the large space station.&lt;/p&gt;&#xA;&lt;p&gt;Voice acting is top notch, albeit I found it distracting that the voice does not match the text description, so I ended up reading everything twice.&lt;/p&gt;&#xA;&lt;figure class=&#34;left half&#34;&gt;&lt;img src=&#34;https://yozy.net/images/system-shock/ss-cyberspace.jpg&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Can I go in there, or is it just another wall?&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;One thing I need to rant about is the cyberspace sections. These are unnecessarily tedious, mostly because of the transparency of the walls making it really hard to know where to go at some points. Especially for someone like me who has already hard time evaluating distances and knowing my left from right. The controls are quite wooden and combatting ICE nodes requires a dose of luck and patience more than anything else.&lt;/p&gt;&#xA;&lt;c-clear/&gt;&#xA;&lt;p&gt;I like how Shodan gets progressively madder at each step you make. This is something I don&amp;rsquo;t remember from System Shock 2 but I&amp;rsquo;ll have to replay it and see. As an antagonist she is really one of the best out there.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/system-shock/ss-shodan-mad.jpg&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;I don&amp;#39;t think it&amp;#39;s me who has no hope.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/system-shock/ss-notes.jpg#+third+right+margin&#34; alt=&#34;ss-notes&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;System Shock has left me with more than just good feelings. I have also kept something physical: my notes I took during the playthrough, to keep track of codes and objectives. At some point the player has to find a malfunctioning relay. I have missed the data log specifying its identification number so I had to scour the engineering level and find all of the relays, then enter them into the diagnostics tool and find which one was broken. Paper and map notes were wery handy in this instance.&lt;/p&gt;&#xA;&lt;p&gt;Since I have not kept track of the numbers given by the destroyed comptuers, I had to take a scenic route just before the ending and re-visit all of the previous locations and find all of the places where the computers were.&lt;/p&gt;&#xA;&lt;c-clear/&gt;&#xA;&lt;figure class=&#34;right third&#34;&gt;&lt;img src=&#34;https://yozy.net/images/system-shock/ss-last-battle.jpg&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;I went into the last room doped on every possible substance.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Due to my play style I have ended up with a ton of grenades, ammunition and healing drugs to last me for the final combat twenty times over. I wonder if it would be possible to design a game in a way to force me to not squirrel objects that much. At the same time, the laser rapier is a mighty good weapon once you have found the closest power station. The end fight was relatively easy and final cyberspace section ended surprisingly quickly.&lt;/p&gt;&#xA;&lt;c-clear/&gt;&#xA;&lt;p&gt;See you on the Von Braun!&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>CSS Classes in Pure Markdown</title>
      <link>https://yozy.net/2020/04/css-classes-in-pure-markdown/</link>
      <pubDate>Mon, 27 Apr 2020 08:00:00 +0200</pubDate>
      <guid>https://yozy.net/2020/04/css-classes-in-pure-markdown/</guid>
      <description>&lt;p&gt;One of Markdowns design choices is to not implement any layout.&lt;/p&gt;&#xA;&lt;h1 id=&#34;problem&#34;&gt;Problem&lt;/h1&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2020-04-27/illustration.jpg#+right+third+margin&#34; alt=&#34;illustration&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;One thing I wish it had would be a way of specifying image positions. E.g.: float on right and have width equal to the third of the column. Just like the example illustration somewhere next to this text.&lt;/p&gt;&#xA;&lt;p&gt;Markdown does support plain html tags, so a verbatim &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tag would be a solution. I find this inelegant, however. Various markdown processors support their own way to add classes, or have their own layout engine. As I prefer to keep my markdown as close to the GitHub style as possible, this is not an option for me.&lt;/p&gt;&#xA;&lt;h1 id=&#34;solution&#34;&gt;Solution&lt;/h1&gt;&#xA;&lt;p&gt;I have already explored the use of the &lt;code&gt;$=&lt;/code&gt; selector for the &lt;code&gt;src&lt;/code&gt; attribute in my &lt;a href=&#34;https://yozy.net/2018/01/pure-css-solution-to-retina-images-with-a-single-file/&#34;&gt;previous article&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now let us take this approach a bit further. We declare the CSS like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;+right&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;margin-left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;+third&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;30&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This allows us to add classes in markdown inside location hashes.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-markdown&#34; data-lang=&#34;markdown&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;The following image will be floating on the right.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;![illustration]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;[illustration]: http://example.com/illustration.png#+right+third&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And that is all there is to it.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Satay Eggplant</title>
      <link>https://yozy.net/2020/04/satay-eggplant/</link>
      <pubDate>Sun, 26 Apr 2020 08:00:00 +0200</pubDate>
      <guid>https://yozy.net/2020/04/satay-eggplant/</guid>
      <description>&lt;p&gt;After a long time a quick one.&lt;/p&gt;&#xA;&lt;p&gt;This is a recipe for a nice and flavourful eggplant. It is quite fat and also salty so it&amp;rsquo;s best eaten along with plain white rice.&lt;/p&gt;&#xA;&lt;h1 id=&#34;the-ingredients&#34;&gt;The Ingredients&lt;/h1&gt;&#xA;&lt;p&gt;We will need these:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/satay-eggplant/ingredients.jpg&#34; alt=&#34;ingredients&#34; title=&#34;Required ingredients&#34;&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;One eggplant&lt;/li&gt;&#xA;&lt;li&gt;Few (4-5) cloves of garlic&lt;/li&gt;&#xA;&lt;li&gt;A small onion&lt;/li&gt;&#xA;&lt;li&gt;Dried garlic&lt;/li&gt;&#xA;&lt;li&gt;Black pepper (or a mixture of pepper)&lt;/li&gt;&#xA;&lt;li&gt;Salt (optional)&lt;/li&gt;&#xA;&lt;li&gt;Oil&lt;/li&gt;&#xA;&lt;li&gt;Soy sauce&lt;/li&gt;&#xA;&lt;li&gt;Sesame oil&lt;/li&gt;&#xA;&lt;li&gt;Rice wine&lt;/li&gt;&#xA;&lt;li&gt;Satay sauce&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;preparation&#34;&gt;Preparation&lt;/h1&gt;&#xA;&lt;p&gt;The best taste is achieved when the eggplant is marinated for a couple of hours.&lt;/p&gt;&#xA;&lt;h2 id=&#34;hacking-and-slashing&#34;&gt;Hacking and slashing&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Dice the eggplant into pieces of around 2-3 cm in size.&lt;/li&gt;&#xA;&lt;li&gt;Mince the garlic.&lt;/li&gt;&#xA;&lt;li&gt;Cut the onion into small dice. (This can be done a bit later).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;pouring-and-shaking&#34;&gt;Pouring and shaking&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Mix the eggplant and the minced garlic.&lt;/li&gt;&#xA;&lt;li&gt;Add pepper.&lt;/li&gt;&#xA;&lt;li&gt;Add dried garlic.&lt;/li&gt;&#xA;&lt;li&gt;Optionally add salt, this really depends on how salty your soy sauce already is.&lt;/li&gt;&#xA;&lt;li&gt;Add satay sauce.&lt;/li&gt;&#xA;&lt;li&gt;Mix it all a bit.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/satay-eggplant/prep-1-cut-and-seasoned.jpg&#34; alt=&#34;prep-1-cut-and-seasoned&#34; title=&#34;Preparation Step 1: Cut and seasoned&#34;&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Add oil, about 3-4 table spoons. Eggplant is like a sponge so it will soak it up pretty fast.&lt;/li&gt;&#xA;&lt;li&gt;Add the sesame oil, give the bottle a good shake, 10-15 drops at least.&lt;/li&gt;&#xA;&lt;li&gt;Add the soy sauce to taste.&lt;/li&gt;&#xA;&lt;li&gt;Add one cap of rice wine.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/satay-eggplant/prep-2-soaked.jpg&#34; alt=&#34;prep-2-soaked&#34; title=&#34;Preparation Step 2: Soaked with sauce&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Culinary pro tip! Put plastic wrap over your bowl, put a plate over that. Then lift the bowl and shake the hell out of it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/satay-eggplant/prep-3-wrapped.jpg#+half+left&#34; alt=&#34;prep-3-wrapped&#34; title=&#34;Preparation Step 3: Wrapped in plastic wrap&#34;&gt;&#xA;&lt;img src=&#34;https://yozy.net/images/satay-eggplant/prep-4-shaken.jpg#+half&#34; alt=&#34;prep-4-shaken&#34; title=&#34;Preparation Step 4: All well mixed&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;This will make the ingredients mix very nicely.&lt;/p&gt;&#xA;&lt;p&gt;Put the mixture in the fridge for about 2 hours.&lt;/p&gt;&#xA;&lt;h1 id=&#34;cooking&#34;&gt;Cooking&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Put some oil in a pan, add the diced onions and cook them until transparent.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/satay-eggplant/cooking-1-onions.jpg&#34; alt=&#34;cooking-1-onions&#34; title=&#34;Cooking Step 1: Onions&#34;&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Add in the prepared mixture and cook first on high, then on medium heat until the sauce becomes soupy and sticky.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;video autoplay loop width=&#34;960&#34;&gt;&#xA;  &lt;source src=&#34;https://yozy.net/images/satay-eggplant/cooking-2-eggplant.mp4&#34; type=&#34;video/mp4&#34;&gt;&#xA;&lt;/video&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Serve with rice.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/satay-eggplant/satay-eggplant.jpg&#34; alt=&#34;satay-eggplant&#34; title=&#34;Final presentation of satay eggplant&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>DOS Game Club Podcast Episode 39: Worms</title>
      <link>https://yozy.net/2020/04/dos-game-club-podcast-episode-39-worms/</link>
      <pubDate>Sat, 25 Apr 2020 12:08:26 +0200</pubDate>
      <guid>https://yozy.net/2020/04/dos-game-club-podcast-episode-39-worms/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://www.dosgameclub.com/worms/&#34;&gt;Episode 39 of the Dos Games Club&lt;/a&gt; podcast is out, join Martijn, Florian, Tim, Elias and me to discuss Worms, the legendary game that started the franchise with over 20 sequels.&lt;/p&gt;&#xA;&lt;p&gt;In this episode we also assist &lt;em&gt;live&lt;/em&gt; to the final match of our club tournament between Florian and Tim.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>DOS Game Club Podcast Episode 34: UFO: Enemy Unknown</title>
      <link>https://yozy.net/2019/10/dos-game-club-podcast-episode-34-ufo-enemy-unknown/</link>
      <pubDate>Thu, 24 Oct 2019 22:42:11 +0200</pubDate>
      <guid>https://yozy.net/2019/10/dos-game-club-podcast-episode-34-ufo-enemy-unknown/</guid>
      <description>&lt;p&gt;Today, my friends at &lt;a href=&#34;https://dosgameclub.com&#34;&gt;DOS Game Club&lt;/a&gt; released a &lt;a href=&#34;https://www.dosgameclub.com/ufo-enemy-unknown/&#34;&gt;new episode of the podcast&lt;/a&gt;. I was one of the guests and together with Martijn, Tyler and Matthew we sat for a long chat about an old-time classic: UFO: Enemy Unknown, published by Microprose. In North America this game is known as X-Com: UFO Defense.&lt;/p&gt;&#xA;&lt;p&gt;This game started a long series of games in all genres and is one of the longest going series.&lt;/p&gt;&#xA;&lt;p&gt;Enjoy!&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>DOS Game Club Podcast Episode 30: Blackthrone</title>
      <link>https://yozy.net/2019/06/dos-game-club-podcast-episode-30-blackthrone/</link>
      <pubDate>Sat, 15 Jun 2019 08:24:56 +0200</pubDate>
      <guid>https://yozy.net/2019/06/dos-game-club-podcast-episode-30-blackthrone/</guid>
      <description>&lt;p&gt;A new episode of &lt;a href=&#34;https://www.dosgameclub.com/blackthorne/&#34;&gt;Dos Game Club podcast&lt;/a&gt; was released today.&lt;/p&gt;&#xA;&lt;p&gt;Martijn and Florian invited Oddvar me to discuss &lt;a href=&#34;https://www.mobygames.com/game/dos/blackthorne&#34;&gt;Blackthorne&lt;/a&gt;, one of the early Blizzard games. This game is a &amp;ldquo;slow&amp;rdquo; platformer, similar to Flashback.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>WWDC 2019 Predictions</title>
      <link>https://yozy.net/2019/06/wwdc-2019-predictions/</link>
      <pubDate>Mon, 03 Jun 2019 09:13:29 +0200</pubDate>
      <guid>https://yozy.net/2019/06/wwdc-2019-predictions/</guid>
      <description>&lt;p&gt;This year&amp;rsquo;s Apple WWDC keynote will be allegedly focused on “Marzipan” and new iPad functionalities of iOS 13. Here are a few predictions that do not concern any of these.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Apple will tease the new Mac Pro and it will contain at least one user accessible ARM CPU. This will be usable for tasks like machine learning and iOS development.&lt;/li&gt;&#xA;&lt;li&gt;Apple will not introduce a new MacBook Pro format. Otherwise they would Osbourne the latest crop of 15” MBPs.&lt;/li&gt;&#xA;&lt;li&gt;HomePod will get multiple user functionality through voice recognition. Siri can already train on various voices and it seems to be working okay.&lt;/li&gt;&#xA;&lt;li&gt;iOS 13 will be compatible with A9 and upwards. It might be even A10 but I doubt it. If it is A10, I would expect a feature that requires big.LITTLE CPU, like fewer restrictions for backgrounded apps.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;As a side note, I hope Apple will not make the iTunes successor too simple. I wish it would retain support for iTunes Store, iTunes Match and local music, all of which are of great importance.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Segmented Control With Color Images</title>
      <link>https://yozy.net/2019/05/segmented-control-with-color-images/</link>
      <pubDate>Thu, 09 May 2019 22:57:41 +0200</pubDate>
      <guid>https://yozy.net/2019/05/segmented-control-with-color-images/</guid>
      <description>&lt;p&gt;The default &lt;code&gt;UISegmentedControl&lt;/code&gt; does not support color images. As I wanted to have some in Eventail, I have developed a quick replacement for the default view. It tries to copy the API as closely as possible.&lt;/p&gt;&#xA;&lt;p&gt;I use some helper function from my &amp;ldquo;utility&amp;rdquo; library:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;extension&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Collection&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;/// Return an element of a collection or nil&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;subscript&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;optional&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Iterator&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Element&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;indices&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;contains&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;/// Iterate over collection elements, progressively yielding the previous, current and next element&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;rollOver&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;closure&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;Self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Element&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;Self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Element&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;Self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Element&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Void&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;prev&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;Self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Element&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;indices&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;next&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;optional&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;index&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;after&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;closure&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;prev&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;next&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;prev&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The class itself is simple and is &lt;code&gt;@IBDesignable&lt;/code&gt;. Unfortunately, Xcode does not (yet) support &lt;code&gt;@IBInspectable&lt;/code&gt; arrays so I expose three UIImage variables. If you need to add segments, copy and paste a few of those.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;//  ImageSegmentedControl.swift&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Foundation&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;UIKit&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;@IBDesignable&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;ImageSegmentedControl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIControl&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// @IBInspectable does not support arrays yet, but a segmented control does&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// not really need to have too many elements&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;@IBInspectable&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;image1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIImage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kr&#34;&gt;didSet&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;images&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;image1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;@IBInspectable&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;image2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIImage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kr&#34;&gt;didSet&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;images&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;image2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;@IBInspectable&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;image3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIImage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kr&#34;&gt;didSet&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;images&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;image3&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;/// Currently selegted segment&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;selectedSegmentIndex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Int&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// A nil image will represent a non-existing segment&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;images&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;UIImage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?](&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;repeating&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;segments&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;UIView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;isSegmentEnabled&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;Bool&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;](&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;repeating&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;borders&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CALayer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;private&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;initialized&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Bool&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGRect&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;super&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;required&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;aDecoder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;NSCoder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;super&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;coder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;aDecoder&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;layoutSubviews&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;initialized&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;layer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cornerRadius&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;5&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;layer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;borderWidth&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;layer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;borderColor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tintColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cgColor&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;clipsToBounds&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;images&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;forEach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;guard&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;image&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$0&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;imageView&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIImageView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;image&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;image&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;imageView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;contentMode&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;center&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;imageView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;translatesAutoresizingMaskIntoConstraints&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;segments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;imageView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;segments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rollOver&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;prev&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;_&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;addSubview&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;previousAnchor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;prev&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;trailingAnchor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;??&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;leadingAnchor&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;NSLayoutConstraint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;activate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;([&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;leadingAnchor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;constraint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;equalTo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;previousAnchor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;centerYAnchor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;constraint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;equalTo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;centerYAnchor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;heightAnchor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;constraint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;equalTo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;heightAnchor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;widthAnchor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;constraint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;equalTo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;widthAnchor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;multiplier&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;segments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;count&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;p&#34;&gt;])&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;prev&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;          &lt;span class=&#34;n&#34;&gt;borders&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;append&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;addLeftBorderWithColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tintColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;isUserInteractionEnabled&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;tapRecognizer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UITapGestureRecognizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;target&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;#selector&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ImageSegmentedControl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;handleTap&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;_&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:)))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;tapRecognizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;numberOfTapsRequired&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;tapRecognizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;isEnabled&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;addGestureRecognizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tapRecognizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;initialized&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;borders&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;forEach&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;frame&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGRect&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;origin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;frame&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;segments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;count&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;segments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;backgroundColor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;selectedSegmentIndex&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;tintColor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;nil&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;segments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;isUserInteractionEnabled&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;isSegmentEnabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;segments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;isSegmentEnabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.25&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kc&#34;&gt;super&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;layoutSubviews&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;@objc&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;handleTap&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;_&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;recognizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UITapGestureRecognizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;segments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;firstIndex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;where&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$0&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;recognizer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;})&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;selectedSegmentIndex&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;i&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;setNeedsLayout&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;UIView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;animate&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;withDuration&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;layoutIfNeeded&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;sendActions&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;valueChanged&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;setEnabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;_&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;enabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Bool&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;forSegmentAt&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;segmentIndex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Int&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// We need to store the enabled/disabled state because the segments&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;c1&#34;&gt;// can be actually initialized after this method is called&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;isSegmentEnabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;segmentIndex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;enabled&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;segment&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;segments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;optional&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;segmentIndex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;isUserInteractionEnabled&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;enabled&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;n&#34;&gt;segment&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;alpha&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;enabled&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.25&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Some features of this view:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Exposes the currently selected segment via &lt;code&gt;selectedSegmentIndex&lt;/code&gt; akin to &lt;code&gt;UISegmentedControl&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Inherits from UIControl so it has all of the outlets for common events. Only the &lt;code&gt;valueChanged&lt;/code&gt; event fires though.&lt;/li&gt;&#xA;&lt;li&gt;Is &lt;code&gt;@IBDesignable&lt;/code&gt; so you can see how will it look&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;And this is how it looks in Xcode&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/swift/image-segmented-control.png&#34; alt=&#34;screenshot&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Eventail 3.0 and beyond</title>
      <link>https://yozy.net/2019/03/eventail-3.0-and-beyond/</link>
      <pubDate>Fri, 01 Mar 2019 11:41:39 +0100</pubDate>
      <guid>https://yozy.net/2019/03/eventail-3.0-and-beyond/</guid>
      <description>&lt;p&gt;I have released a few versions of Eventail since my last post.&lt;/p&gt;&#xA;&lt;h1 id=&#34;version-30&#34;&gt;Version 3.0&lt;/h1&gt;&#xA;&lt;p&gt;The notable major update 3.0 has brought the &lt;em&gt;interactive mode&lt;/em&gt;. When active, the widget will give each entry more space in the day view and populate each entry with buttons which can launch various actions.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2019-03-01/iphone-tilted@2x.jpg&#34; alt=&#34;image-iphone-im&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The actions can open the events or reminders in an app of the user&amp;rsquo;s choice, start navigation to a specific event, join a conference call and more. The full list is described in the &lt;a href=&#34;https://eventail.app/documentation.latest.html#settings-behaviour-interactive-mode&#34;&gt;documentation&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This new mode is malleable and makes it easy for me to add integrations with other applications in the future.&lt;/p&gt;&#xA;&lt;h1 id=&#34;version-31&#34;&gt;Version 3.1&lt;/h1&gt;&#xA;&lt;p&gt;The 3.1 update for Eventail has brought support for, what I call, &amp;ldquo;universal URLs&amp;rdquo;. What this feature does is that any event or reminder that has the URL property set, will have a button in the widget to open it.&lt;/p&gt;&#xA;&lt;p&gt;First usage that pops to mind is adding URLs to events manually, and there are some great candidates for that. For example you can use the &lt;a href=&#34;https://support.apple.com/en-gb/guide/shortcuts/run-a-shortcut-from-a-url-apd624386f42/ios&#34;&gt;iOS shortcuts URL scheme&lt;/a&gt; to launch a shortcut.&lt;/p&gt;&#xA;&lt;p&gt;Another handy feature of iOS is that it will add a callback URL here every time you create an event from a message, be it an e-mail or iMessage. Since the message itself can contain useful information (such as a door access code for your hotel or flight reservation number) the ability to show it immediately from the lock screen is very practical.&lt;/p&gt;&#xA;&lt;h1 id=&#34;version-311&#34;&gt;Version 3.1.1&lt;/h1&gt;&#xA;&lt;p&gt;In version 3.1.1 I have added a possibility to define custom URLs for opening events and reminders. This way, I will not have to manually enter all possible URLs. A simple template will do. I will try to scour the Internet and add as many URLs for popular apps into the documentation.&lt;/p&gt;&#xA;&lt;h1 id=&#34;sneak-peek-into-the-future&#34;&gt;Sneak peek into the future&lt;/h1&gt;&#xA;&lt;p&gt;Next release will bring a possibility to display the reminders with due dates inside the Todo widget instead of the Calendar view. Possibly there will be some new integrations as well.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>A few things to consider before localising your application</title>
      <link>https://yozy.net/2019/02/a-few-things-to-consider-before-localising-your-application/</link>
      <pubDate>Mon, 18 Feb 2019 16:01:37 +0100</pubDate>
      <guid>https://yozy.net/2019/02/a-few-things-to-consider-before-localising-your-application/</guid>
      <description>&lt;p&gt;Your application is finished and uploaded to the App Store. You are happy and eager to see the reactions from customers. Then, a review like this lands in:&lt;/p&gt;&#xA;&lt;div style=&#34;max-width:8cm;background:#f5f5f5;text-color:#222;border-radius:10px;padding:15px;box-shadow:2px 2px 20px #444&#34;&gt;&#xA;&lt;p&gt;&lt;strong&gt;Spanish,please&lt;/strong&gt; &lt;span style=&#34;color:#fa1&#34;&gt;★★★☆☆&lt;/span&gt;&lt;br/&gt;&#xA;by disappointed person – Feb 16, 2019&lt;/p&gt;&#xA;&lt;p&gt;Cuándo será en español, la compraré....&lt;/p&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;After a few dozens of such reviews, you may be tempted to translate the application into another language. In this article I will point out a few reasons why that might be a bad idea and give a few pointers for when you decide to pass the hurdle.&lt;/p&gt;&#xA;&lt;aside class=&#34;note&#34;&gt;Note: I am writing this from a perspective of a solo iOS developer. Things are different if you work in a massive company that has a department dedicated to internationalisation, but the platforms, be it Android or Windows do not matter.&lt;/aside&gt;&#xA;&lt;h1 id=&#34;translation-may-bring-other-people-into-the-churn&#34;&gt;Translation may bring other people into the churn&lt;/h1&gt;&#xA;&lt;p&gt;Working alone on an app makes a things easy and agile—writing new features and fixing bugs takes little time and once they are written nothing stops you from releasing the new version.&lt;/p&gt;&#xA;&lt;p&gt;If you translate the application into a language that you do not master yourself, you need to bring in translators and to depend on them. This ties to someone else&amp;rsquo;s schedule every time you modify a visible text in the application.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Someone else&lt;/em&gt; might be on vacation, they might be sick or have other stuff to do and will not scramble to translate things for you. You have to plan the releases around their availabilities.&lt;/p&gt;&#xA;&lt;h1 id=&#34;translation-brings-additional-boring-work&#34;&gt;Translation brings additional (boring) work&lt;/h1&gt;&#xA;&lt;p&gt;I assume that you have thought about internationalisation from the beginning and that your code uses &lt;a href=&#34;https://developer.apple.com/documentation/foundation/nslocalizedstring&#34;&gt;localisable strings&lt;/a&gt; everywhere. If it does not, this should be done before any translating can start.&lt;/p&gt;&#xA;&lt;p&gt;You will have to translate all of the strings in the application and the whole UI. Be aware than many terms that are common in English are do not always have counterparts in other languages. This concerns a lot of technical and computer related vocabulary. This means that you will need to do due diligence to find out what terms are colloquially used in the target language for what you wish to describe.&lt;/p&gt;&#xA;&lt;p&gt;Some languages handle the context differently from others: A menu with a lot of switches may only require a short label in front of each switch in English, but demand longer descriptions when translated. This may require alterations to the UI because the labels might no longer fit in the original space.&lt;/p&gt;&#xA;&lt;p&gt;Once your application has been translated, you are halfway done. You also have to think about screenshots, documentation, marketing material&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; and the website.&lt;/p&gt;&#xA;&lt;h1 id=&#34;translation-is-a-commitment&#34;&gt;Translation is a commitment&lt;/h1&gt;&#xA;&lt;p&gt;Features which modify visible text will generate more work from now on. Screenshots, for example, are required for each supported language. Depending on your platform, their generation can be automated by tools such as &lt;a href=&#34;https://fastlane.tools&#34;&gt;fastlane&lt;/a&gt;&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Be prepared to find yourself in a situation when you have finished the features, fixed the bugs, and are ready to submit, only to realise that you have forgot to translate the one button which you have added. If you are using translators, pray that they are not on vacation.&lt;/p&gt;&#xA;&lt;p&gt;Expect to receive support mail in foreign languages. If you have used an external translator, you may not be able to answer them.&lt;/p&gt;&#xA;&lt;h1 id=&#34;a-few-hints-for-future-polyglots&#34;&gt;A few hints for future polyglots&lt;/h1&gt;&#xA;&lt;p&gt;If you have considered the above and are ready to start translating I can give you a few hints:&lt;/p&gt;&#xA;&lt;h2 id=&#34;minimise-text-in-your-application&#34;&gt;Minimise text in your application&lt;/h2&gt;&#xA;&lt;p&gt;Put as few labels as possible into your applications. Consider them like you consider code, if it exists it must be maintained.&lt;/p&gt;&#xA;&lt;p&gt;I have removed some settings from my app at the last minute, so I would not have to translate the associated controls. If a feature is hard to explain in a foreign language, it might be too complex to use as well.&lt;/p&gt;&#xA;&lt;p&gt;If a label can be replaced by a pictogram do so. A good example would be to use a slider with small and large character at either side rather than listing text sizes.&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;use-textual-representation-for-your-translated-strings&#34;&gt;Use textual representation for your translated strings&lt;/h2&gt;&#xA;&lt;p&gt;In iOS, you can use full Storyboards or string lists for translating the UI. Stick with the plain text lists as they are easy to diff and mistakes in them are quick to spot.&lt;/p&gt;&#xA;&lt;p&gt;Localisation will live next to the code in your SCM repository and it is important that its format be adapted.&lt;/p&gt;&#xA;&lt;h2 id=&#34;make-the-non-translated-strings-pop&#34;&gt;Make the non-translated strings pop&lt;/h2&gt;&#xA;&lt;p&gt;Use a gibberish placeholder for untranslated strings and add them immediately after you create each new string. Most frameworks will use the default (usually English) label for non translated strings and this can lead to forgotten translations.&lt;/p&gt;&#xA;&lt;h1 id=&#34;closing-words&#34;&gt;Closing words&lt;/h1&gt;&#xA;&lt;p&gt;Translating an application might seem to be a good way to increase the number of possible clients and profit. But consider what you are giving up: having an application developed by a single person in a single language gives you incredible flexibility. This agility might be worth more than a satisfying few angry customers.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;e.g.: App Store description, change logs&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;Sadly it does not work for everything—I am looking at you, Today Widgets on iOS.&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:3&#34;&gt;&#xA;&lt;p&gt;Something that I though about too late when writing Eventail, but it is on the roadmap.&amp;#160;&lt;a href=&#34;#fnref:3&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>DOS Game Club Podcast Episode 25: Six Small Games</title>
      <link>https://yozy.net/2019/02/dos-game-club-podcast-episode-25-six-small-games/</link>
      <pubDate>Mon, 18 Feb 2019 13:45:12 +0100</pubDate>
      <guid>https://yozy.net/2019/02/dos-game-club-podcast-episode-25-six-small-games/</guid>
      <description>&lt;p&gt;Over at the &lt;a href=&#34;https://dosgame.club&#34;&gt;DOS Games Club&lt;/a&gt; we have played six small games&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; during the cold month of December. I have suggested playing &lt;a href=&#34;https://www.mobygames.com/game/dos/ugh&#34;&gt;UGH!&lt;/a&gt; and joined Florian, Martijn, Mike, Philipp and Tim on the &lt;a href=&#34;https://www.dosgame.club/six-small-games/&#34;&gt;25&lt;sup&gt;th&lt;/sup&gt; episode&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In February we will be operating on unfortunate patients in the &lt;a href=&#34;https://www.mobygames.com/game/dos/life-death&#34;&gt;Life &amp;amp; Death&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;Ugh!, Bolo Ball, Micro&amp;rsquo;s Dilemma II, Lode Runner, Alley Cat, MinerVGA&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Web applications cannot replace native ones</title>
      <link>https://yozy.net/2018/12/web-applications-cannot-replace-native-ones/</link>
      <pubDate>Mon, 10 Dec 2018 11:23:58 +0100</pubDate>
      <guid>https://yozy.net/2018/12/web-applications-cannot-replace-native-ones/</guid>
      <description>&lt;aside class=&#34;note&#34;&gt;Note: This rant is about programs running in browser windows, I will address Electron in some other post.&lt;/aside&gt;&#xA;&lt;p&gt;Increasing amount of tools are written for web, many presenting themselves as replacement for standard desktop applications.&lt;/p&gt;&#xA;&lt;p&gt;For simple stuff this is fine, few people would like to install an application for every shop or transport provider.&lt;/p&gt;&#xA;&lt;p&gt;Complex programs running in tabs hit an insurmountable hurdle: &amp;ldquo;they cannot implement correct keyboard shortcuts&amp;rdquo;. And it is a problem that nobody has figured out yet, it is a fundamental issue that will never be fixed.&lt;/p&gt;&#xA;&lt;p&gt;Some examples that come to mind:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How would you open a tab in your web app? &lt;kbd&gt;⌘T&lt;/kbd&gt; opens a new browser tab. What about a new window&lt;kbd&gt;⌘N&lt;/kbd&gt;?&lt;/li&gt;&#xA;&lt;li&gt;How do you undo? In Safari &lt;kbd&gt;⌘Z&lt;/kbd&gt; undoes closing of a tab.&lt;/li&gt;&#xA;&lt;li&gt;If your application provides a save option, what would you use? &lt;kbd&gt;⌘S&lt;/kbd&gt; will try to save a useless HTML document.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Another problem is selection. &lt;kbd&gt;⌘A&lt;/kbd&gt; selects everything, this is &lt;em&gt;never&lt;/em&gt; what you want to do in an application, but it can be something you want to do on a webpage. This means you need to break one behavior or the other.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Improving iPhone and Pixel Photos</title>
      <link>https://yozy.net/2018/12/improving-iphone-and-pixel-photos/</link>
      <pubDate>Sun, 09 Dec 2018 10:01:42 +0100</pubDate>
      <guid>https://yozy.net/2018/12/improving-iphone-and-pixel-photos/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=_5-bo8a4zU0&#34;&gt;MKBHD&amp;rsquo;s video about blind camera comparison&lt;/a&gt; concluded with a baffling result. The most interesting thing is not the winner, but the phones that got to share the last place: iPhone XS, iPhone X and Pixel 3.&lt;/p&gt;&#xA;&lt;p&gt;Although their cameras are superior on technical level&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;, people prefer pictures from other cameras because of increased brightness and saturation.&lt;/p&gt;&#xA;&lt;p&gt;Of course there is nothing that stops iPhone and Pixel to do the same thing at the cost of losing information rendering further post-processing inflexible. That being said, I can imagine that being beaten by a Blackberry in a photography test must hurt.&lt;/p&gt;&#xA;&lt;h1 id=&#34;solution&#34;&gt;Solution&lt;/h1&gt;&#xA;&lt;p&gt;The solution is simple. I am sure that if pictures after auto-enhance have been thrown in the competition, the results would be different. The winner might stay the same, but I doubt that iPhones and Pixels would remain dead last.&lt;/p&gt;&#xA;&lt;p&gt;What Apple and Google should do is to add an option to turn on auto-enhance by default. This way no information would be lost and people who prefer pictures without it could disable it. It would make the pictures coming straight off-camera punchier.&lt;/p&gt;&#xA;&lt;p&gt;But first Apple would need to fix their auto-enhance algorithm which makes everything orange.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;Noise, dynamic range and colour reproduction are comical on some of the tested phones.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Let&#39;s Play Alcatraz</title>
      <link>https://yozy.net/2018/12/lets-play-alcatraz/</link>
      <pubDate>Tue, 04 Dec 2018 14:56:41 +0100</pubDate>
      <guid>https://yozy.net/2018/12/lets-play-alcatraz/</guid>
      <description>&lt;p&gt;As a side project I am launching my YouTube channel &lt;em&gt;Binary Campfire&lt;/em&gt;. I haven&amp;rsquo;t decided its ultimate purpose; but as others before me, I will start posting some videos about video games. Old ones, as that is what I play these days.&lt;/p&gt;&#xA;&lt;p&gt;The first video will take us back to 1992, with a side scroller/shooter game Alcatraz.&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/xfjYKkWcGgI?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;</description>
    </item>
    <item>
      <title>What is Holding the ARM Mac Release?</title>
      <link>https://yozy.net/2018/11/what-is-holding-the-arm-mac-release/</link>
      <pubDate>Sat, 03 Nov 2018 10:30:00 +0100</pubDate>
      <guid>https://yozy.net/2018/11/what-is-holding-the-arm-mac-release/</guid>
      <description>&lt;p&gt;The event held on the 30th of October solidified the idea roaming the Internet since a few years: ARM Macs are coming, and they are coming &lt;em&gt;soon&lt;/em&gt;. A-series chips have caught up to all but the best Intel mobile chips&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;, so why is there an Intel processor inside the new &lt;em&gt;MacBook Air&lt;/em&gt;?&lt;/p&gt;&#xA;&lt;p&gt;I have a theory: A-series chips are not powerful enough–but in an unapparent way.&lt;/p&gt;&#xA;&lt;p&gt;In my previous article I have predicted that Apple would:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Rename the current &lt;em&gt;MacBook&lt;/em&gt; to &lt;em&gt;MacBook Air&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Discontinue the &lt;em&gt;13″ MacBook Pro without TouchBar&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Introduce a new, cheaper, 13″ computer called &lt;em&gt;MacBook&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;This did not happen as predicted. What was announced is a new &lt;em&gt;MacBook Air&lt;/em&gt;, which is a 13&amp;quot; version of the current MacBook. Other laptops in the &lt;em&gt;MacBook&lt;/em&gt; line were untouched.&lt;/p&gt;&#xA;&lt;p&gt;What I think will happen &lt;em&gt;next&lt;/em&gt; year is:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Apple will introduce a new &lt;em&gt;12&amp;quot; MacBook Air&lt;/em&gt; and &amp;ldquo;discontinue&amp;rdquo;&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt; the &lt;em&gt;MacBook&lt;/em&gt; line.&lt;/li&gt;&#xA;&lt;li&gt;Apple will introduce a new &lt;em&gt;13&amp;quot; MacBook with Apple ARM chip&lt;/em&gt;&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;But herein lies the problem. Which chip would go in? If Apple took the A12X processor from the current iPad Pro and added a bit of RAM, this setup would breathe at the neck of the current &lt;em&gt;15&amp;quot; MacBook Pro with Touchbar&lt;/em&gt;&lt;sup id=&#34;fnref:4&#34;&gt;&lt;a href=&#34;#fn:4&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;4&lt;/a&gt;&lt;/sup&gt;. This would have serious implications for the Pro line as the only differentiator would be the software they can use.&lt;/p&gt;&#xA;&lt;p&gt;In order to offer compelling Pro hardware, Apple needs to make a beefier A-series chip. One that would give even the Intel desktop chips a run for their money.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;An &lt;a href=&#34;https://browser.geekbench.com/v4/cpu/compare/10611310?baseline=10581888&#34;&gt;A12X chip is neck-to-neck with a 6-core Intel Core i7-8850H&lt;/a&gt;; it only falls behind an i9&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;In today&amp;rsquo;s Apple&amp;rsquo;s philosophy this means that it will continue to be sold, maybe with lower price.&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:3&#34;&gt;&#xA;&lt;p&gt;I expect this name to be something unexpected, what about an &amp;ldquo;Apple Mac&amp;rdquo;?&amp;#160;&lt;a href=&#34;#fnref:3&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:4&#34;&gt;&#xA;&lt;p&gt;If they added active cooling, I would bet that it could run circles around a 45watt 4-core Intel processor.&amp;#160;&lt;a href=&#34;#fnref:4&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>DOS Game Club Podcast Episode 22: The Secret of Monkey Island</title>
      <link>https://yozy.net/2018/10/dos-game-club-podcast-episode-22-the-secret-of-monkey-island/</link>
      <pubDate>Thu, 25 Oct 2018 21:38:01 +0200</pubDate>
      <guid>https://yozy.net/2018/10/dos-game-club-podcast-episode-22-the-secret-of-monkey-island/</guid>
      <description>&lt;p&gt;A new episode of &lt;a href=&#34;https://www.dosgameclub.com/monkey-island/&#34;&gt;Dos Game Club podcast&lt;/a&gt; was released today. This&#xA;22&lt;sup&gt;nd&lt;/sup&gt; instalment is about a legendary game: The Secret of Monkey&#xA;Island.&lt;/p&gt;&#xA;&lt;p&gt;I have been fortunate to be able to join Martijn, Florian, Mike, Philipp and&#xA;Esko to discuss this great game during an epic 3 hour session. If you enjoy&#xA;retro gaming and especially DOS games, give this podcast a try!&lt;/p&gt;&#xA;&lt;p&gt;Every month we select a different game to play and discuss on the forums and&#xA;IRC. Martijn and Florian then invite a few guests do discuss the episode and&#xA;record a podcast session.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Apple September 2018 Keynote Predictions</title>
      <link>https://yozy.net/2018/08/apple-september-2018-keynote-predictions/</link>
      <pubDate>Mon, 27 Aug 2018 12:00:00 +0200</pubDate>
      <guid>https://yozy.net/2018/08/apple-september-2018-keynote-predictions/</guid>
      <description>&lt;p&gt;As a fun exercise I would like to make some predictions for the 2018 September Apple keynote. There are two rumored machines that should come out.&lt;/p&gt;&#xA;&lt;h1 id=&#34;the-new-mac-mini&#34;&gt;The new Mac Mini&lt;/h1&gt;&#xA;&lt;p&gt;According to rumors, this machine will be geared towards pro users. As usual, the statement is vague. What pro users? Developers, animators, writers?&lt;/p&gt;&#xA;&lt;p&gt;Current Mac Minis mainly serve three purposes:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;home media server&lt;/li&gt;&#xA;&lt;li&gt;&amp;ldquo;rich man&amp;rsquo;s raspberry pi&amp;rdquo;&lt;/li&gt;&#xA;&lt;li&gt;server in a colo&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Professionals do not need home media servers, and since Apple does not make a standalone screen it means that the machine will have to be usable headless.&lt;/p&gt;&#xA;&lt;p&gt;As such it will require Ethernet and power, which makes it possible to do away with all other ports. I expect Apple to offer a low-grade Xeon CPU option in order to allow for ECC ram and at least an option with 32G ram.&lt;/p&gt;&#xA;&lt;p&gt;Why would Apple do this?&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Nobody uses underpowered desktops today.&lt;/li&gt;&#xA;&lt;li&gt;Apple needs and probably has a similar machine for internal usage.&lt;/li&gt;&#xA;&lt;li&gt;The work on Xcode automation is useless if one cannot have an affordable Mac server.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1 id=&#34;the-new-macbook-air&#34;&gt;The new MacBook Air&lt;/h1&gt;&#xA;&lt;p&gt;I expect Apple to sanitize their offering. Nobody except Apple pundits knows how are the machines named before they enter the Apple store.&lt;/p&gt;&#xA;&lt;p&gt;I believe that Apple will:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Rename the current &lt;em&gt;MacBook&lt;/em&gt; to &lt;em&gt;MacBook Air&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Discontinue the &lt;em&gt;13″ MacBook Pro without TouchBar&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Introduce a new cheaper 13″ computer called &lt;em&gt;MacBook&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;This will make the lightest Mac have the &lt;em&gt;Air&lt;/em&gt; moniker. The current &lt;em&gt;MacBook&lt;/em&gt; is underpowered for the generic user and the current &lt;em&gt;MacBook Pro without TouchBar&lt;/em&gt; is a compromised machine with no market.&lt;/p&gt;&#xA;&lt;h2 id=&#34;cpu-and-graphics&#34;&gt;CPU and Graphics&lt;/h2&gt;&#xA;&lt;p&gt;For CPU it will have the cheapest Intel 15W CPU Apple can get, with expensive upgrades to CPUs with the same TDP. It will not have a discrete GPU and no TouchBar.&lt;/p&gt;&#xA;&lt;h2 id=&#34;ports&#34;&gt;Ports&lt;/h2&gt;&#xA;&lt;p&gt;People buying the Pro computer should be savvy enough to know which dongles to buy and people buying an ultra-light computer do not need peripherals.&lt;/p&gt;&#xA;&lt;p&gt;However, Apple needs the &lt;em&gt;Average Joe&amp;rsquo;s MacBook&lt;/em&gt; to work for most users today, not in an imaginary future. This means it needs at least one USB port. It does not need thunderbolt. It would be better with an HDMI port and an SD card slot but these are unlikely to be included.&lt;/p&gt;&#xA;&lt;p&gt;I predict that it will have 2 USB-C ports for power and 1 or 2 USB-A ports (for symmetry).&lt;/p&gt;&#xA;&lt;h2 id=&#34;keyboard&#34;&gt;Keyboard&lt;/h2&gt;&#xA;&lt;p&gt;If Apple wants to make this work they would need to backpedal to the old system. Even the new updated 2018 butterfly keyboard keeps failing. If they make a new body for this machine, it is possible that they would introduce a v4 of the butterfly switch mechanism.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>My take on 3D Touch</title>
      <link>https://yozy.net/2018/08/my-take-on-3d-touch/</link>
      <pubDate>Tue, 14 Aug 2018 19:30:00 +0000</pubDate>
      <guid>https://yozy.net/2018/08/my-take-on-3d-touch/</guid>
      <description>&lt;p&gt;As the release of new iPhones is approaching, it is time to speculate on new features, or the removal of the old ones. There are rumors that one of the new iPhones will lack 3D Touch capability. To me, this is disturbing as I think that the biggest hindrance in 3D Touch adoption is that it is not omnipresent. Contrary to the opinion that &lt;a href=&#34;https://medium.com/@eliz_kilic/how-apple-can-fix-3d-touch-2f0ca5ea589e&#34;&gt;it is broken&lt;/a&gt;, I believe that discoverability is a minor issue.&lt;/p&gt;&#xA;&lt;p&gt;On a desktop interface there are no indicators to show that a particular element can be right-clicked. This is so because:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There are few actions that are only doable by right clicking, mainly thanks to of toolbars and menu bars.&lt;/li&gt;&#xA;&lt;li&gt;Users intuitively know which elements can be right-clicked.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;First point can be resolved by software: I leave it to designers to design a replacement for menus or toolbars that enable advanced functionality which can be then used with 3D Touch. The second point can be solved with users being exposed to 3D Touch all the time. With the current lineup this is a non-starter as it is available on high end phones only—not on the SE, and not on the iPad.&lt;/p&gt;&#xA;&lt;p&gt;Now is the time for Apple to show if they are invested in 3D Touch or whether it is just a &lt;em&gt;nice-to-have&lt;/em&gt; feature.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>What happens when you delete ~/.Trash folder on macOS</title>
      <link>https://yozy.net/2018/05/what-happens-when-you-delete-~/.trash-folder-on-macos/</link>
      <pubDate>Tue, 15 May 2018 13:00:00 +0200</pubDate>
      <guid>https://yozy.net/2018/05/what-happens-when-you-delete-~/.trash-folder-on-macos/</guid>
      <description>&lt;p&gt;I have done some stupid stuff and managed to delete the &lt;code&gt;~/.Trash&lt;/code&gt; folder on my Mac. The result was surprising:&lt;/p&gt;&#xA;&lt;video width=&#34;720&#34; height=&#34;600&#34; controls&gt;&#xA;  &lt;source src=&#34;https://yozy.net/videos/finder-delete-trash.mp4&#34; type=&#34;video/mp4&#34;&gt;&#xA;&#x9;Your browser does not support the video tag.&#xA;&lt;/video&gt;&#xA;&lt;p&gt;To fix this you can type this in the shell:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-shell&#34; data-lang=&#34;shell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkdir ~/.Trash&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is clearly bad user experience. Somebody not knowing how to fix this will just assume that the trash stopped working. Even worse, they might miss the message and just click on Delete.&lt;/p&gt;&#xA;&lt;p&gt;What should macOS do in this case, is to silently restore the trash folder and keep on humming.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>The new RCS standard is just better SMS, and that is a bad thing</title>
      <link>https://yozy.net/2018/05/the-new-rcs-standard-is-just-better-sms-and-that-is-a-bad-thing/</link>
      <pubDate>Thu, 10 May 2018 21:15:00 +0200</pubDate>
      <guid>https://yozy.net/2018/05/the-new-rcs-standard-is-just-better-sms-and-that-is-a-bad-thing/</guid>
      <description>&lt;p&gt;Google has managed to herd device manufacturers and telcos to support a new standard for messaging: Rich Communication Services (RCS). In short it is &amp;ldquo;SMS, but good&amp;rdquo;, with support for images and other rich media. After gChat, Hangouts, Google+, Meet, Allo or Duo, we can be skeptical on whether it will be adopted.&lt;/p&gt;&#xA;&lt;p&gt;But I think it will. In order to understand why, let’s look at iMessage. When iMessage launched people already had means to communicate with their families, colleagues and friends: WhatsApp, Skype, Hangouts, Facebook WeChat… SMS usage varied country by country, depending on whether the service was paid per message. RCS will be integrated just like iMessage: when you send a message to a phone which supports RCS, it will be used instead of SMS.&lt;/p&gt;&#xA;&lt;p&gt;When iMessage was introduced I had sporadic use of SMS and I knew few people with iPhones. But as that number grew, so did the amount of blue bubbles. Feature-wise iMessage was comparable to other platforms. What makes the Messages&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; app stand out is that it is present by default and cannot be deleted.&lt;/p&gt;&#xA;&lt;p&gt;In a similar fashion, the Android Chat will replace SMS. RCS is not a new silo; it is the long needed update to an outdated system.&lt;/p&gt;&#xA;&lt;h2 id=&#34;rcsthe-messaging-app-killer&#34;&gt;RCS–the messaging app killer&lt;/h2&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/rcs-folder-full-of-apps@3x.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;So many single purpose apps!&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Each social network starts with an original idea but in the end the users will stay if it has a compelling messaging component. To build such a service, it is necessary to know your connections. Initially it was possible to borrow the social graph from Twitter and Facebook, but they have closed the pipes. New players piggy-back on the phone’s contact list to create a rudimentary graph of connections that is tied to telephone numbers. This is a great advantage for RCS it already has access to your contact list as it is your new default messaging service.&lt;/p&gt;&#xA;&lt;p&gt;As people upgrade to RCS, they will discover that they do not need to have Messaging App X for “that one person”. As nobody wants to have a folder full of instant messaging apps, many will be replaced by RCS by erosion. When you replace the application you use for one person by RCS, they have one fewer reasons to use it. As times goes on, only the very large networks will survive.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-the-bad-news&#34;&gt;What is the bad news?&lt;/h2&gt;&#xA;&lt;p&gt;When people left SMS for other services they have got encryption for free. Some services provided end-to-end encryption&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;, some only at the transport level. With the exception of Signal, few people choose messaging services based on privacy — many do not even know what it means for them.&lt;/p&gt;&#xA;&lt;p&gt;With RCS, this feature will disappear and many will lose the protection provided by encryption without knowing it. When SMS was created, security was not a thing in personal communication. Anybody who got hold of your phone could suck all of its information.&lt;/p&gt;&#xA;&lt;p&gt;But our phones did not know everything about us back then. Today, there are lot of actors that would like to get their hands on them sweet messages: criminals, governments and criminal governments.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-can-be-done&#34;&gt;What can be done?&lt;/h2&gt;&#xA;&lt;p&gt;Nothing. We will see how this will play out but I fear that after RCS is entrenched, many messages will be floating around in plain text. I hope that the current secure services will solve problems that RCS can not, providing a compelling reason to stay off it.&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;The app used for iMessage and SMS, the equivalent of the future Android Chat.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;End to end encrypted messages (Signal, WhatsApp, iMessage), guarantee that nobody, including the platform provider, can read your messages.&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Why Does Eventail Have So Many Settings?</title>
      <link>https://yozy.net/2018/04/why-does-eventail-have-so-many-settings/</link>
      <pubDate>Fri, 20 Apr 2018 20:00:00 +0200</pubDate>
      <guid>https://yozy.net/2018/04/why-does-eventail-have-so-many-settings/</guid>
      <description>&lt;p&gt;In general, I do dislike applications which have many settings. It might be a little bit surprising that &lt;a href=&#34;https://itunes.apple.com/us/app/eventail/id959674103?ls=1&amp;amp;mt=8&amp;amp;at=1010lIXq&#34;&gt;Eventail&lt;/a&gt; falls into this category. If you look at the whole un-cropped UI it might be a perfect fit for the sword-like iPhone 20.&lt;/p&gt;&#xA;&lt;p&gt;In design, I try to abide to this rule:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;ldquo;If you want to add an option, you need to decide on the default value. Once you have chosen the default, keep it and remove the option.&amp;rdquo;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;With Eventail, I have broken this rule in two ways: On top of having many options, Eventail&amp;rsquo;s defaults are not even what I would recommend people to use.&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-perfect-app&#34;&gt;The perfect app&lt;/h2&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-04-20/eventail-settings@3x.png#+right+half+margin&#34; alt=&#34;eventail-settings&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The ultimate goal of Eventail is to be a perfect calendar widget for the masses. As I have argued in my &lt;a href=&#34;https://yozy.net/2018/03/why-there-is-no-perfect-email-application/&#34;&gt;article about e-mail clients&lt;/a&gt;: everybody&amp;rsquo;s definition of perfect is different. As such, I have defined two ground rules about the widget which will stay unbroken.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The app uses iOS calendar API, I will not be making any custom clients to manage CalDav or Exchange servers.&lt;/li&gt;&#xA;&lt;li&gt;The app stays a simple and nice to look at widget. There are already a lot of great calendaring apps.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The first rule dictates limits on the features I can implement. For example there is no way I could handle Exchange categories or Google custom event colors in the current iOS (11.3).&lt;/p&gt;&#xA;&lt;p&gt;The second rule might look at odds with many settings, but it is the widget itself that must stay simple. My stats show that most people who download Eventail launch the application once or twice. This is either because the app is crap, or because they set it up the first time they launch it and stash it in a dump folder. I choose to believe in the second case since this is how I intended people to use the app.&lt;/p&gt;&#xA;&lt;p&gt;The complexity of settings dissipates after you have customized the widget to suit your needs. Tap and a detailed view opens, tap again and you are back. Two states is all there is. This is why the widget has (unlike other apps) a prominent preview of how will it look on top.&lt;/p&gt;&#xA;&lt;h2 id=&#34;behind-the-scenesoptions-that-got-axed&#34;&gt;Behind the scenes—options that got axed&lt;/h2&gt;&#xA;&lt;p&gt;Although this means that Eventail will grow in complexity, it will not have &lt;em&gt;all of them, the features&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In the 2.2 version, I have added a thin left border on the events in the default theme. Initially, this was a separate theme because I did not want to get e-mails from people unhappy with the change. In the end I have decided to risk the hit. The new theme is more iOS-like and it makes the choice of the theme simple–just decide whether titles or calendars are more important.&lt;/p&gt;&#xA;&lt;p&gt;New icons for events were initially optional, there was a fallback to spheres for everything. Again, other applications use spheres all the time, but I wanted the invitations to be distinct. There may be more icons coming for other things. For example would it not be great to see a group of two people when there are just two people in the event?&lt;/p&gt;&#xA;&lt;c-clear&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;I have opted for the switch options to be all in the positive tone: &amp;ldquo;display this,&amp;rdquo; &amp;ldquo;enable that&amp;rdquo;. For the sake of consistency and discoverability, they are all turned on by default. I would recommend to hide the empty days though.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Eventail 2.2</title>
      <link>https://yozy.net/2018/04/eventail-2.2/</link>
      <pubDate>Thu, 12 Apr 2018 16:00:00 +0200</pubDate>
      <guid>https://yozy.net/2018/04/eventail-2.2/</guid>
      <description>&lt;p&gt;After two months of coding I am pleased to announce a new version of Eventail.&lt;/p&gt;&#xA;&lt;p&gt;This release brings some new features and a lot of polish into the settings screen.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-04-12/eventail-2.2@2x.png&#34; alt=&#34;Eventail Screenshots&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The app now has some more personality, the preview is more prominent and looks like a preview too!&lt;/p&gt;&#xA;&lt;h2 id=&#34;colors&#34;&gt;Colors&lt;/h2&gt;&#xA;&lt;p&gt;iPhone X users will be, hopefully, delighted by the new &lt;a href=&#34;http://eventailapp.com/documentation.2.2.0.html#settings-theme-background&#34;&gt;&lt;em&gt;Black&lt;/em&gt; theme&lt;/a&gt;, which gives you a pure black background.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-04-12/theme-black-ios@3x.png&#34; alt=&#34;Black Theme&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;There are some good news for people who organize their life by colors too. A new &lt;a href=&#34;http://eventailapp.com/documentation.2.2.0.html#settings-theme-foreground&#34;&gt;&lt;em&gt;Vivid&lt;/em&gt; color scheme&lt;/a&gt; puts accent on the calendar color and makes it easy to navigate through the day if you do a lot of context switching.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-04-12/theme-dark-vivid@3x.png&#34; alt=&#34;Black Theme&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Weekends can &lt;a href=&#34;http://eventailapp.com/documentation.2.2.0.html#settings-aesthetics-tint-weekends&#34;&gt;get their own color too&lt;/a&gt;! A subtle background color indicates where the week ends.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-04-12/tint-weekends-on@3x.png&#34; alt=&#34;Black Theme&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;tweaks&#34;&gt;Tweaks&lt;/h2&gt;&#xA;&lt;p&gt;The events now have a bold-colored stripe on the left, to highlight the calendar they are in.&lt;/p&gt;&#xA;&lt;p&gt;Event invitations have distinct icons, it is easy to distinguish between invitations and own events; and also to see the RSVP status at a glance.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-04-12/eventail-day-view@3x.png&#34; alt=&#34;New Day View Icons&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;and-more&#34;&gt;And more&lt;/h2&gt;&#xA;&lt;p&gt;I have squashed a number of bugs, and worked on the pestering memory issues. In most cases the widget should no longer fail to load, and the troubleshooting options will resolve the rest.&lt;/p&gt;&#xA;&lt;p&gt;Without further ado, find &lt;a href=&#34;https://itunes.apple.com/us/app/eventail/id959674103?ls=1&amp;amp;mt=8&amp;amp;at=1010lIXq&#34;&gt;Eventail on the App Store&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Eventail 2.0</title>
      <link>https://yozy.net/2018/01/eventail-2.0/</link>
      <pubDate>Sun, 28 Jan 2018 18:00:00 +0100</pubDate>
      <guid>https://yozy.net/2018/01/eventail-2.0/</guid>
      <description>&lt;p&gt;After a few months of development, I am proud to announce a new version of my iOS Calendar Widget App Eventail.&lt;/p&gt;&#xA;&lt;p&gt;I am really happy how it turned out and invite you to try it, it is free.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-28/eventail.jpg&#34; alt=&#34;Eventail Screenshots&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Find &lt;a href=&#34;https://itunes.apple.com/us/app/eventail/id959674103?ls=1&amp;amp;mt=8&amp;amp;at=1010lIXq&#34;&gt;Eventail on the App Store&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Zoom out any page on mobile Safari</title>
      <link>https://yozy.net/2018/01/zoom-out-any-page-on-mobile-safari/</link>
      <pubDate>Fri, 26 Jan 2018 10:20:00 +0100</pubDate>
      <guid>https://yozy.net/2018/01/zoom-out-any-page-on-mobile-safari/</guid>
      <description>&lt;p&gt;Just now I wanted to publish a new version of my app to testers. This is to be done on the iTunes connect website. I only had my phone, but according to Steve &amp;ldquo;iOS has full web experience&amp;rdquo; so this should not be a problem.&lt;/p&gt;&#xA;&lt;p&gt;However, iTunes connect does not work exactly well on mobile. This is because the zoom level of the page is fixed on the &amp;ldquo;background&amp;rdquo; while the dialogs are in front. The result is that the button &lt;em&gt;Submit&lt;/em&gt; is inaccessible.&lt;/p&gt;&#xA;&lt;p&gt;After some amount of looking for a solution I have found several bookmarklets that should unlock the zoom. None of them worked. So I made my own solution.&lt;/p&gt;&#xA;&lt;p&gt;Bookmark this page in Safari and change its URL to this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;javascript&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(){&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;body&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;zoom&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;0.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;})()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then, on a page which has elements outside of the viewport, launch the bookmark from the bookmark menu. The page will be twice as small, but more of it will fit!&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>10 Laws of UX, digested</title>
      <link>https://yozy.net/2018/01/10-laws-of-ux-digested/</link>
      <pubDate>Fri, 19 Jan 2018 15:43:59 +0100</pubDate>
      <guid>https://yozy.net/2018/01/10-laws-of-ux-digested/</guid>
      <description>&lt;p&gt;After reading the article on &lt;a href=&#34;https://lawsofux.com/&#34;&gt;10 Laws of UX&lt;/a&gt; and the associated comments on &lt;a href=&#34;https://news.ycombinator.com/item?id=16185118&#34;&gt;Hacker News&lt;/a&gt;, I have decided to try a shot at reformatting the page to a more legible format. In the form of a blog post—because I do not think that every idea on the internet needs its own domain.&lt;/p&gt;&#xA;&lt;p&gt;I provide my own interpretation of the laws in the titles, they are not in the original article.&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-if-a-function-needs-to-be-accessed-often-andor-quickly-make-the-button-big&#34;&gt;1. If a function needs to be accessed often and/or quickly, make the button big&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The time to acquire a target is a function of the distance to and size of the target.&lt;/p&gt;&#xA;&lt;p&gt;&amp;ndash; Paul Fitts&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Fitts%27s_law&#34;&gt;Fitt&amp;rsquo;s Law on Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;2-only-provide-choices-when-a-good-default-does-not-exist&#34;&gt;2. Only provide choices when a good default does not exist&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The time it takes to make a decision increases with the number and complexity of choices.&lt;/p&gt;&#xA;&lt;p&gt;&amp;ndash; William Edmund Hick and Ray Hyman&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Hick%27s_law&#34;&gt;Hick&amp;rsquo;s Law on Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;3-respect-the-platforms-conventions-and-interface-guidelines&#34;&gt;3. Respect the platform&amp;rsquo;s conventions and interface guidelines&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Users spend most of their time on other sites. This means that users prefer your site to work the same way as all the other sites they already know.&lt;/p&gt;&#xA;&lt;p&gt;&amp;ndash; Jakob Nielsen&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.nngroup.com/videos/jakobs-law-internet-ux/&#34;&gt;Jakob&amp;rsquo;s Law on Nielsen Norman Group&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;4-do-not-stuff-too-much-detail-into-a-small-space&#34;&gt;4. Do not stuff too much detail into a small space&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Law of Prägnanz:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;People will perceive and interpret ambiguous or complex images as the simplest form possible, because it is the interpretation that requires the least cognitive effort of us.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.interaction-design.org/literature/article/the-laws-of-figure-ground-praegnanz-closure-and-common-fate-gestalt-principles-3&#34;&gt;The Laws of Figure/Ground, Prägnanz, Closure, and Common Fate on Interaction Design&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;5-put-actions-that-do-similar-things-together&#34;&gt;5. Put actions that do similar things together&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Law of Proximity:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Objects that are near, or proximate to each other, tend to be grouped together.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;N.B.: The recent &lt;a href=&#34;https://twitter.com/CivilBeat/status/953127542050795520&#34;&gt;missile alert fiasco&lt;/a&gt; is a good example of why this is important&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;6-reduce-the-number-of-things-your-users-have-to-remember&#34;&gt;6. Reduce the number of things your users have to remember&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The average person can only keep 7 (plus or minus 2) items in their working memory.&lt;/p&gt;&#xA;&lt;p&gt;&amp;ndash; George Miller&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Miller%27s_law&#34;&gt;Miller&amp;rsquo;s Law on Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;7-make-tasks-short-simple-and-with-set-deadlines&#34;&gt;7. Make tasks short, simple and with set deadlines&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Any task will inflate until all of the available time is spent.&lt;/p&gt;&#xA;&lt;p&gt;&amp;ndash; Cyril Northcote Parkinson&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Parkinson%27s_law&#34;&gt;Parkinson&amp;rsquo;s Law on Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;8-put-the-important-things-at-the-beginning-or-at-the-end&#34;&gt;8. Put the important things at the beginning or at the end&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;Users have a propensity to best remember the first and last items in a series.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Serial-position_effect&#34;&gt;Serial Position Effect on Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;9-removing-features-from-your-product-may-result-in-users-not-being-able-to-achieve-some-goals&#34;&gt;9. Removing features from your product may result in users not being able to achieve some goals&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;Tesler&amp;rsquo;s Law, also known as The Law of Conservation of Complexity, states that for any system there is a certain amount of complexity which cannot be reduced.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Law_of_conservation_of_complexity&#34;&gt;Larry Tesler&amp;rsquo;s Law of Conservation of Complexity on Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;10-make-the-most-important-thing-stand-out&#34;&gt;10. Make the most important thing stand out&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;The Von Restorff effect, also known as The Isolation Effect, predicts that when multiple similar objects are present, the one that differs from the rest is most likely to be remembered.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Von_Restorff_effect&#34;&gt;Von Restorff Effect on Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Alternatively: If you want to stand out from competition, find a feature which is always the same and make it different.&lt;/p&gt;&#xA;&lt;h3 id=&#34;bonus-law&#34;&gt;Bonus law&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Do not put a leading zero on numbers that do not have to be aligned.&lt;/p&gt;&lt;/blockquote&gt;&#xA;</description>
    </item>
    <item>
      <title>How I discovered how iOS calendar app chooses colors by digging into the icloud.com JavaScript code</title>
      <link>https://yozy.net/2018/01/how-i-discovered-how-ios-calendar-app-chooses-colors-by-digging-into-the-icloud.com-javascript-code/</link>
      <pubDate>Sat, 13 Jan 2018 19:50:00 +0100</pubDate>
      <guid>https://yozy.net/2018/01/how-i-discovered-how-ios-calendar-app-chooses-colors-by-digging-into-the-icloud.com-javascript-code/</guid>
      <description>&lt;p&gt;While making an iOS calendar app, I needed to find out how Apple calculates background and text colors when displaying events in the Calendar app. I wanted to use the same algorithm for my display, in order to integrate well with the OS.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/apple-event-colors-iphone@3x.jpeg&#34; alt=&#34;colors-iphone&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;I was hoping for some &lt;code&gt;displayBacgkroundColor&lt;/code&gt; property on &lt;code&gt;EKCalendar&lt;/code&gt; object or something similar, but it does not seem to exist. I almost decided to start approximating their algorithm while I realized one thing—the icloud.com site has a calendar &amp;ldquo;application&amp;rdquo;. The event colors there seem to follow the same logic as those in the Calendar app. They are not strictly the same but it could provide some insight into how the color switching works.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/apple-event-colors-icloud@2x.png&#34; alt=&#34;colors-icloud&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;iCloud.com being a modern web application, it runs a bunch of client side JavaScript. Since it is possible to add events, change calendar colors and so on, I assumed that the code which calculates the text and background colors for events must be somewhere in the publicly available JavaScript. There was a small possibility that they pre-computed the colors on the server but this seemed unlikely.&lt;/p&gt;&#xA;&lt;h1 id=&#34;homing-in-on-the-function&#34;&gt;Homing in on the function&lt;/h1&gt;&#xA;&lt;p&gt;I decided to use Safari for this. It seems kind of appropriate and I am quite familiar with its web developer tools. I open the iCloud website, open the calendar page and look into what kind of JavaScript files are loaded.&lt;/p&gt;&#xA;&lt;p&gt;Among others, this page loads mainly two big JavaScript files, both called &lt;code&gt;javascript-packed.js&lt;/code&gt;. The other files are all called &lt;code&gt;javascript-strings&lt;/code&gt; so I assume these load the localization files or something like that.&lt;/p&gt;&#xA;&lt;p&gt;My first hypothesis was that the function is called when a color of an already present event is changed. This might happen when, for example, the calendar to which the event belongs is changed.&lt;/p&gt;&#xA;&lt;p&gt;Luckily Safari can display minified JavaScript files in indented mode. However searching for functions for strings like &amp;ldquo;update&amp;rdquo; gave me too many results.&lt;/p&gt;&#xA;&lt;p&gt;Looking at the HTML code of an event, I can observe that its color is inside an inline style attribute and that it changes when I change the calendar. This is good news, as the inspector lets me to put a breakpoint on that.&lt;/p&gt;&#xA;&lt;p&gt;In the inspector I find the event element, right click on the div in the tree structure and set a breakpoint on &lt;em&gt;Attribute Modified&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/set-breakpoint@2x.png&#34; alt=&#34;set-breakpoint&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now I click on the event in the app, change the calendar&amp;hellip; and voilà.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/callstack@2x.png&#34; alt=&#34;callstack&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;walking-up-the-call-stack&#34;&gt;Walking up the call stack&lt;/h2&gt;&#xA;&lt;p&gt;At the very end of the call stack I can see that a property is assigned a value of &lt;code&gt;#a66110&lt;/code&gt;. This is actually the text color for this calendar (I checked this in the inspector). My hope is that it will be calculated somewhere up the stack.&lt;/p&gt;&#xA;&lt;p&gt;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/callstack-01@2x.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;1 style: Assign #a66110 as as the color property of a CSS declaration&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/callstack-02@2x.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;2 anonymous: Function that that applies the CSS style when called&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/callstack-03@2x.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;3 access: This function is a sort of trampoline&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/callstack-04@2x.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;4 css: This function generates the anonymous function in step 2, it does get the #a66110 as a parameter &amp;#39;n&amp;#39;&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/callstack-05@2x.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;5 updateProperty: calls the css function, and also gets the #a66110 as a parameter &amp;#39;r&amp;#39;&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;When I get to the 6th level I finally hit something interesting. This is where the value &lt;code&gt;#a66110&lt;/code&gt; is created (inside a function called &lt;code&gt;_update&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/callstack-06@2x.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;6 _update: This function seems to update the whole event, its title, state and most importantly, colors&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;textColor&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;get&lt;/code&gt; method seems to be doing something akin to the following (I did not really dig into this):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;prototype&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;propName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;call&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;properties&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;propName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I any case, the color value is derived from object &lt;code&gt;t&lt;/code&gt; and its property &lt;code&gt;textColor&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;finding-the-event-object&#34;&gt;Finding the &amp;lsquo;Event&amp;rsquo; object&lt;/h2&gt;&#xA;&lt;p&gt;I look into the &lt;code&gt;t&lt;/code&gt; object&amp;rsquo;s properties and see this:&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-13/t-object-properties@2x.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;A cursory glance at the properties confirms to me that this is an &amp;lsquo;Event&amp;rsquo; object. It has the usual ones such as &lt;code&gt;owner&lt;/code&gt;, &lt;code&gt;isAccepted&lt;/code&gt; and so on.&lt;/p&gt;&#xA;&lt;p&gt;Intuitively this line then, in the &lt;code&gt;_update&lt;/code&gt; function, does what we were searching for: &lt;em&gt;Get the text color for an event and change the elements css representation to reflect that.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;textColor&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;updateProperty&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;.text&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;color&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I dig into this &lt;code&gt;textColor&lt;/code&gt; property. I search the JavaScript file for it and look over the few results I get.&lt;/p&gt;&#xA;&lt;p&gt;Within a piece of code which starts with &lt;code&gt;Cal.Collection = CoreCal.Collection.extend({&lt;/code&gt; I find this (among the other event properties):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;textColor&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;isBirthdayCalendar&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#4d5765&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;_hexColor&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Cal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;colorController&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;computeTextColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;property&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;_hexColor&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;cacheable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;backgroundColor&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;isBirthdayCalendar&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#cfd3d9&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;_hexColor&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Cal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;colorController&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;computeBackgroundColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;property&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;_hexColor&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;cacheable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;Cal.colorController.computeTextColor(e)&lt;/code&gt; and &lt;code&gt;Cal.colorController.computeBackgroundColor(e)&lt;/code&gt; and in both cases &lt;code&gt;e&lt;/code&gt; is a color&amp;hellip; finally I have struck gold!&lt;/p&gt;&#xA;&lt;h2 id=&#34;compute-text-and-background-color&#34;&gt;Compute text and background color&lt;/h2&gt;&#xA;&lt;p&gt;The function iCloud uses to compute the text color is this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;computeTextColor&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;CW&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fatalError&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Cannot provide a text color without a starting color&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;toLowerCase&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;specialColors&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;SC&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;convertHexToHsv&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;f&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isLight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;light&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isDark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;dark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;l&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isGray&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;f&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;SC&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;convertHsvToHex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;l&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;f&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;By putting a breakpoint on the &lt;code&gt;f = ...&lt;/code&gt; line I can deduce the constants &lt;code&gt;n = 0.35&lt;/code&gt;, &lt;code&gt;e = 0.5&lt;/code&gt; and &lt;code&gt;t = 0.3&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;As for the background color:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;computeBackgroundColor&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;SC&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Cannot provide a background color without a starting color&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;toLowerCase&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;this&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;specialColors&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;backgrounds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;SC&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;convertHexToHsv&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isLight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;light&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isDark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;dark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isGray&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;SC&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;convertHsvToHex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;bgBrightness&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#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 the contents of the &lt;code&gt;specialColors&lt;/code&gt; are here (comments are from my investigation of constants):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;specialColors&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;light&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#dddddd&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#a8a8a8&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#f8f8f8&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;dark&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#1a1a1a&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#000000&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#bababa&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;titles&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;s2&#34;&gt;&amp;#34;#cc73e1&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#b14bc9&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;s2&#34;&gt;&amp;#34;#65db39&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#49bf1f&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;s2&#34;&gt;&amp;#34;#ffcc00&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#e0ac00&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;s2&#34;&gt;&amp;#34;#ff9500&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#ff7f00&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;backgrounds&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;s2&#34;&gt;&amp;#34;#a2845e&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#e0d3c1&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;isLight&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;kd&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Cal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;colorController&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// r = 0.6, i = 0.1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;isDark&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// t = 0.3&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;isGray&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// i = 0.1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;    &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;bgBrightness&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;min&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;n&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;1.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;o&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then there is a bunch of color conversion functions that work in a pretty standard way.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;convertHsvToHex&lt;/code&gt; takes a R, G, B triplet and returns a &lt;code&gt;[H, S, V]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;convertHexToHsv&lt;/code&gt; takes an array of three elements &lt;code&gt;[H, S, V]&lt;/code&gt; and returns an array &lt;code&gt;[R, G, B]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;two regexes to check if a colors is in the HTML &lt;code&gt;rgb(r, g, b)&lt;/code&gt; or &lt;code&gt;#RRGGBB&lt;/code&gt; format&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;parseColor&lt;/code&gt; which converts either of the two formats and returns a &lt;code&gt;#RRGGBB&lt;/code&gt; representation&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;expandColor&lt;/code&gt; which takes the &lt;code&gt;#RRGGBB&lt;/code&gt; color and returns an array of &lt;code&gt;[R, G, B]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;toColorPart&lt;/code&gt; which takes a number in 0-255 range and transforms it to hex representation&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I am not going to detail these functions here, but I have uploaded them here if you would like to look:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/2018/original-apple-conversion-functions.js&#34;&gt;Original Apple Conversion Functions&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;rewriting-the-functions-into-more-human-readable-format&#34;&gt;Rewriting the functions into more human readable format&lt;/h1&gt;&#xA;&lt;p&gt;These functions were of course at least partly generated and minified. So I have rewritten them into a digestible format.&lt;/p&gt;&#xA;&lt;p&gt;First, I have written a &lt;code&gt;colorTools&lt;/code&gt; object which has the properties from the &lt;code&gt;specialColors&lt;/code&gt; object on iCloud.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;light&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#a8a8a8&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#f8f8f8&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;dark&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#000000&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#bababa&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;backgrounds&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;s2&#34;&gt;&amp;#34;#a2845e&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;#e0d3c1&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;isLight&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.6&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;isDark&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.3&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;isGray&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;bgBrightness&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;min&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;1.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;cm&#34;&gt;/* color space conversion removed for brevity */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This object is then used as a helper for the two functions I was actually searching for in the beginning.&lt;/p&gt;&#xA;&lt;h2 id=&#34;text-color&#34;&gt;Text Color&lt;/h2&gt;&#xA;&lt;p&gt;If the color is too light or too dark then use a pre-computed text color. Otherwise cap the saturation to 0.5 (for grayish colors just set it at 0) and reduce the value by 0.35.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;computeTextColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;rgb&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;convertHexToHsv&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;rgb&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;  &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isLight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;light&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isDark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;dark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;rs&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isGray&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;rv&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.35&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;convertHsvToHex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;rs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Math&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;max&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;rv&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;background-color&#34;&gt;Background color&lt;/h2&gt;&#xA;&lt;p&gt;In a similar fashion, use a pre-computed colors if the background is too light or dark. Set the saturation to 0 for grayish colors.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;computeBackgroundColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;rgb&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;backgrounds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;rgb&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;])&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;backgrounds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;rgb&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;convertHexToHsv&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;rgb&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isLight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;light&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isDark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;dark&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;background&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;rs&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;isGray&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;convertHsvToHex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;rs&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;colorTools&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;bgBrightness&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;v&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This was fun. Now, the colors on iCloud website are not strictly the same than in the iOS app, but that requires just a bit of tweaking with the constants.&lt;/p&gt;&#xA;&lt;p&gt;You can download the complete JavaScript file I have extracted here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/2018/apple-calendar-colors.js&#34;&gt;Apple Calendar Colors&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;some-final-words&#34;&gt;Some final words&lt;/h1&gt;&#xA;&lt;p&gt;There you have it. In the end I was actually surprised that it was pretty easy to extract these functions from the code. I expected the minified/obfuscated code to be quite hard to read. Interestingly, most function names did not get mangled. I suppose this is due to the fact that they are called through strings in some part of the framework Apple uses.&lt;/p&gt;&#xA;&lt;p&gt;Of course, later I have converted these functions into Swift UIColor extensions so I can use them in my &lt;a href=&#34;https://itunes.apple.com/us/app/eventail/id959674103?mt=8&#34;&gt;application&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I might publish them here sometime later, but if you are interested ask me on Twitter.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Thoughts about spam notifications in iOS</title>
      <link>https://yozy.net/2018/01/thoughts-about-spam-notifications-in-ios/</link>
      <pubDate>Tue, 09 Jan 2018 15:00:00 +0100</pubDate>
      <guid>https://yozy.net/2018/01/thoughts-about-spam-notifications-in-ios/</guid>
      <description>&lt;p&gt;I try to keep my notifications minimal. Only those which are important should get through.&lt;/p&gt;&#xA;&lt;p&gt;But when I receive notifications like this my blood boils:&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-05/spam-notification@3x.jpg&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Spam notification from Prime Video, for an episode I have already watched.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Amazon is not the sole culprit. When I received several notifications from The Fork I have confronted them on Twitter. They have promised to do something about it, and then a few days later I was spammed again&amp;hellip; with the same notification.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-05/spam-notification-fork@3x.jpg&#34; alt=&#34;The Fork is guilty too&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Although this is forbidden by &lt;a href=&#34;https://developer.apple.com/app-store/review/guidelines/#apple-sites-and-services&#34;&gt;Apple App Store Review Guidelines, Design section 4.5.3&lt;/a&gt;, big firms do not care.&lt;/p&gt;&#xA;&lt;p&gt;I think the main problem comes from the fact that these cost nothing and are invisible to apple. I think we should be able to report these to Apple, in the same way it is done for spam e-mail.&lt;/p&gt;&#xA;&lt;h1 id=&#34;where-to-put-the-report-button&#34;&gt;Where to put the report button?&lt;/h1&gt;&#xA;&lt;p&gt;Putting a button on each notification would be an overkill, it would be easy to hit it with a fat thumb.&lt;/p&gt;&#xA;&lt;p&gt;It could go into the slide over or 3D touch menu in the notification center. But the problem is that if a notification pops up while the phone is unlocked, and you tap it by reflex, it gets a free pass. These are maddening.&lt;/p&gt;&#xA;&lt;p&gt;My idea would be to put a section inside the Privacy tab. This view would display last few notifications you have received, with an option to report them to Apple and an option to ignore notifications with the same text from this application. At first, this would not have much impact, but over time Apple could use this data to pressure App publishers and maybe even start training Siri to act as a spam filter.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Pure CSS solution to retina images with a single file</title>
      <link>https://yozy.net/2018/01/pure-css-solution-to-retina-images-with-a-single-file/</link>
      <pubDate>Wed, 03 Jan 2018 10:20:50 +0100</pubDate>
      <guid>https://yozy.net/2018/01/pure-css-solution-to-retina-images-with-a-single-file/</guid>
      <description>&lt;p&gt;Problem: You have an image and want it to display well in browsers on a high DPI display. There are many ways to do this, some of them &lt;a href=&#34;http://mir.aculo.us/2012/06/26/flowchart-how-to-retinafy-your-website/&#34;&gt;more complicated&lt;/a&gt; than &lt;a href=&#34;http://brianflove.com/2014/08/07/retina-display-images/&#34;&gt;others&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;My requirements were pretty simple:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I want to be able to publish &amp;ldquo;retina&amp;rdquo; images with default markdown syntax&lt;/li&gt;&#xA;&lt;li&gt;I prefer images to be blurry on non-high DPI screens, they are blurry anyway so what&amp;rsquo;s the harm.&lt;/li&gt;&#xA;&lt;li&gt;I do not care about wasted bandwidth by sending retina assets to clients with standard definition screens. Not having ads or huge javascript on this site makes up for this.&lt;/li&gt;&#xA;&lt;li&gt;I do not want to use any javascript or server side hacks&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So what&amp;rsquo;s the solution?&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Name @2x assets with &lt;code&gt;@2x&lt;/code&gt; in their filename, for example &lt;a href=&#34;mailto:image@2x.png&#34;&gt;image@2x.png&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Add this small snippet into my CSS file (thanks, Internet Explorer!)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*=&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;@2x&amp;#39;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;zoom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;50&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;%&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For an example usage look at my &lt;a href=&#34;https://yozy.net/2018/01/qt-creator-hidden-gems/&#34;&gt;article about Qt Creator&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Qt Creator Hidden Gems</title>
      <link>https://yozy.net/2018/01/qt-creator-hidden-gems/</link>
      <pubDate>Tue, 02 Jan 2018 11:57:28 +0100</pubDate>
      <guid>https://yozy.net/2018/01/qt-creator-hidden-gems/</guid>
      <description>&lt;p&gt;When it comes to C++ IDEs I always reach for Qt Creator. I love its streamlined user interface which nevertheless exposes all screws and knobs if necessary.&lt;/p&gt;&#xA;&lt;p&gt;But mostly I like how it manages to surprise me with every update.&lt;/p&gt;&#xA;&lt;p&gt;Most recently I have updated to version 4.5.1 (from the 4.5 RC) and as I am hacking on the keyboard I see this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-02/qt-creator-output-param@2x.png&#34; alt=&#34;QtCreator detects output parameters&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Finally a work around the terrible decision to not explicitly mark function parameters used as a reference in C++.&lt;/p&gt;&#xA;&lt;p&gt;What&amp;rsquo;s more, Qt Creator does support &amp;ldquo;relative&amp;rdquo; text style for this highlight. One &lt;code&gt;saturation +0.30&lt;/code&gt; later I have:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/2018-01-02/qt-creator-output-param-hilight@2x.png&#34; alt=&#34;QtCreator can change text style relatively&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Can&amp;rsquo;t wait for what the 4.6 will bring!&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Setting File Permissions on Windows With C</title>
      <link>https://yozy.net/2017/11/setting-file-permissions-on-windows-with-c/</link>
      <pubDate>Thu, 30 Nov 2017 11:07:22 +0100</pubDate>
      <guid>https://yozy.net/2017/11/setting-file-permissions-on-windows-with-c/</guid>
      <description>&lt;p&gt;&lt;em&gt;Edit 2018-01-19&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;In my original article I have naively supposed that the group names are not localized. This is false. Always use the Well Known Security IDs when manipulating permissions on Windows.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve spent good part of my morning trying to find a way how to set permissions to a particular group.&lt;/p&gt;&#xA;&lt;p&gt;Finally while digging though Stack Overflow I have found &lt;a href=&#34;https://stackoverflow.com/questions/910528/how-to-change-the-acls-from-c&#34;&gt;this question&lt;/a&gt; which lead to &lt;a href=&#34;https://stackoverflow.com/questions/1095745/am-i-using-setnamedsecurityinfo-incorrectly-the-acl-of-my-file-doesnt-seem-to&#34;&gt;another&lt;/a&gt; because of deprecation errors.&lt;/p&gt;&#xA;&lt;p&gt;My final version of the code to &lt;em&gt;add&lt;/em&gt; file &lt;em&gt;read&lt;/em&gt; and &lt;em&gt;write&lt;/em&gt; permissions to the group &lt;em&gt;Users&lt;/em&gt; is this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-c++&#34; data-lang=&#34;c++&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#include&lt;/span&gt; &lt;span class=&#34;cpf&#34;&gt;&amp;lt;Windows.h&amp;gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#include&lt;/span&gt; &lt;span class=&#34;cpf&#34;&gt;&amp;lt;AccCtrl.h&amp;gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#include&lt;/span&gt; &lt;span class=&#34;cpf&#34;&gt;&amp;lt;Aclapi.h&amp;gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fileName&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;C:/path/to/your_file.txt&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;DWORD&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;PACL&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pDACL&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;PACL&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pOldDACL&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;PSECURITY_DESCRIPTOR&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pSD&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;EXPLICIT_ACCESS&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;PSID&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pUsersSID&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;auto&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;cleanup&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pOldDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pSD&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pUsersSID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;](){&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pOldDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;LocalFree&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pOldDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;LocalFree&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pSD&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;LocalFree&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pSD&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pUsersSID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FreeSid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pUsersSID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetNamedSecurityInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;static_cast&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LPTSTR&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fileName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SE_FILE_OBJECT&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DACL_SECURITY_INFORMATION&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pOldDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pSD&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ERROR_SUCCESS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cerr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Failed to get the security info [&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;]&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;endl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;cleanup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EReturnCode_Error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ZeroMemory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;sizeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;EXPLICIT_ACCESS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;SID_IDENTIFIER_AUTHORITY&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SIDAuthNT&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SECURITY_NT_AUTHORITY&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AllocateAndInitializeSid&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;SIDAuthNT&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SECURITY_BUILTIN_DOMAIN_RID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DOMAIN_ALIAS_RID_USERS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pUsersSID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cerr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Failed to allocate SID&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;endl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;cleanup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EReturnCode_Error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;grfAccessPermissions&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FILE_GENERIC_WRITE&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FILE_GENERIC_READ&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;grfAccessMode&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SET_ACCESS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;grfInheritance&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CONTAINER_INHERIT_ACE&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;OBJECT_INHERIT_ACE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Trustee&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TrusteeForm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TRUSTEE_IS_SID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Trustee&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TrusteeType&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TRUSTEE_IS_WELL_KNOWN_GROUP&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Trustee&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ptstrName&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;reinterpret_cast&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LPTSTR&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pUsersSID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetEntriesInAcl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pOldDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ERROR_SUCCESS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cerr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Failed to set entries in the access control list [&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;]&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;endl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;cleanup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EReturnCode_Error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SetNamedSecurityInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;static_cast&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LPTSTR&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fileName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SE_FILE_OBJECT&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;DACL_SECURITY_INFORMATION&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ERROR_SUCCESS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cerr&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Failed to set the security info [&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;]&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;endl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;n&#34;&gt;cleanup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;EReturnCode_Error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;cleanup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note: You will also need to link your program with &lt;code&gt;Advapi32.lib&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;My original code follows, do &lt;em&gt;not&lt;/em&gt; use this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-c++&#34; data-lang=&#34;c++&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;fileName&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;C:/path/to/your_file.txt&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;PACL&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pDACL&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;PACL&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pOldDACL&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;PSECURITY_DESCRIPTOR&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pSD&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;EXPLICIT_ACCESS&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;GetNamedSecurityInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;static_cast&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LPTSTR&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fileName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SE_FILE_OBJECT&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                     &lt;span class=&#34;n&#34;&gt;DACL_SECURITY_INFORMATION&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                     &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pOldDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pSD&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ZeroMemory&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;sizeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;EXPLICIT_ACCESS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;groupUsersName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;USERS&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;grfAccessPermissions&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FILE_GENERIC_WRITE&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;FILE_GENERIC_READ&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;grfAccessMode&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SET_ACCESS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;grfInheritance&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CONTAINER_INHERIT_ACE&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;OBJECT_INHERIT_ACE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Trustee&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TrusteeForm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TRUSTEE_IS_NAME&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Trustee&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;TrusteeType&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;TRUSTEE_IS_GROUP&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Trustee&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ptstrName&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;groupUsersName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;SetEntriesInAcl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ea&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pOldDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;SetNamedSecurityInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;static_cast&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;LPTSTR&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fileName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SE_FILE_OBJECT&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                     &lt;span class=&#34;n&#34;&gt;DACL_SECURITY_INFORMATION&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;pDACL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#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>Parallels 12 and Windows 7 Slow Cursor</title>
      <link>https://yozy.net/2017/11/parallels-12-and-windows-7-slow-cursor/</link>
      <pubDate>Wed, 22 Nov 2017 11:41:09 +0100</pubDate>
      <guid>https://yozy.net/2017/11/parallels-12-and-windows-7-slow-cursor/</guid>
      <description>&lt;p&gt;After updating my macOS, Parallels 12 has broken loading a VM from the&#xA;Bootcamp partition. This has forced me to use my Windows 7 virtual machine&#xA;and I have discovered a weird problem:&lt;/p&gt;&#xA;&lt;p&gt;The mouse cursor inside the virtual machine is really slow if an&#xA;application is loading something or doing some activity.&lt;/p&gt;&#xA;&lt;p&gt;At first I thought this was because the machine was hogged, but the&#xA;problem is actually simpler than that: &lt;em&gt;Windows 7, in Parallels 12, is&#xA;really &lt;strong&gt;slow&lt;/strong&gt; when rendering an animated cursor&lt;/em&gt;. I have changed my&#xA;cursor theme to an old non-aero one and everything is fine now.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Use QtCreator to develop OpenViBE in 2017 on Linux</title>
      <link>https://yozy.net/2017/11/use-qtcreator-to-develop-openvibe-in-2017-on-linux/</link>
      <pubDate>Sun, 19 Nov 2017 20:00:00 +0000</pubDate>
      <guid>https://yozy.net/2017/11/use-qtcreator-to-develop-openvibe-in-2017-on-linux/</guid>
      <description>&lt;p&gt;Note: This tutorial does not use the &lt;em&gt;meta&lt;/em&gt; repository. It uses the latest OpenViBE 2.0.0 repositories with the multi-repository build. It is based on QtCreator 4.4.1 (the currently latest stable release). It will work on the 4.5 version, however this one seems to not currently work very well on Linux.&lt;/p&gt;&#xA;&lt;p&gt;It is possible to simplify this installation a LOT if you only wish to build the OpenViBE component and wish to use the default SDK (Kernel, Modules, base plugins..) and Designer. In that case only take the part concerning the &lt;em&gt;extras&lt;/em&gt; repo and do not specify custom &lt;strong&gt;OPENVIBE_SDK_PATH&lt;/strong&gt; and &lt;strong&gt;DESIGNER_SDK_PATH&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This tutorial also does not use the build scripts!&lt;/p&gt;&#xA;&lt;p&gt;This post assumes that your final configuration will look like this:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;openvibe&lt;/strong&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;sdk&lt;/strong&gt; &lt;em&gt;git repository for OpenViBE SDK&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;designer&lt;/strong&gt; &lt;em&gt;git repository for OpenViBE Designer&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;extras&lt;/strong&gt; &lt;em&gt;git repository for OpenViBE Extras&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;test&lt;/strong&gt; &lt;em&gt;git repository for integration tests&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;build&lt;/strong&gt; &lt;em&gt;contains all of the build folders populated by CMake&lt;/em&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;sdk-debug&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;sdk-release&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;designer-debug&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;designer-release&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;extras-debug&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;extras-release&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;dist&lt;/strong&gt; &lt;em&gt;contains all of the folders created during CMake INSTALL phase&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;sdk-debug&lt;/strong&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;sdk-release&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;designer-debug&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;designer-release&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;openvibe-debug&lt;/strong&gt; &lt;em&gt;this tis the final destination of the complete Debug build&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;openvibe-release&lt;/strong&gt; &lt;em&gt;and the release build&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In my examples I am putting all of these files under &lt;code&gt;/opt&lt;/code&gt;, if you want them somewhere else you should change all instances of &lt;code&gt;/opt&lt;/code&gt; in this tutorial to something else.&lt;/p&gt;&#xA;&lt;h1 id=&#34;clone-the-repositories&#34;&gt;Clone the repositories&lt;/h1&gt;&#xA;&lt;p&gt;Get to the folder where you want to have your &lt;strong&gt;openvibe&lt;/strong&gt; root folder and do:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; /opt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkdir openvibe&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; openvibe&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkdir build&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; build&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkdir sdk-debug sdk-release designer-debug designer-release openvibe-debug openvibe-release&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; ..&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkdir dist&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone git@gitlab.inria.fr:openvibe/sdk.git sdk&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone git@gitlab.inria.fr:openvibe/designer.git designer&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone git@gitlab.inria.fr:openvibe/extras.git extras&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git clone git@gitlab.inria.fr:openvibe/test.git &lt;span class=&#34;nb&#34;&gt;test&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id=&#34;install-dependencies&#34;&gt;Install dependencies&lt;/h1&gt;&#xA;&lt;p&gt;Some dependencies are needed, this will install all linux native packages + some extras such as test.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# if you want test data you will need the values for these variables&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;PROXYPASS&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;DEPENDENCY_SERVER&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;perl sdk/scripts/linux-install_dependencies.pl --manifest-dir sdk/scripts/ --dependencies-dir dependencies&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;perl sdk/scripts/linux-install_dependencies.pl --manifest-dir designer/scripts/ --dependencies-dir dependencies&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;perl sdk/scripts/linux-install_dependencies.pl --manifest-dir extras/scripts/ --dependencies-dir dependencies&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; /opt/openvibe/sdk&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;./unix-get-dependencies.sh --manifest tests-data.txt --out /opt/openvibe/dependencies --cache /opt/openvibe/dependencies/arch&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id=&#34;configure-the-qtcreator&#34;&gt;Configure the QtCreator&lt;/h1&gt;&#xA;&lt;p&gt;This step will have to be reproduced for all of the other repositories with minor changes.&lt;/p&gt;&#xA;&lt;p&gt;It is important to know how CMake actually works, a quick summary:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CMake creates a &lt;em&gt;build&lt;/em&gt; folder during configuration step. This folder contains all of the configuration files (CMakeCache.txt is the most important), ninja file (this tells the compiler in what order it should build the project) and the built binary files.&lt;/li&gt;&#xA;&lt;li&gt;When you configure the project all of the variables you specify at configure are saved in the &lt;em&gt;build&lt;/em&gt; folder.&lt;/li&gt;&#xA;&lt;li&gt;When you build the project, the binary files are kept in the &lt;em&gt;build&lt;/em&gt; folder.&lt;/li&gt;&#xA;&lt;li&gt;When you INSTALL the project, only the files that are necessary for the final application are copied into the &lt;em&gt;dist&lt;/em&gt; folder (specified by &lt;strong&gt;CMAKE_INSTALL_PREFIX&lt;/strong&gt;. On Linux, the default &lt;em&gt;dist&lt;/em&gt; folder is &lt;code&gt;/usr/local&lt;/code&gt; and on Windows it is &lt;code&gt;C:\Program Files (x86)\PROJECT_NAME&lt;/code&gt;. We &lt;strong&gt;do not&lt;/strong&gt; want to use the default folders!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;session-configuration&#34;&gt;Session configuration&lt;/h2&gt;&#xA;&lt;p&gt;Launch QtCreator, create a new session&lt;/p&gt;&#xA;&lt;h2 id=&#34;sdk-configuration&#34;&gt;SDK configuration&lt;/h2&gt;&#xA;&lt;p&gt;Go to &lt;strong&gt;Welcome -&amp;gt; Open Project&lt;/strong&gt; and navigate to the &lt;code&gt;openvibe/sdk/CMakeLists.txt&lt;/code&gt; file, a dialog like this will open:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/sdk-configure-project.png&#34; alt=&#34;sdk-configure-project&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note that I have already changed all paths to what they should be.&lt;/p&gt;&#xA;&lt;p&gt;Click on the &lt;strong&gt;Configure Project&lt;/strong&gt; button.&lt;/p&gt;&#xA;&lt;h3 id=&#34;cmake-variables&#34;&gt;CMake variables&lt;/h3&gt;&#xA;&lt;p&gt;You will see a lot of errors printed in the General Messages tab on the bottom. Go to the &lt;strong&gt;Projects&lt;/strong&gt; pane on the right and select &lt;strong&gt;build&lt;/strong&gt; under GCC.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/build-configuration-button.png&#34; alt=&#34;build-config-button&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Check that the &lt;strong&gt;Edit build configuration&lt;/strong&gt; dropdown is set to &lt;strong&gt;Debug&lt;/strong&gt; on the top of this window.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/sdk-build-type-debug.png&#34; alt=&#34;sdk-build-type-debug&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now you will need to (sadly, blindly) add a few variables to the lot. This is because the configuration by default is not what we want.&lt;/p&gt;&#xA;&lt;p&gt;Add these variables:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;CMAKE_INSTALL_PREFIX&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt; &lt;code&gt;/opt/openvibe/dist/sdk-debug&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;OV_CUSTOM_DEPENDENCIES_PATH&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt; &lt;code&gt;/opt/openvibe/dependencies&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;BUILD_UNIT_TEST&lt;/strong&gt; &lt;code&gt;Boolean&lt;/code&gt; &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;BUILD_VALIDATION_TEST&lt;/strong&gt; &lt;code&gt;Boolean&lt;/code&gt; &lt;code&gt;ON&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The test variables are not strictly necessary and you can turn them OFF if you want.&lt;/p&gt;&#xA;&lt;p&gt;Click on &lt;strong&gt;Apply Configuration&lt;/strong&gt;. Note that Qt Creator does not save this configuration if you do not use Apply!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/sdk-build-configuration.png&#34; alt=&#34;sdk-build-config&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;install-and-clean&#34;&gt;Install and clean&lt;/h3&gt;&#xA;&lt;p&gt;In order to actually run the INSTALL step after each build (this is not how normal projects work but here it is necessary).&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;strong&gt;Build Steps&lt;/strong&gt; and &lt;strong&gt;Clean Steps&lt;/strong&gt; choose the &lt;em&gt;install&lt;/em&gt; and &lt;em&gt;clean&lt;/em&gt; option respectively.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/sdk-build-steps.png&#34; alt=&#34;sdk-build-steps&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;run-environment&#34;&gt;Run environment&lt;/h3&gt;&#xA;&lt;p&gt;OpenViBE requires some variables on runtime to work. Also, as we are not installing into a default prefix we need to tell Linux where to find the libraries.&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;strong&gt;Build Environment&lt;/strong&gt; click on &lt;strong&gt;Batch Edit&amp;hellip;&lt;/strong&gt; and insert the following string:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;LD_LIBRARY_PATH=/opt/openvibe/dist/sdk-debug/lib&#xA;OV_PATH_ROOT=/opt/openvibe/dist/sdk-debug&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You are now ready to build &lt;em&gt;OpenViBE SDK&lt;/em&gt; in &lt;em&gt;Debug&lt;/em&gt; mode. Give it a spin, either right click on the OpenVIBE project in the &lt;strong&gt;Edit&lt;/strong&gt; view or use the hammer button on the bottom left.&lt;/p&gt;&#xA;&lt;h3 id=&#34;release-configuration&#34;&gt;Release configuration&lt;/h3&gt;&#xA;&lt;p&gt;Redo the same thing for &lt;strong&gt;Release&lt;/strong&gt; configuration on the top.&lt;/p&gt;&#xA;&lt;p&gt;In this case you will need to change the &lt;strong&gt;CMAKE_INSTALL_PREFIX&lt;/strong&gt; to &lt;code&gt;/opt/openvibe/dist/sdk-release/&lt;/code&gt;. And choose the appropriate environment variables like so:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;LD_LIBRARY_PATH=/opt/openvibe/dist/sdk-release/lib&#xA;OV_PATH_ROOT=/opt/openvibe/dist/sdk-release&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;designer-configuration&#34;&gt;Designer configuration&lt;/h2&gt;&#xA;&lt;p&gt;This step is very similar to the SDK. First open the project from the Welcome screen.&lt;/p&gt;&#xA;&lt;p&gt;On the &lt;em&gt;configure project&lt;/em&gt; page select:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Debug &lt;em&gt;build folder&lt;/em&gt; is &lt;code&gt;/opt/openvibe/build/designer-debug&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Release &lt;em&gt;build folder&lt;/em&gt; is &lt;code&gt;/opt/openvibe/build/designer-release&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Do not forget to disable all other build types.&lt;/p&gt;&#xA;&lt;h3 id=&#34;cmake-variables-1&#34;&gt;CMake variables&lt;/h3&gt;&#xA;&lt;p&gt;You will need some additional CMake variable specified:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;OPENVIBE_SDK_PATH&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt; &lt;code&gt;/opt/openvibe/dist/sdk-debug&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;LIST_DEPENDENCIES_PATH&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt; &lt;code&gt;/opt/openvibe/dependencies&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;CMAKE_INSTALL_PREFIX&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt; &lt;code&gt;/opt/openvibe/dist/designer-debug&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This tells the designer to find the SDK built in the previous step. Otherwise the designer will use SDK from its dependencies.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/designer-build-configuration.png&#34; alt=&#34;designer-build-config&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Click on &lt;strong&gt;Apply Configuration&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;install--clean&#34;&gt;Install &amp;amp; Clean&lt;/h3&gt;&#xA;&lt;p&gt;Check the &lt;code&gt;install&lt;/code&gt; and &lt;code&gt;clean&lt;/code&gt; options in Clean and Build steps like in SDK.&lt;/p&gt;&#xA;&lt;h3 id=&#34;run-environment-1&#34;&gt;Run environment&lt;/h3&gt;&#xA;&lt;p&gt;We also want to be able to run a &amp;ldquo;pure&amp;rdquo; designer installation from Qt Creator.&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;strong&gt;Build Environment&lt;/strong&gt; click on &lt;strong&gt;Batch Edit&amp;hellip;&lt;/strong&gt; and insert the following string:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;LD_LIBRARY_PATH=/opt/openvibe/dist/designer-debug/lib&#xA;OV_PATH_ROOT=/opt/openvibe/dist/designer-debug&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You are now ready to build &lt;em&gt;OpenViBE Designer&lt;/em&gt; in &lt;em&gt;Debug&lt;/em&gt; mode. Give it a spin, either right click on the OpenVIBE project in the &lt;strong&gt;Edit&lt;/strong&gt; view or use the hammer button on the bottom left.&lt;/p&gt;&#xA;&lt;h2 id=&#34;extras-configuration&#34;&gt;Extras configuration&lt;/h2&gt;&#xA;&lt;p&gt;Once again (and for the last time).&lt;/p&gt;&#xA;&lt;p&gt;On the &lt;em&gt;configure project&lt;/em&gt; page select:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Debug &lt;em&gt;build folder&lt;/em&gt; is &lt;code&gt;/opt/openvibe/build/openvibe-debug&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Release &lt;em&gt;build folder&lt;/em&gt; is &lt;code&gt;/opt/openvibe/build/opevibe-release&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Do not forget to disable all other build types.&lt;/p&gt;&#xA;&lt;h3 id=&#34;cmake-variables-2&#34;&gt;CMake variables&lt;/h3&gt;&#xA;&lt;p&gt;You will need some additional CMake variable specified:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;OPENVIBE_SDK_PATH&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt; &lt;code&gt;/opt/openvibe/dist/sdk-debug&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;DESIGNER_SDK_PATH&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt; &lt;code&gt;/opt/openvibe/dist/designer-debug&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;LIST_DEPENDENCIES_PATH&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt; &lt;code&gt;/opt/openvibe/dependencies&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;CMAKE_INSTALL_PREFIX&lt;/strong&gt; &lt;code&gt;String&lt;/code&gt; &lt;code&gt;/opt/openvibe/dist/openvibe-debug&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This tells the designer to find the SDK built in the previous step. Otherwise the designer will use SDK from its dependencies.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/extras-build-configuration.png&#34; alt=&#34;extras-build-config&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Click on &lt;strong&gt;Apply Configuration&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;h3 id=&#34;install--clean-1&#34;&gt;Install &amp;amp; Clean&lt;/h3&gt;&#xA;&lt;p&gt;Check the &lt;code&gt;install&lt;/code&gt; and &lt;code&gt;clean&lt;/code&gt; options in Clean and Build steps like in SDK.&lt;/p&gt;&#xA;&lt;h3 id=&#34;run-environment-2&#34;&gt;Run environment&lt;/h3&gt;&#xA;&lt;p&gt;Finally, we want to be able to run the complete installation.&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;strong&gt;Build Environment&lt;/strong&gt; click on &lt;strong&gt;Batch Edit&amp;hellip;&lt;/strong&gt; and insert the following string:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;LD_LIBRARY_PATH=/opt/openvibe/dist/openvibe-debug/lib&#xA;OV_PATH_ROOT=/opt/openvibe/dist/openvibe-debug&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;You are now ready to build the &lt;em&gt;Full OpenViBE Designer&lt;/em&gt; in &lt;em&gt;Debug&lt;/em&gt; mode. Give it a spin, either right click on the OpenVIBE project in the &lt;strong&gt;Edit&lt;/strong&gt; view or use the hammer button on the bottom left.&lt;/p&gt;&#xA;&lt;p&gt;You should now see all of the various OpenViBE projects in the build menu.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/projects.png&#34; alt=&#34;projects&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;running-the-openvibe-designer-with-the-full-feature-set&#34;&gt;Running the OpenViBE Designer with the full feature set&lt;/h3&gt;&#xA;&lt;p&gt;The Designer project is built in a separate project from extras. If you want to run the designer (or debug it) with all of the plugins, you need to create a new run configuration.&lt;/p&gt;&#xA;&lt;p&gt;Go to &lt;strong&gt;Projects -&amp;gt; OpenViBE -&amp;gt; Run&lt;/strong&gt; in the left pane. Be careful to choose the OpenViBE Project which corresponds to extras!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/run-configuration-button.png&#34; alt=&#34;run-config-button&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Click on &lt;strong&gt;Add -&amp;gt; Custom Executable&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/run-configuration-add-button.png&#34; alt=&#34;run-config-add-button&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now select the &lt;code&gt;/opt/openvibe/dist/openvibe-debug/bin/openvibe-designer&lt;/code&gt; as &lt;em&gt;Executable&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Rename this configuration as &lt;em&gt;Debug Designer&lt;/em&gt;. You can now choose it from the projects menu and run it using the play button (or debug it using the play button with a little bug on it)&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/openvibe-qtcreator/debug-designer.png&#34; alt=&#34;debug-designer&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>DTerm and Fish shell, together</title>
      <link>https://yozy.net/2017/10/dterm-and-fish-shell-together/</link>
      <pubDate>Tue, 31 Oct 2017 15:10:51 +0000</pubDate>
      <guid>https://yozy.net/2017/10/dterm-and-fish-shell-together/</guid>
      <description>&lt;p&gt;Fish shell does not seem to like to live within the DTerm terminal emulator. Sadly, DTerm seems in a state of abandon.&lt;/p&gt;&#xA;&lt;p&gt;What I do now is to force &lt;code&gt;bash&lt;/code&gt; as the shell used by DTerm. I do this by launching:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fish&#34; data-lang=&#34;fish&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nf&#34;&gt;env&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;SHELL&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;/bin/bash &lt;span class=&#34;nb&#34;&gt;open&lt;/span&gt; /Applications/DTerm.app&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Possible future of the Mac Mini</title>
      <link>https://yozy.net/2017/10/possible-future-of-the-mac-mini/</link>
      <pubDate>Fri, 27 Oct 2017 06:26:53 +0000</pubDate>
      <guid>https://yozy.net/2017/10/possible-future-of-the-mac-mini/</guid>
      <description>&lt;p&gt;The current Mac Mini has many uses and most of them are not for desktop users.&#xA;So, what would you want to use a small “cheap” computer running macOS for?&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A media center connected to a TV&lt;/li&gt;&#xA;&lt;li&gt;A Facebook machine with iTunes music on it&lt;/li&gt;&#xA;&lt;li&gt;A build/test server for developers&lt;/li&gt;&#xA;&lt;li&gt;A server that one can put into a rack (like at Mac Mini Colo)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;None of these things need a x86 processor.&lt;/p&gt;&#xA;&lt;p&gt;I bet that whatever replaces the Mac Mini will be the first ARM based Mac. And&#xA;it will be glorious.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>MiKTeX 2.9 and Windows 10 package installation woes</title>
      <link>https://yozy.net/2017/08/miktex-2.9-and-windows-10-package-installation-woes/</link>
      <pubDate>Wed, 02 Aug 2017 15:42:08 +0000</pubDate>
      <guid>https://yozy.net/2017/08/miktex-2.9-and-windows-10-package-installation-woes/</guid>
      <description>&lt;p&gt;Today my MiKTeX installation stopped installing packages on the fly. After trying to install packages through Package Manager I found out that this did not work either. The error that I have obtained is this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;The executed process did not succeed.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;fileName&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;C:\Program Files (x86)\MiKTeX 2.9\MiKTeX\bin\initexmf.exe&amp;#34;&lt;/span&gt;, &lt;span class=&#34;nv&#34;&gt;arguments&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34; --mklinks --mkmaps&amp;#34;&lt;/span&gt;, &lt;span class=&#34;nv&#34;&gt;exitCode&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;1&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I googled around and found out that this might be a problem with the installation folder not being accessible and the suggested solution was to install MiKTeX somewhere else (or just for the local user). This was not an option for me as a toolchain that does not depend only on me requires the latex binary to be in the default folder.&lt;/p&gt;&#xA;&lt;p&gt;My solution was to go to the &lt;code&gt;C:\Program Files (x86)\MiKTeX 2.9&lt;/code&gt; folder properties and changing the &lt;strong&gt;Users&lt;/strong&gt; permissions to &lt;strong&gt;Full Control&lt;/strong&gt;. Not extremely secure but at least now I can build my documentation.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Unprotect password protected Word documents</title>
      <link>https://yozy.net/2016/10/unprotect-password-protected-word-documents/</link>
      <pubDate>Sat, 22 Oct 2016 13:13:43 +0000</pubDate>
      <guid>https://yozy.net/2016/10/unprotect-password-protected-word-documents/</guid>
      <description>&lt;p&gt;It is always annoying when people expect you to collaborate with them and they send you locked files.&lt;/p&gt;&#xA;&lt;p&gt;This trick only works for documents that are protected for &lt;strong&gt;Review&lt;/strong&gt;. Not when you can not even open them.&lt;/p&gt;&#xA;&lt;p&gt;So, let us assume you have a &lt;code&gt;Protected.docx&lt;/code&gt; file that looks something like this. Notice the disabled &lt;em&gt;Delete Comment&lt;/em&gt;, &lt;em&gt;Accept Changes&lt;/em&gt; and so buttons.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/unprotect-word/protected-document.png&#34; alt=&#34;Sad grey icons&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-1-open-the-box&#34;&gt;Step 1: Open the box&lt;/h2&gt;&#xA;&lt;p&gt;A good thing to know is that .docx (and .xlsx) files are just zipped folders.&lt;/p&gt;&#xA;&lt;p&gt;Rename the &lt;code&gt;Protected.docx&lt;/code&gt; file to &lt;code&gt;Protected.zip&lt;/code&gt; and unzip it. You will obtain something that looks like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/unprotect-word/file-contents.png&#34; alt=&#34;Docx folder contents&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-2-tinker-with-the-contents&#34;&gt;Step 2: Tinker with the contents&lt;/h2&gt;&#xA;&lt;p&gt;Open the file &lt;code&gt;word/settings.xml&lt;/code&gt;. Its contents will look somewhat like this (except there will be more of it and everything will be on the same line):&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-xml&#34; data-lang=&#34;xml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-8&amp;#34; standalone=&amp;#34;yes&amp;#34;?&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;w:settings&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:mc=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:o=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;urn:schemas-microsoft-com:office:office&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:r=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;http://schemas.openxmlformats.org/officeDocument/2006/relationships&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:m=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;http://schemas.openxmlformats.org/officeDocument/2006/math&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:v=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;urn:schemas-microsoft-com:vml&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:w10=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;urn:schemas-microsoft-com:office:word&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:w=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;http://schemas.openxmlformats.org/wordprocessingml/2006/main&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:w14=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;http://schemas.microsoft.com/office/word/2010/wordml&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:w15=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;http://schemas.microsoft.com/office/word/2012/wordml&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;xmlns:sl=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;http://schemas.openxmlformats.org/schemaLibrary/2006/main&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;mc:Ignorable=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;w14 w15&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nt&#34;&gt;&amp;lt;w:zoom&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:percent=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;100&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nt&#34;&gt;&amp;lt;w:proofState&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:spelling=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;clean&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:grammar=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;clean&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nt&#34;&gt;&amp;lt;w:trackRevisions/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nt&#34;&gt;&amp;lt;w:documentProtection&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:edit=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;trackedChanges&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:enforcement=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;1&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptProviderType=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;rsaFull&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptAlgorithmClass=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;hash&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptAlgorithmType=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;typeAny&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptAlgorithmSid=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;4&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptSpinCount=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;100000&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:hash=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;1+kEXOhPYpKExv2F8dIx9VCN5Ps=&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:salt=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;aOdV7QoW4ZJW3KVDxd7jBg==&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nt&#34;&gt;&amp;lt;w:defaultTabStop&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:val=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;720&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nt&#34;&gt;&amp;lt;w:characterSpacingControl&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:val=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;doNotCompress&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nt&#34;&gt;&amp;lt;w:savePreviewPicture/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nt&#34;&gt;&amp;lt;w:compat&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nt&#34;&gt;&amp;lt;w:useFELayout/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; ...&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Notice the&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-xml&#34; data-lang=&#34;xml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;w:documentProtection&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:edit=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;trackedChanges&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:enforcement=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;1&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptProviderType=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;rsaFull&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptAlgorithmClass=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;hash&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptAlgorithmType=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;typeAny&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptAlgorithmSid=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;4&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:cryptSpinCount=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;100000&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:hash=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;1+kEXOhPYpKExv2F8dIx9VCN5Ps=&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;w:salt=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;aOdV7QoW4ZJW3KVDxd7jBg==&amp;#34;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;this is the source of our woes. Now, simply remove the characters between &lt;code&gt;&amp;lt;w:documentProtection&lt;/code&gt; and the first &lt;code&gt;/&amp;gt;&lt;/code&gt; you encounter after it. Save the file.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-3-put-the-box-back-together&#34;&gt;Step 3: Put the box back together&lt;/h2&gt;&#xA;&lt;p&gt;Now, zip the folder back again. It is important that you compress the files as they were: the folders &lt;code&gt;word&lt;/code&gt;, &lt;code&gt;_rels&lt;/code&gt;, &lt;code&gt;docProps&lt;/code&gt; and the file &lt;code&gt;[Content_Types].xml&lt;/code&gt; are on the top level of the zip (i.e.: not in a subfolder that was probably created when you unzipped the original file). Let us call the new file &lt;code&gt;Unprotected.zip&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Finally, rename the file back to &lt;code&gt;Unprotected.docx&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-4-look-into-the-box&#34;&gt;Step 4: Look into the box&lt;/h2&gt;&#xA;&lt;p&gt;And voilà:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/unprotect-word/unprotected-document.png&#34; alt=&#34;Sad grey icons&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note: Word might complain about the document being corrupted, simply choose &lt;em&gt;Open Anyway&lt;/em&gt; and re-save the file again.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Centre a one line text in a UITextView</title>
      <link>https://yozy.net/2015/12/centre-a-one-line-text-in-a-uitextview/</link>
      <pubDate>Fri, 25 Dec 2015 07:59:02 +0000</pubDate>
      <guid>https://yozy.net/2015/12/centre-a-one-line-text-in-a-uitextview/</guid>
      <description>&lt;p&gt;I had a problem. First I have set up an UITextView with these parameters:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;backgroundColor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;blueColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;text&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;An example text&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;textColor&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;whiteColor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;textContainerInset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;top&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;textContainerInset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bottom&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I wanted to be able to centre the text in the view vertically. This should be easy, one just needs to position the top of the text according to the formula: &lt;code&gt;top = (container.height - content.height) / 2&lt;/code&gt;. However, when you look at the actual look of the UITextView you will see this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIFont&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;boldSystemFontOfSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;100.0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/uitextview-centring/uitextview-default-system.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIFont&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;DINCondensed-Bold&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;100.0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/uitextview-centring/uitextview-default-din.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Ouch, there is a semi-randomly placed offset at the top of the text. Turns out the point size of a font is not always the one you have demanded. However it is possible to get the actual height. An &lt;code&gt;UIFont&lt;/code&gt; class provides a bunch of useful metrics:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIFont&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;boldSystemFontOfSize&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;100.0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;capHeight&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// 70.5&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pointSize&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// 100.0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ascender&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// 95.2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;lineHeight&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// 119.3&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;UIFont&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;DINCondensed-Bold&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;100.0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;capHeight&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// 71.2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pointSize&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// 100.0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ascender&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// 71.2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;lineHeight&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// 100.0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On a graph this would look like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/uitextview-centring/uitextview-metrics.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Finally, the method you can now use is:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-swift&#34; data-lang=&#34;swift&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;extension&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;UITextView&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;func&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;centerTextVertically&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;guard&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;ascender&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ascender&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;guard&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;capHeight&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;font&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;?.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;capHeight&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;textContainerInset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;top&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;view&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;bounds&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;height&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ascender&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ascender&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;capHeight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CGFloat&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mf&#34;&gt;2.0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note that this will only for one liners and only if you know the height of the &lt;code&gt;UITextView&lt;/code&gt; (i.e.: the height was given to it on creation)&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>The one argument for keeping the 3.5mm jack</title>
      <link>https://yozy.net/2015/12/the-one-argument-for-keeping-the-3.5mm-jack/</link>
      <pubDate>Thu, 03 Dec 2015 13:20:36 +0000</pubDate>
      <guid>https://yozy.net/2015/12/the-one-argument-for-keeping-the-3.5mm-jack/</guid>
      <description>&lt;p&gt;The rumour about Apple removing the 3.5mm jack in the future iPhone has wreaked&#xA;havoc around the Internet. There are several arguments for and against it, but I&#xA;think there is only one that is valid: it would make it impossible to create&#xA;accessories for iPhone without going through the MFI process.&lt;/p&gt;&#xA;&lt;p&gt;Case in point, Apple has recently featured this application in their&#xA;advert &amp;ldquo;Ridiculously Powerful&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/iPhone-commercial-wind-speed-app.jpg&#34; alt=&#34;1&#34; title=&#34;iPhone application for measuring wind speed&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;This application would probably never exist without the possibility to&#xA;leverage a cheap and universal interface with the device.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Pondering the new iPhone lineup</title>
      <link>https://yozy.net/2015/08/pondering-the-new-iphone-lineup/</link>
      <pubDate>Thu, 13 Aug 2015 07:12:52 +0000</pubDate>
      <guid>https://yozy.net/2015/08/pondering-the-new-iphone-lineup/</guid>
      <description>&lt;p&gt;Here is a theory. There have been quite a lot of rumours about a new &amp;ldquo;iPhone&#xA;6C&amp;rdquo; which ought to have the 6&amp;rsquo;s internals in a brand new 4&amp;quot; plastic body.&#xA;However, with no parts leaks this late into summer, the existence of this model&#xA;is not a given.  (side note: there are no leaks for the iPhone 6S plus out&#xA;either)&lt;/p&gt;&#xA;&lt;p&gt;We know that Apple has already broken the pattern of older devices moving down&#xA;the price range with the 5C. I think this year the pattern could be broken&#xA;again.&lt;/p&gt;&#xA;&lt;p&gt;After the iPhone 5C was introduced, the Internet was swamped with articles&#xA;describing how much of a flop it was. The reality is that most people who buy&#xA;iPhones in October buy the latest and &lt;em&gt;beefiest&lt;/em&gt; one.&lt;/p&gt;&#xA;&lt;p&gt;So, what if Apple introduced the new, plastic, iPhone 6C in September but only&#xA;made it available in shops in December for the holidays? This would give them&#xA;approximately until October to ramp up the production, which would explain the&#xA;lack of the leaks.&lt;/p&gt;&#xA;&lt;p&gt;Not only would they protect themselves. But they would also get an excuse for&#xA;the lower number of phones sold.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;em&gt;Edit 2015-09-14&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Well, first predition, first failure. My score so far: 0 out&#xA;of 1.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Gulf is now on GitHub</title>
      <link>https://yozy.net/2015/03/gulf-is-now-on-github/</link>
      <pubDate>Mon, 30 Mar 2015 10:19:37 +0000</pubDate>
      <guid>https://yozy.net/2015/03/gulf-is-now-on-github/</guid>
      <description>&lt;p&gt;In order to clean up all stuff I am moving the Gulf theme to a &lt;a href=&#34;http://github.com/jlegeny/gulf&#34; title=&#34;Gulf GitHub repository&#34;&gt;GitHub&#xA;repository&lt;/a&gt;. Currently it is available for QtCreator and Xcode. A Vim&#xA;port will follow soon-ish.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>More gratuitous hate</title>
      <link>https://yozy.net/2014/05/more-gratuitous-hate/</link>
      <pubDate>Thu, 29 May 2014 22:21:03 +0000</pubDate>
      <guid>https://yozy.net/2014/05/more-gratuitous-hate/</guid>
      <description>&lt;p&gt;This has been in Rennes for some while now. One has to wonder what this&#xA;particular person&amp;rsquo;s feud with Google is to express their hate like this.&lt;/p&gt;&#xA;&lt;p&gt;In any case, it is quite an impressive feat.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/google-hate.jpg&#34; alt=&#34;People will go to great heights to diss someone they dislike&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Fixed the Atom feed</title>
      <link>https://yozy.net/2014/05/fixed-the-atom-feed/</link>
      <pubDate>Wed, 21 May 2014 04:06:00 +0000</pubDate>
      <guid>https://yozy.net/2014/05/fixed-the-atom-feed/</guid>
      <description>&lt;p&gt;So I have fixed the atom feed. Hopefully.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Moving to static website</title>
      <link>https://yozy.net/2014/05/moving-to-static-website/</link>
      <pubDate>Mon, 05 May 2014 21:54:00 +0000</pubDate>
      <guid>https://yozy.net/2014/05/moving-to-static-website/</guid>
      <description>&lt;p&gt;So I have jumped on the bandwagon and decided to generate my website&#xA;statically&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;. For you, it basically means that the site will be a lot&#xA;faster. For me, I can finally write stuff in markdown only and not worry that&#xA;some web-editor will butcher it.&lt;/p&gt;&#xA;&lt;p&gt;Also, the search field has disappeared, but I am looking for a different&#xA;option. Either Google custom search or Bing. I will see.&lt;/p&gt;&#xA;&lt;p&gt;Ciao&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;I am using the &lt;a href=&#34;http://middlemanapp.com&#34;&gt;Middleman&lt;/a&gt; with a modified &lt;a href=&#34;http://themble.com/bones/&#34;&gt;Bones&lt;/a&gt; theme&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
    <item>
      <title>Chrome: Your profile could not be opened correctly</title>
      <link>https://yozy.net/2014/03/chrome-your-profile-could-not-be-opened-correctly/</link>
      <pubDate>Tue, 11 Mar 2014 16:25:45 +0000</pubDate>
      <guid>https://yozy.net/2014/03/chrome-your-profile-could-not-be-opened-correctly/</guid>
      <description>&lt;p&gt;Long story short:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;If you want to use Google Chrome on Windows, uninstall AVG&lt;/p&gt;&lt;/blockquote&gt;&#xA;</description>
    </item>
    <item>
      <title>New look</title>
      <link>https://yozy.net/2014/02/new-look/</link>
      <pubDate>Sun, 23 Feb 2014 21:11:00 +0000</pubDate>
      <guid>https://yozy.net/2014/02/new-look/</guid>
      <description>&lt;p&gt;Update to a newer theme is now complete. Fonts should be nicer and faster on&#xA;Apple hardware or anywhere with Helvetica Neue and Avenir installed. I have&#xA;removed the web fonts as they were slowing down the site for no reason.&lt;/p&gt;&#xA;&lt;p&gt;The mobile theme now works with Disqus. I have not figured out why it did not&#xA;work in the previous one.&lt;/p&gt;&#xA;&lt;p&gt;Code snippets are handled by &lt;a href=&#34;http://highlightjs.org&#34; title=&#34;HighlightJS&#34;&gt;highlight.js&lt;/a&gt; instead of the Syntax&#xA;Highlighter. Code snippets also fit into their pre-defined frames and bounce on&#xA;touch devices.&lt;/p&gt;&#xA;&lt;p&gt;The &amp;ldquo;big&amp;rdquo; news is addition of my Instagram profile to the sidebar. Please go&#xA;take a look, I promise not to post photos of my face or shoes. Cannot guarantee&#xA;the amount of food pictures though.&lt;/p&gt;&#xA;&lt;p&gt;I have several articles in the pipes. I will try to post more often.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Maintenance</title>
      <link>https://yozy.net/2014/02/maintenance/</link>
      <pubDate>Thu, 13 Feb 2014 11:29:15 +0000</pubDate>
      <guid>https://yozy.net/2014/02/maintenance/</guid>
      <description>&lt;p&gt;It is 2014 and the old theme was derived from an old TwenyTen Wordpress theme. Time has come to update it to more modern technology and fix a nasty bug where Disqus would not load the mobile version on phones.&lt;/p&gt;&#xA;&lt;p&gt;See you soon.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Make Notes.app more beautiful</title>
      <link>https://yozy.net/2013/11/make-notes.app-more-beautiful/</link>
      <pubDate>Mon, 11 Nov 2013 15:59:51 +0000</pubDate>
      <guid>https://yozy.net/2013/11/make-notes.app-more-beautiful/</guid>
      <description>&lt;p&gt;A bit of googling shows that the old version of the Notes.app will not work in Mavericks. But luckily one quickly finds out that the Resources folder is quite resourceful.&lt;/p&gt;&#xA;&lt;p&gt;Namely there are two files that are interesting:&lt;/p&gt;&#xA;&lt;p&gt;In &lt;code&gt;/Applications/Notes.app/Contents/Resources&lt;/code&gt; there is a file named &lt;code&gt;paper.tiff&lt;/code&gt; which looks like this:&lt;/p&gt;&#xA;&lt;p&gt;Yup, this is the ugly texture under the text. Small change to it and we have something looking like a post-it already. Now, this method is not new and plenty has been written about it.&lt;/p&gt;&#xA;&lt;p&gt;The other change is to change the default fonts, once again in &lt;code&gt;/Applications/Notes.app/Contents/Resources/en.lproj&lt;/code&gt; there is a file called DefaultFonts.plist and it is quite straightforward. I am a huge fan of TektonPro for notes so I put in&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-xml&#34; data-lang=&#34;xml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;FontName&lt;span class=&#34;nt&#34;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;string&amp;gt;&lt;/span&gt;TektonPro-Bold&lt;span class=&#34;nt&#34;&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Size&lt;span class=&#34;nt&#34;&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;integer&amp;gt;&lt;/span&gt;14&lt;span class=&#34;nt&#34;&gt;&amp;lt;/integer&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And &amp;rsquo;lo my new Notes.app look:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/Notes.app.png&#34; alt=&#34;Updated look of Notes.app&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve made a quick mod to patch the files. You can grab it here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/Notes.app-Mod-v1.zip&#34;&gt;Mod for Notes.app v1&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>iPhone : Connect to iTunes to Use Push Notifications</title>
      <link>https://yozy.net/2013/10/iphone-connect-to-itunes-to-use-push-notifications/</link>
      <pubDate>Wed, 23 Oct 2013 10:02:35 +0000</pubDate>
      <guid>https://yozy.net/2013/10/iphone-connect-to-itunes-to-use-push-notifications/</guid>
      <description>&lt;p&gt;It seems that this message is randomly appearing for quite some people. It did for me when I updated to the iOS 7.0.3.&lt;/p&gt;&#xA;&lt;p&gt;There are several solutions available on the internet including:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Backup to iTunes Do factory reset Restore from Backup Re-install applications from appstore&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Although this will probably work for everybody it is not the best of the solutions.&lt;/p&gt;&#xA;&lt;p&gt;For me &lt;strong&gt;disabling iCloud Keychain&lt;/strong&gt; was sufficient, hopefully it will be fixed soon.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Restore iA Writer&#39;s background with this script [Update]</title>
      <link>https://yozy.net/2013/10/restore-ia-writers-background-with-this-script-update/</link>
      <pubDate>Thu, 10 Oct 2013 00:42:44 +0000</pubDate>
      <guid>https://yozy.net/2013/10/restore-ia-writers-background-with-this-script-update/</guid>
      <description>&lt;p&gt;This is a very quick and dirty utility to restore iA Writer’s background to the pre–1.3.1 state. What it does is that it replaces these three images inside the iA Writer folder: &lt;em&gt;backgroundPattern&lt;/em&gt;, &lt;em&gt;tr-up-pattern&lt;/em&gt; and &lt;em&gt;td-down-pattern&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The original solution was posted in &lt;a href=&#34;http://support.iawriter.com/help/discussions/mac-suggestions/389-ia-writer-surface-design&#34;&gt;this thread on the support forum&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/iAWriter-BGFix-1.5.zip&#34;&gt;Background fix for iA Writer 1.5&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;To use this script simply unzip the file wherever you like. Once it is done run the script like this in the terminal (it will be ran as root, you will have to enter your password)&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo sh bgfix.sh&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Updated to work with iA Writer 1.5 on 2013-10-10&lt;/p&gt;&#xA;&lt;p&gt;Enjoy&lt;/p&gt;&#xA;&lt;p&gt;&lt;small&gt;This post was originally posted on 2012-10-24&lt;/small&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>If you want to sell iPhones, colors matter</title>
      <link>https://yozy.net/2013/09/if-you-want-to-sell-iphones-colors-matter/</link>
      <pubDate>Fri, 20 Sep 2013 11:01:22 +0000</pubDate>
      <guid>https://yozy.net/2013/09/if-you-want-to-sell-iphones-colors-matter/</guid>
      <description>&lt;p&gt;So I was looking around during the big launch day and stumbled upon some&#xA;terrible terrible promotion material.&lt;/p&gt;&#xA;&lt;p&gt;Wrong settings in Photoshop, maybe?&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/comparaison-apple-bouygues.jpeg&#34; alt=&#34;iphone-bouygues&#34; title=&#34;Left image is by Apple, right image is used in the Bouygues store. Sizes are original.&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Left image is by Apple, right image is used in the Bouygues store. Sizes are&#xA;original.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;</description>
    </item>
    <item>
      <title>What is wrong with ebook prices</title>
      <link>https://yozy.net/2013/08/what-is-wrong-with-ebook-prices/</link>
      <pubDate>Fri, 23 Aug 2013 19:10:02 +0000</pubDate>
      <guid>https://yozy.net/2013/08/what-is-wrong-with-ebook-prices/</guid>
      <description>&lt;p&gt;After the whole dung-storm about price fixing of ebooks at Apple I wanted to&#xA;add my own rant.&lt;/p&gt;&#xA;&lt;p&gt;When digital music came out CD publishers were unhappy; why? Because digital&#xA;download prices were much lower that CD prices, people did not have to lift&#xA;their ass of their couch and had the music right away.&lt;/p&gt;&#xA;&lt;p&gt;What do we get with digital downloaded books? This:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/ebook-prices.png&#34; alt=&#34;Screenshot from Amazon book pricing&#34; title=&#34;Insane ebook prices&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;First to clarify: the book currently runs a $10 discount on the paperback&#xA;edition, normally it sells for $29.99. Regardless though, how is it more&#xA;convenient to get the book for more in digital format than a physical copy? No&#xA;matter the shipping cost you still save money on getting a hardcover. And let&#xA;us not even mention the used book for $0.01…&lt;/p&gt;&#xA;&lt;p&gt;Note: Apple does not sell this book as an iBook, the book in question is &lt;em&gt;The&#xA;inmates are running the asylum&lt;/em&gt; by Alan Cooper&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Apple&#39;s (future) presence in China</title>
      <link>https://yozy.net/2013/08/apples-future-presence-in-china/</link>
      <pubDate>Mon, 19 Aug 2013 22:01:33 +0000</pubDate>
      <guid>https://yozy.net/2013/08/apples-future-presence-in-china/</guid>
      <description>&lt;p&gt;Rumours about the new lower-cost plastic iPhone are so prominent that we can,&#xA;rather safely, take the &amp;ldquo;iPhone 5C&amp;rdquo; for granted. Its target is purportedly the&#xA;cost conscious customer, and according to many articles, Asian emerging markets&#xA;(read China).&lt;/p&gt;&#xA;&lt;p&gt;On my recent trip there I came to wonder if this is really the right move to&#xA;increase presence in China. Walking around, one realises that Chinese people do&#xA;not necessarily seek cheap stuff; when buying phones the thing that matters&#xA;most is the size. People do not care that they can not put their massive 6.3&amp;quot;&#xA;Samsung MEGAs into their pocket because it never leaves their hand. (I wonder&#xA;what effect on health this will have on the long term)&lt;/p&gt;&#xA;&lt;p&gt;It is quite unlike Apple to create derivate devices for specific markets. iOS,&#xA;for example, is the same in every country with all social networking options&#xA;available everywhere. However it is not a coincidence that all car makers make&#xA;specific (bigger) versions of their vehicles tailored for Chinese taste. Such&#xA;an enormous population is well worth additional upkeep expenses.&lt;/p&gt;&#xA;&lt;p&gt;While the new iPhone will inevitably attract new customers, I would not bet it&#xA;will help Apple gain much traction in China. The alleged new iPhone will not be&#xA;cheap, and the price is not the main reason why people in China do not buy&#xA;iPhones. One reason is the size, the other is that Chinese input method in iOS&#xA;sucks. What they need is an ugly maxi-phone, which they could sell at a premium&#xA;price. And buy Sogou.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>gzip, bzip, zip and md5sum a folder</title>
      <link>https://yozy.net/2013/07/gzip-bzip-zip-and-md5sum-a-folder/</link>
      <pubDate>Tue, 09 Jul 2013 19:00:39 +0000</pubDate>
      <guid>https://yozy.net/2013/07/gzip-bzip-zip-and-md5sum-a-folder/</guid>
      <description>&lt;p&gt;During the OpenViBE releases I found myself to repeat this procedure ad&#xA;nauseum. So I made a little script that does the thing automatically. I will&#xA;just leave it here for future reference:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-perl&#34; data-lang=&#34;perl&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;ch&#34;&gt;#!/usr/bin/perl&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$folder&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$ARGV&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;print&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`tar czf $folder.tar.gz $folder\n`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;print&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`tar cjf $folder.tar.bz2 $folder\n`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;print&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`zip -9 -r $folder.zip $folder\n`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;print&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`md5sum $folder.tar.gz $folder.tar.bz2 $folder.zip &amp;gt; $folder.md5\n`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Happy hacking&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>A bookmarklet to make a stretched article readable</title>
      <link>https://yozy.net/2013/07/a-bookmarklet-to-make-a-stretched-article-readable/</link>
      <pubDate>Tue, 09 Jul 2013 11:21:33 +0000</pubDate>
      <guid>https://yozy.net/2013/07/a-bookmarklet-to-make-a-stretched-article-readable/</guid>
      <description>&lt;p&gt;There are many tools like &lt;a href=&#34;http://www.readability.com/&#34;&gt;Readability&lt;/a&gt; or &lt;a href=&#34;http://evernote.com/clearly/&#34;&gt;Evernote Clearly&lt;/a&gt; to make any&#xA;arbitrary article readable and they are very good at their job.&lt;/p&gt;&#xA;&lt;p&gt;Sometimes however you do not want to get rid of all of the formatting and&#xA;sometimes they simply just do not work, e.g., on web forums.&lt;/p&gt;&#xA;&lt;p&gt;One thing you can find all over the Internet is pages stretched from side to&#xA;side, and they are all but readable on larger screens. Of course with&#xA;responsive design you can just resize your browser but that is not what you&#xA;want to do all of the time.&lt;/p&gt;&#xA;&lt;p&gt;Here is a handy bookmarklet that will &amp;lsquo;columnize&amp;rsquo; any webpage:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;javascript&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;d&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementsByTagName&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;body&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;d&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;11in&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;d&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;margin&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;0 auto&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;void&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Enjoy&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Publications</title>
      <link>https://yozy.net/2013/07/publications/</link>
      <pubDate>Wed, 03 Jul 2013 14:12:42 +0000</pubDate>
      <guid>https://yozy.net/2013/07/publications/</guid>
      <description>&lt;p&gt;I have updated my &lt;a href=&#34;https://yozy.net/pages/Biography.html&#34; title=&#34;Biography&#34;&gt;biography page&lt;/a&gt;. I have added a link to my PRESENCE paper&#xA;and citation for the T:CIAIG one.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Augmented sausages</title>
      <link>https://yozy.net/2013/06/augmented-sausages/</link>
      <pubDate>Fri, 21 Jun 2013 23:05:34 +0000</pubDate>
      <guid>https://yozy.net/2013/06/augmented-sausages/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;My sausages are augmented&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;As I came home, craving for some chowder, I was wondering what to cook. I&#xA;wanted to finish some meat from earlier in my fridge but had to make decisions.&#xA;Do I cook sausages, or do I grill some bacon?&lt;/p&gt;&#xA;&lt;p&gt;Finally I have decided to do both.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/augmented-sausages/augmented-sausages-raw.jpg&#34; alt=&#34;raw-sausages&#34; title=&#34;Raw sausages&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;With a bit of cayenne and cheese you got yourself a good healthy dinner. Oh,&#xA;and for vitamins grill it in some pig fat.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/augmented-sausages/augmented-sausages-cooked.jpg&#34; alt=&#34;cooked-sausages&#34; title=&#34;Grilled sausages with cheese&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Betteridge&#39;s vengeance</title>
      <link>https://yozy.net/2013/06/betteridges-vengeance/</link>
      <pubDate>Mon, 17 Jun 2013 17:43:29 +0000</pubDate>
      <guid>https://yozy.net/2013/06/betteridges-vengeance/</guid>
      <description>&lt;p&gt;By Shaunacy Ferro, &lt;a href=&#34;http://www.popsci.com/science/article/2013-06/are-lego-figures-getting-angrier&#34;&gt;Are Angry Legos Harming Our Children?&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The paper estimates that on average, there are 75 Lego bricks for every&#xA;person on Earth. &amp;ldquo;We cannot help but wonder how the move from only positive&#xA;faces to an increasing number of negative faces impacts how children play,&amp;rdquo;&#xA;the researchers write. &amp;ldquo;The children that grow up with LEGO today will&#xA;remember not only smileys, but also anger and fear in the Minifigures’&#xA;faces.&amp;rdquo;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Another headline, another &amp;ldquo;no&amp;rdquo;. I remember painting over the lego faces to give&#xA;them any expression I wished them to have. Bad guys were quite angry.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Gulf color theme for Xcode</title>
      <link>https://yozy.net/2013/05/gulf-color-theme-for-xcode/</link>
      <pubDate>Thu, 30 May 2013 14:37:42 +0000</pubDate>
      <guid>https://yozy.net/2013/05/gulf-color-theme-for-xcode/</guid>
      <description>&lt;p&gt;I have started teaching myself some Objective-C which also means that I have to&#xA;use something else than my beloved Qt Creator.&lt;/p&gt;&#xA;&lt;p&gt;As to feel a bit at home I have ported my Gulf theme over to Xcode. The choice&#xA;I have made in creating this theme is to conserve all of the colours from the&#xA;original (e.g. Types and Classes are greenish, while attributes are blueish).&lt;/p&gt;&#xA;&lt;p&gt;Sadly Xcode does not provide different colours for global and local variables.&#xA;However, all externally imported classes, types and functions are marked in&#xA;italics, so you can easily know what belongs to you.&lt;/p&gt;&#xA;&lt;p&gt;Here is a quick look at the theme:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/gulf-xcode.png&#34; alt=&#34;1&#34; title=&#34;Gulf theme for Xcode&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;And here is the download link, enjoy:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/gulf-theme-xcode.zip&#34;&gt;Gulf theme for Xcode&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Ultimate student food - Tomato Bacon Pasta</title>
      <link>https://yozy.net/2013/05/ultimate-student-food-tomato-bacon-pasta/</link>
      <pubDate>Sun, 12 May 2013 16:31:35 +0000</pubDate>
      <guid>https://yozy.net/2013/05/ultimate-student-food-tomato-bacon-pasta/</guid>
      <description>&lt;p&gt;This time I will share a recipe to what is probably the first thing I have&#xA;cooked and required more tools than a can opener.&lt;/p&gt;&#xA;&lt;p&gt;This meal is dead simple and the greatest thing is that you can cook it without&#xA;even having any precious condiments, such as salt or oil (but it helps).&lt;/p&gt;&#xA;&lt;h2 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;p&gt;Here are the ingredients you will need. As it is designed to be cheap, there&#xA;are very few of them. If you live in France you may notice that everything&#xA;comes from Intermarché&amp;rsquo;s store brands.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/tomato-pasta/tomato-pasta-ingredients.jpg&#34; alt=&#34;ingredients&#34; title=&#34;Ingredients&#34;&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Smoked bacon&lt;/li&gt;&#xA;&lt;li&gt;Emmental cheese&lt;/li&gt;&#xA;&lt;li&gt;Half an onion&lt;/li&gt;&#xA;&lt;li&gt;Tomato sauce (thick)&lt;/li&gt;&#xA;&lt;li&gt;Pasta&lt;/li&gt;&#xA;&lt;li&gt;Bonus: salt and oil&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;cooking&#34;&gt;Cooking&lt;/h2&gt;&#xA;&lt;p&gt;Dice the onions.&lt;/p&gt;&#xA;&lt;p&gt;For the sauce put some oil (if you have any) to a frying pan, heat it and then&#xA;add onions. Stir until they are somewhat cooked (become glass-like). If you are&#xA;cooking without oil keep an eye on them and stir a lot so you do not burn them.&lt;/p&gt;&#xA;&lt;p&gt;Once the onions are good add the bacon. Stir until it becomes opaque. At this&#xA;point the bacon will probably release quite a lot of juicy grease. Depending on&#xA;how fat you are and want to be you can throw some of the grease away.&lt;/p&gt;&#xA;&lt;p&gt;After this add a can of the tomato puree. Pro tip: in order to not lose the&#xA;precious sauce, pour water into the can and stir. Then pour the tomatoey water&#xA;into your sauce, it will make it more smooth.&lt;/p&gt;&#xA;&lt;p&gt;Cook the pasta.&lt;/p&gt;&#xA;&lt;h3 id=&#34;nota-bene-on-cooking-pasta-skip-if-you-know-how-to-do-it&#34;&gt;Nota-bene on cooking pasta (skip if you know how to do it)&lt;/h3&gt;&#xA;&lt;p&gt;For one person use about this much spaghetti:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/tomato-pasta/tomato-pasta-amount-of-pasta.jpg&#34; alt=&#34;serving-size&#34; title=&#34;Serving size&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Step by step guide to edible pasta:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Boil water&lt;/li&gt;&#xA;&lt;li&gt;Put salt to water if you want salted pasta, serves no other purpose&lt;/li&gt;&#xA;&lt;li&gt;Put pasta into boiling water&lt;/li&gt;&#xA;&lt;li&gt;Wait as many minutes as written on the package and then one more&lt;/li&gt;&#xA;&lt;li&gt;If the water spills out of the pan give zero fucks&lt;/li&gt;&#xA;&lt;li&gt;Get pasta out, serve immediately&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;serving&#34;&gt;Serving&lt;/h2&gt;&#xA;&lt;p&gt;Put the pasta on a plate, cover with cheese. Put the sauce on top.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/tomato-pasta/tomato-pasta-final.jpg&#34; alt=&#34;presentation&#34; title=&#34;Suggestion of presentation&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you are wondering why my torti from the photo magically transformed to&#xA;spaghetti then know that I only had a new pack of torti in the kitchen. Also&#xA;this works with any pasta, of course.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>First world problems</title>
      <link>https://yozy.net/2013/04/first-world-problems/</link>
      <pubDate>Fri, 26 Apr 2013 01:09:56 +0000</pubDate>
      <guid>https://yozy.net/2013/04/first-world-problems/</guid>
      <description>&lt;p&gt;Have you ever thought you might be liking too much stuff on Facebook? Have you&#xA;ever thought that it might be such an important issue that you need to stop&#xA;doing it? And write about it on a popular tech website?&lt;/p&gt;&#xA;&lt;p&gt;Well, some people have, as written in &lt;a href=&#34;http://readwrite.com/2013/04/17/like-experiment%23feed=/tag/facebook&#34;&gt;this article&lt;/a&gt;. Seriously, if people&#xA;do not have a real problem to cope with they will find one. If we have a job, a&#xA;home, and a decent life let us complain about how we must do stuff that did not&#xA;even exist a few years ago.&lt;/p&gt;&#xA;&lt;p&gt;Lend Kendall:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I’ve hit the &amp;ldquo;like&amp;rdquo; button thousands of times out of obligation, for worry&#xA;that I might hurt someone&amp;rsquo;s feelings or make them feel ignored.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Really? What kind of obligation do you have to random people on the Internet?&#xA;Luckily Facebook does not have (yet) a feature showing you who read your posts&#xA;like they have for chat.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Quickfix for pogdesign checkboxes</title>
      <link>https://yozy.net/2013/04/quickfix-for-pogdesign-checkboxes/</link>
      <pubDate>Wed, 24 Apr 2013 00:11:17 +0000</pubDate>
      <guid>https://yozy.net/2013/04/quickfix-for-pogdesign-checkboxes/</guid>
      <description>&lt;p&gt;I got finally fed up with the Unity-like checkboxes on my favourite &lt;a href=&#34;http://www.pogdesign.co.uk/cat&#34;&gt;TV-show&#xA;tracking site&lt;/a&gt;. Quick roundup: these checkboxes are represented by a box&#xA;with a grey checkmark when unchecked and a box with green checkmark when&#xA;checked.&lt;/p&gt;&#xA;&lt;p&gt;Not only is this horrible for colorblind people, it also drives sane persons&#xA;nuts.&lt;/p&gt;&#xA;&lt;p&gt;If you use Stylish extension for firefox, or some alternative for your browser&#xA;then you can use this snippet to replace them with standard controls:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;namespace&lt;/span&gt; &lt;span class=&#34;nt&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;http&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;://&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;www&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;w3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;org&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;1999&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;xhtml&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;@&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;-moz-document&lt;/span&gt; &lt;span class=&#34;nt&#34;&gt;url-prefix&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;http://www.pogdesign.co.uk/cat&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;lists&lt;/span&gt; &lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;nt&#34;&gt;label&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;day&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;ep&lt;/span&gt; &lt;span class=&#34;nt&#34;&gt;label&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;today&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;ep&lt;/span&gt; &lt;span class=&#34;nt&#34;&gt;label&lt;/span&gt;  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;c&#34;&gt;/* bright background */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;k&#34;&gt;background-image&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAsCAYAAACzBUKoAAABJElEQVQ4je2TscqDQBCEZyWPFiFgYymWKXyGvEEsfISAvdilFCEEJEXeIU0KO0vhlttcqpOY8POvRboMHNcMyzAfQ6fTyQVBAP+IaPqJCDM1TeOg0PV6dYExRuOFiCBgZpXZWgv1ZWZeaNbGWGQ2xiw0W2vVMWi/3ztP65XeK1X/VuM4Qo17t9upcOd5/j/uLMscoMC93W7d4/EA8IY7iqJZnDRNnbUWIjK1MZmNMdhsNg4A4jh2zAxmRlmW5M0rH4OZISIIw9AZYyAiqOt6qmOG+3w+k7/GzDgej7PePnB3XUfMjLZt3wr+A/flcvkw+hi0Xq/VuOl+v+vXfbvdVLiHYfite9KX111VlX7dfd/r110UhQr34XD4rXvSl9edJIka9xPBTXfNN90QEQAAAABJRU5ErkJggg==&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;cp&#34;&gt;!important&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;c&#34;&gt;/* dark background */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;c&#34;&gt;/* background-image: url(&amp;#39;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAsCAYAAACzBUKoAAABJ0lEQVQ4je2TsY2FMBAF1+g6oAJSEpqgCEqhAwgogQpogYScyBkRBA6IIETyCuMfLQLj01+Cy86ShVYeW0+Mnui6zgZBALSFEOdXCAG31batBcbq+94GWmsOC8YYCBCRBe/7DuyXEfElzI3xCtZav4T3fWfHEEVRWLJ1tXe1Svtn2zZg687znKW7LMvvupdlsQAM3QQCOLqvB775oZuAKxiGoThhN4YPfMDXA9/80E2AC56wq9sHUgyRpilbt1BK8ds9jiNL97qu/+0+1x+3u2kafrvneea3u6oqlu66rr/rVkrx2j1Nkz2OAwAc3VLKW5xhGKwxBgh+6KYLUkqLiICIEEXR7+2mC9ZaiOPY3+4kSW7/yZ0fuglwwRN2dftAiiGyLGPr/gDD7TWBmCHgngAAAABJRU5ErkJggg==&amp;#39;) !important; */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you use a dark background then un-comment the second background-image tag.&lt;/p&gt;&#xA;&lt;p&gt;Enjoy&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Redesigns for the worse</title>
      <link>https://yozy.net/2013/04/redesigns-for-the-worse/</link>
      <pubDate>Sun, 14 Apr 2013 23:03:55 +0000</pubDate>
      <guid>https://yozy.net/2013/04/redesigns-for-the-worse/</guid>
      <description>&lt;p&gt;With the iPhone 5S release approaching feature wish lists and redesigns of iOS7&#xA;are legion on the Interwebz. Undoubtedly many people find that iOS in its&#xA;current state lacks features, looks old and boring, and more generally &amp;ldquo;has to&#xA;catch up with the competition&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;Usually the argument goes in the lines of &amp;ldquo;the home screen is just a list of&#xA;icons&amp;rdquo; or &amp;ldquo;Apple must put widgets on the screen&amp;rdquo; or even &amp;ldquo;iPhone should&#xA;centered around people, not apps&amp;rdquo;. Many proposed changes poke around the lock&#xA;screen, many of them add a lot of eye candy, most of them are just wishful&#xA;thinking.&lt;/p&gt;&#xA;&lt;p&gt;It seems that lot of designers want to be part of the apple experience, want to&#xA;show their skill by &amp;ldquo;improving&amp;rdquo; the user experience of an applauded product.&#xA;The problem is that they base their designs on opinions of a minority (albeit&#xA;very vocal) of geeks and tech enthusiasts. They criticize Apple&amp;rsquo;s design&#xA;decisions without looking at the reason behind them.&lt;/p&gt;&#xA;&lt;p&gt;Let us look at some examples and see what&amp;rsquo;s wrong with them:&lt;/p&gt;&#xA;&lt;h2 id=&#34;case-the-ios7-redesign-video&#34;&gt;Case: the iOS7 redesign video&lt;/h2&gt;&#xA;&lt;p&gt;A few days ago Federico Bianco has published a &lt;a href=&#34;http://youtube.com/watch?v=JdW4qNeFkBk&#34;&gt;video of his ideas of how iOS 7&#xA;should look like&lt;/a&gt;. General reception, if we take comments on forums such as&#xA;Mac Rumors, was positive. But it these comments were several very good remarks.&lt;/p&gt;&#xA;&lt;h3 id=&#34;lock-screen&#34;&gt;Lock screen&lt;/h3&gt;&#xA;&lt;p&gt;The first thing that comes in mind after seeing all of those lock screen&#xA;features is security. Judging from several security holes that have surfaced in&#xA;the past months it is apparent that the less features the lock screen has, the&#xA;better. In its current state it can display time, notifications (that you have&#xA;chosen to appear there), let you call emergency numbers and take a picture. For&#xA;any other action you need to type in your passcode. Now, of course not all&#xA;people use the passcode protection but most people do and it is a good practice&#xA;that should not be discouraged.&lt;/p&gt;&#xA;&lt;p&gt;After the redesign one can reply to texts, call arbitrary numbers, switch off&#xA;wifi and my personal favorite: put the phone into airplane mode. What a joy&#xA;when some random bloke can cut your phone off as a prank whenever you leave&#xA;your phone out of sight for a minute. Apple has put a lot of effort so that&#xA;without passcode people can not access even your photos and this dude lets&#xA;everybody happily use your call minutes.&lt;/p&gt;&#xA;&lt;h3 id=&#34;widgets&#34;&gt;Widgets&lt;/h3&gt;&#xA;&lt;p&gt;The widgets Mr. Bianco proposes are a nice touch, in theory the allow you to&#xA;peek at some of the information the application provides and in some cases take&#xA;some rudimentary action. In practice the implementation is quite poor.&lt;/p&gt;&#xA;&lt;p&gt;One very important thing to consider when using the double tap/click is the&#xA;action that happens when the user is too slow. For example if we consider the&#xA;selection on iOS then if the double tap is too slow one would move the cursor&#xA;with the first tap and open the selection menu with the second. Once there one&#xA;can select the word with a single additional tap.&lt;/p&gt;&#xA;&lt;p&gt;In the case of double tap opening widgets, a wrong gesture would open the app.&#xA;No big problem as you can get the information from inside the app as well as&#xA;from the widget, as long as it does not take too long to open which would be a&#xA;major frustration. Instead of earning half a second you would lose two.&lt;/p&gt;&#xA;&lt;p&gt;The one thing I do not get with all these on-screen widgets is their utility.&#xA;Why would I throw out place for apps to put some random information instead?&#xA;What is the point of putting them on the main screen when in order to access it&#xA;you need to close your current app?&lt;/p&gt;&#xA;&lt;p&gt;Apple does already have a perfect place for widgets, the only missing thing is&#xA;opening the API. You have guessed it: the notification center. The NC is the&#xA;best place to put all kinds of widgets for several reasons:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It is already there&lt;/li&gt;&#xA;&lt;li&gt;It is accessible from everywhere&lt;/li&gt;&#xA;&lt;li&gt;People are already familiar with it&lt;/li&gt;&#xA;&lt;li&gt;Jailbreak community has already shown that it works&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;If Apple would open the API then a lot of people would be happy.&lt;/p&gt;&#xA;&lt;h3 id=&#34;settings-drawer&#34;&gt;Settings drawer&lt;/h3&gt;&#xA;&lt;p&gt;Another active corner = another hidden feature. There is clearly a huge demand&#xA;for quicker access to settings. However I would see this more either as a&#xA;widget (made by Apple, there is not much hope that apps will ever get access to&#xA;phone settings) or inside the app switcher alongside music controls.&lt;/p&gt;&#xA;&lt;h3 id=&#34;mission-control&#34;&gt;Mission control&lt;/h3&gt;&#xA;&lt;p&gt;Task switching was remade by a great ton of designers such as &lt;a href=&#34;http://youtube.com/watch?v=iRt5qagkGBU&#34;&gt;here in this&#xA;video&lt;/a&gt;. Some of them are already available for the jailbreak community, like&#xA;the much appraised &lt;a href=&#34;http://youtube.com/watch?v=c4IA5AvqUYA&#34;&gt;Auxo&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The common point of all of this switchers are snapshots or live previews of the&#xA;applications. In the case of Auxo they are completely useless as they are&#xA;hardly twice as big as the app icon. The icon itself is shrunk. It is beyond me&#xA;how somebody thinks this is a good idea. A snapshot preview consumes&#xA;considerably more memory than an icon and it is much harder to quickly&#xA;recognize.&lt;/p&gt;&#xA;&lt;p&gt;As for live previews, they bring up the problem of real multitasking. Although&#xA;background running apps could, in theory, provide a live preview, for most of&#xA;them that would be impossible. Simply because the background process is not the&#xA;same and the renderer for the application does not run and should not run&#xA;because of performance issues.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-shelf&#34;&gt;The shelf&lt;/h3&gt;&#xA;&lt;p&gt;This is the best idea in the video in my opinion. The major issue I have with&#xA;it is the fact that it sits on your dashboard as a folder. The news stand like&#xA;shelf can only show 3 files on the iPhone at the same time, which is really not&#xA;enough if you consider the quantity of the files that would end up there.&lt;/p&gt;&#xA;&lt;p&gt;I really like the idea of system-wide file repository, as long as it is&#xA;organized by type and searchable and not in a folder-like structure.&lt;/p&gt;&#xA;&lt;h2 id=&#34;case-closed&#34;&gt;Case closed&lt;/h2&gt;&#xA;&lt;p&gt;Well, my rant is finished. It was largely based on comments and articles I read&#xA;previously such as the piece on &lt;a href=&#34;http://ignorethecode.net/blog/2011/05/15/unsolicited_redesigns/&#34;&gt;Unsolicited redesigns&lt;/a&gt;. Of course&#xA;redesigning something is a boatload of fun, however it would be nice if people&#xA;first asked themselves &amp;ldquo;why&amp;rdquo; has the original author done it one way or another&#xA;before trying to improve on it.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Elegant as Clockwork template for Apple Pages</title>
      <link>https://yozy.net/2013/04/elegant-as-clockwork-template-for-apple-pages/</link>
      <pubDate>Sun, 07 Apr 2013 13:28:59 +0000</pubDate>
      <guid>https://yozy.net/2013/04/elegant-as-clockwork-template-for-apple-pages/</guid>
      <description>&lt;p&gt;Pages is a quite nice word processor even though has several quite&#xA;stupid anti features (such as the page being stuck to the top-left&#xA;corner). Nevertheless it is currently my tool of choice when I need a&#xA;document with more than headers, lists and bold text, for which I would&#xA;of course choose markdown. I have created my own default template, which&#xA;you can of course download right here. In the zip file you will also&#xA;find a document explaining all of the features of this template. You can&#xA;see how it compares to the default style on this image:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/Elegant-as-Clockwork-comparison.png&#34; alt=&#34;1&#34; title=&#34;Comparison between the default pages style and EaC&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Download the zip package containing the theme here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/Elegant-as-Clockwork-v1.zip&#34;&gt;Elegant as Clockwork v1&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;To install it, put it into &lt;code&gt;~/Library/Application Support/iWork/Pages/Templates/My Templates&lt;/code&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Lock screen on Mac OS X with keyboard shortcut [updated]</title>
      <link>https://yozy.net/2012/11/lock-screen-on-mac-os-x-with-keyboard-shortcut-updated/</link>
      <pubDate>Wed, 28 Nov 2012 16:56:37 +0000</pubDate>
      <guid>https://yozy.net/2012/11/lock-screen-on-mac-os-x-with-keyboard-shortcut-updated/</guid>
      <description>&lt;p&gt;&lt;em&gt;Last update: 2017-11-18 for High Sierra&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Luckily we now have a real shortcut without hacks using &lt;strong&gt;⌃⌘Q&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;One of the issues that rises the most eyebrows while using Mac OS X is that&#xA;there is no native way of simply locking your screen with a keyboard shortcut.&#xA;Finally I have managed to compile all of the stuff on the Internet to come up&#xA;with a simple yet &lt;em&gt;real&lt;/em&gt; solution to this problem If you can not be bothered by&#xA;reading the whole article here is the short version:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Run &lt;strong&gt;Keychain Access&lt;/strong&gt; go to &lt;strong&gt;Preferences → General → Show keychain status in menubar&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Look at &lt;a href=&#34;https://yozy.net/2011/05/global-keyboard-actions-in-snow-leopard-without-third-party-software&#34; title=&#34;Global keyboard actions in Snow Leaopard without third party software&#34;&gt;this tutorial&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Use the script from &lt;a href=&#34;https://gist.github.com/1322095&#34; title=&#34;https://gist.github.com/1322095&#34;&gt;freespace&amp;rsquo;s github page&lt;/a&gt; instead of my example.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;And now for the long version.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;There are a lot of ways to work around this problem and many of them were&#xA;already published on a zillion of blogs. In practice four methods prevail:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Setting the system to lock immediately upon launching the screensaver and&#xA;then using the &lt;strong&gt;ctrl+⇧+⏏&lt;/strong&gt; (control+shift+eject) shortcut.&lt;/li&gt;&#xA;&lt;li&gt;Enabling the Keychain Access menu item and then choosing &lt;strong&gt;lock screen&lt;/strong&gt;&#xA;from the menu (by mouse).&lt;/li&gt;&#xA;&lt;li&gt;Enabling the multiple user login and then switching user.&lt;/li&gt;&#xA;&lt;li&gt;Using a third party software, such as Quicksilver or Alfred.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Of course these methods have all some benefits and some drawbacks. When we look&#xA;at them we can easily spot that only the option two actually does what we want:&#xA;it locks the screen without closing the session, it is native and it &lt;em&gt;has&lt;/em&gt; to&#xA;be invoked by the user. However it does not use the feedback, so fails to&#xA;satisfy the primary objective.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-real-solution&#34;&gt;The real solution&lt;/h2&gt;&#xA;&lt;p&gt;It is extremely simple to assign a keyboard shortcut to any item in the&#xA;application menu. Sadly, the task bar is not considered part of it and the&#xA;keyboard shortcuts will not reach it. Enter AppleScript and Automator, solution&#xA;to any problem there is! It took some digging but there actually &lt;strong&gt;is&lt;/strong&gt; an&#xA;AppleScript which clicks on menu items. With that we can create a service that&#xA;will then be available thorough a global shortcut.&lt;/p&gt;&#xA;&lt;h3 id=&#34;preliminary&#34;&gt;Preliminary&lt;/h3&gt;&#xA;&lt;p&gt;In order for this to work you need to enable the Keychain Access menu item. Run&#xA;&lt;strong&gt;Keychain Access&lt;/strong&gt; go to &lt;strong&gt;Preferences → General → Show keychain status in&#xA;menubar&lt;/strong&gt;,&lt;/p&gt;&#xA;&lt;h3 id=&#34;implementation&#34;&gt;Implementation&lt;/h3&gt;&#xA;&lt;p&gt;The path from a script to a service to a keyboard shortcut is already paved. I&#xA;have already covered how to &lt;a href=&#34;https://yozy.net/2011/05/global-keyboard-actions-in-snow-leopard-without-third-party-software&#34; title=&#34;Global keyboard actions in Snow Leaopard without third party software&#34;&gt;assign a global keyboard shortcut to a script&lt;/a&gt;&#xA;so please refer to that.&lt;/p&gt;&#xA;&lt;h3 id=&#34;the-script&#34;&gt;The script&lt;/h3&gt;&#xA;&lt;p&gt;The actual script to use is taken from &lt;a href=&#34;https://gist.github.com/1322095&#34; title=&#34;https://gist.github.com/1322095&#34;&gt;freespace&amp;rsquo;s github page&lt;/a&gt; and is&#xA;actually based on an example provided by Apple itself. For the sake of&#xA;consistency, here is the script:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-applescript&#34; data-lang=&#34;applescript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;application&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;System Events&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;properties&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;every&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;process&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;UI&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;elements&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;enabled&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;process&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;SystemUIServer&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;repeat&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;with&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;to&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;number&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;of&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;items&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;of&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;description&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;of&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;item&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;of&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;is&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Keychain menu extra&amp;#34;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;item&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;i&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;of&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;bar&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;nv&#34;&gt;click&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;of&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;item&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;of&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;front&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;is&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Lock Screen&amp;#34;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;nv&#34;&gt;click&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;item&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Lock Screen&amp;#34;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;of&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;front&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;menu&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                            &lt;span class=&#34;k&#34;&gt;exit&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;repeat&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                        &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                    &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;                &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;repeat&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;application&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;System Preferences&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nb&#34;&gt;activate&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;current&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;pane&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;to&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;pane&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;com.apple.preference.universalaccess&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nb&#34;&gt;display dialog&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;UI element scripting is not enabled. Check \&amp;#34;Enable access for assistive devices\&amp;#34;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And for the sake of clarity: I did not code this script.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Fried noodles with pork</title>
      <link>https://yozy.net/2012/11/fried-noodles-with-pork/</link>
      <pubDate>Thu, 22 Nov 2012 14:01:08 +0000</pubDate>
      <guid>https://yozy.net/2012/11/fried-noodles-with-pork/</guid>
      <description>&lt;p&gt;More food from my production. Tested, eaten and tasty. This food does not&#xA;require much ingredients and should be pretty quick to prepare (if you are good&#xA;at multitasking then about 20 minutes)&lt;/p&gt;&#xA;&lt;h2 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;p&gt;As always, we will have to do some shopping before cooking anything. Depending&#xA;on what you already have you can get this for about 6€ for two doses. So go and&#xA;get these:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/fried-noodles/Ingredients.jpg&#34; alt=&#34;ingredients&#34;&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Some mushrooms&lt;/li&gt;&#xA;&lt;li&gt;Some shiitake mushrooms&lt;/li&gt;&#xA;&lt;li&gt;A piece of leek&lt;/li&gt;&#xA;&lt;li&gt;Half a carrot&lt;/li&gt;&#xA;&lt;li&gt;Half an onion&lt;/li&gt;&#xA;&lt;li&gt;Several slices of garlic&lt;/li&gt;&#xA;&lt;li&gt;Soy sauce&lt;/li&gt;&#xA;&lt;li&gt;Cornstarch&lt;/li&gt;&#xA;&lt;li&gt;Salt&lt;/li&gt;&#xA;&lt;li&gt;Black pepper&lt;/li&gt;&#xA;&lt;li&gt;Chinese noodles&lt;/li&gt;&#xA;&lt;li&gt;Pork (can be some other meat)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;preparation-of-ingredients&#34;&gt;Preparation of ingredients&lt;/h3&gt;&#xA;&lt;p&gt;Before cooking comes washing and cutting&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wash the mushrooms and cut them into quarters or similar&lt;/li&gt;&#xA;&lt;li&gt;Cut the shiitake mushrooms into slices (wash them too)&lt;/li&gt;&#xA;&lt;li&gt;Cut the leek and carrots into long thin bars&lt;/li&gt;&#xA;&lt;li&gt;Cut the onion into dices&lt;/li&gt;&#xA;&lt;li&gt;Crush one piece of garlic and cut the rest into small pieces&lt;/li&gt;&#xA;&lt;li&gt;Cut the meat into french-fries like pieces (salt it)&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Dip the meat in soy sauce and wrap it in cornstarch&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/fried-noodles/Sliced-Ingredients.jpg&#34; alt=&#34;sliced-ingredients&#34;&gt;&#xA;&lt;img src=&#34;https://yozy.net/images/fried-noodles/Dipped-Meat.jpg&#34; alt=&#34;dipped-meat&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;cooking&#34;&gt;Cooking&lt;/h2&gt;&#xA;&lt;h3 id=&#34;first-stage&#34;&gt;First stage&lt;/h3&gt;&#xA;&lt;p&gt;First we will cook the mushrooms. Put the crushed piece of garlic into salted&#xA;water (not much just enough to have the mushrooms covered) and make it boil.&#xA;Then add mushrooms (both) and cook for about three minutes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/fried-noodles/Cooking-Mushrooms.jpg&#34; alt=&#34;cooking-mushrooms&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;At the same time put some oil onto a frying pan, heat it and add sliced garlic.&#xA;When it turns brownish add the meat and fry it for a while. Add pepper. When&#xA;the crust from cornstarch appears add mushrooms and some water (use the&#xA;mushroomy water). After a while add carrots and leek. Cook for several minutes&#xA;stirring all the time. Add some more water from mushrooms from time to time. At&#xA;the same time (this is when multitasking comes handy) make the noodles (for&#xA;cooking method refer to the package)&lt;/p&gt;&#xA;&lt;h3 id=&#34;second-stage&#34;&gt;Second stage&lt;/h3&gt;&#xA;&lt;p&gt;Put some oil into a wok and add onions. Put noodles into the wok add soy sauce&#xA;and fry them for a while (mix them well). After a while add the meat and some&#xA;more water. Cook for several minutes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/fried-noodles/Cooking-Meat-1.jpg&#34; alt=&#34;cooking-meat-1&#34;&gt;&#xA;&lt;img src=&#34;https://yozy.net/images/fried-noodles/Cooking-Meat-2.jpg&#34; alt=&#34;cooking-meat-2&#34;&gt;&#xA;&lt;img src=&#34;https://yozy.net/images/fried-noodles/Cooking-Meat-3.jpg&#34; alt=&#34;cooking-meat-3&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;final-stage&#34;&gt;Final stage&lt;/h3&gt;&#xA;&lt;p&gt;Eat.&lt;/p&gt;&#xA;&lt;p&gt;Suggestion of presentation:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/fried-noodles/Final-Product.jpg&#34; alt=&#34;final-product&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Putting old stuff back in</title>
      <link>https://yozy.net/2012/11/putting-old-stuff-back-in/</link>
      <pubDate>Tue, 20 Nov 2012 00:10:39 +0000</pubDate>
      <guid>https://yozy.net/2012/11/putting-old-stuff-back-in/</guid>
      <description>&lt;p&gt;I have decided to re-publish the old articles from my old Chyrp blog here. I&#xA;have not got to it before as I was too lazy. Not that anybody cares but at&#xA;least it will look like there is something here.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Smelly spread</title>
      <link>https://yozy.net/2012/11/smelly-spread/</link>
      <pubDate>Tue, 20 Nov 2012 00:06:06 +0000</pubDate>
      <guid>https://yozy.net/2012/11/smelly-spread/</guid>
      <description>&lt;p&gt;Why smelly? Because your breath after eating this will be comparable to that of&#xA;a thousand years old dragon. But it is well worth it. The recipe is dead simple&#xA;as well.&lt;/p&gt;&#xA;&lt;h3 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h3&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/smelly-spread/Ingredients.jpg&#34; alt=&#34;ingredients&#34;&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Sardines in oil (any oil as long as it is not motor oil)&lt;/li&gt;&#xA;&lt;li&gt;Butter&lt;/li&gt;&#xA;&lt;li&gt;Onions&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3 id=&#34;preparation&#34;&gt;Preparation&lt;/h3&gt;&#xA;&lt;p&gt;Simple as promised: Just put the fish into a bowl, add a few slices of butter&#xA;and the diced onions. Then furiously mix the thing until it vaguely looks like&#xA;something spreadable on a bread. Job&amp;rsquo;s done!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/smelly-spread/Preparation-1.jpg&#34; alt=&#34;preparation-1&#34;&gt;&#xA;&lt;img src=&#34;https://yozy.net/images/smelly-spread/Preparation-2.jpg&#34; alt=&#34;preparation-2&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;and-yet-&#34;&gt;And yet &amp;hellip;&lt;/h3&gt;&#xA;&lt;p&gt;Making the spread is simple, the difficult part is to serve it right and&#xA;arrange the plate so it will have some bling to it. I did not try this time,&#xA;but somedays I&amp;rsquo;ll update this with some better presentation.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/smelly-spread/Finished.jpg&#34; alt=&#34;finished&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Shanghai Heat</title>
      <link>https://yozy.net/2012/11/shanghai-heat/</link>
      <pubDate>Mon, 19 Nov 2012 02:47:46 +0000</pubDate>
      <guid>https://yozy.net/2012/11/shanghai-heat/</guid>
      <description>&lt;p&gt;More noodles! Why ?, you might ask, well because everyone loves noodles. And&#xA;mushrooms, we will be seeing lots of those in just a few moments. So, put on&#xA;your white hat and start making a list of things to buy.&lt;/p&gt;&#xA;&lt;h2 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;p&gt;OK, be prepared to raid the nearest Asian shop because this meal needs several&#xA;special ingredients. As always, here&amp;rsquo;s a picture of what we&amp;rsquo;ll need :&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/shanghai-heat/Ingredients.jpg&#34; alt=&#34;img-ingredients&#34; title=&#34;Ingredients&#34;&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Chicken escalopes&lt;/li&gt;&#xA;&lt;li&gt;Mushrooms - &lt;em&gt;Agaricus&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Shiitake mushrooms&lt;/li&gt;&#xA;&lt;li&gt;More shrooms - &lt;em&gt;Pleurotus&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Auricularia auricula-judae&lt;/em&gt; or &amp;ldquo;black curly Chinese mushrooms&amp;rdquo; (I actually mix two kinds of them)&lt;/li&gt;&#xA;&lt;li&gt;Green and red bell pepper&lt;/li&gt;&#xA;&lt;li&gt;Chilly pepper, also both red and green&lt;/li&gt;&#xA;&lt;li&gt;Onions&lt;/li&gt;&#xA;&lt;li&gt;Garlic&lt;/li&gt;&#xA;&lt;li&gt;Butter (salted butter for the win)&lt;/li&gt;&#xA;&lt;li&gt;Corn starch&lt;/li&gt;&#xA;&lt;li&gt;Black pepper&lt;/li&gt;&#xA;&lt;li&gt;Spices - coriander, caraway, cumin, cinnamon, paprika &amp;hellip;&lt;/li&gt;&#xA;&lt;li&gt;Salt&lt;/li&gt;&#xA;&lt;li&gt;Soy sauce&lt;/li&gt;&#xA;&lt;li&gt;Shanghai noodles&lt;/li&gt;&#xA;&lt;li&gt;Green-tea &lt;em&gt;soba&lt;/em&gt; noodles&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;preparation&#34;&gt;Preparation&lt;/h2&gt;&#xA;&lt;p&gt;Got everything? Good! Preparation of the ingredients is pretty simple and&#xA;shouldn&amp;rsquo;t take more than twenty minutes.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Clean the chicken and slice it to small pieces. Add the spice mix and cover&#xA;it in a thin layer of corn starch. I usually just put a soup spoonful of it on&#xA;it and mix it with hands.&lt;/li&gt;&#xA;&lt;li&gt;Wash the mushrooms and slice them.&lt;/li&gt;&#xA;&lt;li&gt;If the black mushrooms are too huge, crush them before washing them.&lt;/li&gt;&#xA;&lt;li&gt;Wash, clean and cut the bell peppers into cubes.&lt;/li&gt;&#xA;&lt;li&gt;Wash the chilly peppers and cut them into roundels.&lt;/li&gt;&#xA;&lt;li&gt;Cut the onion into halves. Dice one of the halves and cut the other to&#xA;several smaller parts.&lt;/li&gt;&#xA;&lt;li&gt;Crush one piece of garlic and dice the rest.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/shanghai-heat/Meat.jpg&#34; alt=&#34;img-meat&#34; title=&#34;Meat&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;cooking&#34;&gt;Cooking&lt;/h2&gt;&#xA;&lt;p&gt;Everything&amp;rsquo;s done ? Excellent, now we can start doing some cooking.&lt;/p&gt;&#xA;&lt;h3 id=&#34;shrooms&#34;&gt;Shrooms&lt;/h3&gt;&#xA;&lt;p&gt;Pour some water into a bucket &amp;hellip; err a cooking pot. Not too much of it though.&#xA;Just enough that when you put all the mushrooms into it it will cover them all.&#xA;Don&amp;rsquo;t put them in it just yet though. Put some butter and one crushed clove of&#xA;garlic in there first, don&amp;rsquo;t forget to add salt. Let it boil and put all the&#xA;mushrooms inside afterwards. Wait for about 2 minutes.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/shanghai-heat/Shrooms.jpg&#34; alt=&#34;img-shrooms&#34; title=&#34;Shrooms&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;vegetables&#34;&gt;Vegetables&lt;/h3&gt;&#xA;&lt;p&gt;Once the mushrooms are half cooked pour more water into the pot and add all the&#xA;vegetables - bell pepper, chilly and half of the onion (the one cut into bigger&#xA;cubes). Add some black pepper as well. Cook until it&amp;rsquo;s cooked (duh).&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/shanghai-heat/Vegetables.jpg&#34; alt=&#34;img-vegetables&#34; title=&#34;Vegetables&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;meat&#34;&gt;Meat&lt;/h3&gt;&#xA;&lt;p&gt;Once the vegetables are cooking, you can begin to prepare the meat. Put the&#xA;diced garlic and onions onto a frying pan with a bit of oil. Make them fry for&#xA;a while and then put the meat into the pan and add some soy sauce.&lt;/p&gt;&#xA;&lt;p&gt;After a few minutes, when the meat is fried, add the contents of the cooking&#xA;pot into the wok. Do keep at least a half of the water in the pot, we will use&#xA;that later. Lower down the heat under the wok.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/shanghai-heat/Frying.jpg&#34; alt=&#34;img-frying&#34; title=&#34;Frying&#34;&gt;&#xA;&lt;img src=&#34;https://yozy.net/images/shanghai-heat/Combining.jpg&#34; alt=&#34;img-combining&#34; title=&#34;Combining&#34;&gt;&#xA;&lt;img src=&#34;https://yozy.net/images/shanghai-heat/Combining-2.jpg&#34; alt=&#34;img-combining2&#34; title=&#34;Combining 2&#34;&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;noodles&#34;&gt;Noodles&lt;/h3&gt;&#xA;&lt;p&gt;We will be using a mix of Shanghai noodles and green-tea flavoured noodles, but&#xA;any noodles will go. Add more water to the cooking pot, let it boil again and&#xA;cook the noodles inside (refer yourself to the package, cooking time may (and&#xA;will) vary). Once the noodles are cooked, you are ready to serve.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/shanghai-heat/Noodles.jpg&#34; alt=&#34;img-noodles&#34; title=&#34;Noodles&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;final-word&#34;&gt;Final word&lt;/h2&gt;&#xA;&lt;p&gt;Finally a meal that not only tastes, but also looks good. When making this one,&#xA;don&amp;rsquo;t hesitate to experiment. Personally I like to add some baby-corn, bamboo&#xA;and especially some chilly sauce&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/shanghai-heat/Shanghai-Heat.jpg&#34; alt=&#34;img-finished&#34; title=&#34;Shanghai Heat&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Add shortcuts for emoji characters to finally put the ± key to use</title>
      <link>https://yozy.net/2012/11/add-shortcuts-for-emoji-characters-to-finally-put-the-key-to-use/</link>
      <pubDate>Thu, 08 Nov 2012 03:13:01 +0000</pubDate>
      <guid>https://yozy.net/2012/11/add-shortcuts-for-emoji-characters-to-finally-put-the-key-to-use/</guid>
      <description>&lt;p&gt;I have finally managed to find a use for the ± key on the Apple keyboard. This keyI have finally managed to find a use for the ± key on the Apple keyboard. This key bugged me since I got the computer as I have never ever seen it in a text and just can not understand why it would be on a keyboard in the first place.&lt;/p&gt;&#xA;&lt;p&gt;Since there is a native text-expansion feature in OS X (Settings → Language&#xA;&amp;amp; Text → Text) it seems that this character could serve as a perfect&#xA;&amp;ldquo;marker&amp;rdquo; for some exotic shortcuts. The color emoticons available in the OS X&#xA;make a perfect candidate since inserting them into text is quite a hassle as&#xA;one has to go through the Special Character menu.&lt;/p&gt;&#xA;&lt;p&gt;Thus I made shortcuts for some of them as illustrated here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/emoji-shortcuts.png&#34; alt=&#34;img-emoji-shortcuts&#34; title=&#34;Emoji shortcut examples&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;They help me navigate in plain text document and provide valuable highlighting&#xA;options in places where other methods do not exist. Maybe this could help you&#xA;too. Bugged me since I got the computer as I have never ever seen it in a text&#xA;and just can not understand why it would be on a keyboard in the first place.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Vim setup</title>
      <link>https://yozy.net/2012/10/vim-setup/</link>
      <pubDate>Mon, 22 Oct 2012 15:14:01 +0000</pubDate>
      <guid>https://yozy.net/2012/10/vim-setup/</guid>
      <description>&lt;p&gt;Again, this is mostly a social bookmark to have a trace of what different parts&#xA;of my configuration files in my Vim folder do. Feel free to steal whatever part&#xA;you like. Note that not all of these settings will work without additional&#xA;plugins. The ones I use on daily basis are: &lt;strong&gt;Powerline&lt;/strong&gt;, &lt;strong&gt;bclose&lt;/strong&gt;, &lt;strong&gt;voom&lt;/strong&gt;&#xA;and &lt;strong&gt;latex-suite&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A hint: Since I am using several computers I use Dropbox to synchronize all of&#xA;my vim configurations thus my .vim folder on every machine is just a symlink to&#xA;the Dropbox folder. I have moved my vimrc file there as well and source it from&#xA;the original .vimrc file in the home folder.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&amp;quot; In case we are in a 256 color capable terminal&#xA;set t_Co=256&#xA;&#xA;&amp;quot; Set a right colorscheme&#xA;colorscheme zenburn&#xA;&#xA;&amp;quot; Let Powerline use nice symbols&#xA;let g:Powerline_symbols = &#39;fancy&#39;&#xA;&#xA;&amp;quot; Look for modelines embedded in source files, this is especially useful when&#xA;&amp;quot; getting python code from other developers&#xA;set modeline&#xA;&#xA;&amp;quot; The only GUI element we want is the icon, remove menubar, toolbars etc.&#xA;set go=i&#xA;&#xA;&amp;quot; Always show the statusline&#xA;set laststatus=2&#xA;&#xA;&amp;quot; Display the beginning of the last line at the end of the buffer&#xA;set display=lastline&#xA;&#xA;&amp;quot; Turn on the syntax highlighting&#xA;syntax on&#xA;&#xA;&amp;quot; Set default window size to something sensible&#xA;set lines=60&#xA;set columns=170&#xA;&amp;quot;&#xA;&amp;quot; Set the editor to wrap long lines on words&#xA;set wrap&#xA;set linebreak&#xA;&#xA;&amp;quot; Do not insert break lines to long lines&#xA;set textwidth=0&#xA;set wrapmargin=0&#xA;&#xA;&amp;quot; Turn on folding&#xA;set foldenable&#xA;&#xA;&amp;quot; Make folding indent sensitive&#xA;set foldmethod=indent&#xA;&#xA;&amp;quot; Don&#39;t autofold anything (but I can still fold manually)&#xA;set foldlevel=100&#xA;&#xA;&amp;quot; don&#39;t open folds when you search into them&#xA;set foldopen-=search&#xA;&#xA;&amp;quot; don&#39;t open folds when you undo stuff&#xA;set foldopen-=undo&#xA;&#xA;&amp;quot; Start the filetype plugin, this is really necessary&#xA;filetype plugin on&#xA;&#xA;&amp;quot;set fuopt=maxvert&#xA;&#xA;&amp;quot; I use simple php templates&#xA;au BufNewFile,BufRead *.tmpl setf php&#xA;&#xA;&amp;quot; Load doxygen syntax highlighting when necessary&#xA;let g:load_doxygen_syntax=1&#xA;&#xA;&amp;quot; Add doxygen syntax highlighting to all cpp files&#xA;au BufNewFile,BufRead *.cpp setf cpp.doxygen&#xA;&#xA;&amp;quot; Add jQuery syntax highlighting&#xA;au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery&#xA;&#xA;&amp;quot; Activate line numbers&#xA;set number&#xA;&#xA;&amp;quot; Tab size to 4 spaces, and no expanding of tabs to spaces!&#xA;set tabstop=4&#xA;set shiftwidth=4&#xA;set noexpandtab&#xA;&#xA;&amp;quot; Display only 5 first suggestions when correcting orthograph&#xA;set spellsuggest=best,5&#xA;&#xA;&amp;quot; I use the &amp;lt;,&amp;gt; shortcut to align a paragraph to the wrap width&#xA;nmap , gqap&#xA;&amp;quot;&#xA;&amp;quot; Use Ctrl-W+` to close current file without closing the split (needs bclose&#xA;&amp;quot; plugin)&#xA;nmap &amp;lt;C-W&amp;gt;` &amp;lt;Plug&amp;gt;Kwbd&#xA;&#xA;&amp;quot; Enable the use of Ctrl-Space and Ctrl-Enter for completion&#xA;imap &amp;lt;C-S-space&amp;gt; &amp;lt;C-n&amp;gt;&#xA;imap &amp;lt;C-space&amp;gt; &amp;lt;C-p&amp;gt;&#xA;imap &amp;lt;C-CR&amp;gt; &amp;lt;C-x&amp;gt;&amp;lt;C-o&amp;gt;&#xA;&#xA;&amp;quot; Map the up/down arrow keys to follow visual lines, not the real ones&#xA;map &amp;lt;Up&amp;gt; gk&#xA;map &amp;lt;Down&amp;gt; gj&#xA;imap &amp;lt;Down&amp;gt; &amp;lt;C-o&amp;gt;gj&#xA;imap &amp;lt;Up&amp;gt; &amp;lt;C-o&amp;gt;gk&#xA;&#xA;&amp;quot; Map Meta-j and Meta-k to follow visual lines&#xA;map &amp;lt;M-j&amp;gt; gj&#xA;map &amp;lt;M-k&amp;gt; gk&#xA;&#xA;&amp;quot; Map Home and End to go to beginning and end of the visual line&#xA;map &amp;lt;End&amp;gt; g&amp;lt;End&amp;gt;&#xA;map &amp;lt;Home&amp;gt; g&amp;lt;Home&amp;gt;&#xA;imap &amp;lt;End&amp;gt; &amp;lt;C-o&amp;gt;g&amp;lt;End&amp;gt;&#xA;imap &amp;lt;Home&amp;gt; &amp;lt;C-o&amp;gt;g&amp;lt;Home&amp;gt;&#xA;&#xA;&amp;quot; Make Meta-Shift-MouseScroll create a visual block selection&#xA;noremap &amp;lt;M-S-LeftMouse&amp;gt; &amp;lt;4-LeftMouse&amp;gt;&#xA;inoremap &amp;lt;M-S-LeftMouse&amp;gt; &amp;lt;4-LeftMouse&amp;gt;&#xA;noremap &amp;lt;M-S-LeftDrag&amp;gt; &amp;lt;LeftDrag&amp;gt;&#xA;inoremap &amp;lt;M-S-LeftDrag&amp;gt; &amp;lt;LeftDrag&amp;gt;&#xA;&#xA;&amp;quot;set statusline=%&amp;lt;[%02n]\ %F%(\ %m%h%w%y%r%)\ %a%=\ %8l,%c%V/%L\ (%P)&#xA;&amp;quot; Map gw to switch the word under the cursors with the next one&#xA;nnoremap &amp;lt;silent&amp;gt; gw &amp;quot;_yiw:s/\(\%#\w\+\)\(\W\+\)\(\w\+\)/\3\2\1/&amp;lt;CR&amp;gt;&amp;lt;c-o&amp;gt;&amp;lt;c-l&amp;gt;&#xA;&#xA;&amp;quot; Map gl to switch the word under the cursor with the previous one&#xA;nnoremap &amp;lt;silent&amp;gt; gl &amp;quot;_yiw?\w\+\_W\+\%#&amp;lt;CR&amp;gt;:s/\(\%#\w\+\)\(\_W\+\)\(\w\+\)/\3\2\1/&amp;lt;CR&amp;gt;&amp;lt;c-o&amp;gt;&amp;lt;c-l&amp;gt;&#xA;&#xA;&amp;quot; Map F3 to show the list of buffers&#xA;map &amp;lt;F3&amp;gt; :buffers&amp;lt;CR&amp;gt;:b&amp;lt;space&amp;gt;&#xA;&#xA;&amp;quot; Map F4 to switch between .h and .cpp file&#xA;map &amp;lt;F4&amp;gt; :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,&amp;lt;CR&amp;gt;g`&amp;quot;&#xA;&#xA;&amp;quot; Map F5 and F6 to go to next/previous error marker&#xA;map &amp;lt;F5&amp;gt; :cp&amp;lt;CR&amp;gt;&#xA;map &amp;lt;F6&amp;gt; :cn&amp;lt;CR&amp;gt;&#xA;&#xA;&amp;quot; Map F8 to save all files and run Make&#xA;map &amp;lt;F8&amp;gt; :wall&amp;lt;CR&amp;gt;:make&amp;lt;CR&amp;gt;&#xA;&#xA;&amp;quot; Start indenting scheme automatically&#xA;filetype plugin indent on&#xA;&#xA;&amp;quot; Use the right grep command on mac&#xA;set grepprg=grep\ -nH\ $*&#xA;&#xA;&amp;quot; Of course we are using latex&#xA;let g:tex_flavor=&#39;latex&#39;&#xA;&#xA;&amp;quot; Autogenerate ctags on C/C++ source file save&#xA;&amp;quot;au BufWritePost .c,.cpp,*.h silent! !ctags -R &amp;amp;amp;&#xA;&#xA;&amp;quot; If we are on a Mac&#xA;if has(&amp;quot;unix&amp;quot;) &amp;amp;amp;&amp;amp;amp; match(system(&amp;quot;uname&amp;quot;),&#39;Darwin&#39;) != -1&#xA;let g:platform_MAC=1&#xA;&amp;quot; Setup a nice font for powerline&#xA;set guifont=Meslo\ LG\ M\ DZ\ for\ Powerline:h12&#xA;&#xA;&amp;quot; Receive option keys as meta&#xA;set macmeta&#xA;&#xA;&amp;quot; Map :TB for mode for writing text on a big screen&#xA;command TB colorscheme mayansmoke|set spell|set linespace=8|set guifont=Meslo\ LG\ M\ DZ\ for\ Powerline:h20|set fu&#xA;&amp;quot; Map :TB for mode for writing text on a small screen&#xA;command T colorscheme mayansmoke|set spell|set linespace=8|set guifont=Meslo\ LG\ M\ DZ\ for\ Powerline:h14&#xA;&amp;quot; Map :TB for mode for writing code&#xA;command C colorscheme zenburn|set nospell|set linespace=0|set guifont=Meslo\ LG\ M\ DZ\ for\ Powerline:h12&#xA;&#xA;&amp;quot; If we are on Linux&#xA;else&#xA;set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 12&#xA;let g:Powerline_symbols = &#39;fancy&#39;&#xA;&#xA;&amp;quot; Map Meta+V as paste from system clipboard&#xA;imap &amp;lt;M-v&amp;gt; &amp;lt;Esc&amp;gt;&amp;quot;+pa&#xA;imap &amp;lt;M-S-v&amp;gt; &amp;lt;Esc&amp;gt;&amp;quot;+Pa&#xA;nmap &amp;lt;M-v&amp;gt; &amp;quot;+p&#xA;nmap &amp;lt;M-S-v&amp;gt; &amp;quot;+P&#xA;&#xA;&amp;quot; Map Meta+C as copy to system clipboard&#xA;vmap &amp;lt;M-c&amp;gt; &amp;quot;+y&#xA;&#xA;&amp;quot; Map Ctrl+S as save&#xA;nmap &amp;lt;C-s&amp;gt; :w&amp;lt;CR&amp;gt;&#xA;imap &amp;lt;C-s&amp;gt; &amp;lt;Esc&amp;gt;:w&amp;lt;CR&amp;gt;a&#xA;&#xA;&amp;quot; Map :TB for mode for writing text&#xA;command T colorscheme mayansmoke|set spell|set linespace=8|set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 14&#xA;&amp;quot; Map :TB for mode for writing code&#xA;command C colorscheme zenburn|set nospell|set linespace=0|set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 10&#xA;endif&#xA;&#xA;&amp;quot; Deletes double lines and such from a SVN log&#xA;function! CleanSVNLog()&#xA;%s/^-*$//g&#xA;%s/^r\d\d*.*$//g&#xA;%s/\n\n\n*/\r\r/&#xA;endfunction&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;</description>
    </item>
    <item>
      <title>US Extended layout for Mac with switched `/~ and §/± keys</title>
      <link>https://yozy.net/2012/10/us-extended-layout-for-mac-with-switched-/~-and-/-keys/</link>
      <pubDate>Thu, 18 Oct 2012 23:02:03 +0000</pubDate>
      <guid>https://yozy.net/2012/10/us-extended-layout-for-mac-with-switched-/~-and-/-keys/</guid>
      <description>&lt;p&gt;The Mac keyboard layout is weird. Some choices Apple made when designing it are&#xA;good but some of them really come from outer space. Why would anybody need a ±&#xA;symbol on his keyboard is beyond me. Luckily Ukelele software provides an&#xA;acceptable solution.&lt;/p&gt;&#xA;&lt;p&gt;Personally I use U.S. Extended layout for almost everything. The only time I&#xA;switch is when I have a very lengthy french text to write. (Speaking of which,&#xA;why does french layout have a  character directly on the keyboard? Just how&#xA;often would anybody use that?). So, in order to keep the layout consistent with&#xA;other keyboards I have made a U.S. Extended+ version which changes flips the&#xA;&lt;strong&gt;§±&lt;/strong&gt; and &lt;strong&gt;`~&lt;/strong&gt; keys around.&lt;/p&gt;&#xA;&lt;p&gt;Download it here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/USExtended+.zip&#34; title=&#34;USExtended+ keyboard layout&#34;&gt;USExtended+&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>How to make Uncle Ben&#39;s chili sauce not suck</title>
      <link>https://yozy.net/2012/10/how-to-make-uncle-bens-chili-sauce-not-suck/</link>
      <pubDate>Sat, 06 Oct 2012 20:14:15 +0000</pubDate>
      <guid>https://yozy.net/2012/10/how-to-make-uncle-bens-chili-sauce-not-suck/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/Chiliupgrade.jpg#+right+w300+margin&#34; alt=&#34;1&#34; title=&#34;Uncle Ben&#39;s chili upgraded&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;When Leader Price discontinued my preferred chili sauce I was angry and very&#xA;sad. Oddly enough, Intermarché did the same and removed chili from their&#xA;selection of Claude Léger sauces. Obviously there is no market for chili in&#xA;France. What is done is done and we, cheap chili lovers, are now stuck with the&#xA;Uncle Ben&amp;rsquo;s crap.&lt;/p&gt;&#xA;&lt;p&gt;But let us not fall into despair, there is a way to save this non-perishable&#xA;canned (bottled?) food franchise. The recipe is extremely simple, take a bottle&#xA;of Uncle Ben&amp;rsquo;s chili sauce, add in a can of tomato paste and an appropriate&#xA;amount of Sriracha sauce. And, voilà, ready to cook and serve. Preferably with&#xA;bacon and rice.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>List of useful links to hack your OS X installation</title>
      <link>https://yozy.net/2012/07/list-of-useful-links-to-hack-your-os-x-installation/</link>
      <pubDate>Thu, 05 Jul 2012 08:00:40 +0000</pubDate>
      <guid>https://yozy.net/2012/07/list-of-useful-links-to-hack-your-os-x-installation/</guid>
      <description>&lt;p&gt;This is more of a social bookmark than a full article. OS X is pretty neat but&#xA;the ever-present philosophy of &amp;ldquo;our way of doing it is the right way&amp;rdquo; can be&#xA;frustrating from time to time. Since I do not really like the trend of&#xA;paraphrasing already written articles I will just dump a bunch of links here&#xA;and say what I used them for.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://phatness.com/2007/08/fix-home-and-end-keys-on-mac-os-x/&#34; title=&#34;Fix Home and End keys behaviour&#34;&gt;Fix Home and End keys behaviour&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Home and End keys should go to the beginning and end of the line you are on&#xA;while editing. In OS X they scroll to the top and the bottom of the current&#xA;document, which is retarded.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/mathiasbynens/dotfiles/blob/master/.osx&#34; title=&#34;A ton of useful hidden settings&#34;&gt;A ton of useful hidden settings&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I like keyboard repeat. Also I like to be able to copy text from QuickLook.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.macworld.com/article/1131923/qlterminal.html&#34; title=&#34;Use QuickLook from the terminal&#34;&gt;Use QuickLook from the terminal&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I use this for my side-project of making Midnight Commander actually usable on&#xA;OS X. So far I did not have time to really invest into it.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Duck gizzard salad, the Yoz-way</title>
      <link>https://yozy.net/2012/07/duck-gizzard-salad-the-yoz-way/</link>
      <pubDate>Wed, 04 Jul 2012 09:25:55 +0000</pubDate>
      <guid>https://yozy.net/2012/07/duck-gizzard-salad-the-yoz-way/</guid>
      <description>&lt;p&gt;Since the last recipe was for a burger, let us make something healthier. Like a&#xA;salad. However let us make it tasty as well, like by adding a pint of fat.&lt;/p&gt;&#xA;&lt;h2 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Mesclun&lt;/li&gt;&#xA;&lt;li&gt;Duck gizzards&lt;/li&gt;&#xA;&lt;li&gt;Tomatoes&lt;/li&gt;&#xA;&lt;li&gt;Västerbottensost (Swedish cheese)&lt;/li&gt;&#xA;&lt;li&gt;Cashew nuts&lt;/li&gt;&#xA;&lt;li&gt;Salt&lt;/li&gt;&#xA;&lt;li&gt;Pepper&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;preparation-of-ingredients&#34;&gt;Preparation of ingredients&lt;/h2&gt;&#xA;&lt;p&gt;Wash the salad, dice the tomatoes (wash them first, eh). Dice the cheese.&lt;/p&gt;&#xA;&lt;p&gt;If your duck needs to be heated in bain-marie do so. Cut the meat to smaller&#xA;pieces (keep the fat).&lt;/p&gt;&#xA;&lt;h2 id=&#34;cooking&#34;&gt;Cooking&lt;/h2&gt;&#xA;&lt;p&gt;Heat a frying pan. Use the fat from the duck to grease it. Throw the duck and&#xA;cashew nuts in. Salt, pepper and stir for a bit.&lt;/p&gt;&#xA;&lt;p&gt;Take a salad bowl and throw everything in. Mix vigorously.&lt;/p&gt;&#xA;&lt;h2 id=&#34;afterword&#34;&gt;Afterword&lt;/h2&gt;&#xA;&lt;p&gt;Making salad is easy. Just take anything you have in the fridge and throw it&#xA;into a bowl. The more colors the better.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/duck-salad.jpg&#34; alt=&#34;duck-salad&#34; title=&#34;Salad from mesclun, duck gizzards, tomatoes, swedish cheese and cashew nuts&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>The almighty Yozburger</title>
      <link>https://yozy.net/2012/06/the-almighty-yozburger/</link>
      <pubDate>Mon, 25 Jun 2012 11:48:52 +0000</pubDate>
      <guid>https://yozy.net/2012/06/the-almighty-yozburger/</guid>
      <description>&lt;p&gt;Hunger strikes again! And best remedy for hunger is food! And best food is&amp;hellip;&#xA;burgers!&lt;/p&gt;&#xA;&lt;h2 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;p&gt;Possibilities are endless but decisions have to be made. Usually I put this&#xA;into a burger, but feel free to add whatever you like.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Hamburger bun (big one)&lt;/li&gt;&#xA;&lt;li&gt;Beef burger&lt;/li&gt;&#xA;&lt;li&gt;Bacon&lt;/li&gt;&#xA;&lt;li&gt;Cheddar cheese&lt;/li&gt;&#xA;&lt;li&gt;Egg&lt;/li&gt;&#xA;&lt;li&gt;Tomato&lt;/li&gt;&#xA;&lt;li&gt;Onion&lt;/li&gt;&#xA;&lt;li&gt;Lettuce (or Chinese cabbage)&lt;/li&gt;&#xA;&lt;li&gt;Salt&lt;/li&gt;&#xA;&lt;li&gt;Pepper&lt;/li&gt;&#xA;&lt;li&gt;Brown sugar&lt;/li&gt;&#xA;&lt;li&gt;Pork fat&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;preparation-of-ingredients&#34;&gt;Preparation of ingredients&lt;/h2&gt;&#xA;&lt;p&gt;Slice the onion to stripes. Slice tomatoes to circular slices. Cut the lettuce&#xA;to smaller leaves.&lt;/p&gt;&#xA;&lt;h2 id=&#34;cooking&#34;&gt;Cooking&lt;/h2&gt;&#xA;&lt;p&gt;Start of by melting the fat on a pan. Put the bacon in and pour brown sugar&#xA;over it to make candied bacon.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/yozburger/yozburger.png#+right+w300+margin&#34; alt=&#34;yozburger&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Remove the bacon, salt and pepper the burger and put it on the pan (use the&#xA;same pan for everything). When the steak is almost done (rare) put the onions&#xA;and tomato and lettuce in. Also start frying the egg (and salt it a bit). It is&#xA;important to cook the onions, lettuce and tomato in the same oil as the bacon&#xA;and the burger. If you do not have enough place to put everything into the pan&#xA;then cook what you must after you have removed the burger.&lt;/p&gt;&#xA;&lt;p&gt;Start assembling the burger. From bottom I usually do : bun, cheese, onions,&#xA;tomato, burger, cheese, onions, tomato, lettuce, egg, bun. Refer to the diagram&#xA;for more precise information.&lt;/p&gt;&#xA;&lt;p&gt;Secret knack : after I finish assembling the burger, just before putting the&#xA;egg in I pour all of the oil from the pan into the burger. This serves as the&#xA;best sauce you will ever have and this way you will avoid using unhealthy&#xA;sauces like ketchup or mayo.&lt;/p&gt;&#xA;&lt;h2 id=&#34;final-word&#34;&gt;Final word&lt;/h2&gt;&#xA;&lt;p&gt;No words are necessary, just look at the beauty!&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/yozburger/yozburger-photo.jpg&#34; alt=&#34;yozburger-photo&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Best editor for Chinese text on Mac</title>
      <link>https://yozy.net/2012/06/best-editor-for-chinese-text-on-mac/</link>
      <pubDate>Sun, 24 Jun 2012 16:15:27 +0000</pubDate>
      <guid>https://yozy.net/2012/06/best-editor-for-chinese-text-on-mac/</guid>
      <description>&lt;p&gt;I have spent some time (like an hour or so) looking for a good editor for&#xA;Chinese script on Mac OS X. To my surprise most of what I have tried sucked in&#xA;one or more ways.&lt;/p&gt;&#xA;&lt;h2 id=&#34;competitors&#34;&gt;Competitors&lt;/h2&gt;&#xA;&lt;p&gt;Of course, I have started with the editor I use to edit plaintext daily -&#xA;&lt;strong&gt;iA Writer&lt;/strong&gt;. For once, I have said to myself, the humongous font&#xA;this editor uses would be very useful. Sadly, iA Writer uses the default OS X&#xA;font for chinese. This derivate of Heiti is quite broken and many glyphs are&#xA;wrong (this was pointed out to me by a native speaker). Also, line height of&#xA;lines with chinese characters is weird, and it changes depending of the&#xA;presence of non-chinese characters in it (including blank space). I have&#xA;reported the issue to the authors and it was acknowledged so there might be a&#xA;different font used in future versions… we will see.&lt;/p&gt;&#xA;&lt;p&gt;So my first choice did not work out. No worries, there are plenty other editors&#xA;to check. My second choice was &lt;a href=&#34;http://code.google.com/p/macvim/&#34; title=&#34;MacVim&#34;&gt;&lt;strong&gt;MacVim&lt;/strong&gt;&lt;/a&gt;, which is the best&#xA;invention since sliced bread. The experience was very poor. The insert mode&#xA;works well, as expected, however the normal mode hates IMKQIM input method. It&#xA;would seem that Vim was not meant to be used with other than standard input&#xA;methods, which is understandable.&lt;/p&gt;&#xA;&lt;p&gt;Moving on. Since alternative software did not work out I tried the native&#xA;solutions. &lt;strong&gt;TextEdit&lt;/strong&gt; is usually a very good text editor, if you&#xA;do not need any features. When writing immediately (in plain text mode), you&#xA;will run into the same problem as with iA Writer : horrible font. You can&#xA;change the font for plain text mode, of course, but you have to choose the&#xA;right one. STSong is a good choice, with other fonts you might run into&#xA;problems with line heights (as some fonts miss some glyphs).&#xA;&lt;strong&gt;Fraise&lt;/strong&gt; suffers from similar problems.&lt;/p&gt;&#xA;&lt;p&gt;I have also tried &lt;strong&gt;Pages&lt;/strong&gt;, it works really well, with the right fonts. Line&#xA;heights are always OK. But it is not a plain text editor, and it has all the&#xA;downsides of a text processor with hundreds of options.&lt;/p&gt;&#xA;&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h2&gt;&#xA;&lt;p&gt;Finally, I ended up with yet another editor. I have dug up the rusty&#xA;&lt;a href=&#34;http://gottcode.org/focuswriter/&#34; title=&#34;FocusWriter&#34;&gt;&lt;strong&gt;FocusWriter&lt;/strong&gt;&lt;/a&gt; which I have abandoned previously to&#xA;iA Writer. The possibility to switch themes makes it a good choice for&#xA;different scripts. My choice was the 华文细黑 font.  Best of all FocusWriter is&#xA;available on all platforms, so I just use that on Linux as well.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;em&gt;Edit 2015-10-18&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;iA Writer no longer has the aforementioned problems, at least in OSX 10.11&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Cannot be unseen</title>
      <link>https://yozy.net/2012/05/cannot-be-unseen/</link>
      <pubDate>Mon, 21 May 2012 02:07:46 +0000</pubDate>
      <guid>https://yozy.net/2012/05/cannot-be-unseen/</guid>
      <description>&lt;p&gt;On my trip to London I have stumbled upon a bridge with a curious design of the&#xA;cable holding contraption.&lt;/p&gt;&#xA;&lt;p&gt;Once seen, this cannot be unseen. Well, at least it gives an interesting&#xA;picture. Would be probably better in worse weather though.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/cannot-be-unseen.jpg&#34; alt=&#34;cannot-be-unseen&#34; title=&#34;Cannot be unseen&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Carbonara Supercharge</title>
      <link>https://yozy.net/2012/05/carbonara-supercharge/</link>
      <pubDate>Sat, 12 May 2012 18:50:23 +0000</pubDate>
      <guid>https://yozy.net/2012/05/carbonara-supercharge/</guid>
      <description>&lt;p&gt;When you are dying of hunger you need to swallow something with a lot of&#xA;calories of all sorts (just in case), and you need to do it fast. This is a ten&#xA;minute recipe for delicious pasta with enough fat to give you a minor&#xA;heart-attack.&lt;/p&gt;&#xA;&lt;p&gt;Today we are cooking a spinoff of spaghetti (or whatever, all pasta tastes the&#xA;same) carbonara.&lt;/p&gt;&#xA;&lt;h2 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/carbonara-supercharge/Ingredients.jpg&#34; alt=&#34;ingredients&#34; title=&#34;Carbonara Supercharge Ingredients&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;You should always have these around in your house anyways, but maybe you will&#xA;have to add 10 minutes for shopping&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Pasta (I use spaghetti or penne)&lt;/li&gt;&#xA;&lt;li&gt;Sliced bacon&lt;/li&gt;&#xA;&lt;li&gt;Liquid cream (or any other, actually)&lt;/li&gt;&#xA;&lt;li&gt;Parmesan cheese&lt;/li&gt;&#xA;&lt;li&gt;Emmental cheese&lt;/li&gt;&#xA;&lt;li&gt;Canned sliced mushrooms&lt;/li&gt;&#xA;&lt;li&gt;Egg&lt;/li&gt;&#xA;&lt;li&gt;Onion&lt;/li&gt;&#xA;&lt;li&gt;Bonus: White Wine&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;preparation-of-ingredients&#34;&gt;Preparation of ingredients&lt;/h2&gt;&#xA;&lt;p&gt;Nada. Well, open the can of mushrooms at least. Oh, and dice the onion.&lt;/p&gt;&#xA;&lt;h2 id=&#34;cooking&#34;&gt;Cooking&lt;/h2&gt;&#xA;&lt;p&gt;Depending on your pasta you will have to start cooking it at some random moment&#xA;during the cooking of the sauce. Or you can just cook it after sauce is ready,&#xA;it can wait, the pasta can not.&lt;/p&gt;&#xA;&lt;p&gt;Start by frying the onions in a pan. Once they are ready put in the bacon. Cook&#xA;until the bacon changes colour and add sliced mushrooms. Cook for like a minute&#xA;and then add some cream. Afterwards add some cheese (either or both), not too&#xA;much, and cook until it disolves. If you are rich enough add a spoonful or two&#xA;of white wine into the mix now. Repeat the previous step until you think you&#xA;have enough cheese in the mix. Cook for a bit. Now put in the egg and stirr&#xA;furiously.&lt;/p&gt;&#xA;&lt;p&gt;Voilà! Dinner is ready.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/carbonara-supercharge/Finished.jpg&#34; alt=&#34;finished&#34; title=&#34;Carbonara Supercharge&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Fix the home and end keys in Firefox with Keyconfig and Vimperator</title>
      <link>https://yozy.net/2012/04/fix-the-home-and-end-keys-in-firefox-with-keyconfig-and-vimperator/</link>
      <pubDate>Wed, 25 Apr 2012 11:12:58 +0000</pubDate>
      <guid>https://yozy.net/2012/04/fix-the-home-and-end-keys-in-firefox-with-keyconfig-and-vimperator/</guid>
      <description>&lt;p&gt;Somme funny man thought that it would be good to screw up the behavior of home&#xA;and end keys in firefox on Mac. Nobody knows why and everybody is complaining.&#xA;Also, the same genius have made the &lt;em&gt;⌘→&lt;/em&gt; and &lt;em&gt;⌘←&lt;/em&gt;&#xA;commands navigate in history instead of doing what they do in every other&#xA;application which is &amp;ldquo;move to the end or beginning of the line&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;Oh well.. Luckily there IS a solution for this. The extension keyconfig will&#xA;fix half of the problem. &lt;a href=&#34;http://forums.mozillazine.org/viewtopic.php?t=72994&#34; title=&#34;Keyconfig Firefox Extension&#34;&gt;Get the keyconfing extension here&lt;/a&gt; and&#xA;disable the incriminating keys. Many thanks to the author. Now you have working&#xA;command keys. As for the home and end key, I fixed my problem in vimperator,&#xA;since it is an extension I use on all of my firefoxes. Basically the idea is to&#xA;remap home and end (along with +shift variants)) so they fire off the&#xA;command+arrow commands. Here is the code, enjoy :&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;imap &amp;lt;Home&amp;gt; &amp;lt;M-Left&amp;gt;&#xA;imap &amp;lt;End&amp;gt; &amp;lt;M-Right&amp;gt;&#xA;imap &amp;lt;S-End&amp;gt; &amp;lt;M-S-Right&amp;gt;&#xA;imap &amp;lt;S-Home&amp;gt; &amp;lt;M-S-Left&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Either run it in the vimperator command line and do a :mkvimperatorrc! or put&#xA;it directly into your configuration file.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Creating a document management program that actually works - Part 1</title>
      <link>https://yozy.net/2012/04/creating-a-document-management-program-that-actually-works-part-1/</link>
      <pubDate>Sat, 21 Apr 2012 17:42:20 +0000</pubDate>
      <guid>https://yozy.net/2012/04/creating-a-document-management-program-that-actually-works-part-1/</guid>
      <description>&lt;p&gt;I have tried several document management programs, applications, systems -&#xA;whatever you want to call them. Finally I have decided to abandon all of them&#xA;for a bunch of folders, which is not exactly ideal. Thing is, I really like&#xA;working with libraries rather than the filesystem itself. It is much more&#xA;convenient, but also brings a lot of crap to the house. You can not really move&#xA;a library, if it is in a binary form you will have hard way synchronizing it&#xA;over several computers (YES! I want my files in Dropbox).&lt;/p&gt;&#xA;&lt;p&gt;I have decided to make a document management system on my own. I have currently&#xA;no idea how will it look in the end, because I do not know yet about what I&#xA;want it to do. Nevertheless I will rant here for a while and maybe some day I&#xA;will find out on how to do this thing right.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-should-a-good-document-management-system-do&#34;&gt;What should a good document management system do?&lt;/h2&gt;&#xA;&lt;p&gt;There are many things a document management system should do, but there are&#xA;even more things it should not. There lies the problem with most of the&#xA;applications.&lt;/p&gt;&#xA;&lt;p&gt;As an example of a &lt;em&gt;good&lt;/em&gt; library manager I would cite Amarok, Quodlibet and&#xA;iTunes (the latter only for the music collection).&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;While using the application you do not have to worry about where the files&#xA;are, what is their format and stuff like that. When you are not using the&#xA;application you can, however, navigate in the files easily.&lt;/li&gt;&#xA;&lt;li&gt;The metadata is actually saved in the documents (id3 tags, for example) so&#xA;even if you lose your library (the database), it is very easy to reconstruct.&#xA;(quodlibet does not use any database whatsoever)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;As examples of &lt;em&gt;bad&lt;/em&gt; document managers, let us have a look at iPhoto or Evernote.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The files are saved “somewhere”, there is no way of poking into the file&#xA;structure of the application database without breaking something.&lt;/li&gt;&#xA;&lt;li&gt;They provide a lot of features, which is good, but there is no way of adding&#xA;some. If you use an external application to edit a photo in iPhoto library you&#xA;are losing most of the features : the new version is not linked to the&#xA;original, no way to revert back, no nothing.&lt;/li&gt;&#xA;&lt;li&gt;If you lose your library then reconstructing it all over again from the&#xA;originals is a huge pain in the ass.&lt;/li&gt;&#xA;&lt;li&gt;Some things you would be able to do with vanilla files are no longer an&#xA;option.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Basically what I am trying to say is that while a good management system should&#xA;not require you to use the filesystem in any way, it should use it in order to&#xA;get things done. There is no need to reinvent the wheel here.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Push irssi away messages to your iPhone</title>
      <link>https://yozy.net/2012/04/push-irssi-away-messages-to-your-iphone/</link>
      <pubDate>Sat, 14 Apr 2012 16:05:12 +0000</pubDate>
      <guid>https://yozy.net/2012/04/push-irssi-away-messages-to-your-iphone/</guid>
      <description>&lt;p&gt;Using irssi for IRC is quite a must. Add some &lt;a href=&#34;http://www.bitlbee.org/main.php/news.r.html&#34;&gt;bitlbee&lt;/a&gt; sweetness&#xA;and you have everything you need for your instant messaging needs. With a handy&#xA;ssh application like iSSH you will get to a cyborg state when you are always&#xA;connected. Small problem arises when compared to other IM applications, like&#xA;IMO, that is that there are no notifications available and you will probably&#xA;miss a lot of conversations. Fear not, however, for there is a solution for&#xA;every problem.&lt;/p&gt;&#xA;&lt;h2 id=&#34;push-notification-application&#34;&gt;Push notification application&lt;/h2&gt;&#xA;&lt;p&gt;First, you will need an application to get any push notification to your phone.&#xA;There are several of them, I would recommend using the &lt;a href=&#34;http://www.appnotifications.com/&#34; title=&#34;Notifications App&#34;&gt;Push4&lt;/a&gt;.&#xA;There is a free version if you want to test it first. Once you have installed&#xA;it and created an account go to your account settings on your website and go to&#xA;My Account -&amp;gt; Settings -&amp;gt; Profile to get your API key. You can also make the&#xA;application send you an e-mail with the key.&lt;/p&gt;&#xA;&lt;h2 id=&#34;some-scripting&#34;&gt;Some scripting&lt;/h2&gt;&#xA;&lt;p&gt;You will need to make two scripts to send the notifications. (You could manage&#xA;with less, of course, but I am too lazy). First one is a bash script which uses&#xA;curl to send a notification to your phone. Here it is :&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;user_credentials=YOUR_API_KEY&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;notification[message]=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;notification[long_message]=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$2&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;notification[title]=New irssi notification&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;notification[subtitle]=irssi message&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;notification[long_message_preview]=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;notification[message_level]=2&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;notification[silent]=0&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;notification[action_loc\_key]=OK&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;notification[sound]=1&amp;#34;&lt;/span&gt; https://www.appnotifications.com/account/notifications.json&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Do not forget to replace the YOUR_API_KEY by your real API key.&lt;/p&gt;&#xA;&lt;p&gt;You can test the script immediately, although it might not work for a few hours&#xA;just after your Push4 account creation. Basically this script sends you a&#xA;notifications with first parameter as short text preview and second as a long&#xA;text (which can use HTML markup). A second script is needed to parse the&#xA;awaylog and send notifications using the first script.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-perl&#34; data-lang=&#34;perl&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;ch&#34;&gt;#!/usr/bin/perl -n use HTML::Entities;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/(\d+:\d+) (?:([#&amp;amp;][^ ]+)+:)?.*?\/.*?\/(.*?).g.8.*?e(YOURNICK: )?(.*)/&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$time&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$channel&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$sender&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$message&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$message&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=~&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;s/\\/:/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$message&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=~&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;s/&amp;#34;/\\&amp;#34;/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nv&#34;&gt;$message&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=~&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;s/[;&amp;amp;]/:/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;print&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`./irssi_notify.sh &amp;#34;$sender : $message at $time&amp;#34; &amp;#34;Message from &amp;lt;b&amp;gt;$sender&amp;lt;/b&amp;gt; (&amp;lt;i&amp;gt;$channel&amp;lt;/i&amp;gt;) at &amp;lt;b&amp;gt;$time&amp;lt;/b&amp;gt; : $message&amp;#34;\n`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, to clarify things a bit. What this script does is that it takes some&#xA;input, and if it is in some format, &lt;code&gt;/(\d+:\d+) (?:([#&amp;amp;][^ ]+)+:)?.\*?\/.\*?\/(.\*?).g.8.\*?e(YOURNICK: )?(.*)/&lt;/code&gt;, to be precise, it will&#xA;parse it and send it via a notification. Note that this works if you did not&#xA;play with your irssi theme too much, as the awaylog basically copies the format&#xA;of public and highlight messages. The (YOURNICK: )? part is optional, and it&#xA;helps to remove the usual prefix of highlight messages. I can not help you much&#xA;with the regex, you have to find one on your own or you can use this script&#xA;which basically takes anything in awaylog and sends it as it is (it works well&#xA;and everywhere).&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-perl&#34; data-lang=&#34;perl&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;ch&#34;&gt;#!/usr/bin/perl -n use HTML::Entities;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$message&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;encode_entities&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$_&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$message&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=~&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;s/\\/:/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$message&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=~&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;s/&amp;#34;/\\&amp;#34;/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$message&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=~&lt;/span&gt; &lt;span class=&#34;sr&#34;&gt;s/[;&amp;amp;]/:/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;print&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`./irssi_notify.sh &amp;#34;$message&amp;#34; &amp;#34;$message&amp;#34;\n`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;making-it-all-work&#34;&gt;Making it all work&lt;/h2&gt;&#xA;&lt;p&gt;Let us run the machine now. You will need to start another screen to run this&#xA;(if somebody will help me with making a nohup version of the command I will&#xA;gladly have it). Run a terminal on your shell and run&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;screen bash tailf ~/.irssi/away.log &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; perl irssi_notify.pl&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now detach the screen and you are on the roll.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;&lt;em&gt;Edit 2015-10-17&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;The Push4 service is no longer available. I am currently using a solution that&#xA;uses &lt;em&gt;Pushover&lt;/em&gt;. I&amp;rsquo;ll write up an article on how to use that shortly.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Autocopy links of files uploaded to Dropbox public folder with a folder action</title>
      <link>https://yozy.net/2012/02/autocopy-links-of-files-uploaded-to-dropbox-public-folder-with-a-folder-action/</link>
      <pubDate>Sat, 25 Feb 2012 23:54:55 +0000</pubDate>
      <guid>https://yozy.net/2012/02/autocopy-links-of-files-uploaded-to-dropbox-public-folder-with-a-folder-action/</guid>
      <description>&lt;p&gt;This tutorial is largely based on &lt;a href=&#34;http://forums.dropbox.com/topic.php?id=4659&#34;&gt;this post on the Dropbox&#xA;forums&lt;/a&gt;, all credit on the script goes to the original&#xA;author Christian G. My contribution is that this script also invokes a Growl&#xA;message (thus, you will need Growl installed) also, the # character is replaced&#xA;by %23 (because Dropbox does not like it much) Here goes the script :&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-applescripts&#34; data-lang=&#34;applescripts&#34;&gt;on adding folder items to this_folder after receiving added_items&#xA;    try&#xA;        set the item_count to the number of items in the added_items&#xA;        if the item_count is equal to 1 then&#xA;            set theFile to item 1 of added_items&#xA;            set theRawFilename to (&amp;#34;&amp;#34; &amp;amp;amp; theFile)&#xA;&#xA;            set tid to AppleScript&amp;#39;s text item delimiters&#xA;            set AppleScript&amp;#39;s text item delimiters to &amp;#34;:&amp;#34;&#xA;            set theFileName to (text item 6 of theRawFilename) as text&#xA;            set AppleScript&amp;#39;s text item delimiters to tid&#xA;&#xA;            set theWebSafeFileName to switchText from theFileName to &amp;#34;%20&amp;#34; instead of &amp;#34; &amp;#34;&#xA;            set theWebSafeFileName to switchText from theWebSafeFileName to &amp;#34;%23&amp;#34; instead of &amp;#34;#&amp;#34;&#xA;&#xA;            set theURL to &amp;#34;http://dl.dropbox.com/u/YOUR_DROPBOX_ID/&amp;#34; &amp;amp;amp; theWebSafeFileName&#xA;            set the clipboard to theURL as text&#xA;&#xA;            tell application &amp;#34;GrowlHelperApp&amp;#34;&#xA;&#xA;                set the allNotificationsList to ¬&#xA;                    {&amp;#34;Public URL&amp;#34;}&#xA;&#xA;                set the enabledNotificationsList to allNotificationsList&#xA;&#xA;                register as application ¬&#xA;                    &amp;#34;CopyDropboxURL&amp;#34; all notifications allNotificationsList ¬&#xA;                    default notifications enabledNotificationsList ¬&#xA;                    icon of application &amp;#34;Dropbox&amp;#34;&#xA;&#xA;                notify with name ¬&#xA;                    &amp;#34;Public URL&amp;#34; title ¬&#xA;                    &amp;#34;Dropbox Public Folder Updated&amp;#34; description ¬&#xA;                    (theURL &amp;amp;amp; &amp;#34; copied to clipboard.&amp;#34;) application name &amp;#34;CopyDropboxURL&amp;#34;&#xA;&#xA;            end tell&#xA;        end if&#xA;    end try&#xA;end adding folder items to&#xA;&#xA;to switchText from t to r instead of s&#xA;    set d to text item delimiters&#xA;    set text item delimiters to s&#xA;    set t to t&amp;#39;s text items&#xA;    set text item delimiters to r&#xA;    tell t to set t to item 1 &amp;amp;amp; ({&amp;#34;&amp;#34;} &amp;amp;amp; rest)&#xA;    set text item delimiters to d&#xA;    t&#xA;end switchText&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-use-this&#34;&gt;How to use this&lt;/h2&gt;&#xA;&lt;p&gt;First of allyou have to know your Dropbox user ID and change the&#xA;YOUR_DROPBOX_ID to it. This is the number that appears after /u/ in your&#xA;public Dropbox links. Now open the apple script editor and save this script&#xA;into&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Macintosh HD/Library/Scripts/Folder Action Scripts&lt;/code&gt; as CopyDropboxURL.scpt.&#xA;Next navigate to your Dropbox public folder in finder, right click (or ⌘-click)&#xA;it. Choose Services→Folder Actions Setup&amp;hellip; from the menu. In the menu that&#xA;opens choose the CopyDropboxURL.scpt.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Beijing Soup</title>
      <link>https://yozy.net/2012/02/beijing-soup/</link>
      <pubDate>Tue, 07 Feb 2012 02:24:27 +0000</pubDate>
      <guid>https://yozy.net/2012/02/beijing-soup/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been searching for this recipe for quite a long time. Finally I got hold of it thanks to my brother. And due to popular demand here is the recipe complete for one of the best soups out there. So&amp;hellip; without further delays.&lt;/p&gt;&#xA;&lt;h2 id=&#34;ingredients&#34;&gt;Ingredients&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;One whole chicken&lt;/li&gt;&#xA;&lt;li&gt;Shiitake mushrooms (dried)&lt;/li&gt;&#xA;&lt;li&gt;Black mushrooms (dried)&lt;/li&gt;&#xA;&lt;li&gt;A carrot&lt;/li&gt;&#xA;&lt;li&gt;Bamboo sprouts&lt;/li&gt;&#xA;&lt;li&gt;Two eggs&lt;/li&gt;&#xA;&lt;li&gt;Soy sauce&lt;/li&gt;&#xA;&lt;li&gt;Rice vinegar&lt;/li&gt;&#xA;&lt;li&gt;Sambala sauce&lt;/li&gt;&#xA;&lt;li&gt;Tapioca starch&lt;/li&gt;&#xA;&lt;li&gt;Salt&lt;/li&gt;&#xA;&lt;li&gt;Whole black pepper&lt;/li&gt;&#xA;&lt;li&gt;Chicken bouillon cube&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;preparation-of-ingredients&#34;&gt;Preparation of ingredients&lt;/h2&gt;&#xA;&lt;p&gt;&lt;em&gt;Hint&lt;/em&gt; : I recommend reading the whole recipe first as some of the steps can be&#xA;done at the same time.&lt;/p&gt;&#xA;&lt;p&gt;It is best to begin by dipping the mushrooms in warm water (shiitake and black&#xA;mushrooms separately) as it takes about 30 minutes for them to soak well. The&#xA;longer the better. After they have soaked cut the shiitake to small pieces.&lt;/p&gt;&#xA;&lt;p&gt;Cut off the legs and breasts of the chicken, put them aside we will not be&#xA;needing them for this meal.&lt;/p&gt;&#xA;&lt;p&gt;Clean the carrot and cut it to small pieces. Cut the bamboo sprouts as well.&lt;/p&gt;&#xA;&lt;p&gt;Crack the two eggs into a bowl and scramble them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;cooking&#34;&gt;Cooking&lt;/h2&gt;&#xA;&lt;p&gt;Heat about 1.5L of water, salt it, put in a dozen of grains of the whole pepper&#xA;and put the chicken inside. Cook for about 45 minutes.&lt;/p&gt;&#xA;&lt;p&gt;Take the chicken out and put the bouillon cube as well as the mushrooms (both),&#xA;carrots and bamboo sprouts inside.&lt;/p&gt;&#xA;&lt;p&gt;Cut off all of the meat from the bones of the chicken and put it back into the&#xA;soup (the meat, not the bones).&lt;/p&gt;&#xA;&lt;p&gt;Cook for about ten minutes, then add two table spoons of vinegar, three table&#xA;spoons of soy sauce and two spoonfuls of Sambal sauce (or more, if you wish the&#xA;soup to be more spicy).&lt;/p&gt;&#xA;&lt;p&gt;Cook for another 10 minutes, afterwards add in the eggs and stir well. Finally&#xA;prepare two spoons of tapioca starch in a bowl - add a bit of water and mix&#xA;until all of the starch has diluted. Then add the mix to the soup. Cook for&#xA;about 10 minutes and you are done.&lt;/p&gt;&#xA;&lt;h2 id=&#34;afterword&#34;&gt;Afterword&lt;/h2&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/SourSpicy.jpg&#34; alt=&#34;img-soup&#34; title=&#34;Sour &amp;amp; Spicy&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;The soup is to be eaten very hot. If you do not have chicken you can use more&#xA;bouillon cubes instead (still, it is much better with real meat).&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Enable system volume control for a generic USB device in Snow Leopard</title>
      <link>https://yozy.net/2011/06/enable-system-volume-control-for-a-generic-usb-device-in-snow-leopard/</link>
      <pubDate>Mon, 06 Jun 2011 08:00:56 +0000</pubDate>
      <guid>https://yozy.net/2011/06/enable-system-volume-control-for-a-generic-usb-device-in-snow-leopard/</guid>
      <description>&lt;p&gt;This post is mainly targeted at people who have used an X-Fi USB audio card&#xA;with their PCs on Windows or Linux. Many of us got a bad surprise when we&#xA;plugged it into our shiny new Macs and we couldn&amp;rsquo;t even control the volume of&#xA;the device through the system.&lt;/p&gt;&#xA;&lt;p&gt;This particular problem is due to lack of dedicated drivers made by Creative.&#xA;It seems that they only make OS X drivers for cards specially targeted at Macs.&lt;/p&gt;&#xA;&lt;p&gt;Luckily there is a way to work around this limitation using a piece of software called &lt;a href=&#34;http://cycling74.com/products/soundflower/&#34; title=&#34;Soundflower homepage&#34;&gt;Soundflower&lt;/a&gt;. The procedure is very simple, just follow the four steps here:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Download and install SoundFlower (this might require a restart)&lt;/li&gt;&#xA;&lt;li&gt;Set &lt;strong&gt;Soundflower (2ch)&lt;/strong&gt; as your audio output device (hint: you can option (⌥)-click your volume control icon in the menu)&lt;/li&gt;&#xA;&lt;li&gt;Launch Soundflowerbed (it was installed along with Soundflower)&lt;/li&gt;&#xA;&lt;li&gt;In the 2 channel device output options select your USB card.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;And it is done, you can happily use your volume control buttons once again.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/soundflower-volume/soundflower_system_output_settings.png&#34; alt=&#34;system-output&#34; title=&#34;Set system output to Soundflower (2ch)&#34;&gt;&#xA;&lt;img src=&#34;https://yozy.net/images/soundflower-volume/soundflower_driver_settings.png&#34; alt=&#34;soundflower-output&#34; title=&#34;Set Soundflower output to your USB card&#34;&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>A nice dark color theme for QtCreator</title>
      <link>https://yozy.net/2011/05/a-nice-dark-color-theme-for-qtcreator/</link>
      <pubDate>Thu, 26 May 2011 19:18:46 +0000</pubDate>
      <guid>https://yozy.net/2011/05/a-nice-dark-color-theme-for-qtcreator/</guid>
      <description>&lt;p&gt;&lt;em&gt;Last update: 2013-06-29 for Qt Creator 2.7.1&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Staring at long lines of code can get frustrating. Even more so if the said&#xA;lines have ugly eye-hurting colors. I have been using the beautiful MacVim&#xA;theme in Vim for some time now and it is quite awesome. However QtCreator,&#xA;which I &lt;a href=&#34;https://yozy.net/2011/04/using-qtcreator-for-openvibe-development/&#34; title=&#34;Using QtCreator for OpenViBE development&#34;&gt;use for OpenViBE development&lt;/a&gt;, lacks such a theme. This problem was&#xA;easily fixed though. Here is a screenshot of a theme I have created and,&#xA;because of the lack of creativity, named &lt;em&gt;Gulf&lt;/em&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/Gulf-Qt-Creator-Theme.png&#34; alt=&#34;gulf-screenshot&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;And here is the link for download:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/gulf_qtcreator_theme.zip&#34;&gt;Gulf QtCreator theme&lt;/a&gt;&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Get ID3 tags right on your Cowon S9 with Linux</title>
      <link>https://yozy.net/2011/05/get-id3-tags-right-on-your-cowon-s9-with-linux/</link>
      <pubDate>Sun, 22 May 2011 13:49:31 +0000</pubDate>
      <guid>https://yozy.net/2011/05/get-id3-tags-right-on-your-cowon-s9-with-linux/</guid>
      <description>&lt;p&gt;Those ID3 tags on Cowon can be pesky. Sometimes you do not see the embedded&#xA;images, sometimes you see things like [11] instead of genres and if you are&#xA;really unlucky you will not see any tags at all. So, as a quick hint on how to&#xA;get all of this right:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use &lt;a href=&#34;http://easytag.sourceforge.net/&#34; title=&#34;EeasyTAG for Linux&#34;&gt;EasyTAG&lt;/a&gt; (can be downloaded using your package manager in most&#xA;distributions)&lt;/li&gt;&#xA;&lt;li&gt;In Settings → Preferences go to the ID3Tag settings and do the following&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Check Automatically convert old ID3v2 tag versions&lt;/li&gt;&#xA;&lt;li&gt;Check Write ID3v2 tag → &lt;strong&gt;Version 2.3&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Uncheck Write ID3v1.x tag&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;Edit tags of your files, be sure to re-save all files which appear in red&#xA;in EasyTAG as they have probably different versions of ID3 tags&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/EasyTAG-Cowon-settings.png&#34; alt=&#34;easytag-settings&#34; title=&#34;EasyTAG Cowon settings&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you want to use images from the tags instead of the per-folder cover.jpg&#xA;files you can use EasyTAG to include them in the tags as well. Bear in mind&#xA;though that only &lt;strong&gt;jpeg&lt;/strong&gt; files will be taken into account and only in mp3&#xA;files (no love for ogg users). Also for best effects use images of 272  x 272&#xA;pixels large.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Quick access to the last public url of a file in Dropbox</title>
      <link>https://yozy.net/2011/05/quick-access-to-the-last-public-url-of-a-file-in-dropbox/</link>
      <pubDate>Sun, 08 May 2011 08:00:14 +0000</pubDate>
      <guid>https://yozy.net/2011/05/quick-access-to-the-last-public-url-of-a-file-in-dropbox/</guid>
      <description>&lt;p&gt;I got bored to search for the url after uploading a file to the Dropbox&amp;rsquo;s&#xA;public folder. So I have hacked a quick shell script that takes the public url&#xA;of the latest file you uploaded to your public Dropbox folder and copies it to&#xA;the clipboard. I thought I could share:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#!/bin/sh&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;DROPBOX&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$HOME&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/Dropbox&amp;#34;&lt;/span&gt; dropbox puburl &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$DROPBOX&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/Public/\`ls -1 -t &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$DROPBOX&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/Public | head -n 1\`&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; xclip&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, on OS X I have a folder action which does the same thing automatically&#xA;when a new file is uploaded. I will have to tinker with inotify and get it to&#xA;work on Linux as well.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Gtk, Glade and signal handlers in C&#43;&#43;</title>
      <link>https://yozy.net/2011/05/gtk-glade-and-signal-handlers-in-c-/</link>
      <pubDate>Thu, 05 May 2011 08:00:49 +0000</pubDate>
      <guid>https://yozy.net/2011/05/gtk-glade-and-signal-handlers-in-c-/</guid>
      <description>&lt;p&gt;Much was written about connecting signal handlers to interfaces made with Glade&#xA;and imported with GtkBuilder. The problem is that everybody uses a different&#xA;system and/or language. So here is a guide which explains all the magic:&lt;/p&gt;&#xA;&lt;h2 id=&#34;glade-interface&#34;&gt;Glade Interface&lt;/h2&gt;&#xA;&lt;p&gt;First of all create your widget in Glade and assign it a signal handler. We are&#xA;going to create a very simple application which has a single button which exits&#xA;it. The Glade interface should look something like this. It is basically a Main&#xA;Window (main_window) widget with a Button (exit_button) inside. We define a&#xA;handler for the signal &amp;ldquo;clicked&amp;rdquo; for the button and call it&#xA;exit_button_handler.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/ui.glade.png&#34; alt=&#34;glade-interface-example&#34; title=&#34;The UI inside Glade&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;c-code&#34;&gt;C++ code&lt;/h2&gt;&#xA;&lt;p&gt;Now let&amp;rsquo;s create the source file, it looks like this. As you can see our signal&#xA;handler is just a basic void returning function.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-c++&#34; data-lang=&#34;c++&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#include&lt;/span&gt; &lt;span class=&#34;cpf&#34;&gt;&amp;lt;gtk/gtk.h&amp;gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;extern&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;C&amp;#34;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;G_MODULE_EXPORT&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;void&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;exit_button_handler&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GtkObject&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;caller&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gpointer&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;gtk_main_quit&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;argc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;**&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;argv&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;gtk_init&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;amp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;argc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;amp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;argv&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;GtkBuilder&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;l_BuilderInterface&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gtk_builder_new&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;gtk_builder_add_from_file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l_BuilderInterface&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;ui.glade&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;gtk_builder_connect_signals&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l_BuilderInterface&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;gtk_widget_show&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;GTK_WIDGET&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;gtk_builder_get_object&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l_BuilderInterface&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;main_window&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;gtk_main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The important thing to notice is that the declaration of the callback function&#xA;is preceded by &lt;code&gt;extern &amp;quot;C&amp;quot; G_MODULE_EXPORT&lt;/code&gt;. These two bits of code ensure that&#xA;the produced object will have a C-compatible table-entry for this function even&#xA;though we are using a C++ compiler and that it will be accessible under Windows&#xA;as well. Indeed, the &lt;code&gt;G_MODULE_EXPORT&lt;/code&gt; macro expands to nothing under Linux.&lt;/p&gt;&#xA;&lt;h2 id=&#34;compilation&#34;&gt;Compilation&lt;/h2&gt;&#xA;&lt;p&gt;Now, we need to compile the whole thing. Let&amp;rsquo;s say we have called the file&#xA;above &lt;em&gt;main.cpp&lt;/em&gt;. The line to call on Linux would be :&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;g++ `pkg-config --cflags --libs gtk+-2.0 gmodule-2.0` main.cpp -o test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s look at the output of the pkg-config file for a while :&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;-pthread -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1  -pthread -Wl,--export-dynamic -L/usr/lib/x86_64-linux-gnu -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lrt -lglib-2.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;That&amp;rsquo;s a lot of stuff! Depending on the system your mileage can vary,&#xA;but the important bit is : &lt;code&gt;-Wl,--export-dynamic&lt;/code&gt;. This piece of code&#xA;ensures that you will be actually able to find the symbol once it is&#xA;needed. On Windows, there is no need for the &amp;ndash;export-dynamic flag, just&#xA;be sure to load the &lt;em&gt;gtk&lt;/em&gt; library as well as the &lt;em&gt;gmodule&lt;/em&gt;. And that&amp;rsquo;s&#xA;it, done and done!&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Global keyboard actions in Snow Leopard without third-party software</title>
      <link>https://yozy.net/2011/05/global-keyboard-actions-in-snow-leopard-without-third-party-software/</link>
      <pubDate>Wed, 04 May 2011 08:00:15 +0000</pubDate>
      <guid>https://yozy.net/2011/05/global-keyboard-actions-in-snow-leopard-without-third-party-software/</guid>
      <description>&lt;p&gt;When I first got to use Mac OS X I have wondered whether it is possible to do&#xA;stuff which I was used to do (more or less) easily on Linux. Among others there&#xA;is the possibility to assign keyboard shortcuts to arbitrary actions (and&#xA;especially shell scripts). I found several tutorials on how to do this, but&#xA;they often include third party software like Quicksilver. Since I want to keep&#xA;my system as vanilla as possible I was searching for a way to do it otherwise,&#xA;and found it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;introducing-services&#34;&gt;Introducing Services&lt;/h2&gt;&#xA;&lt;p&gt;Snow Leopard has this great thing called Services, which is a very simple to&#xA;use way of creating very powerful actions in no time. Now, usually these are&#xA;bound to a specific application or context, but they can be global. Since it is&#xA;much easier to explain something on an example, let us use a simple example.&#xA;Following this article on how to pause iTunes for a short period of time.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step-1&#34;&gt;Step 1&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open up the &lt;strong&gt;Automator&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Create a New Service.&lt;/li&gt;&#xA;&lt;li&gt;In the &amp;lsquo;service receives selected&amp;rsquo; drop-down box select &lt;strong&gt;no input&lt;/strong&gt; in&#xA;&lt;strong&gt;any application&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;In the left sidebar find &lt;strong&gt;Run AppleScript&lt;/strong&gt; and drag it into the workflow&lt;/li&gt;&#xA;&lt;li&gt;Paste the code below on the place where it says &lt;em&gt;(&lt;/em&gt; Your script goes here&#xA;&lt;em&gt;)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Save the service as &amp;ldquo;Pause iTunes for 5 minutes&amp;rdquo;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;The script in question follows:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-applescript&#34; data-lang=&#34;applescript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;application&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;iTunes&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nb&#34;&gt;pause&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nb&#34;&gt;delay&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;300&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nb&#34;&gt;play&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;tell&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In the end the whole Automator window should look like this.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/global-mac-shortcuts/Automator-service-example.png&#34; alt=&#34;automator-service-example&#34; title=&#34;Automator service example&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you go to the current application&amp;rsquo;s menu now you should see your service in&#xA;the Services sub-menu.&lt;/p&gt;&#xA;&lt;h3 id=&#34;step-2&#34;&gt;Step 2&lt;/h3&gt;&#xA;&lt;p&gt;Now the only thing that remains is to add a keyboard shortcut for this service.&#xA;Open up System Preferences → Keyboard → Keyboard Shortcuts. In the left panel&#xA;click on Services and then click on the + button under the right panel. In the&#xA;following dialog choose:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Application : &lt;strong&gt;All Applications&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Menu Title : &lt;strong&gt;Pause iTunes for 5 minutes&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Keyboard Shortcut : &lt;strong&gt;F10&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Following shortcut illustrates the result. Note that it is vital that the Menu&#xA;Title chosen is &lt;strong&gt;exactly the same&lt;/strong&gt; as the name under which you have saved the&#xA;service.&lt;/p&gt;&#xA;&lt;p&gt;[Update] New services will be added to the list automatically. The only&#xA;remaining thing is to add a shortcut key. This might be a feature of Lion or&#xA;Mountain Lion as I do not recall it while using 10.6.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/global-mac-shortcuts/Automator-service-example.png&#34; alt=&#34;shortcut-asignment&#34; title=&#34;Snow Leopard keyboard shortcut assignment&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;All done, you can now enjoy launching your script anywhere, anytime by pressing&#xA;F10.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Vintage effect Script-Fu for GIMP</title>
      <link>https://yozy.net/2011/04/vintage-effect-script-fu-for-gimp/</link>
      <pubDate>Wed, 27 Apr 2011 08:00:02 +0000</pubDate>
      <guid>https://yozy.net/2011/04/vintage-effect-script-fu-for-gimp/</guid>
      <description>&lt;p&gt;Any self-respected hipster photographer must provide his share of vintage&#xA;photos with helvetica captions. In order to make life easier for people using&#xA;the Greatest Image Manipulation Program™ I have made a script which does the&#xA;hard part. The provided script is based on &lt;a href=&#34;http://gimpology.com/submission/view/authentic_vintage_effect&#34; title=&#34;Authentic Vintage Effect GIMP&#34;&gt;this tutorial&lt;/a&gt;.&#xA;Download the script and put it into your &lt;code&gt;${HOME}/.gimp/scripts&lt;/code&gt; folder (or its&#xA;equivalent on your system).&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://yozy.net/files/downloads/vintage_color_v1.1.scm&#34; title=&#34;Vintage Color script for GIMP&#34;&gt;Vintage Color script for GIMP&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;some-demos&#34;&gt;Some demos&lt;/h2&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://yozy.net/images/gimp-vintage/ducks.jpg&#34; alt=&#34;ducks&#34; title=&#34;Photo of Ducks&#34;&gt;&#xA;&lt;img src=&#34;https://yozy.net/images/gimp-vintage/ducks-vintage.jpg&#34; alt=&#34;ducks-vintage&#34; title=&#34;Altered photo of Ducks&#34;&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;changelog&#34;&gt;Changelog&lt;/h2&gt;&#xA;&lt;p&gt;version 1.1&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;put the whole script into an undo group&lt;/li&gt;&#xA;&lt;li&gt;replaced deprecated functions by newer ones - operating on items&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;version 1.0&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;initial release&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;</description>
    </item>
    <item>
      <title></title>
      <link>https://yozy.net/1/01/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://yozy.net/1/01/</guid>
      <description>&lt;p&gt;We’ve been there, you update your Windows, Linux, MacOS, or phone, and suddenly your favourite program stops working. It goes the other way too, you are happily using an older version of the system, the program you are using gets an exciting new update&amp;hellip; and you can’t use it because the new version is not compatible with your old OS.&lt;/p&gt;&#xA;&lt;p&gt;Why does this happen? There are several reasons for this. I’ll try to explain them here. If you would like to discuss it, contact me on Mastodon.&lt;/p&gt;&#xA;&lt;p&gt;Broadly speaking, the reasons for deprecation are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hardware support&lt;/li&gt;&#xA;&lt;li&gt;Dependencies&lt;/li&gt;&#xA;&lt;li&gt;maintenance cost&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;hardware-support&#34;&gt;Hardware support&lt;/h1&gt;&#xA;</description>
    </item>
  </channel>
</rss>
