<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>David M. Chan - Blog</title>
  <subtitle>I&#39;m David - an AI researcher, writer, and tech enthusiast. Probably.</subtitle>
  <link href="https://dchan.cc/feed.xml" rel="self" />
  <link href="https://dchan.cc/blog/" />
  <updated>2024-07-26T00:00:00Z</updated>
  <id>https://dchan.cc/blog/</id>
  <author>
    <name>David Chan</name>
    <email>david@iridescent.io</email>
  </author>
  <entry>
    <title>Migrating to 11ty</title>
    <link href="https://dchan.cc/posts/2024-07-26-migrating-to-11ty/" />
    <updated>2024-07-26T00:00:00Z</updated>
    <id>https://dchan.cc/posts/2024-07-26-migrating-to-11ty/</id>
    <content type="html">&lt;p&gt;Wow, so this is my new blog! And it&#39;s built with 11ty! I&#39;m so excited to share this with you all. I&#39;ve been working on this for a while now and I&#39;m so happy with how it turned out. I hope you all enjoy it as much as I do!&lt;/p&gt;
&lt;h1&gt;What is 11ty?&lt;/h1&gt;
&lt;p&gt;11ty is a static site generator that is simple, fast, and flexible. It&#39;s built with JavaScript and it&#39;s super easy to use. You can use it to build blogs, portfolios, documentation sites, and more. It&#39;s a great tool for anyone who wants to build a static site without having to deal with a lot of complexity.&lt;/p&gt;
&lt;h1&gt;Why did I migrate to 11ty?&lt;/h1&gt;
&lt;p&gt;I decided to migrate to 11ty because I wanted a simpler, faster, and more flexible way to build my blog. Before I was using ghost, a headless CMS, but I found that it was too complex for my needs. I wanted something that was easier to use and that would allow me to have more control over my content. 11ty was the perfect solution for me. It&#39;s simple to use, it&#39;s fast, and it&#39;s super flexible. I can customize it to fit my needs and I can build my blog exactly the way I want it.&lt;/p&gt;
&lt;h1&gt;What&#39;s next?&lt;/h1&gt;
&lt;p&gt;I have a lot of exciting things planned for this blog. I&#39;m going to be posting (probably not regularly, but sometimes), and I&#39;m also going to be adding new features and functionality to the site, so stay tuned for updates. I hope you enjoy my new blog and I can&#39;t wait to share more with you soon!&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>A Kubernetes Jouney</title>
    <link href="https://dchan.cc/a-kubernetes-jouney/" />
    <updated>2023-02-01T00:00:00Z</updated>
    <id>https://dchan.cc/a-kubernetes-jouney/</id>
    <content type="html">&lt;p&gt;&lt;img src=&quot;https://dchan.cc/assets/images/2022/12/image-8.png&quot; alt=&quot;Meme&quot;&gt;
So, I realized that a bunch of the TIL&#39;s that I&#39;ve posted on the &lt;a href=&quot;https://til.dchan.cc&quot;&gt;Sister &amp;quot;blog&amp;quot;&lt;/a&gt; to this blog are based on my journey in Kubernetes  (yes, my unused blog has another unused blog attached to it.... it&#39;s blogs all the way down) , so I thought that it might be interesting to sit down and write a bit of a longer piece about my 6 month process of transitioning all of my personal hosting infrastructure to Kubernetes.&lt;/p&gt;
&lt;h2&gt;What is Kubernetes&lt;/h2&gt;
&lt;p&gt;If anyone is visiting this page, they&#39;ve probably heard the word &amp;quot;Kubernetes&amp;quot; or &amp;quot;K8s&amp;quot; thrown around. It&#39;s possible, though, that even though you&#39;ve heard the term, you have no idea what it means. Kubernetes (or, since we love abbreviations in web development, K8s), is, in the terms of their homepage: &amp;quot;&lt;strong&gt;&lt;em&gt;an open-source system for automating deployment, scaling, and management of containerized applications&lt;/em&gt;&lt;/strong&gt;.&amp;quot; In practice, for me it&#39;s a tool which helps to manage all of the infrastructure for anything I expose to the web. Famously used by Google to manage its deployment infrastructure, Kubernetes excels at managing huge deployments of &lt;a href=&quot;https://www.datadoghq.com/knowledge-center/containerized-applications&quot;&gt;containerized applications&lt;/a&gt;, and can scale to the size of most of the cloud giants. It&#39;s an impressive piece of work.
&lt;img src=&quot;https://dchan.cc/assets/images/2022/12/image-7.png&quot; alt=&quot;Meme (long comic panel)&quot;&gt;
For more information on what exactly Kubernetes is, you can check out the &lt;a href=&quot;https://cloud.google.com/learn/what-is-kubernetes&quot;&gt;Google cloud page&lt;/a&gt; but, actually, while googling this, I didn&#39;t find a great resource for people who aren&#39;t deep into devops. I suspect this belies the complexity of getting this whole thing working – perhaps I should write something. But that&#39;s a blog post for another day.&lt;/p&gt;
&lt;h2&gt;Why on earth would you use Kubernetes for a personal project?&lt;/h2&gt;
&lt;p&gt;The first thing that anyone who has ever used Kubernetes before will say is &amp;quot;Why would you ever want to use this for a personal project?&amp;quot; Kubernetes is notorious for it&#39;s finicky deployments, impossible configuration files, dense documentation, steep learning curve, and complicated infrastructure.&lt;/p&gt;
&lt;p&gt;Well, you see, I have a lot of personal projects. Currently, I manage over 20 different applications which are exposed to the web. One of these is this blog that you&#39;re reading right now. Another one is the sister project to this blog, &lt;a href=&quot;https://til.dchan.cc&quot;&gt;til.dchan.cc&lt;/a&gt; which is a collection of much shorter &amp;quot;Today I learned&amp;quot; style posts. I run several services which backend data collection for my PhD. I run a system which automates checking each of the 15 servers that I manage for the lab at UC Berkeley for SSH accessibility (and makes that available in real-time on statuspage.io). I run DDNS servers with healthchecks.io (That&#39;s a whole different blog post). I run a &lt;a href=&quot;https://github.com/DavidMChan/ArXiV-Notify&quot;&gt;web service&lt;/a&gt; that updates me every day with the latest papers published in my field. And so so so many more things. At a certain point, running each of these apps in a loose collection of VPS instances from sketchy VPS providers became dangerous, expensive, and it became super easy to forget that something was running (or where something was running), or even perhaps how much something was costing me to run. So I decided to move from this loose collection to a tight ship of dockerized containers.&lt;/p&gt;
&lt;h2&gt;Towards Kubernetes Everywhere&lt;/h2&gt;
&lt;p&gt;So, now that I&#39;ve made this decision, what exactly did it take? What exactly was the price I paid...&lt;/p&gt;
&lt;h4&gt;Step 1: Dockerizing Every Application&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://dchan.cc/assets/images/2022/12/image.png&quot; alt=&quot;Meme&quot;&gt;
So, the first problem that I had was that almost none of my projects were built into containers. The container infrastructure was a revolution in devops - you could package up all of your code and dependencies into a package, and deploy this package on pretty much anything, pretty much anywhere, with one command. For somebody who is running deployments, this is amazing, but for somebody building personal projects, it is a nightmare of additional complexity. It took probably a few long weekends to get every one of my personal projects to run on docker.&lt;/p&gt;
&lt;h4&gt;Step 2: Finding a Container Registry&lt;/h4&gt;
&lt;p&gt;Next, I needed somewhere to host all of these docker files. Because most of the files are for personal projects, that aren&#39;t open source, I didn&#39;t necessarily want to publish them to a public container registry like Docker hub. For me &lt;a href=&quot;https://ghcr.io/&quot;&gt;ghcr.io&lt;/a&gt; came to the rescue: It&#39;s tight integration with Github (which I already use to store all of my personal code), and the relatively relaxed pricing structure gave me an excellent place to start (and for public repos, it&#39;s free!). Fantastic. Now, I had done most of the hard work, I thought. I have all of my code running in containers, and uploaded to a container repository somewhere. All I have to do is create a cluster and press go, right? Right?&lt;/p&gt;
&lt;h4&gt;Step 3: Setting up the control plane&lt;/h4&gt;
&lt;p&gt;So Kubernetes needs a couple of things to run. It needs worker nodes which run each of your individual pods (read: servers that run containers), and it needs a server which organizes all of the work that the servers do. Because I&#39;m nothing but cheap, I thought to myself &amp;quot;Ok, maybe I can provision a few VPS instances (at least three, they say in the docs) using my cheap (and sketchy) online VPS providers, and get this working&amp;quot;. Turns out, that &lt;strong&gt;really doesn&#39;t work&lt;/strong&gt;. I was about six hours deep into reading about how to link Kubernetes nodes together over the internet before I realized that this was a lost cause. Turns out, that Kubernetes is designed to run between nodes which live in a firewall-protected VPS. And getting around that is a huge no. So I did the numbers, and I caved, and set up the cluster through linode (I was influenced by all of the podcasts. So many podcasts). Each node in the cluster cost $10/month, and you needed at least three, so we&#39;re at 30$/month already. Yes, I know, not that much.... but I&#39;m a PhD student. That&#39;s the cost of Dinner out in the bay area, for one person. I guess more hot dogs on rice for me. Ok, so now I had the control plane, just a few lines of YAML to get my first app up and running to the public right?&lt;/p&gt;
&lt;h4&gt;Step 4: My First Deployment (And Regret)&lt;/h4&gt;
&lt;p&gt;So, the first thing that I decided to do was to get a simple static page running, the landing page for a site I haven&#39;t yet built: &lt;a href=&quot;https://starlight.dev/&quot;&gt;starlight.dev&lt;/a&gt;. All I needed to do was serve a static file, so I had created a docker container with nginx, and I needed to get this exposed to the internet. So I followed a tutorial, and created a deployment. And nothing happened. So I added some more YAML code to make sure that my cluster was authorized to pull containers from ghcr. Well, that kinda worked. Now, I could see my pod running in the cluster (woohoo!), but I couldn&#39;t access it from the outside world. Or really, from the inside world. Or really, from anywhere. Then I read another tutorial, and I wrote some more YAML, and I had a service. But I still couldn&#39;t access it. And then I read another tutorial. And I realized that actually, I needed an &amp;quot;Ingress service&amp;quot;, and without really knowing what that was, I somehow managed to get &lt;a href=&quot;https://traefik.io/&quot;&gt;traefik&lt;/a&gt; installed on the cluster, and then finally, I still couldn&#39;t access anything. Not only that, but ingress services cost money, so we were up to $40/month, and I still couldn&#39;t even see my static page. After another few tutorials, I finally created an IngressRoute which apparently talks to Traefik, and Finally, &lt;em&gt;finally&lt;/em&gt; something happened. I saw a static page. On the internet. After at least 30 hours of messing around with it.
&lt;img src=&quot;https://dchan.cc/assets/images/2022/12/image-9.png&quot; alt=&quot;It doesn&#39;t work.... why? It works... Why? meme&quot;&gt;
Turns out, the Kubernetes learning curve is no joke. And honestly, at that point I still didn&#39;t really understand what I had done. It was just a huge collection of YAML files I had applied (to the default namespace no less) to the cluster, and I had no idea what I was doing for real. To this day, I&#39;m still not really sure that I know what I&#39;m doing, but hey, maybe I&#39;ll figure it out one day.&lt;/p&gt;
&lt;h4&gt;Step 5: SSL&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://dchan.cc/assets/images/2022/12/image-10.png&quot; alt=&quot;&amp;quot;I should really start to... Encrypt Everything!&amp;quot; - Meme&quot;&gt;
Well, there was only one little problem with my static web page. It had the red lock of doom (i.e. no SSL), so the next step was to figure out how to get my cluster to hand out the right SSL keys. Since Traefik was terminating the SSL connections, I had to figure out how to give Traefik the certs (from Cloudflare, which handles my DNS, in strict mode), that it needed to prove that yes, indeed, I am David (or at least, that my sites are trusted by me). This required a new thing - &lt;a href=&quot;https://cert-manager.io/&quot;&gt;cert-manager&lt;/a&gt;, which, after a bunch of fiddling around with YAML files, I managed to get deployed in my cluster. But cert-manager only handles the soring fo the certificates, I still needed to generate them. Luckily, there was this tool &lt;a href=&quot;https://github.com/cloudflare/origin-ca-issuer&quot;&gt;origin-ca-issuer&lt;/a&gt; from Cloudflare which is supposed to interface between Cloudflare and my cluster, to get the origin certificates sorted out correctly. There were installation instructions, and boy did I run them. Like two or three times. But each time, the docker container would crash. Turns out, it just needed more &lt;a href=&quot;https://github.com/cloudflare/origin-ca-issuer/issues/23&quot;&gt;memory&lt;/a&gt;. Ah. Good times. But it finally worked. And I got the green lock. But yeah, another set of hours sunk into something that I have not (to this day), touched in my cluster. Sometimes I worry that if something dies, I won&#39;t be able to get all of the origin certs working again.... but that&#39;s a problem for the David of the future.&lt;/p&gt;
&lt;h4&gt;Step 6: More Deployments&lt;/h4&gt;
&lt;p&gt;I&#39;ll skip over the hours sunk into each of my other deployments. From not adding the &lt;code&gt;-n&lt;/code&gt; to &lt;code&gt;echo&lt;/code&gt; when encoding secrets in base64, to figuring out how to attach Linode volumes (turns out, Linode block storage doesn&#39;t support &lt;code&gt;ReadWriteMany&lt;/code&gt;), to having to pay at least $1/month for each 10GB block storage (since even though my app only needs 150Mb of persistent storage, I still have to attach a volume), to getting MySQL running since Ghost needs that... to getting OOM errors for my pods, and installing &lt;a href=&quot;https://github.com/kubernetes-sigs/metrics-server&quot;&gt;metrics-server&lt;/a&gt; to track that. Man, it was a journey. But honestly, at this point, it was starting to feel a bit smoother. I (somewhat) understood how Kubernetes was working at this point, and I was starting to get the muscle memory required to write the YAML files which became a huge chunk of my infrastructure. I started using namespaces for each of my projects, and I started storing all of the YAML files in a GitHub repository, so that the entire cluster would be reproducible if something failed... I&#39;m still not sure that it is, but since Linode&#39;s control plane hasn&#39;t failed yet, it&#39;s not something that I&#39;ve had to worry about. It also became much easier over time to add new deployments. It&#39;s no longer a pain to worry about the infrastructure for a new side project, all I have to do is just use a &lt;a href=&quot;https://github.com/cookiecutter/cookiecutter&quot;&gt;cookie-cutter&lt;/a&gt; template to create a new deployment/service, and it&#39;s all up and running pretty quickly. Exposed to the internet. With SSL. All with one or two commands. And I get some redundancy built in (but honestly, none of my projects are popular enough to need it).&lt;/p&gt;
&lt;h4&gt;Step 7: Cron Jobs&lt;/h4&gt;
&lt;p&gt;I have a bunch of things that run on their own, and honestly, this was one of the easiest things to get running. All I had to do was to create a YAML definition of the job, add a schedule, and it would pull and run the image every time it was scheduled. This was, by far, the easiest part of getting this whole thing to work, and to be honest, I would start here for anyone learning how Kubernetes works, or for anyone who wants to get their feet wet. Getting a CronJob running on Kubernetes is rewarding, and frankly, not that hard. Certainly beats SSL. And Reverse Proxies. And literally. Everything. Else.&lt;/p&gt;
&lt;h4&gt;Step 8: Figuring out how to get DNS to work&lt;/h4&gt;
&lt;p&gt;&lt;img src=&quot;https://dchan.cc/assets/images/2022/12/image-1.png&quot; alt=&quot;YAML Meme&quot;&gt;
So, at this point, I had everything working, but every time I created a deployment, I needed to manually create the DNS entries in cloudflare. Hunh, I thought. I can do this automatically! No need to handle anything manually! I am a Kubernetes master! I can do this myself. So I found this tool &lt;a href=&quot;https://github.com/kubernetes-sigs/external-dns&quot;&gt;external-dns&lt;/a&gt;, which did a great job of handling the DNS. Or so it claimed. Well, you see, because I was using Traefik IngressRoutes, there wasn&#39;t any built-in support. Oh no. I tried everything to get it working, but no dice. Finally, I stumbled across a tiny footnote in the docs – the custom resource directory, and the source code for the &lt;a href=&quot;https://github.com/kubernetes-sigs/external-dns/blob/master/docs/contributing/crd-source.md&quot;&gt;crd-source&lt;/a&gt;. By registering a CRD, and uploading it to the cluster, and pairing it with a working external-dns installation, I was finally able to create DNS Endpoints in YAML, and finally, my Kubernetes cluster was complete!&lt;/p&gt;
&lt;h2&gt;So... there&#39;s this thing called &amp;quot;helm&amp;quot;&lt;/h2&gt;
&lt;p&gt;So, up until this point, I had been building out my cluster *entirely from scratch. *This means that I wasn&#39;t using helm, or rancher, or any of those handy tools that actually make Kubernetes usable. What does this mean? To run installs, it was a combination of cloning source code, building libraries, and running &lt;code&gt;kubectl apply -f&lt;/code&gt; a lot. Like a lot. But after setting all of this up, I realized that there&#39;s this tool called helm, which makes a lot of these things easier. Oh yeah, and there&#39;s a tool called rancher which makes this easier too. Oops. But I guess, learning experience?
&lt;img src=&quot;https://dchan.cc/assets/images/2022/12/image-11.png&quot; alt=&quot;&amp;quot;Thrilling Learning Experience Meme&amp;quot;&quot;&gt;&lt;/p&gt;
&lt;h2&gt;So, is it worth it?&lt;/h2&gt;
&lt;p&gt;Now that I&#39;ve been living with my (personal) Kubernetes cluster for a few months, I can honestly say... it&#39;s not worth it at all. The pain of setting things up, and getting the whole thing deployed, along with the costs that are associated with it (since all of the companies that have the useful tools assume that you&#39;re using it for corporate purposes – what even is $10/month for each ingress??), means that it&#39;s in no way worth it for a single user. Really, just get a beefy computer, and run docker swarm or something. So much easier.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;But.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I love it. I love my new Kubernetes cluster. Not only is it so much easier to manage all of my personal applications, it feels like a pet that I&#39;ve been tending to for several months. It&#39;s really fulfilling to say to myself - I can manage all of these projects using the best of the best tools that&#39;s out there. And frankly, the fact that in less than 30 seconds I can provision DNS, SSL, Hardware infrastructure, Routing, and Databases for a new application using a cookiecutter template is amazing. It really allows me to focus the time that I would have put into managing all of my code into new projects, and worry about what color the font on my home page should be. It&#39;s great.&lt;/p&gt;
&lt;h2&gt;What&#39;s Next?&lt;/h2&gt;
&lt;p&gt;So, what&#39;s next? I&#39;ll probably continue using this cluster for a while. It&#39;s a great tool, and it really helps amp up my productivity. As I find more things to run, I&#39;ll probably start figuring out how to scale the ingresses, and scale the underlying cluster... it&#39;ll probably break this blog at some point. But for now, my Kubernetes journey has reached a plateau. I&#39;ll end with one last meme, which I think sums everything up.
&lt;img src=&quot;https://dchan.cc/assets/images/2022/12/image-12.png&quot; alt=&quot;A bar chart titled &amp;quot;What gives people feelings of power&amp;quot;. The first line, money, is the smallest bar, followed by the second line &amp;quot;status&amp;quot;, and the largest bar is &amp;quot;Run your own kubernetes cluster&amp;quot;.&quot;&gt;
Cheers!
David&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Quick Tricks: Downloading Files in Parallel with Curl and Parallel</title>
    <link href="https://dchan.cc/downloading-files-in-parallel-with-curl/" />
    <updated>2021-08-12T00:00:00Z</updated>
    <id>https://dchan.cc/downloading-files-in-parallel-with-curl/</id>
    <content type="html">&lt;p&gt;Recently, I&#39;ve been doing a lot of downloading of data. The &lt;a href=&quot;https://deepmind.com/research/open-source/kinetics&quot;&gt;Kinetics dataset&lt;/a&gt; from DeepMind is about 600GB, and as hosted by the &lt;a href=&quot;http://www.cvdfoundation.org/&quot;&gt;Common Visual Data Foundation&lt;/a&gt;,  consists of about 1300 links to files, each about 1.5GB that need to be downloaded. It&#39;s quite a task. In this post, I&#39;ll talk a bit about how I got this done.&lt;/p&gt;
&lt;h4&gt;What didn&#39;t work - Aria2&lt;/h4&gt;
&lt;p&gt;Originally, I looked online for a good way to download large numbers of files from the internet. &lt;a href=&quot;https://aria2.github.io/&quot;&gt;Aria2&lt;/a&gt; seemed to me to be the best option, and fit the bill perfectly. The first time that I went about this download, I used the following option:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;aria2c -x8 -j32 -i k600_train_path.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This allowed me to use 8 connections per file, with 32 unique processes to fetch the data from the list of S3 links in the &lt;code&gt;k600_train_path.txt&lt;/code&gt; file. While the usual common courtesy on the internet is to make no more than 4 connections, with 16 parallel downloads, I figured that Amazon, the great S3 provider, could handle the additional traffic which would be able to saturate my 1Gbps conneciton.&lt;/p&gt;
&lt;p&gt;While the files downloaded fine (and in remarkable time, I might add), I had an issue: The files were mostly incomplete, and thus, contained a truncated amount of training data. Because tar/gzip is capable of recoving from some corrruption, and is a linear file, I actually didn&#39;t notice until I realized that some of my training classes had no examples!  Not only this, Aria2 didn&#39;t provide any warnings or errors, so I had figured everything was ok. I guess not.&lt;/p&gt;
&lt;p&gt;Usually, when you&#39;re working with data at the research scale, you can run into issues that people hadn&#39;t thought much about in the initial design process. Files are too large, there are too many files, etc.&lt;/p&gt;
&lt;h4&gt;A better/old-school option: Curl + GNU Parallel&lt;/h4&gt;
&lt;p&gt;With Aria2 off the table, I went back to my bash roots, and dusted off two of my favorite command line programs: &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;parallel&lt;/code&gt;. Both of these programs are remarkably powerful, and I figured, it would be easy enough to stitch together the two to create a parallel downloader of my own. Not only this, but I probably could have done this faster than typing &lt;code&gt;apt install aria2c&lt;/code&gt; which is the command to install the (somewhat flawed) data downloader above.&lt;/p&gt;
&lt;p&gt;First, I had to think about how to download a single file. Easy, right?&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;curl -O https://s3.amazonaws.com/kinetics/600/test/part_59.tar.gz
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then, we just need to let parallel do it&#39;s magic. Since I have a pretty large number of files, I don&#39;t have to worry too much about the number of connections per file.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;cat k600_train_path.txt | parallel --bar -j32 curl -sO {}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let&#39;s break down the command above. First, this takes the list of URLs in the &lt;code&gt;k600_train_path.txt&lt;/code&gt; file, and puts them into stdout. I then pipe these URLs into GNU parallel with two options: &lt;code&gt;--bar&lt;/code&gt; to give me a nice download progress bar, and &lt;code&gt;-j32&lt;/code&gt; for 32 parallel threads of execution. What follows, is the command that I want to run for each of the URLs. &lt;code&gt;curl -sO {}&lt;/code&gt;. The &lt;code&gt;-sO&lt;/code&gt; says that curl should be silent (so it doesn&#39;t mess with my beautiful progress bar), and that the file should be dumped to disk. The &lt;code&gt;{}&lt;/code&gt; is where each of the URLs is coming in from stdin should go.&lt;/p&gt;
&lt;p&gt;This worked, and in fact, it was much cleaner, with tools that I already had installed on my system. I probably should have just gone with this from the start, but I am, reallly, a sucker for new tools. You can use this in your own work as well! Whenever you need a large number of files downloaded, or need to do a batch operation, I&#39;d look into the wonders of GNU parallel, and what it can do! There&#39;s so much more to this program than meets the eye, and it&#39;s well worth your time to take a look. Check out the original docs &lt;a href=&quot;https://www.gnu.org/software/parallel/parallel_tutorial.html&quot;&gt;here&lt;/a&gt;, and get it with &lt;code&gt;sudo apt install parallel&lt;/code&gt; on ubuntu, or check &lt;a href=&quot;https://www.gnu.org/software/parallel/&quot;&gt;here&lt;/a&gt; for any other system.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Staying Productive - Tools &amp; Methods</title>
    <link href="https://dchan.cc/productivity-tools/" />
    <updated>2019-08-23T00:00:00Z</updated>
    <id>https://dchan.cc/productivity-tools/</id>
    <content type="html">&lt;h2&gt;I&#39;m on vacation. In lieu of another shallowish dive, I&#39;m posting this quick look into what I do when I&#39;m not enjoying the sunny weather of somewhere nice.&lt;/h2&gt;
&lt;p&gt;It may not seem like it from this blog post, but in reality, I&#39;m actually a pretty productive person. A lot of this productivity stems from two things: &lt;em&gt;Philosophies, and gadgets&lt;/em&gt;. Staying productive is something that we all struggle with from time to time - so to keep you motivated, here are some of the ways that I try to stay productive!&lt;/p&gt;
&lt;h1&gt;Getting Things Done&lt;/h1&gt;
&lt;p&gt;The core of being productive is getting things done - that is, taking in tasks, and producing results. In this section, I&#39;m going to talk about some of the things that I do to get things done, and to motivate myself to finish work once I&#39;ve begun.&lt;/p&gt;
&lt;h2&gt;Gadget: Make a list&lt;/h2&gt;
&lt;p&gt;There&#39;s nothing quite like the age old todo list, and there&#39;s a reason that this is on everybody&#39;s &amp;quot;5 things you can do to be more productive&amp;quot; list. As humans, we have very little ability to keep things in our head - and by moving our todo list from our heads onto a piece of paper (or an awesome app) can keep the mind free for actually thinking, instead of trying to remember what we have to do. The issue with the todo list is that if something doesn&#39;t make it onto the list, it flies into the garbage heap of forgotten things - so the only gotcha here is that you have to stick with it, and keep writing everything down!&lt;/p&gt;
&lt;p&gt;The todo app that I use is &lt;a href=&quot;https://todoist.com&quot;&gt;Todoist&lt;/a&gt;. I have a lot of qualms with todo apps (which could easily be another blog post) - but this one hits my minimum qualifications:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I can view todos on all of my devices (there&#39;s a web app, along with mobile clients)&lt;/li&gt;
&lt;li&gt;I can organize todos into projects&lt;/li&gt;
&lt;li&gt;I can schedule todos on a particular day, prioritize them, and view my whole week from a top-down view.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Philosophy: Just Do It.&lt;/h2&gt;
&lt;p&gt;One philosophy that I love to use to keep quick things off of my todo list, and keep my time free, is a &amp;quot;Just do it&amp;quot; philosophy that I picked up somewhere (not Shia LeBoeuf). &amp;quot;Just do it&amp;quot; is the idea that if you have a task which is going to take less than five minutes, you should do it immediately instead of putting it off until later. This strategy of completing tasks has a number of immediate benefits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It makes people think you are task superman (since you get most things done super fast)&lt;/li&gt;
&lt;li&gt;It keeps your todo list free of small things, which can pile up rather quickly&lt;/li&gt;
&lt;li&gt;It keeps your mind free to work on big projects, instead of small nagging things in the back of your head.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Unfortunately, sometimes the Todoist app and the Just Do It philosophy are at odds with one another. Todoist has a thing called &amp;quot;Karma&amp;quot;, which you get for adding and completing tasks in the app. When you&#39;re &amp;quot;Just doing&amp;quot; things, you really quickly create and check off tasks, which is somewhat annoying, but hey, you can get that rush of finishing something without feeling like you did any work.&lt;/p&gt;
&lt;h2&gt;Philosophy: Frog Friday&lt;/h2&gt;
&lt;p&gt;While it might seem odd, this is a classic productivity technique. The idea stems from the Mark Twain strategy of &amp;quot;Eat Your Frogs&amp;quot;, which while quoted in different ways, goes mostly like:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If it&#39;s your job to eat a frog, it&#39;s best to do it first thing in the morning. And If it&#39;s your job to eat two frogs, it&#39;s best to eat the biggest one first.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This roughly correlates to &amp;quot;Do the thing that you dread most early in the morning.&amp;quot; While I would love to wake up every morning and get the day&#39;s rough work out of the way, there are always some things that I manage to push on and on and on until they end up costing me a lot of productivity. To this end, I use the idea of &amp;quot;Frog Friday.&amp;quot;&lt;/p&gt;
&lt;p&gt;Frog Friday is where I save everything that I know I don&#39;t want to do, or find tedious until Friday, and then take the whole day to work on these things. When I&#39;m done with these things, I consider my week finished, and I pack it in for the day. This has the net result of leaving me with a clean desk/mind for the weekend, while accomplishing everything that I need to do that isn&#39;t so pleasant. Packing these things into a single day forces me to work on them - and provides some structure that I really need to get things done.&lt;/p&gt;
&lt;h2&gt;Philosophy: Fill Productive Time with Productivity&lt;/h2&gt;
&lt;p&gt;One of the hardest things that we can do as people is ignore all of the distractions around us and focus on what needs to be done. This starts by separating time into &amp;quot;productive time&amp;quot; and &amp;quot;relaxation time,&amp;quot; and drawing strict boundaries between them.&lt;/p&gt;
&lt;p&gt;During productive time, I expect to be getting things done - I take the highest priority items from the top of my todo list, and finish them. Then you take the next item, and do that. It&#39;s a shockingly simple philosophy - but it works really quite well. During productive time, you shouldn&#39;t be focusing on those notifications on facebook, or that funny link that somebody just sent you. You should be getting things done - trust me - those messages and emails can wait.&lt;/p&gt;
&lt;p&gt;When you are using your time productively, it can be surprising how much you actually get done. One of the things that I can struggle with from time to time is not having enough things on my Todo list to keep working on during productive time periods. When you hit this point, it&#39;s always really easy to quit, and say &amp;quot;Well, I&#39;ve finished everything.&amp;quot; This isn&#39;t really what you should be doing, however. If this ever happens, you should take some time to replan what you are doing the next few days, and add some more tasks to today. If you have nothing for the rest of the week, then you should search out some things to do (Or take up a hobby which fills arbitrary amounts of time).&lt;/p&gt;
&lt;p&gt;During relaxation time, I expect to be relaxing. I expect to be spending hours binging the latest episodes of Friends, or playing games. This one is the easy bit. Letting work spill into relaxation time is &lt;strong&gt;just as bad&lt;/strong&gt; as letting relaxation spill into productivity time.&lt;/p&gt;
&lt;h1&gt;Staying Productive&lt;/h1&gt;
&lt;p&gt;When I&#39;m working, I usually have more than one project, more than one task, and more than one thing to do. It&#39;s always hard to prioritize what comes next, and switch contexts from one project to another. These are some of my strategies for keeping my projects straight, and on track.&lt;/p&gt;
&lt;h2&gt;Gadget: &lt;a href=&quot;https://www.dropbox.com/paper&quot;&gt;Dropbox Paper&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Recently, Dropbox released a tool called &amp;quot;&lt;a href=&quot;https://www.dropbox.com/paper&quot;&gt;Dropbox Paper&lt;/a&gt;&amp;quot;, which is basically a notepad for the internet. There&#39;s nothing particularly special about it, but it provides a great place to keep your life organized at a high level. I have a paper doc for every project with a few sections:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Project Outline&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the project outline, I talk a bit about what the project is, who is involved, and some of the high level details. It&#39;s amazing how just writing these things down can clean up the details of a project that lives only in your head. For many of my projects, this is the &amp;quot;abstract&amp;quot; of the paper that I&#39;m going to write. It&#39;s the high level overview of what I think I&#39;m going to get done.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Project Goals&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The project goals are targets/milestones that I want to hit. These can involve tasks, or they can be higher level goals, such as things we want to demonstrate by working on the project. By clarifying the goals of a project, I can generate todos that work towards these goals, and I can always take the product that I have so far, and keep re-evaluating to make sure that I&#39;m staying true to what I want to get out of the project.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Project Timeline&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Planning ahead is an amazing thing to do. By estimating the amount of time that I expect different parts of a project to take, as well as plotting out the different milestones, deadlines, and other bits and pieces, I can get a good feel for how urgent some things are. In addition, I can use the super handy Gantt chart feature in Dropbox paper to do this - which makes planning super easy.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Week 1...N progress&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At the end of every week, I like to write a summary of what I accomplished for that project in the given week, and what the upcoming todos are for the next week. This helps me see if I&#39;m still on track, and can be handy later when somebody asks &amp;quot;What have you been doing for the past week&amp;quot;  - and you can go back to this section, and see your progress right there, without having to do too much thinking.&lt;/p&gt;
&lt;h2&gt;Philosophy: Stay on Target&lt;/h2&gt;
&lt;p&gt;While the name for this philosophy comes from Star Wars, it&#39;s actually a really interesting idea to keep in mind when planning long projects. Usually, at the beginning of each project, we have a set of goals that we want to get out of the project. Sometimes these are deliverables (and very clear) and sometimes these are much less clear, and much less obvious. It&#39;s always important to go back to these goals (preferably for every week/todo) and make sure that you&#39;re generating tasks which take you closer to a goal. A lot of times, we can avoid doing unnecessary work by making sure we&#39;re staying on track at a high level.&lt;/p&gt;
&lt;h2&gt;Philosophy: Shot for an MVP, then refine&lt;/h2&gt;
&lt;p&gt;This idea is one that I think a lot of people say they are going to do, and then they don&#39;t. When working on a problem, it&#39;s easy to get lost in &amp;quot;What if&#39;s....&amp;quot; and do preventative work that isn&#39;t exactly necessary. Since I&#39;m a machine learning researcher, I tend to do this a lot, where I start working on something and then add some functionality or code that I don&#39;t exactly need - but could help solve a problem that I don&#39;t have yet. While it&#39;s important to keep potential problems in mind, and leave yourself enough flexibility to solve them later, it&#39;s important to not spend too much time solving problems that you don&#39;t have if you want to move fast.&lt;/p&gt;
&lt;h1&gt;Inbox Zero&lt;/h1&gt;
&lt;p&gt;This is a controversial one, but when it comes to email, I like to keep inbox zero. This means that the only things that I have in my inbox at any given time are emails that I have to respond to. When an email comes in, I archive it right away if it doesn&#39;t matter to my productivity flow. I use the &amp;quot;mute&amp;quot; function in gmail liberally, and I do my best to unsubscribe to promotional emails when I get them. My metric for unsubscribing is not a harsh one: &amp;quot;Have I ever used the content in this email?&amp;quot; If yes, then I keep them around, but it&#39;s amazing how many emails that I get fail this check.&lt;/p&gt;
&lt;h1&gt;What I Don&#39;t Use&lt;/h1&gt;
&lt;p&gt;For me, these two productivity tools are enough. I used to pay for &lt;a href=&quot;https://newtonhq.com/&quot;&gt;Newton&lt;/a&gt;, an excellent email client, however I realized that I don&#39;t spend enough time responding to emails or handling email things to use the advanced functionality. I used to use &lt;a href=&quot;https://trello.com&quot;&gt;Trello&lt;/a&gt; as well, but I never really could get moving the cards around to stick. Not only that, cards wouldn&#39;t archive automatically when they reached the end of my boards (unless I paid for a plugin), so that was right out. I used to use &lt;a href=&quot;https://toggl.com/&quot;&gt;Toggl&lt;/a&gt; for time tracking, but I realized that I don&#39;t have the patience to start and stop productivity times every time I wanted to get work done.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;I might not use many tools, but by sticking with my philosophies of getting work done, and using the tools that make sense, I&#39;m able to be rather productive - I mean hey, I managed to write a blog post three weeks in a row. That&#39;s something! I hope that this was useful to somebody - but if not, it&#39;s nice to just get some of my thoughts and philosophies down so I can point people at this later if they ever have the question &amp;quot;How are you so productive?&amp;quot;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>What&#39;s wrong with configuration management?</title>
    <link href="https://dchan.cc/tech-blogs-a-deep-dive-into-argparse/" />
    <updated>2019-08-09T00:00:00Z</updated>
    <id>https://dchan.cc/tech-blogs-a-deep-dive-into-argparse/</id>
    <content type="html">&lt;p&gt;Configuration management isn&#39;t a sexy topic. It&#39;s not AI. It&#39;s not Machine Learning. It&#39;s not the Cloud or Blockchain. But it&#39;s an essential part of what we do every day. When we write code, we always know that we will have to support multiple different functionalities, multiple &amp;quot;configurations.&amp;quot; In machine learning, this can be different hyper-parameters/optimizations, input files, produced artifacts, etc.&lt;/p&gt;
&lt;h3&gt;Why Configuration Management Is Broken&lt;/h3&gt;
&lt;p&gt;For a long time I&#39;ve thought that configuration management is broken. Current configuration tools suffer from a number of problems:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. They&#39;re one dimensional (And pretty opinionated)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Most configuration tools focus on one mode of configuration, and allow you to configure in one way). You can use the command line OR you can use a database. You can access your variables using a namespace object, or you can automatically assign them to variables in a function scope.&lt;/p&gt;
&lt;p&gt;A good configuration management tool should be able to handle many different kinds of configuration, from configuration files to command line, to even configuration from database tools, or HTML requests. Good configuration management allows you to load and combine configurations from different sources, defining priorities and defaults between these methods.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. They don&#39;t leave a trace&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have written the following line of code 1000 times:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;with open(&#39;config.json&#39;) as jf:
    json.dump(vars(args), jf)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately, this means that I have to write paired loading code for the arguments later on, and I have to worry about all of the configuring myself. This isn&#39;t exactly an appealing use of my time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. They don&#39;t scale&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When you start a project, you don&#39;t really think about scaling. You think about how quickly you can get an MVP up and running. Unfortunately, this means that a lot of the configuration tools that exist right now won&#39;t scale to larger projects, or scenarios that you never imagined would exist. Not only this, but they&#39;re inflexible when it comes to expanding it yourself. A good configuration management tool allows for expansion.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. They require too much code to use&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You shouldn&#39;t have to write hundreds of lines of code to get your code to respect your configurable variables. Configurations should be available where you need them, when you need them, without requiring a user to bend over backwards.&lt;/p&gt;
&lt;p&gt;A good configuration management tool should be invisible in your code - if something is configurable, it shouldn&#39;t require hundreds of lines of code to understand and write. It shouldn&#39;t require you to do crazy backwards magic in order to get code to run in different configurable states. A good configuration tool has a &amp;quot;magical&amp;quot; interface which gives you what you need, when you need it.&lt;/p&gt;
&lt;p&gt;A good example of an invisible configuration tool is &lt;a href=&quot;https://github.com/IDSIA/sacred&quot;&gt;Sacred&lt;/a&gt; which silently injects the value of configurable variables into your function scopes (If this sounds dangerous, you&#39;re right! it is! It&#39;s not a perfect tool, but it&#39;s just fun to use).&lt;/p&gt;
&lt;h1&gt;Designing the Perfect Configuration Tool&lt;/h1&gt;
&lt;p&gt;Over the next few weeks, I&#39;m going to be working on developing the outline of a configuration management tool. Who knows, I might even build the tool. But this is going to be an exercise in discovering the world of configuration management - and building a new tool which I can use in my everyday work which is designed to be a powerful and flexible solution to our configuration woes.&lt;/p&gt;
&lt;p&gt;From the above problems, I can already think of a set of overall design goals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Be flexible&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Seamlessly scale from small projects to large codebases&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Leave footprints&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Be &amp;quot;magical&amp;quot; to use, but safe enough to bet the farm on&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are some awesome tools out there like &lt;a href=&quot;https://docs.python.org/2/library/argparse.html&quot;&gt;argparse&lt;/a&gt;, &lt;a href=&quot;https://github.com/IDSIA/sacred&quot;&gt;Sacred&lt;/a&gt;, &lt;a href=&quot;https://github.com/rochacbruno/dynaconf&quot;&gt;dynaconf&lt;/a&gt;, &lt;a href=&quot;https://click.palletsprojects.com/en/7.x/&quot;&gt;click&lt;/a&gt;, &lt;a href=&quot;http://docopt.org/&quot;&gt;docopt&lt;/a&gt;, &lt;a href=&quot;https://github.com/google/python-gflags&quot;&gt;gflags&lt;/a&gt;, &lt;a href=&quot;https://github.com/CITGuru/PyInquirer&quot;&gt;PyInquirer&lt;/a&gt;, &lt;a href=&quot;https://pypi.org/project/clint/&quot;&gt;Clint&lt;/a&gt;, &lt;a href=&quot;https://docs.openstack.org/cliff/latest/&quot;&gt;Cliff&lt;/a&gt;, &lt;a href=&quot;https://builtoncement.com/&quot;&gt;Cement&lt;/a&gt;, &lt;a href=&quot;https://pypi.org/project/plac/&quot;&gt;Plac&lt;/a&gt;,  and many more.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Installing CUDA on Linux the Right Way (in Ubuntu &lt; 19.04)</title>
    <link href="https://dchan.cc/tech-blogs-installing-cuda-the-right-way/" />
    <updated>2018-12-15T00:00:00Z</updated>
    <id>https://dchan.cc/tech-blogs-installing-cuda-the-right-way/</id>
    <content type="html">&lt;p&gt;So, you&#39;ve got a shiny new computer, or a shiny new graphics card, and you want to install CUDA. Not only this, but you&#39;re not going to play video games with your graphics card. Maybe you want to try some of this new &amp;quot;Deep Learning&amp;quot; hype. Maybe you just want to make your code a little bit faster (There&#39;s easier ways... try the -O3 compiler command). Regardless of the reason, you need to install CUDA on your machine.&lt;/p&gt;
&lt;p&gt;For some reason, everyone that I talk to really struggles with this installation process. The reason for this is that it&#39;s not easy. It&#39;s not easy at all. Most people install CUDA with apt (and then it breaks their whole computer when they want the next version) or they try downloading the CUDA package file, and get a cryptic error about &amp;quot;X-Windows.&amp;quot; In this tutorial, I&#39;m going to walk you through the right way to download and install CUDA on your Linux box, in a way that&#39;s not so scary, and will actually make sense later when you want to go upgrade to the next version. So let&#39;s begin!&lt;/p&gt;
&lt;h2&gt;1. Read the Tutorial&lt;/h2&gt;
&lt;p&gt;Most people fail this step. They think to themselves that they really just need to skip ahead to the commands. They&#39;re not wrong. You can probably do everything in this tutorial without reading it. But it won&#39;t make you happy. I promise.&lt;/p&gt;
&lt;h2&gt;2. Installing the NVIDIA drivers&lt;/h2&gt;
&lt;p&gt;There is one prerequisite step to installing CUDA, and that&#39;s making sure that you have the latest NVIDIA drivers. This is actually a separate step to the CUDA installation that we&#39;re going to do below, since it&#39;s useful to know how to install the drivers on your own. Not only this, but installing the drivers is one of the more challenging things that you have to do.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note: As of Ubuntu version 19.04, it is no longer necessary to obtain the CUDA drivers. They should already be pre-installed. If you need to update the drivers, you should do so by using your package manager.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The first thing to do is obtain the right Runfile for your GPU and Linux version. Go here: &lt;a href=&quot;https://www.nvidia.com/Download/index.aspx?lang=en-us&quot;&gt;https://www.nvidia.com/Download/index.aspx?lang=en-us&lt;/a&gt; and use the manual search to select your GPU version, and the Linux version that you&#39;re using (Usually the system box is Linux 64-bit, unless you have something special, and if you have something that special, you&#39;re probably not in need of this tutorial).
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image.png&quot; alt=&quot;&quot;&gt;
Clicking on &amp;quot;Start Search&amp;quot; will give us the driver download link:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-1.png&quot; alt=&quot;&quot;&gt;
Agree to the TOS, and download. Or don&#39;t agree to the TOS, and give up.
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-2.png&quot; alt=&quot;&quot;&gt;
This will download a file, appropriately named &lt;code&gt;NVIDA-Linux-&amp;lt;system&amp;gt;-&amp;lt;version&amp;gt;.run&lt;/code&gt;. This file is the one that you&#39;re going to use. If you&#39;re installing on a remote machine, or don&#39;t have direct access. Right click on the Download button, and copy the link. You can then use wget:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;wget &amp;lt;copied link&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;to get the file on the remote machine.&lt;/p&gt;
&lt;p&gt;Now that we have the file we need, we need to install the drivers. Open up a terminal (&lt;code&gt;Ctrl+Alt+T&lt;/code&gt; on Ubuntu), and navigate to your downloads folder. If you don&#39;t know how to use the terminal, I suggest a crash course: &lt;a href=&quot;https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/&quot;&gt;https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Running &lt;code&gt;chmod +x NVIDA-Linux-&amp;lt;system&amp;gt;-&amp;lt;version&amp;gt;.run&lt;/code&gt; replacing the &lt;system&gt; and &lt;version&gt; options will make this file executable. If you try to run this file as is, you&#39;re going to get a myriad of issues. One, for example, might be this one:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-3.png&quot; alt=&quot;&quot;&gt;
Most people give up here, and try to google a tutorial. But if we read these errors, they&#39;re actually pretty insightful. This one says that I&#39;m already using my NVIDIA driver, and that it has to not be in use before we can upgrade it.&lt;/version&gt;&lt;/system&gt;&lt;/p&gt;
&lt;p&gt;To deal with these issues, we&#39;re going to have to do something a little bit unique. It&#39;s at this point that you want to open this tutorial up on your phone, or another mobile device. We&#39;re going to be working in a TTY session for the remainder of this install, which means that you won&#39;t have access to your internet browser. The reason that we have to enter a TTY session is that we&#39;re going to have to kill the X-server which runs the GUI. This means that we can&#39;t be using any of the fancy graphical features of the OS.&lt;/p&gt;
&lt;p&gt;Now that you&#39;re on mobile - reboot your computer. When you get to the login screen, if you&#39;re on Ubuntu 17.10 or newer, you want to enter a TTY session by pressing &lt;code&gt;Ctrl+Alt+F3&lt;/code&gt;. If you&#39;re on an older version of Ubuntu, you can use &lt;code&gt;Ctrl+Alt+F1&lt;/code&gt;. If you&#39;re on RHEL, you&#39;re going to want &lt;code&gt;Ctrl+Alt+F2&lt;/code&gt;. If you&#39;re on Centos, it&#39;s another F-key. Basically, all of the F-keys map to TTY sessions (you can read about them more here: &lt;a href=&quot;https://askubuntu.com/questions/66195/what-is-a-tty-and-how-do-i-access-a-tty&quot;&gt;https://askubuntu.com/questions/66195/what-is-a-tty-and-how-do-i-access-a-tty&lt;/a&gt;). You&#39;ll know you&#39;ve entered the TTY session when your screen goes dark, and you&#39;re greeted by a login prompt. You can login here. On Ubuntu, it looks like this:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-4.png&quot; alt=&quot;&quot;&gt;
Now that we&#39;re in a TTY, it acts just like a terminal. The first thing that we&#39;re going to want to do is kill the X-server. In the newer versions of Ubuntu, this can be done by running&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo service lightdm stop&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If this doesn&#39;t work - it&#39;s possible that you have a different display manager. You can try killing GDM with:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo service gdm stop&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Most modern distributions of Ubuntu use one of these two X-server managers. If neither of these commands works, then it&#39;s time to find which X-server/window manager your distribution is using and kill that. I won&#39;t go into how to do this, but I suspect that if you&#39;re not using Ubuntu, you have at least a bit of Google-Fu.&lt;/p&gt;
&lt;p&gt;Now that we&#39;re here, we can change to the directory of the downloaded Runfile. We can then execute the file:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo ./NVIDIA-Linux-&amp;lt;system&amp;gt;-&amp;lt;version&amp;gt;.run&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you haven&#39;t killed your X-server properly, you&#39;re going to get the following error:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-5.png&quot; alt=&quot;&quot;&gt;
Make sure that you&#39;re in a TTY, and that you have killed the X-server which is running your GUI. I often get the following error:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-6.png&quot; alt=&quot;&quot;&gt;
I&#39;ve never actually had an issue with this - it&#39;s safe to continue the installation. If you have DKMS, you&#39;ll be gifted the following screen:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-7.png&quot; alt=&quot;&quot;&gt;
It&#39;s up to you, but I like to put &amp;quot;Yes&amp;quot; for this. This means that if I rebuild my kernel, I probably won&#39;t have to fix the NVIDIA drivers. The next window prompts:&lt;/p&gt;
&lt;p&gt;I like saying yes... But if you&#39;re never going to use them, why bother? After pressing Yes or No here, the screen may freeze for a moment, but then it will enter the installation phase. This phase usually take a minute or two, and then you&#39;ll have a working install of the NVIDIA drivers. The next window is:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-9.png&quot; alt=&quot;&quot;&gt;
I put yes here. And you probably should as well. When you press &amp;quot;Yes&amp;quot;, your system will now have brand new NVIDIA drivers. Reboot your machine, and everything should be set up properly!&lt;/p&gt;
&lt;h3&gt;A sometimes possible error (Login Loop)&lt;/h3&gt;
&lt;p&gt;Sometimes, when you install the NVIDIA drivers and restart your computer, you won&#39;t be able to login with the GUI. It will look like it&#39;s logging in, but it doesn&#39;t, and you get returned to the login screen. This is a problem with the X-Configuration, and it&#39;s relatively easy to fix. Just open a TTY session, and reinstall the NVIDIA drivers. This has always fixed it for me!&lt;/p&gt;
&lt;h2&gt;Validating your Driver Installation&lt;/h2&gt;
&lt;p&gt;You can validate that everything is set up properly by running &lt;code&gt;nvidia-smi&lt;/code&gt;, which should, if the drivers are working, give you a screen similar to the following:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-10.png&quot; alt=&quot;&quot;&gt;
The version is clearly specified, and your GPUs should show up. If your GPUs don&#39;t show up, then there&#39;s an issue with the GPU connecting to the program. If you get the warning &amp;quot;nvidia-smi not found&amp;quot;, you can run the command:&lt;/p&gt;
&lt;p&gt;modinfo nvidia&lt;/p&gt;
&lt;p&gt;Which should give something similar to:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-11.png&quot; alt=&quot;&quot;&gt;
If neither of these commands work, then the drivers have not installed correctly. Try reinstalling the drivers using the above steps. If it&#39;s still not working after that, it&#39;s time to get out the phone, and dial NVIDIA customer support at 1-(800) 797-6530.&lt;/p&gt;
&lt;h2&gt;2. Obtain the latest CUDA version&lt;/h2&gt;
&lt;p&gt;The first thing that we have to do is obtain the latest version of CUDA from *gasp &lt;strong&gt;*the internet***&lt;/strong&gt;. **Shocking. I know. You&#39;re going to want to go here: &lt;a href=&quot;https://developer.nvidia.com/cuda-downloads&quot;&gt;https://developer.nvidia.com/cuda-downloads&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;**Note: (As of 6/14/2019) Tensorflow does not support the latest version of CUDA. You can get version 10.0, which is supported from here: **&lt;a href=&quot;https://developer.nvidia.com/cuda-10.0-download-archive&quot;&gt;https://developer.nvidia.com/cuda-10.0-download-archive&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once you&#39;re on that page, you need to obtain the &amp;quot;&lt;strong&gt;runfile&lt;/strong&gt;&amp;quot;for your distribution. On my computer, I fill out the form like so:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-12.png&quot; alt=&quot;&quot;&gt;
If you&#39;re using a different distribution, you want to follow the instructions for your distribution. There is always a &amp;quot;Runfile (local)&amp;quot; option, and that is the one that we want. It&#39;s always tempting to download the .deb files (if you&#39;re on Ubuntu), but this will always bring you pain. If you&#39;re on a non-LTS version of Ubuntu, your distribution may not show up here. That&#39;s ok. You want to pick the version which is closest to yours. For example, if you&#39;re on 17.10, the 18.04 version should work fine.&lt;/p&gt;
&lt;p&gt;We then want to click the download link here:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-13.png&quot; alt=&quot;&quot;&gt;
This will download the latest version of CUDA. If you&#39;re on a remote machine, you can once again right click the download link, and click &amp;quot;save link address&amp;quot;. Then, it&#39;s as simple as using wget to download the file:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;wget &amp;lt;copied link&amp;gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;(In my case, this looked like: &lt;code&gt;wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux&lt;/code&gt; )&lt;/p&gt;
&lt;p&gt;Now that we have the latest version of CUDA downloaded, open a normal terminal. This time, we don&#39;t have to bother with the TTY session, and we can just use a normal terminal. Change directory to the location where you&#39;ve downloaded the Runfile, and run the command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo sh &amp;lt;downloaded file&amp;gt;&lt;/code&gt; (Once again, to me it looked like: &lt;code&gt;sudo sh cuda_10.0.130_410.48_linux.run&lt;/code&gt;)&lt;/p&gt;
&lt;p&gt;If you get an error about &amp;quot;This file is not executable&amp;quot;, all you have to do is run the command &lt;code&gt;chmod +x &amp;lt;downloaded file&amp;gt;&lt;/code&gt; and that should fix the issues that you&#39;re having. At this point, it really is as simple as following the command-line prompts. The first screen you get is this:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-14.png&quot; alt=&quot;&quot;&gt;
Scroll down using the Down Arrow / Space Key and accept the TOS by typing &amp;quot;accept&amp;quot; at the end and pressing enter:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-15.png&quot; alt=&quot;&quot;&gt;
The next prompt asks us if we want to install the graphics driver. We&#39;ve already done that, so it&#39;s the right choice to say &amp;quot;No&amp;quot;:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-16.png&quot; alt=&quot;&quot;&gt;
The next prompt asks if we want to install the CUDA toolkit. The answer is probably yes, if you&#39;ve made it this far in the tutorial:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-17.png&quot; alt=&quot;&quot;&gt;
Putting the CUDA toolkit in the default location is a good choice, just hit enter to continue past this prompt with the default (unless you really want to put it somewhere else, and you know what you&#39;re doing):
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-18.png&quot; alt=&quot;&quot;&gt;
The next step is really cool (Oh, and you want to say yes):
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-19.png&quot; alt=&quot;&quot;&gt;
Because it&#39;s possible to keep multiple versions of CUDA on your computer, you can have a &amp;quot;system&amp;quot; CUDA version by linking against /usr/local/cuda, and keeping that symbolic link up to date. When the next version of CUDA comes out, you can update the symbolic link, but keep the old version around for compatibility.  I always say yes to this - it makes life easier in the future.&lt;/p&gt;
&lt;p&gt;The next step is this:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-20.png&quot; alt=&quot;&quot;&gt;
If you want to install the samples, go for it. I usually don&#39;t - but if it&#39;s your first time using CUDA, you might want them to start playing around with the toolkit.&lt;/p&gt;
&lt;p&gt;Finishing this step will install the CUDA toolkit in the chosen directory. Often, you might get the following warning:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-21.png&quot; alt=&quot;&quot;&gt;
Don&#39;t worry about this. We&#39;ve already installed the driver, so we&#39;re good. **We&#39;re not quite done yet though! **To actually use the toolkit, we want to do two things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add the new installation to your PATH. Open your ~/.bashrc file (or other system profile configuration file) and add the command:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;export PATH=$PATH:/usr/local/cuda/bin&lt;/code&gt;&lt;/p&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;Add the new installation to your LD_LIBRARY_PATH. Open your ~/.bashrc file again, and add:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Both of the above steps you&#39;ll only ever have to do once. The first allows you to run the CUDA binaries such as &lt;code&gt;nvcc&lt;/code&gt; and &lt;code&gt;nvidida-smi&lt;/code&gt; without the full path. The second, allows you to link against the CUDA runtime libraries. If you don&#39;t understand either of those previous sentences, that&#39;s ok.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Restart your computer&lt;/strong&gt;, and you&#39;ll finally have a working installation of the CUDA libraries and NVIDIA drivers. Running&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nvcc --version&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Will validate your installation. If you get errors here, this means that there was a problem installing the drivers or the CUDA libraries. The error itself will be informative. Googling the error is probably the best way to go from here, because there&#39;s a lot of things that could happen, and there&#39;s a lot of smart people on the internet who have likely already solved the problem.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A (possible) issue:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Command &#39;nvcc&#39; not found&lt;/code&gt; : This means that you haven&#39;t installed the CUDA toolkit right. The &lt;em&gt;most likely&lt;/em&gt; issue is that you didn&#39;t export your PATH variable correctly. Make sure you do this, and then restart your computer (or run &lt;code&gt;source ~/.bashrc&lt;/code&gt;). Also make sure that &lt;code&gt;/usr/local/cuda/bin/nvcc&lt;/code&gt; exists. If it doesn&#39;t, this is a much deeper problem.&lt;/p&gt;
&lt;h2&gt;3. You&#39;re Done!&lt;/h2&gt;
&lt;p&gt;Congrats! You now have a brand new installation of CUDA and the associated NVIDIA drivers! You can compile CUDA code. You can run &lt;code&gt;pip install tensorflow-gpu&lt;/code&gt;. You can do what you will with this newfound parallel computation power!&lt;/p&gt;
&lt;p&gt;For some more resources on what to do with CUDA, check out NVIDIA&#39;s website:&lt;a href=&quot;https://developer.nvidia.com/cuda-toolkit&quot;&gt;https://developer.nvidia.com/cuda-toolkit&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;3.5 [Bonus] Installing cuDNN&lt;/h2&gt;
&lt;p&gt;If you&#39;re like me, and you want to train deep neural networks with your GPU, you&#39;re going to need cuDNN, NVIDIA&#39;s DNN library. Luckily, it&#39;s much easier to install than the other counterparts.&lt;/p&gt;
&lt;p&gt;You can download the installation here: &lt;a href=&quot;https://developer.nvidia.com/cudnn&quot;&gt;https://developer.nvidia.com/cudnn&lt;/a&gt;. Unfortunately, you&#39;re going to have to register as an NVIDIA developer to download this software. Once you do that, you can download the software.
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-22.png&quot; alt=&quot;&quot;&gt;
Make sure you get the cuDNN Library for Linux. Using the .deb files is, once again, a landmine of danger.&lt;/p&gt;
&lt;p&gt;This will download a &amp;quot;.tgz&amp;quot; file: &lt;code&gt;cudnn-&amp;lt;version&amp;gt;-linux.tgz&lt;/code&gt;. We can unzip this file using the command: &lt;code&gt;tar -zxvf cudnn-&amp;lt;version&amp;gt;-linux.tgz&lt;/code&gt;. This will extract to a &amp;quot;cuda&amp;quot; folder:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-23.png&quot; alt=&quot;&quot;&gt;
The CUDA folder mirrors the installation at &lt;code&gt;/usr/local/cuda&lt;/code&gt; or wherever you installed CUDA in the previous section. Basically, we&#39;re just going to have to move all of the files from this folder to the right places in the CUDA directory:
&lt;img src=&quot;https://dchan.cc/assets/images/2022/05/image-24.png&quot; alt=&quot;&quot;&gt;
The following commands can do this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo mv cuda/include/* /usr/local/cuda/include/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo mv cuda/lib64/* /usr/local/cuda/lib64/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo mv cuda/NVIDIA_SLA_cuDNN_Support.txt /usr/local/cuda/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Though really the third one is just for posterity&#39;s sake. There&#39;s no real reason to do that. Congrats! You have now installed cuDNN, and can deep-learn to your heart&#39;s content.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>On Timely Feedback During Test Taking</title>
    <link href="https://dchan.cc/timely-feedback/" />
    <updated>2018-10-26T00:00:00Z</updated>
    <id>https://dchan.cc/timely-feedback/</id>
    <content type="html">&lt;p&gt;We&#39;ve all been there. You go in, take a test, and then wait for the results. And wait. And wait. And eventually, a month or two later when you&#39;ve completely forgotten about the test, and you&#39;ve started to move on with your life, the results come back. We&#39;ve all had professors like this.... But is it a good thing?
This is certainly a common phenomenon for many college and high school students, and for somebody like me, who has a terrible case of test anxiety, it turns my life into something of a living hell. So I got thinking. Is there a reason that people might do this beyond the obvious case of &amp;quot;I don&#39;t want to grade 40 papers tonight, I&#39;ll do it tomorrow&amp;quot;? Is there perhaps some benefit to delayed feedback that we, as test-anxious students might be missing?&lt;/p&gt;
&lt;p&gt;So I started, of course, by googling the problem at hand. &amp;quot;Is timely feedback necessary for students?&amp;quot; And the answers were discouraging for our tardy professors. One site remarked: &lt;em&gt;Research has shown that the sooner students receive feedback after submitting work the more effective it is for their learning.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Ok, I thought. What research? They provided a link to [1], a paper which I was able to find, and read. The only mention in this paper, however, of the necessity of timely feedback was a reference to another paper, [2]. So, like any good researcher would do, I found that paper, and read that one as well, but they didn&#39;t really have a lot to say about the problem of instant feedback. In fact, they mentioned the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For ... feedback to be effective it needs to be provided early in the learning process (Brown &amp;amp; Knight 1994) and give guidance for improving performance (William &amp;amp; Black 1996, p. 543).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ok. So two more references. But one of the interesting things to note about this statement is that it came with respect to &amp;quot;Web-Based&amp;quot; courses, and the &amp;quot;Test and rapidly retake&amp;quot; methodology. So really, there&#39;s nothing here about how instant feedback really helps students, just a few claims that it needs to be provided early in the learning process, and a few references.&lt;/p&gt;
&lt;p&gt;So, given the breadcrumbs that we have, let&#39;s follow them - starting with Brown _et al. _[3]. This work has a more promising title: &amp;quot;*Assessing learners in higher education&amp;quot; *but it&#39;s longer. A lot longer. Actually it&#39;s a book. Not only is a book, the google books preview had a promising chapter title: &amp;quot;Chapter 8: Speedier Assessment.&amp;quot;&lt;/p&gt;
&lt;p&gt;Unfortunately, I wanted to write this blog post tonight, and it&#39;s in UCB&#39;s NRLF storage facility. Which means I probably couldn&#39;t get my hands on it until Monday. Thus, we&#39;ll have to do without.&lt;/p&gt;
&lt;p&gt;Let&#39;s turn to the William &amp;amp; Black article [4], &amp;quot;Meanings and Consequences: A Basis for Distinguishing Formative and Summative Functions of Assessment?&amp;quot; With a title like that, how could it not be delightful? It turns out there&#39;s nothing here. Well, there is, but it&#39;s not that helpful - all it says is that feedback should be useful for improving performance. Nothing at all about timeliness.&lt;/p&gt;
&lt;p&gt;Thus, we return once again to the original google search. There&#39;s plenty of opinion out there:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Feedback should be within 24 to 48 hours. This idea seems overwhelming for a teacher who sees 150 to 200 students in a day. But if students wait too long for feedback, they risk losing the context for the valued learning of the work. Strive to attain this response time as a goal, not a policy. With diligence, successes will happen when students need them most.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(That one is from: &lt;a href=&quot;https://www.edutopia.org/blog/timely-feedback-now-or-never-john-mccarthy&quot;&gt;https://www.edutopia.org/blog/timely-feedback-now-or-never-john-mccarthy&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Or&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In most cases, the sooner I get feedback, the better. I don&#39;t want to wait for hours or days to find out whether my students were attentive and whether they learned, or which part of my written story works and which part doesn&#39;t. I say &amp;quot;in most cases&amp;quot; to allow for situations like playing a piano piece in a recital. I don&#39;t want my teacher or the audience barking out feedback as I perform. That&#39;s why it is more precise to say that good feedback is &amp;quot;timely&amp;quot; rather than &amp;quot;immediate.&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(This one is from: &lt;a href=&quot;http://www.ascd.org/publications/educational-leadership/sept12/vol70/num01/Seven-Keys-to-Effective-Feedback.aspx&quot;&gt;http://www.ascd.org/publications/educational-leadership/sept12/vol70/num01/Seven-Keys-to-Effective-Feedback.aspx&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;But really, it&#39;s difficult to find anything that&#39;s not based on opinion. Eventually, I found something:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Appropriate and timely feedback was considered to be the weakest area for more than 40% of Business institutions, with feedback noted as being provided too late to be useful. This was only a minor point across the Art &amp;amp; Design institutions, because of their tradition of oral feedback through tutorials (QAA, 2000).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This paper [4] referenced [5], the UK quality assessment in education. But it was our first real set of results. In business institutions in the UK in 2000, it was a problem. However in Art programs at the same time, it was less of an issue *but only because other feedback was provided earlier. *While it&#39;s too early to quit, I think we may finally be on the right track.&lt;/p&gt;
&lt;p&gt;And then finally, I found something. &amp;quot;Timing Matters: The Impact of Immediate and Delayed Feedback on Artificial Language Learning&amp;quot; [6]. In this experiment, they taught two grammars, however one group received immediate feedback when they answered questions, while another received a 1s delay. Unfortunately, there&#39;s an issue with this. When you get test results back, it&#39;s usually much longer than a single second of delay - and nothing is immediate (barring modern web results). Further, it seems like theres another claim to consider:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;However, feedback that&#39;s &lt;em&gt;too&lt;/em&gt; immediate may cause students to rely on teachers for answers rather than persevering and figuring out problems on their own (Bangert-Drowns, Kulik, Kulik, &amp;amp; Morgan, 1991).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hmm. Perhaps some counter-evidence? In their paper &amp;quot;The Instructional Effect of Feedback in Test-Like Events&amp;quot; [7] they reference another meta-review [8]. Finally - gold. In this meta-review of &lt;strong&gt;53 studies&lt;/strong&gt;, they split the set of studies into three varieties:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Applied studies&lt;/strong&gt; measured learning on criterion examinations made up of items different from those used as learning material.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Experiments on Acquisition of Test Content&lt;/strong&gt; used criterion measures made up of items identical to those used as learning material.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List-Learning Experiments&lt;/strong&gt; used number of trials to acquisition or number of errors made during those trials as a criterion of learning.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In applied studies, immediate feedback was usually superior to delayed feedback (average effect size = 0.28).&lt;/li&gt;
&lt;li&gt;In experiments on acquisition of test content, however, immediate feedback was almost always inferior to delayed feedback (average effect size = -0.36)&lt;/li&gt;
&lt;li&gt;In list-learning experiments, effects of immediate feedback were moderately positive (average effect size = 0.34) but highly variable.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In more detail, for &lt;strong&gt;Applied Studies:&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Nine of the 11 studies of this type found that students achieved more in classrooms where they received immediate rather than delayed feedback. In 4 of these 9 studies, the difference in achievement with immediate versus delayed quiz feedback was reported to be significant. In 2 of the 11 classroom evaluations, examination performance was better when students were taught with delayed feedback, but the gain associated with delayed feedback was not statistically significant.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yet, when we are working with learning content, in &lt;strong&gt;Acquisition&lt;/strong&gt; we find that:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The 14 studies using this type of measure produced fairly consistent results. In 13 studies, students who received immediate feedback performed less well than did those who received delayed feedback, and in 7 of these studies the result was reported to be statistically significant. In 1 study, students performed better with immediate feedback, and the result was reported to be statistically significant.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hunh. So maybe it is possible that delayed feedback helps some in certain scenarios. In addition, there&#39;s some more surprising results:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Results on follow-up tests were consistent with results on the original measures of learning. The average effect size in the eight studies that used a follow-up measure was -0.44. That means that in the average study &lt;strong&gt;retention scores&lt;/strong&gt; of those receiving immediate feedback were 0.44 standard deviations lower than the retention scores of those receiving delayed feedback.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yet, there&#39;s something to note: **These were measures administered between 5 and 7 days after the original criterion measures were administered. ** 5-7 days seems to be helpful. Yet, what about longer than that? What about an entire semester?&lt;/p&gt;
&lt;p&gt;It is from here that I wasn&#39;t able to find too many studies testing these effects. The closest I got was a figure from [7] where the columns go: Criterion, Number of Studies, Mean Effect, Standard Deviation of Effect
What this says is that the effect of the four studies that returned criterion in greater than a week showed decreasing mean effect of feedback on performance. This is keeping with the common opinion that the longer you keep the feedback, the less useful it becomes.&lt;/p&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;So, after all this, what do those professors have to say for themselves? If you haven&#39;t gotten feedback all semester, you&#39;re probably in the scientific right - feedback is important, and every study makes that clear. But if you&#39;re upset about waiting a few hours, or a few days, &lt;strong&gt;science says be patient&lt;/strong&gt;, the professor might not be lazy after all! Just encouraging you to get higher scores on your next exam :)&lt;/p&gt;
&lt;h4&gt;References&lt;/h4&gt;
&lt;p&gt;[1] Irons, Alastair. &lt;em&gt;Enhancing learning through formative assessment and feedback&lt;/em&gt;. Routledge, 2007.APA&lt;/p&gt;
&lt;p&gt;[2] Wang, Kua Hua, et al. &amp;quot;Learning styles and formative assessment strategy: enhancing student achievement in Web‐based learning.&amp;quot; &lt;em&gt;Journal of Computer Assisted Learning&lt;/em&gt; 22.3 (2006): 207-217.&lt;/p&gt;
&lt;p&gt;[3] Brown, Sally, and Peter Knight. &lt;em&gt;Assessing learners in higher education&lt;/em&gt;. Routledge, 2012.&lt;/p&gt;
&lt;p&gt;[4] Melanie R. Weaver (2006) &lt;em&gt;Do students value feedback? Student perceptions of tutors&#39; written responses, Assessment &amp;amp; Evaluation in Higher Education&lt;/em&gt;, 31:3, 379-394, DOI: 10.1080/02602930500353061&lt;/p&gt;
&lt;p&gt;[5] Quality Assurance Agency (QAA) (2000) &lt;em&gt;Code of practice for the assurance of academic quality and standards of higher education. Section 6: Assessment of students.&lt;/em&gt; Available online at: http:// www.qaa.ac.uk/public/cop/ copaosfinal/COP_AOS.pdf (accessed June 2003).&lt;/p&gt;
&lt;p&gt;[6] Opitz, Bertram, Nicola K. Ferdinand, and Axel Mecklinger. &amp;quot;Timing matters: the impact of immediate and delayed feedback on artificial language learning.&amp;quot; &lt;em&gt;Frontiers in human neuroscience&lt;/em&gt; 5 (2011): 8.&lt;/p&gt;
&lt;p&gt;[7] Bangert-Drowns, Robert L., et al. &amp;quot;The instructional effect of feedback in test-like events.&amp;quot; &lt;em&gt;Review of educational research&lt;/em&gt;61.2 (1991): 213-238.&lt;/p&gt;
&lt;p&gt;[8] Kulik, James A., and Chen-Lin C. Kulik. &amp;quot;Timing of feedback and verbal learning.&amp;quot; &lt;em&gt;Review of educational research&lt;/em&gt; 58.1 (1988): 79-97.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Why do today, what you can do tomorrow?</title>
    <link href="https://dchan.cc/procrastination-is-awesome/" />
    <updated>2018-08-31T00:00:00Z</updated>
    <id>https://dchan.cc/procrastination-is-awesome/</id>
    <content type="html">&lt;p&gt;So, I&#39;ve learned something about writing regular blog posts. I suck at it. So much so that I&#39;ve gone three weeks without something notable to talk about. Not that I&#39;ve been lacking for ideas of course - I just have thought to myself every day that &amp;quot;Oh, I can just do it tomorrow!&amp;quot; Well, that turns out to be the wrong mentality, and leads to an endless amount of procrastination.&lt;/p&gt;
&lt;p&gt;So this &amp;quot;Procrastination&amp;quot; thing... It&#39;s something that happens to everyone I think. Well, at least there&#39;s enough memes on the internet to suggest that it&#39;s a serious problem...&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://media.self.com/photos/57d8ba8d50778cef321a58e2/master/w_752,c_limit/procrastination-meme.jpg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Yup. That&#39;s one.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://blog.qsample.com/wp-content/uploads/2016/04/procrastination-meme.jpg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;Oh look! Another one!&lt;/p&gt;
&lt;p&gt;From what I know about getting work done, everybody shares just a bit of being lazy. But what is it that brings on this procrastination? Why is it that we take one look at that assignment that&#39;s due - or that large research paper that we should be writing and think to ourselves &amp;quot;Eh, I&#39;ll do it tomorrow&amp;quot;?&lt;/p&gt;
&lt;p&gt;A quick google search brings up an article from Psychology Today, listing the top five reasons that people procrastinate:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The absence of structure&lt;/li&gt;
&lt;li&gt;Unpleasant tasks&lt;/li&gt;
&lt;li&gt;Timing&lt;/li&gt;
&lt;li&gt;Anxiety&lt;/li&gt;
&lt;li&gt;Self-Confidence&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Each one of these truly insightful bullet points is backed up by significant research - which talks about how (and why) it&#39;s in our brains to say &amp;quot;Let&#39;s just wait a bit longer.&amp;quot; And while these are good points - I think that there&#39;s something missing. Many of my projects do have structure, deadlines, and direction. Many I&#39;m excited about, and want to work on! They all have immediate rewards, aren&#39;t particularly difficult, and I sure as heck don&#39;t have anxiety or self-confidence issues about doing my homework. So what is it? More google is necessary.&lt;/p&gt;
&lt;p&gt;And I&#39;ve found it. In the Forbes article &amp;quot;Why do we procrastinate&amp;quot; it says:&lt;/p&gt;
&lt;h1&gt;Laziness&lt;/h1&gt;
&lt;p&gt;Yep. That&#39;s it. I&#39;m lazy. But wait - then why do I procrastinate by, say, cleaning my bedroom, or learning about things on the internet? I wouldn&#39;t call that (precisely) the behavior of a lazy individual...&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.memecdn.com/i-amp-039-m-not-lazy-i-amp-039-m-just-on-amp-quot-energy-saver-amp-quot-mode_o_2503297.jpg&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;I think that for me, the root of my procrastination has to do with what I&#39;m feeling like working on at any given time period. Some days, I just feel like it&#39;s exciting to work on one project, and less exciting to work on others. My interests drift from one project to another. &lt;em&gt;My interests aren&#39;t constant&lt;/em&gt;. Thus, I believe that my procrastination is rooted in my &lt;strong&gt;fleeting&lt;/strong&gt; ability to be interested in whatever I&#39;m working on. Hence - why I always have so many projects I&#39;m working on.&lt;/p&gt;
&lt;p&gt;While having a large number of projects can be fun, and certainly has the ability to be engaging (&amp;quot;Oh, don&#39;t want to work on this today? Let&#39;s work on that instead!&amp;quot; my brain might say), it can sometimes be much more of a curse than a blessing. With so many projects, you&#39;re often left juggling too many tasks, or too many ideas.&lt;/p&gt;
&lt;p&gt;Ian Somerhalder, the writer of Lost (and the Vampire Diaries) said once:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I kind of think too much, I try to do too many things at once.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That&#39;s the risk that you run when working on so many projects - trying to keep that many irons in the fire so that you&#39;re ready to strike with the right one when it gets hot (Yes, I think that metaphor was a bit of an over-extension as well).&lt;/p&gt;
&lt;p&gt;So how do I deal with this added stress of having too many projects - so that I can find something to work on when I don&#39;t want to do anything? &lt;strong&gt;I use a todo list&lt;/strong&gt;. Well, it&#39;s a bit more than that. What I do is I try to reduce my cognitive load - the things that I&#39;m carrying around in my head at any given time to the things at hand. I keep notes (hundreds of sticky notes) on every thought that I have, so the paper can remember for me what I certainly wouldn&#39;t be able to juggle on my own. For me, my calendar and numerous trello boards filled with cards, my todoist lists and sticky notes, my pages of sketches and handwritten notes, and even some random text files with ideas serve to be a place where I can put my memory when it&#39;s not in use.&lt;/p&gt;
&lt;p&gt;And for the most part, it works.&lt;/p&gt;
&lt;p&gt;It&#39;s been a long time since I&#39;ve felt stress about having too many projects going. I can&#39;t imagine a world in which I don&#39;t have something that I could be working on that I enjoy. These days, I find that often I have to force myself away from a project that I&#39;m excited about to work on something that is less exciting (because it&#39;s due the next day, or is more &lt;em&gt;academically interesting&lt;/em&gt;). I find myself waking up earlier, more excited for the day because there&#39;s something that I&#39;ve always wanted to work on at the top of my todo list for the day. That&#39;s planning for you. Always have something fun to do.&lt;/p&gt;
&lt;p&gt;Some people might, and probably will, say that this is too optimistic a view of how you can live your life. These people might say &amp;quot;You can&#39;t possibly always be excited about doing things&amp;quot; or &amp;quot;Isn&#39;t there anything that you aren&#39;t excited to do! Some tasks are unpleasant.&amp;quot; And they&#39;re right. There are unpleasant tasks. There are tasks that make me anxious, where I don&#39;t have self-confidence, where there might be an absence of structure, or time might prevent me from doing other things. These things happen. But if you find these tasks happen one day out of 10, if you can devote just an hour each day to doing these things, and keep on keeping on, then you&#39;ll be fine. It all just works itself out (with a bit of work on your part). And you can get back to the things that you enjoy about life.&lt;/p&gt;
&lt;p&gt;So then, we must ask the question: Why haven&#39;t I written a blog post in three weeks? And why is it that we now get some crappy writing about procrastination, and keeping a todo list?&lt;/p&gt;
&lt;p&gt;Well, it&#39;s my blog. I can write whatever sappy heartfelt ode to todo lists that I like. And I finally had something that I wanted to say - today, writing a blog post seemed like fun, it didn&#39;t feel like a chore - it felt like something that I wanted to do. So I did it. And why not?&lt;/p&gt;
</content>
  </entry>
</feed>