<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <generator uri="https://www.11ty.dev/" version="3.0">Eleventy</generator>
  <title type="html">Collin&#39;s Blog</title>
  <subtitle>My personal weblog</subtitle>
  <link href="https://richardscollin.com/feed.xml" rel="self" type="application/atom+xml" />
  <link href="https://richardscollin.com/" rel="alternate" type="text/html" />
  <updated>2021-06-04T06:00:00+08:00</updated>
  <id>https://richardscollin.com/</id>
  <author><name>Collin Richards</name><email>richardscollin@gatech.edu</email></author>
  <entry>
    <title type="html">Making a Font with Inkscape</title>
    <link href="https://richardscollin.com/2021/06/04/making-a-font-with-inkscape" rel="alternate" type="text/html" title="Making a Font with Inkscape" />
    <published>2021-06-04T06:00:00+08:00</published>
    <updated>2021-06-16T00:00:00+08:00</updated>
    <id>https://richardscollin.com/2021/06/04/making-a-font-with-inkscape</id>
    <content type="html" xml:base="https://richardscollin.com/2021/06/04/making-a-font-with-inkscape">&lt;style&gt;
@font-face {
    font-family: &#34;Ricarda Sans&#34;;
    src: url(&#34;/public/fonts/ricarda.otf&#34;);
}
body {
    font-family: &#34;Ricarda Sans&#34;;
}

.inkscape-button {
  font: 14px sans-serif;
  font-weight: 500;
  background-image: linear-gradient(#fafafa, #e9e9e9, #ebebeb);
  border-radius: 3px;
  border: 1px solid #cacaca;
  color: #333333;
  padding: .5em .5em;

  position: relative;
  bottom: 5px;
}
&lt;/style&gt;
&lt;p&gt;I&#39;m writing this in my very own font. It&#39;s ugly, but it&#39;s mine. I created it.&lt;/p&gt;
&lt;p&gt;I like learning new things. So I used building this font as a way to learn Inkscape a bit better.&lt;/p&gt;
&lt;p&gt;I&#39;ve been watching a lot of videos online to learn inkscape. The best tutorial series I&#39;ve found is on a channel called Logos By Nick. He has &lt;a href=&#34;https://www.youtube.com/watch?v=Xgw01FV7qQI&#34;&gt;a video&lt;/a&gt; where he makes a few letters in Inkscape. I used that video as the inspiration for the font.&lt;/p&gt;
&lt;p&gt;First of all, let me say Inkscape is not the best tool for the job. The closed-source Glyphs app or Adobe Illustrator seem to be pretty popular tools for hobbyists and professionals. That said, I prefer using open source tools. Fontforge is another open source tool we will use as well for exporting, but because part of my goal is to get better at using Inkscape (I&#39;m also using it for drawing some art as well). I&#39;ll stick to using that.&lt;/p&gt;
&lt;p&gt;The glyphs:&lt;/p&gt;
&lt;p&gt;A QUICK BROWN FOX JUMPS OVER THE LAZY DOG&lt;/p&gt;
&lt;p&gt;a quick brown fox jumps over the lazy dog&lt;/p&gt;
&lt;p&gt;0123456789&lt;/p&gt;
&lt;p&gt;`~!@#$%^&amp;amp;*()-_=+[{]}|;:&#39;&amp;quot;,&amp;lt;.&amp;gt;/?&lt;/p&gt;
&lt;p&gt;(As of publishing the special chars above are not finished so some will be using a fallback font)&lt;/p&gt;
&lt;h2 id=&#34;inksape-oddities&#34;&gt;Inksape oddities&lt;/h2&gt;
&lt;p&gt;The Inkscape SVG Font Editor&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create the document from: &amp;quot;File &amp;gt; New from Template &amp;gt; Typography Canvas&amp;quot;&lt;/li&gt;
&lt;li&gt;Design each letter in a separate layer&lt;/li&gt;
&lt;li&gt;Modify Glyph settings from &amp;quot;Text &amp;gt; SVG Font Editor&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&#39;m very greatful to the inkscape developers for this tool, but here I&#39;m going to rant a bit about the SVG Font Editor UI. Hopefully if I have some free time later I&#39;ll be able to submit a patch that fixes some of these issues.&lt;/p&gt;
&lt;h3 id=&#34;ui-gripe-no-1&#34;&gt;UI Gripe No. 1&lt;/h3&gt;
&lt;p&gt;The if there is only a single SVG font in use in the document it isn&#39;t auto selected when switching to the SVG Font tab. I had to constantly click to make sure that the current font was selected&lt;/p&gt;
&lt;h3 id=&#34;ui-gripe-no-2&#34;&gt;UI Gripe No. 2&lt;/h3&gt;
&lt;p&gt;The scroll context of the glyph list is constantly lost whenever an action is performed. Like adding a new glyph, changing a glyph name, or adding strokes for a glyph. This means that if you have a long list of glyphs the process for creating a new glyph is cumbersome. You must:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Click the &lt;span class=&#34;inkscape-button&#34;&gt;Add Glyph&lt;/span&gt; button&lt;/li&gt;
  &lt;li&gt;Scroll down to the newly created glyph&lt;/li&gt;
  &lt;li&gt;Rename the glyph (Scroll is reset)&lt;/li&gt;
  &lt;li&gt;Scroll backdown to the glyph&lt;/li&gt;
  &lt;li&gt;Remember that you need to select the stroke first&lt;/li&gt;
  &lt;li&gt;Select the stroke you want to add&lt;/li&gt;
  &lt;li&gt;Re-select the font (Scroll is reset, again)&lt;/li&gt;
  &lt;li&gt;Scroll backdown to the glyph&lt;/li&gt;
  &lt;li&gt;Click the &lt;span class=&#34;inkscape-button&#34;&gt;Get curves from selection...&lt;/span&gt; button&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This process is time consuming especially if you drew all of the paths first and then try to add them as glyphs all at once.&lt;/p&gt;
&lt;p&gt;Again if any developers happen to read this I don&#39;t want these gripes to offend. It&#39;s more a list of UI improvements. Potentially for myself to implement if I get the time or feel ambitious enough.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/fontforge
Open(&amp;quot;ricarda.svg&amp;quot;)
Generate(&amp;quot;ricarda.otf&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;improvements&#34;&gt;Improvements&lt;/h2&gt;
&lt;p&gt;This font is still a work in progress. I&#39;ll update this page as I improve it. Here&#39;s a list of things I&#39;d like to change / fix.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finish implementing ascii special characters&lt;/li&gt;
&lt;li&gt;Figure out x-height issue with fallback glyphs (This may also fix the strikethrough issue)&lt;/li&gt;
&lt;li&gt;Redo Upper K (not wide enough),&lt;/li&gt;
&lt;li&gt;Make Upper Q&#39;s tail more curly&lt;/li&gt;
&lt;li&gt;lower case r isn&#39;t readble enough - looks like i&lt;/li&gt;
&lt;li&gt;glyphs gy69 (Add a bit more whitespace between the curve and the loop)&lt;/li&gt;
&lt;li&gt;rework existing punctation&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I set it as the default font in my OS settings for a while as a way of dogfooding. I disabled it for now because I&#39;d get weird crashes occasionally and sometimes text wouldn&#39;t display in certain text boxes. The most annoying thing right now is when the fallback font and my current font are misaligned.&lt;/p&gt;
&lt;h2 id=&#34;other-font-ideas&#34;&gt;Other font ideas&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;When I first started learning Chinese I had a moment where if I read some signs without my glasses on I thought they were written in Chinese Characters. I want to design a font inspited by that.&lt;/li&gt;
&lt;/ul&gt;
</content>
    <author><name>Collin Richards</name></author>
    <summary type="html">How I built my very own font using Inkscape. I showcase my process for creating my own custom font, Ricarda Sans, and the steps I went through creating it.</summary>
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://richardscollin.com/public/blog-assets/making-a-font-with-inkscape/inkscape-font.png" />
  </entry>
  <entry>
    <title type="html">Receipt Lottery Ticket</title>
    <link href="https://richardscollin.com/2021/06/04/receipt-lottery-ticket" rel="alternate" type="text/html" title="Receipt Lottery Ticket" />
    <published>2021-06-04T05:50:00+08:00</published>
    <updated>2021-06-04T05:50:00+08:00</updated>
    <id>https://richardscollin.com/2021/06/04/receipt-lottery-ticket</id>
    <content type="html" xml:base="https://richardscollin.com/2021/06/04/receipt-lottery-ticket">
&lt;p&gt;When I learned that receipts are lottery tickets in Taiwan, I wondered
if you could win the lottery by making a bunch of small purchases. This obviously wouldn&#39;t work, right? I don&#39;t think these thoughts are that uncommon either. I have a friend who told me they would sometimes split up their purchases so that they would get more receipts. How do we figure out how much a lottery ticket should be worth?&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Expected value.&lt;/b&gt; You just multiply the chances of winning by how much you&#39;ll win.&lt;/p&gt;

&lt;p&gt;There are 8 digits in a receipt lottery ticket. Therefore your odds of winning are 1 in a hundred million.&lt;/p&gt;

&lt;p&gt;So we can multiply the amount of each prize by it&#39;s probability to get the expected value of a 
receipt for a given prize. You can then add up all of the individual expected values for each prize to get the total expected value of the receipt.&lt;/p&gt;

&lt;p&gt;I&#39;ve made a table below for doing these calculations for each prize amount.&lt;/p&gt;

&lt;/div&gt;&lt;div class=&#34;wrapper large-wrapper&#34;&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Prize&lt;/th&gt;
      &lt;th&gt;Winning Amount (NTD)&lt;/th&gt;
      &lt;th&gt;# to match&lt;/th&gt;
      &lt;th&gt;# of Tickets&lt;/th&gt;
      &lt;th&gt;Expected Value of Prize&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Special&lt;/td&gt;
      &lt;td&gt;$10,000,000&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;0.1&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Grand&lt;/td&gt;
      &lt;td&gt;$2,000,000&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;1&lt;/td&gt;
      &lt;td&gt;0.02&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Regular&lt;/td&gt;
      &lt;td&gt;$200,000&lt;/td&gt;
      &lt;td&gt;8&lt;/td&gt;
      &lt;td&gt;3&lt;/td&gt;
      &lt;td&gt;0.006&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;2&lt;sup&gt;nd&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;$40,000&lt;/td&gt;
      &lt;td&gt;7&lt;/td&gt;
      &lt;td&gt;30 - 3 = 27&lt;/td&gt;
      &lt;td&gt;0.0108&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;3&lt;sup&gt;rd&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;$10,000&lt;/td&gt;
      &lt;td&gt;6&lt;/td&gt;
      &lt;td&gt;300 - 30 = 270&lt;/td&gt;
      &lt;td&gt;0.027&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;4&lt;sup&gt;th&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;$4,000&lt;/td&gt;
      &lt;td&gt;5&lt;/td&gt;
      &lt;td&gt;3000 - 300 = 2700&lt;/td&gt;
      &lt;td&gt;0.108&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td colspan=&#34;4&#34;&gt;&lt;b&gt;Subtotal&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;b&gt;0.2718&lt;/b&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;5&lt;sup&gt;th&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;$1,000&lt;/td&gt;
      &lt;td&gt;4&lt;/td&gt;
      &lt;td&gt;30000 - 3000 = 27,000&lt;/td&gt;
      &lt;td&gt;0.27&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;6&lt;sup&gt;th&lt;/sup&gt;&lt;/td&gt;
      &lt;td&gt;$200&lt;/td&gt;
      &lt;td&gt;3&lt;/td&gt;
      &lt;td&gt;300000 - 30000 = 270,000 &lt;/td&gt;
      &lt;td&gt;0.54&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Additional&lt;/td&gt;
      &lt;td&gt;$200&lt;/td&gt;
      &lt;td&gt;3&lt;/td&gt;
      &lt;td&gt;X * 100,000&lt;/td&gt;
      &lt;td&gt;0.2 * X&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td colspan=&#34;4&#34;&gt;&lt;b&gt;Total&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;b&gt;1.2818&lt;/b&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;/div&gt;&lt;div class=&#34;wrapper small-wrapper&#34;&gt;

&lt;p&gt;Note the X in the Additional row is a variable. Some months there are multiple additional prizes and some there
are none.&lt;/p&gt;

&lt;p&gt;But wait &amp;mdash; that&#39;s before tax. There&#39;s a 20% lottery tax that&#39;s applied to receipts that win
more than $1000 NTD. Therefore the expected value actually becomes $1.25444 NTD after taxes.&lt;/p&gt;

&lt;/div&gt;&lt;div class=&#34;wrapper large-wrapper&#34;&gt;
&lt;div style=&#34;font-size: 2rem;margin: 50px 0; border-left:10px solid #349568;padding-left:30px;&#34;&gt;Can you make money by buying stuff just for the receipt?&lt;/div&gt;
&lt;/div&gt;&lt;div class=&#34;wrapper small-wrapper&#34;&gt;

&lt;p&gt;In theory yes. In practice probably not. I searched for the lowest cost item I could find at 7-11. It is a $2 &lt;abbr title=&#34;28 New Taiwanese Dollar ≈ 1 USD&#34;&gt;NTD&lt;/abbr&gt; funeral envelope. My theory is 7-11 is offering it essentially at-cost as an act of good will. Even that item isn&#39;t priced low enough. For this type of scheme to work you&#39;d you&#39;d have to find an item for sale for $1 NTD.&lt;/p&gt;

&lt;p&gt;You could make some money by making lots of $1 NTD purchases (about $ 0.2 NTD per receipt). But once you price in the time and effort spent making the purchases as well as checking all of the receipts it&#39;s probably not worth it.&lt;/p&gt;

&lt;p&gt;The cool thing is if you have hundreds of tickets piled up you should scan them. You can think of each one worth about $1.2 NTD. So what are you waiting for? Check your receipts. You can even check them by using apps to scan them.&lt;/p&gt;
</content>
    <author><name>Collin Richards</name></author>
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://richardscollin.com/public/blog-assets/receipt-lottery-ticket/cover.webp" />
  </entry>
  <entry>
    <title type="html">QR Code Seal Stamp</title>
    <link href="https://richardscollin.com/2021/03/18/qr-code-stamp" rel="alternate" type="text/html" title="QR Code Seal Stamp" />
    <published>2021-03-18T00:00:00+08:00</published>
    <updated>2021-04-11T00:00:00+08:00</updated>
    <id>https://richardscollin.com/2021/03/18/qr-code-stamp</id>
    <content type="html" xml:base="https://richardscollin.com/2021/03/18/qr-code-stamp">&lt;style&gt;
.center-image {
  display:block;
  margin: 16px auto;
}
&lt;/style&gt;

&lt;p&gt;QR codes and official seals are two things that are ubiquitous here in Taiwan. Usually they are of similar size and shape. What if there was a way to combine the two into one?&lt;/p&gt;

&lt;p&gt;We&#39;ll you can! &amp;mdash; But it involves controlling the data within the QR code. &lt;a href=&#34;https://research.swtch.com/qart&#34;&gt;Someone else&lt;/a&gt; did some research for how to get this sort of stuff to work before me. They didn&#39;t do it in the context of Chinese Seals, but nonetheless I was able to take some of their ideas and put them to good use.&lt;/p&gt;

&lt;h2&gt;How it works&lt;/h2&gt;
&lt;p&gt;If you start with a url like https://example.com/page# then you can embed junk data at the end of the url that is actually the image data when it gets encoded to the url. This works because everything after the pound symbol will be ignored by the site. So basically the Seal QR Code would look something like:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;highlight&#34;&gt;https://example.com/path#12341234123901203490234...&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;One insight from &lt;a href=&#34;#references&#34;&gt;[1]&lt;/a&gt; is that if the section part is only numbers then we will be able to control the pixels in the final QR code much easier. This is because the QR standard allows mixing the encoding mode. If we switch to it&#39;s numeric encoding mode then we&#39;ll have control of all of the bits, while still decoding to a valid url.&lt;/p&gt;

&lt;h2&gt;Designing a Seal&lt;/h2&gt;
&lt;img class=&#34;center-image&#34; src=&#34;/public/blog-assets/qr-code-stamp/pixel-editor.png&#34; alt=&#34;Here I am designing how my seal should look in a pixel editor&#34; width=&#34;800&#34;/&gt;
&lt;p&gt;There are some parts of a QR code that must be a certain color. So I&#39;ve intentionally placed the strokes over the QR code timing pattern in order to make the most of the space available. For this to work with my design, I had to flip my characters upside down. The data in a QR Code is encoded bottom-to-top and right-to-left in a strange zig-zag pattern. Also the error correction bits are placed immediately after the data. Therefore because I want it to still decode to a valid url and because of error correction I&#39;m restricted from placing pixels in the left or right portions of the qr code.&lt;/p&gt;

&lt;h2&gt;Mapping Pixels&lt;/h2&gt;
&lt;p&gt;Finally I have the pixel data we just have to figure out how to translate the pixel cordinates and data into the data we can append to the url. There are rules for determining how the pixels map, but I ran into issues wrapping my brain around how to deal with the alignment sections. Instead of spending more hours working on this part I ended up writing code that brute forced generating qr codes chaning one bit of the input each time and finds the (x,y) cordinate of changed module. Running this only takes about 10 seconds and I saved the mapping data in a file that I load when generating qr codes in the future.&lt;/p&gt;

&lt;h2&gt;Masking&lt;/h2&gt;
&lt;p&gt;The QR code generator algoithm includes a masking step which can change based off of the data encoded. We have to reverse this part in order for the data we are encoding to correspond to the pixel data. I used a &lt;a href=&#34;https://github.com/nayuki/QR-Code-generator&#34;&gt;qrcode generator library&lt;/a&gt; that allows fixing the mask pattern. So we&#39;ve gotten to this point:&lt;/p&gt;

&lt;img class=&#34;center-image&#34; style=&#34;transform: rotate(180deg)&#34; src=&#34;/public/blog-assets/qr-code-stamp/qr-seal.svg&#34; width=&#34;150&#34; height=&#34;150&#34; alt=&#34;The finished QR code seal design, rendered as a vector&#34;/&gt;

Now I need to flip the data and export it in a format that I can use for 3D printing. Luckily someone else already did the part
for &lt;a href=&#34;https://ridercz.github.io/OpenSCAD-QR/&#34;&gt;generating it as 3D printing file&lt;/a&gt;. I just had to flip the x-axis.

&lt;img class=&#34;center-image&#34; src=&#34;/public/blog-assets/qr-code-stamp/3d-print.png&#34; width=&#34;800&#34;/&gt;
I also wonder at this point if this is something that a master seal carver could also carve. Having an ornate seal with some cool
designs on the handle would also be nice.

&lt;h2&gt;Prototyping&lt;/h2&gt;
&lt;p&gt;I asked my friend who is really into 3D printing to work on a QR Code stamp prototype. I asked him to print a prototype of a normal QR Code first. The only problem is that the stamp isn&#39;t actually scannable. If I go back and fill in some of the blochy parts with a pen then it&#39;s actually able to scan.&lt;/p&gt;
&lt;img class=&#34;center-image&#34; src=&#34;/public/blog-assets/qr-code-stamp/prototype.jpg&#34; width=&#34;800&#34;/&gt;

&lt;h2&gt;Final Design&lt;/h2&gt;
&lt;p&gt;(Updated Apr 11) After 2 more iterations here is my final design. I modified the back of the stamp face to have
a lip which can wrap around the handle of a real stamp. The best part is that it works really well.&lt;/p&gt;
&lt;img class=&#34;center-image&#34; src=&#34;/public/blog-assets/qr-code-stamp/final-iteration-stamp.jpg&#34; width=&#34;800&#34;/&gt;

&lt;p&gt;The stamp looks best and properly scans when you stamp it when using a silicon backing. I use my laptop cover. Anyway I&#39;m
pretty happy about how this project turned out. I&#39;m planning on making a couple for my friends and maybe possibly selling
some if people are interested in having custom ones made.&lt;/p&gt;

&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a href=&#34;https://research.swtch.com/qart&#34;&gt;QArt Codes&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&#34;https://www.nayuki.io/page/creating-a-qr-code-step-by-step&#34;&gt;Creating a QR Code step by step&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&#34;http://qrcode.meetheed.com/qrcode_art.php&#34;&gt;QR Code Art&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&#34;https://ridercz.github.io/OpenSCAD-QR/&#34;&gt;OpenSCAD QR Code Generator&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Future Work&lt;/h2&gt;
&lt;p&gt;What if when signing important documents you didn&#39;t use your seal, but a some sort of digital signature? It would be really cool to extend what I have made here into generating digital signatures for documents. For example you could have the stamp be a digitally signed hash of an image of the document.&lt;/p&gt;
</content>
    <author><name>Collin Richards</name></author>
    <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://richardscollin.com/public/blog-assets/qr-code-stamp/elevator.jpg" />
  </entry>
  <entry>
    <title type="html">Taiwan Immigration Stats</title>
    <link href="https://richardscollin.com/2021/01/13/taiwan-immigration-stats" rel="alternate" type="text/html" title="Taiwan Immigration Stats" />
    <published>2021-01-13T00:00:00+08:00</published>
    <updated>2021-01-13T00:00:00+08:00</updated>
    <id>https://richardscollin.com/2021/01/13/taiwan-immigration-stats</id>
    <content type="html" xml:base="https://richardscollin.com/2021/01/13/taiwan-immigration-stats">&lt;p&gt;I recently started taking a data visualization course. In order to practice learning D3, a data visualization tool, I deceided to show Taiwan&#39;s immmigration statistics and Covid-19&#39;s impact on it. What I have here is a bit buggy, but still worth sharing at it&#39;s current state. The orange is the number of entries, blue is number of exits, and green is the net (entries - exits) for the given period (day, month).&lt;/p&gt;
&lt;div id=&#34;info&#34;&gt;
&lt;div style=&#34;font-size: 1.25rem; padding-bottom: 1rem;&#34;&gt;Taiwan Immigration Stats&lt;/div&gt;
&lt;label for=&#34;start-date&#34;&gt;Start:&lt;/label&gt;
&lt;input name=&#34;start-date&#34; id=&#34;start-date&#34; type=&#34;date&#34; min=&#34;2015-01-01&#34; max=&#34;2020-12-31&#34; value=&#34;2020-01-01&#34;&gt;
&lt;br&gt;
&lt;label for=&#34;end-date&#34;&gt;End:&lt;/label&gt;
&lt;input name=&#34;end-date&#34; id=&#34;end-date&#34; type=&#34;date&#34; min=&#34;2015-01-01&#34; max=&#34;2020-12-31&#34; value=&#34;2020-12-31&#34;&gt;
&lt;br&gt;
&lt;label for=&#34;bucket-size&#34;&gt;By:&lt;/label&gt;
&lt;select id=&#34;bucket-size&#34; name=&#34;by&#34;&gt;
&lt;option value=&#34;day&#34;&gt;Day&lt;/option&gt;
&lt;option value=&#34;month&#34;&gt;Month&lt;/option&gt;
&lt;/select&gt;
&lt;input id=&#34;reset&#34; type=&#34;button&#34; onclick=&#34;updateData()&#34; value=&#34;Reset&#34;&gt;
&lt;/div&gt;
&lt;svg id=&#34;nia-chart&#34; width=&#34;960&#34; height=&#34;500&#34;&gt;&lt;/svg&gt;
&lt;h2 id=&#34;future-work&#34;&gt;Future Work&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fix interaction bugs in the above graph&lt;/li&gt;
&lt;li&gt;Investigate descrepency between government daily immigration stats and monthly stats&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;references&#34;&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://data.gov.tw/dataset/12369&#34;&gt;Official Daily Immigration Stats&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    <author><name>Collin Richards</name></author>
  </entry>
</feed>
