<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>TIM GITTOS - graphics and artificial intelligence geek</title>
 <link href="http://www.timgittos.com/atom.xml" rel="self"/>
 <link href="http://www.timgittos.com/"/>
 <updated>2016-08-17T21:54:18-07:00</updated>
 <id>http://www.timgittos.com/</id>
 <author>
   <name>Tim Gittos</name>
   <email>info@timgittos.com</email>
 </author>
 
 
 <entry>
   <title>Getting Started with VR</title>
   <link href="http://www.timgittos.com/blog/getting-started-with-vr"/>
   <updated>2016-04-19T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/getting-started-with-vr</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve had my Oculus Rift CV1 for a few weeks now and I&amp;#8217;ve been having fun playing the available content, and having even more fun showing other people around in VR. I can&amp;#8217;t help but feel that a lot of these experiences are fairly shallow though. Eve Valkyrie is a great dogfighter, but that&amp;#8217;s all it is (yes, I have Elite Dangerous, if I ever manage to figure out the controlls). Lucky&amp;#8217;s Tale is a fun little platformer, though I can only do one level before I get bored and have to quit. Other than those 3 titles, there&amp;#8217;s not much compelling content for me on VR right now, at least until other developers start to release content.&lt;/p&gt;
&lt;p&gt;Not being one to complain about a situation and not make any efforts to fix it, I am itching to do some developent for VR. I have a few ideas kicking around, virtual tabletop gaming, cockpit based games (mechs, space ships, etc) and a 3rd person game are among some of the ideas I have. The only problem is that I&amp;#8217;m not a game developer &amp;#8211; I have written one game in C++ that was an ugly clone of Pong. No 3D, nothing polished and nothing with a deep game. It&amp;#8217;s safe to say that there&amp;#8217;s a lot I have to learn.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m starting with one of my stronger interests, computer graphics. I&amp;#8217;m currently running myself through the content at &lt;a href=&quot;http://learnopengl.com&quot;&gt;learnopengl.com&lt;/a&gt; in the attempt to get a handle on how OpenGL works, and sharpen up my terrible C++ skills, as well as aquaint myself with CMake. This is going well, and I&amp;#8217;m currently working my way through the basic shading chapters. There&amp;#8217;s a lot of content to cover and it&amp;#8217;s going to take some time. Once I grok OpenGL and have a little more hands on experience with C++ and graphics programming, I&amp;#8217;ll look into working in Unity or UE 4. I know that seems kind of backwards, but I can&amp;#8217;t work with a tool or library if I don&amp;#8217;t understand the fundamentals it&amp;#8217;s built on.&lt;/p&gt;
&lt;p&gt;As I work my way toward my goal, I will post about my experience, mostly for my own benefit, though anyone who is interested is welcome to follow along.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>I Made A Thing - Notebook Edition</title>
   <link href="http://www.timgittos.com/blog/i-made-a-thing-notebook-edition"/>
   <updated>2015-08-13T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/i-made-a-thing-notebook-edition</id>
   <content type="html">&lt;p&gt;I do a lot of interviewing at work which means I print a lot of resumes. I like to print them single sided so I can write notes on the back and so I&amp;#8217;m often left with a lot of paper that has only been printed on one side. I have a kind of weird relationship with paper and I don&amp;#8217;t often like to waste it.&lt;/p&gt;
&lt;p&gt;For the last 6 or so months, I&amp;#8217;ve been saving the paper from the old no longer needed resumes with the intention of recycling them somehow. After watching the video below, I suddenly knew how I wanted to do it:&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;854&quot; height=&quot;480&quot; src=&quot;https://www.youtube.com/embed/rJITw1HOKS4&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Now, binding a book has been something I&amp;#8217;ve been wanting to do for a long time. I&amp;#8217;ve bought books on the topic, and was waiting on &amp;#8220;time&amp;#8221; to pull the trigger. After seeing how fast the guy above made his book and after a particularly slow day of testing installer builds which took forever to build and deploy, I decided to go for it.&lt;/p&gt;
&lt;p&gt;I folded signatures of paper at work during downtime, and placed an order on Amazon for the following products:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/B00004T7R3/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00004T7R3&amp;linkCode=as2&amp;tag=gebloftigi-20&amp;linkId=ZFXGQ53YYDGAAWN2&quot;&gt;2 awls&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=B00004T7R3&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/B0025TZ26Q/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0025TZ26Q&amp;linkCode=as2&amp;tag=gebloftigi-20&amp;linkId=42UEUR4A35V765T6&quot;&gt;some &lt;span class=&quot;caps&quot;&gt;PVA&lt;/span&gt; glue&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=B0025TZ26Q&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/B0025TTKQE/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0025TTKQE&amp;linkCode=as2&amp;tag=gebloftigi-20&amp;linkId=BMHZLJ5KJPEBAXD2&quot;&gt;a set of book binder&amp;#8217;s needles&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=B0025TTKQE&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/B0025U108E/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0025U108E&amp;linkCode=as2&amp;tag=gebloftigi-20&amp;linkId=HZNFH3PZUETS3MMQ&quot;&gt;some linen thread&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=B0025U108E&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/B0007LS8G0/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0007LS8G0&amp;linkCode=as2&amp;tag=gebloftigi-20&amp;linkId=IJHJ2432GGLIZFQK&quot;&gt;some book binding cloth&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=B0007LS8G0&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/B004BNJDH8/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B004BNJDH8&amp;linkCode=as2&amp;tag=gebloftigi-20&amp;linkId=JKGUJTPOH3FUNWTD&quot;&gt;some headband&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=B004BNJDH8&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/B0013JRFUA/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B0013JRFUA&amp;linkCode=as2&amp;tag=gebloftigi-20&amp;linkId=7TKPUDJ7RUFVLDQ5&quot;&gt;some chipboard&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=B0013JRFUA&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I already had this book:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/1592534554/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1592534554&amp;linkCode=as2&amp;tag=gebloftigi-20&amp;linkId=YEQK3WUUTWYPI3MF&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&amp;ASIN=1592534554&amp;Format=_SL110_&amp;ID=AsinImage&amp;MarketPlace=US&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=gebloftigi-20&quot; &gt;&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=1592534554&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/1592534554/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1592534554&amp;linkCode=as2&amp;tag=gebloftigi-20&amp;linkId=YEQK3WUUTWYPI3MF&quot;&gt;Bookcraft: Techniques for Binding, Folding, and Decorating to Create Books and More&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=1592534554&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Yesterday my box arrived, and I couldn&amp;#8217;t wait to start binding when I got home.&lt;/p&gt;
&lt;p&gt;I pretty much followed the same steps as in the above video, with my book filling in details as required, like how much space to leave between signature stitches.&lt;/p&gt;
&lt;p&gt;After about 2 hours including 40 minutes of waiting for things to dry, I was left with the following notebook:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/bb/01/IMG_1018.JPG&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;/images/bb/01/IMG_1019.JPG&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;/images/bb/01/IMG_1020.JPG&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;/images/bb/01/IMG_1021.JPG&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;/images/bb/01/IMG_1022.JPG&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I made plenty of mistakes as I bound my first book &amp;#8211; I wasn&amp;#8217;t precise enough when putting the holes for the stitches, so some signatures were out of place. I didn&amp;#8217;t use enough glue on the binding when placing the cloth, so the last signature sort of hangs out of the spine. I rushed the creation of my book cover, so it&amp;#8217;s sized a little weird, and I accidentally glued it in crooked so the spine has an odd tilt to it.&lt;/p&gt;
&lt;p&gt;Having said all that, I can&amp;#8217;t help but pick it up and flick through it, knowing that yesterday it was just a pile of folded paper, and last week it was just sheafs of used paper sitting on my desk.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>2014 In Review, And a Look Forward to 2015</title>
   <link href="http://www.timgittos.com/blog/2014-in-review-and-a-look-forward-to-2015"/>
   <updated>2015-01-16T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/2014-in-review-and-a-look-forward-to-2015</id>
   <content type="html">&lt;p&gt;2014 was a crazy year for myself and my family. Full of childhood homes burning down, benign tumors, houses flooding and other general bad stuff. 2014 is not a year I will look back on fondly.&lt;/p&gt;
&lt;p&gt;In 2013, I charged myself to &amp;#8220;create things that are fun&amp;#8221;, with a focus on building a new business idea.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s see how I did:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Travelled to Australia and India to visit my family and friends, spending only 4 days in Australia and 4 days in India, losing luggage in Beijing on the way there. That was fun. We travelled to Jaipur and Agra to visit sights &amp;#8211; I&amp;#8217;ve finally visited the Taj Mahal on my second trip to India.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Travelled domestically to Chattanooga, Boston and Detroit. I enjoyed Chattanooga more than I thought I would, liked Boston less than I thought I would, and I&amp;#8217;ve been to Detroit before.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;I continued working on a business idea for custom 3D printed miniatures, then stopped. I&amp;#8217;ll discuss this more in detail below.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;I started drawing for an hour every day for about 78 days, then stopped because I stopped having fun. I&amp;#8217;ll discuss this below as well.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;I was going to start a game dev project similar to the &amp;#8220;art everyday&amp;#8221; project, but again I was too slow and &lt;a href=&quot;http://handmadehero.org&quot;&gt;Handmade Hero&lt;/a&gt; did what I was going to do, but way better, before I could do it. Now I&amp;#8217;m an avid viewer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/blog/2013-in-review-and-a-look-forward-to-2014/&quot;&gt;Last year&lt;/a&gt; I mentioned that I was starting a business with some of my friends, and we were going to work on custom 3D printed miniatures for tabletop gaming. I was super excited to finally have found something that I was genuinely passionate about and that seemed like a great idea. We got to work immediately, and while I won&amp;#8217;t go into the details right now, I learnt a lot of lessons really fast.&lt;/p&gt;
&lt;p&gt;When we found the &lt;a href=&quot;https://www.heroforge.com/&quot;&gt;HeroForge&lt;/a&gt; Kickstart, at first my heart sank. They were funded and they had a bunch of really good artists on the team. Then I realised, &amp;#8220;Hey, we&amp;#8217;ve already started developing our tech! We have a head start!&amp;#8221;. I felt better immediately and got back to work. Then I ran into a hard issue I still to this date haven&amp;#8217;t solved. We were beaten to market at the end of the year. Their product is great looking, fair priced and generally awesome. We were originally only doing our idea because it hadn&amp;#8217;t been done. Now that it exists, and is awesome, we agreed to &amp;#8230; stop. I don&amp;#8217;t know what&amp;#8217;s next for us.&lt;/p&gt;
&lt;p&gt;At the start of the year, I also started doing art for an hour every night. I managed ~78 nights before I stopped doing it. I stopped doing it because it stopped being fun. I was stressing out about making time to do the art even when I wasn&amp;#8217;t feeling particularly inspired. I started doing really long, grueling multi-night pieces that sucked at my creativity. I wasn&amp;#8217;t having fun, and that was before the break to travel. After getting back from international travel, it was hard to get back into the swing of things, so I stopped. I don&amp;#8217;t regret stopping.&lt;/p&gt;
&lt;p&gt;One thing I did which I wasn&amp;#8217;t planning on doing is keeping more of my time &amp;#8220;down&amp;#8221; than I had before. I actually delved into my Steam library and played a few of the ~114 games I had, as well as a few games on console. I went out of my way to do things that were fun, but not necessarily productive. I wasn&amp;#8217;t learning skills, I wasn&amp;#8217;t building something I could use to make money, I was just having fun.&lt;/p&gt;
&lt;p&gt;Looking back, 2014 was a fairly quiet year for me in terms of personal projects and making progress towards goals. At first I wondered if I was simply burning out and losing interest in the things that I used to like. But as I write this post during some downtime at work, I realized that work was probably the reason why I wasn&amp;#8217;t super ambitious this year. For the last year I&amp;#8217;ve been working on a team tasked to create a new product from scratch. We did market research, talked to users, developed paper prototypes, developed the final product &amp;#8211; everything and all things lean startup. It took a lot of time and a lot of my energy, meaning I haven&amp;#8217;t been super motivated.&lt;/p&gt;
&lt;p&gt;Next year, I think I will make some more concrete goals for myself than I made in the previous years. I will share them here, but I want to think a little harder about them beforehand. When I do post them, I&amp;#8217;ll link this article to them.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Failure</title>
   <link href="http://www.timgittos.com/blog/failure"/>
   <updated>2014-06-05T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/failure</id>
   <content type="html">&lt;p&gt;Failing is an important part of learning and improving. In some ways, knowing what not to do and knowing how to fix mistakes are more important than knowing exactly what to do. I like the following quote, attributed to Thomas Edison: &amp;#8220;I have not failed. I&amp;#8217;ve just found 10,000 ways that won&amp;#8217;t work.&amp;#8221;&lt;/p&gt;
&lt;p&gt;Last year I read &lt;a href=&quot;http://www.amazon.com/gp/product/0743235274/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0743235274&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;The Creative Habit: Learn It and Use It for Life&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=0743235274&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt; by Twyla Tharp. In the book she mentions that it&amp;#8217;s important to fail in public. I didn&amp;#8217;t understand why she said that until a few months ago.&lt;/p&gt;
&lt;p&gt;At the start of this year, I promised myself to pick up art again as a hobby. I was going to film myself learning to draw all over again and post it up on the internet for strangers to see. When it came to start the project I began feeling huge amounts of anxiety. Eventually I got over it, but I had to take a break in May due to travelling. Since I got back I haven&amp;#8217;t picked it up again, because that anxiety is stopping me.&lt;/p&gt;
&lt;p&gt;I think the anxiety is coming from the idea of failing in public. I keep thinking of people watching me fumble around and judging me. I know this indicates a bunch of confidence related issues but rather than deal with all that, it&amp;#8217;s probably easier to just stop failing in public.&lt;/p&gt;
&lt;p&gt;To that end, I won&amp;#8217;t be publishing any more stuff from my project online for the time. I don&amp;#8217;t know if that will change in the future but right now my anxiety is stopping me from doing the work and that&amp;#8217;s a bad thing.&lt;/p&gt;
&lt;p&gt;Furthermore, I&amp;#8217;m going to change the purpose of this site too alongside a redesign.&lt;/p&gt;
&lt;p&gt;I originally started this blog with the intention of blogging about technical issues and sharing interesting things I come across in my work. Working on legacy tech doesn&amp;#8217;t lend itself well to this kind of blogging however, and I&amp;#8217;m also starting to think it&amp;#8217;s a little egotistical to assume that anyone is interested in the things I think anyway.&lt;/p&gt;
&lt;p&gt;I realized a few weeks ago that this website has kind of become a shrine to my failures &amp;#8211; my failures to finish MooCs, various programming projects and generally to fulfill the intention of the blog.&lt;/p&gt;
&lt;p&gt;Given that I no longer want to fail in public, I&amp;#8217;m going to remove most of the content and instead just display the things I haven&amp;#8217;t failed at &amp;#8211; finished projects and any info relevant to my career that people might want to read about.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Hello World Open 2014</title>
   <link href="http://www.timgittos.com/blog/hello-world-open-2014"/>
   <updated>2014-04-16T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/hello-world-open-2014</id>
   <content type="html">&lt;p&gt;About a week ago I found out about this cool AI programming competition called the &lt;a href=&quot;https://helloworldopen.com&quot;&gt;Hello World Open&lt;/a&gt; which is currently running. My timing is not great though as I leave for a vacation to see family overseas and won&amp;#8217;t be back until after the competition finishes.&lt;/p&gt;
&lt;p&gt;The gist of the competition is that you need to build an AI bot to control a slot car around a track. It&amp;#8217;s a time attack style competition with the fastest lap being what you&amp;#8217;re aiming for. It has relatively simple rules that you are &lt;em&gt;not&lt;/em&gt; necessarily told about &amp;#8211; though you are given &lt;a href=&quot;https://helloworldopen.com/techspec&quot;&gt;a protocol/&lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; specification&lt;/a&gt; . Part of the task is to figure out the rules of the competion and to write a bot to take advantage of them.&lt;/p&gt;
&lt;p&gt;The competition supports a wide variety of programming languages, and my intention was to use Clojure to build my bot. Although I don&amp;#8217;t have to the time to write a bot in a new programming language in less than a day, I have been thinking about strategy.&lt;/p&gt;
&lt;p&gt;My general strategy would have been to find out the acceleration, deceleration and top velocity of the slot car and the friction of the track. I would then have wrote my bot to figure out based on the friction how fast it can take the varying radius corners, and basically control the throttle so that the car is always just staying on the track. I then would have added lane switching logic to cut corners and maintain a race line that would be optimal for lap times.&lt;/p&gt;
&lt;p&gt;Even though I can&amp;#8217;t participate due to my lack of time, anyone reading this probably can. If you read this post and decide to participate, I&amp;#8217;d love to hear your strategies and how you did, and whether or not my ideas were on the right track or not.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 78</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-78"/>
   <updated>2014-03-20T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-78</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/89581763&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140319.png&quot;&gt;&lt;img src=&quot;/images/365/20140319.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Fixing the face of my Iron Kingdoms character and cleaning up the illustration of the guns. I&amp;#8217;ve decided against finishing this as I think my time is better spent drawing more figures. Tomorrow I&amp;#8217;ll start drawing my D&amp;amp;D Next character that I tried to draw in January.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-77/&quot;&gt;Day 77&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-79/&quot;&gt;Day 79&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art"/>
   <updated>2014-03-20T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art</id>
   <content type="html">&lt;p&gt;&amp;#8220;You want to know the difference between a master and a beginner? The master has failed more times than the beginner has even tried&amp;#8221; &amp;#8211; &lt;a href=&quot;http://doodlealley.com/2012/10/10/be-friends-with-failure/&quot;&gt;doodlealley.com/2012/10/10/be-friends-with-failure/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8220;The ceramics teacher announced he was dividing his class into two groups. All those on the left side of the studio would be graded solely on the quantity of work they produced, all those on the right graded solely on its quality &amp;#8230; the works of highest quality were all produced by the group being graded for quantity!&amp;#8221; &amp;#8211; &lt;a href=&quot;http://sivers.org/qlq&quot;&gt;sivers.org/qlq&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;365 Days of Drawing is going to be 365 failures in drawing. In an attempt to rekindle past skill in art, I&amp;#8217;m deliberately practicing every day from January 1st, 2014, and recording it. I hope to get better at art, show my progress and possibly help anyone else who&amp;#8217;s wanted to learn how to improve their art technique.&lt;/p&gt;
&lt;div id=&quot;post-list&quot;&gt;
















&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Device Ownership vs. Hosting</title>
   <link href="http://www.timgittos.com/blog/device-ownership-vs-hosting"/>
   <updated>2014-03-19T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/device-ownership-vs-hosting</id>
   <content type="html">&lt;p&gt;Today I saw a video about a design experiment around the concept of hosting a product vs. owning a product. Here&amp;#8217;s the video:&lt;/p&gt;
&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/41363473&quot; width=&quot;720&quot; height=&quot;405&quot;  frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Before I get into why this struck me so much, I&amp;#8217;d like to point out the similarities between Brad and the toaster from the Red Dwarf books. This is totally something I can see that guy doing.&lt;/p&gt;
&lt;p&gt;Back to the experiment itself, I&amp;#8217;ve identified within myself the tendency to buy a lot of stuff that I don&amp;#8217;t really use. In fact just today I had to convince myself out of buying the &lt;a href=&quot;https://www.oculusvr.com/order/&quot;&gt;Oculus Rift Developer Kit 2&lt;/a&gt; because I didn&amp;#8217;t use the original dev kit that I backed on Kickstarter. Even now I go back and forth on purchasing stuff because I&amp;#8217;m worried I won&amp;#8217;t use it, even when it&amp;#8217;s clear I will. I&amp;#8217;m debating purchasing a &lt;a href=&quot;http://www.amazon.com/gp/product/B009QQ7BG0/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B009QQ7BG0&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;Yiynova Cintiq clone&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=B009QQ7BG0&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt; because I&amp;#8217;m doing &lt;a href=&quot;/projects/365-days-of-art/&quot;&gt;a lot of drawing lately&lt;/a&gt;, and still it&amp;#8217;s a hard decision.&lt;/p&gt;
&lt;p&gt;Couple that with the fact that I can absolutely see a resource crunch that means that new products become prohibitively expensive and I can completely understand what the thought experiment is about. Not only that but I also think it would be a positive change. Give your unused and unloved device to someone who will use it more and free up some clutter in your life.&lt;/p&gt;
&lt;p&gt;PS: I also think the idea of a device peer network is both fascinating and terrifying.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 77</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-77"/>
   <updated>2014-03-19T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-77</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/89477122&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140318.png&quot;&gt;&lt;img src=&quot;/images/365/20140318.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Working on completing the design of my character. I&amp;#8217;m fairly happy with the progress, but there is definitely a gap between what I&amp;#8217;m producing and what I want to produce, although its not as bad as it was in past drawings.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-76/&quot;&gt;Day 76&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-78/&quot;&gt;Day 78&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 76</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-76"/>
   <updated>2014-03-18T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-76</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/89376417&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140317.png&quot;&gt;&lt;img src=&quot;/images/365/20140317.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Although I had to resort to tracing to figure out how to draw a figure I liked, I am starting to make progress on a drawing. Hopefully in the future I won&amp;#8217;t need to trace things to figure out construction.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-75/&quot;&gt;Day 75&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-77/&quot;&gt;Day 77&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 75</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-75"/>
   <updated>2014-03-17T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-75</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/89278205&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Learning to draw is hard. I&amp;#8217;m finding myself continually frustrated by my lack of progress and the gap between my taste and my skill level. I think I need to find a happy medium between copying&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-73/&quot;&gt;Day 73&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-76/&quot;&gt;Day 76&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 73</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-73"/>
   <updated>2014-03-17T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-73</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/89189392&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Going over some design ideas for my character and doing a few bad drawings.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-72/&quot;&gt;Day 72&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-75/&quot;&gt;Day 75&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 72</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-72"/>
   <updated>2014-03-17T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-72</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/89078989&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Doing some character design today &amp;#8211; not a lot of drawing, but some. I&amp;#8217;m feeling more confident about my ability to draw from memory, but I still have to keep putting stuff into my memory.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-71/&quot;&gt;Day 71&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-73/&quot;&gt;Day 73&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 71</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-71"/>
   <updated>2014-03-17T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-71</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/88968766&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140313.png&quot;&gt;&lt;img src=&quot;/images/365/20140313.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Started copying photos again, but this time to just practice approximating human features in looser sketches and building a mental library, not so much for realistic rendering.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-70/&quot;&gt;Day 70&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-72/&quot;&gt;Day 72&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 70</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-70"/>
   <updated>2014-03-17T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-70</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/88845000&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140312.png&quot;&gt;&lt;img src=&quot;/images/365/20140312.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Things are getting tough.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-69/&quot;&gt;Day 69&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-71/&quot;&gt;Day 71&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 69</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-69"/>
   <updated>2014-03-10T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-69</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/88726575&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140311.png&quot;&gt;&lt;img src=&quot;/images/365/20140311.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Due to burn out and family issues, I took 4 days off of the project. Today I started back and am starting to draw from imagination. This is frustrating and slow going work, and this session produced a whole lot of nothing in terms of drawings.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-64/&quot;&gt;Day 64&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-70/&quot;&gt;Day 70&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 64</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-64"/>
   <updated>2014-03-05T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-64</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/88321431&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140305.png&quot;&gt;&lt;img src=&quot;/images/365/20140305.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I decided to take a break from this painting. My rendering technique was getting sloppy and I was feeling burnt out. I was make critical mistakes in proportions and volume placement as well. I don&amp;#8217;t know if I will return to this painting, but I don&amp;#8217;t want to do this for the rest of the week. I want to get into some composition studys and start doing original work.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589346315/&quot;&gt;http://www.pinterest.com/pin/333970128589346315/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-63/&quot;&gt;Day 63&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-69/&quot;&gt;Day 69&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 63</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-63"/>
   <updated>2014-03-04T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-63</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/88226522&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140304.png&quot;&gt;&lt;img src=&quot;/images/365/20140304.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I estimate that I&amp;#8217;m about 2 or 3 days out from finishing this painting. I&amp;#8217;ll be glad to finish when I am.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589346315/&quot;&gt;http://www.pinterest.com/pin/333970128589346315/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-62/&quot;&gt;Day 62&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-64/&quot;&gt;Day 64&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 62</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-62"/>
   <updated>2014-03-03T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-62</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/88132034&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140303.png&quot;&gt;&lt;img src=&quot;/images/365/20140303.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Losing a little steam on this, so I just painted for a short while today. I don&amp;#8217;t want the quality of my rendering to suffer because I&amp;#8217;m getting burnt out.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589346315/&quot;&gt;http://www.pinterest.com/pin/333970128589346315/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-61/&quot;&gt;Day 61&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-63/&quot;&gt;Day 63&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 61</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-61"/>
   <updated>2014-03-02T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-61</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/88038384&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140302.png&quot;&gt;&lt;img src=&quot;/images/365/20140302.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Continuing to render the second gauntlet. Slow and steady wins the race.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589346315/&quot;&gt;http://www.pinterest.com/pin/333970128589346315/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-60/&quot;&gt;Day 60&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-62/&quot;&gt;Day 61&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 60</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-60"/>
   <updated>2014-03-01T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-60</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87976002&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140301.png&quot;&gt;&lt;img src=&quot;/images/365/20140301.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Started work on the second gauntlet, blocking in general shapes and starting to render at the bottom.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589346315/&quot;&gt;http://www.pinterest.com/pin/333970128589346315/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-59/&quot;&gt;Day 59&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-61/&quot;&gt;Day 61&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 59</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-59"/>
   <updated>2014-02-28T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-59</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87925557&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140228.png&quot;&gt;&lt;img src=&quot;/images/365/20140228.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve finished the first gauntlet and I&amp;#8217;m very happy with the result. Tomorrow I will try to make a lot of headway on the second gauntlet, and maybe even finish it. I&amp;#8217;d love to have this done by the weekend is over, but I won&amp;#8217;t hold my breath.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589346315/&quot;&gt;http://www.pinterest.com/pin/333970128589346315/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-58/&quot;&gt;Day 58&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-60/&quot;&gt;Day 60&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 58</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-58"/>
   <updated>2014-02-27T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-58</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87840883&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140227.png&quot;&gt;&lt;img src=&quot;/images/365/20140227.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;More very slow progress. At this rate, I&amp;#8217;ll finish a single gauntlet in 2 more days (2 more hours of painting) and probably take just as long for the second gauntlet. This will be my longest painting yet.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589346315/&quot;&gt;http://www.pinterest.com/pin/333970128589346315/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-57/&quot;&gt;Day 57&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-59/&quot;&gt;Day 59&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 57</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-57"/>
   <updated>2014-02-26T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-57</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87745288&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140226.png&quot;&gt;&lt;img src=&quot;/images/365/20140226.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m making very slow progress on painting the armor. Shiny metal with coloured reflections is surprisingly hard to paint.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589346315/&quot;&gt;http://www.pinterest.com/pin/333970128589346315/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-56/&quot;&gt;Day 56&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-58/&quot;&gt;Day 58&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 56</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-56"/>
   <updated>2014-02-25T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-56</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87644185&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140225.png&quot;&gt;&lt;img src=&quot;/images/365/20140225.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I started painting some armor that I was drawn to due to some interesting lifhting effects, and planned a little how I would attack painting it.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589346315/&quot;&gt;http://www.pinterest.com/pin/333970128589346315/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-55/&quot;&gt;Day 55&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-57/&quot;&gt;Day 57&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 55</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-55"/>
   <updated>2014-02-24T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-55</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87540495&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140224.png&quot;&gt;&lt;img src=&quot;/images/365/20140224.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Finished the skull and talked a little about where I&amp;#8217;m going next.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&quot;&gt;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-54/&quot;&gt;Day 54&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-56/&quot;&gt;Day 56&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 54</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-54"/>
   <updated>2014-02-23T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-54</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87438966&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140223.png&quot;&gt;&lt;img src=&quot;/images/365/20140223.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I played dentist as I worked on this skull&amp;#8217;s teeth (haha) and lower jaw. Entering the home stretch tomorrow by finishing the cranium.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&quot;&gt;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-53/&quot;&gt;Day 53&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-55/&quot;&gt;Day 55&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 53</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-53"/>
   <updated>2014-02-22T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-53</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87381942&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140222.png&quot;&gt;&lt;img src=&quot;/images/365/20140222.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Detailing and texturing the upper jaw area and nose socket. Tomorrow I&amp;#8217;m going to work on the teeth and finish the upper jaw.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&quot;&gt;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-52/&quot;&gt;Day 52&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-54/&quot;&gt;Day 54&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 52</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-52"/>
   <updated>2014-02-21T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-52</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87333171&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140221.png&quot;&gt;&lt;img src=&quot;/images/365/20140221.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve started laying down detail and fixing values on the skull. Today was concentrating on the eye sockets. I think I got some nice texture down that I plan to add to other areas of the painting.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&quot;&gt;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-51/&quot;&gt;Day 51&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-53/&quot;&gt;Day 53&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Find The Cracks - Then Break It Wide Open</title>
   <link href="http://www.timgittos.com/blog/find-the-cracks-then-break-it-wide-open"/>
   <updated>2014-02-20T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/find-the-cracks-then-break-it-wide-open</id>
   <content type="html">&lt;p&gt;A lot of the things I do in my free time (and in my job) are overwhelming when I look at them superficially. I have a 4&amp;#8242; &amp;#215; 5&amp;#8242; canvas buried in my closet, a painting of my wife and I that I wanted to do for my mother-in-law, and it&amp;#8217;s been sitting there for 3 years because it&amp;#8217;s so overwhelming. Last year I joined NaNoWriMo because I&amp;#8217;ve had (and recorded) a few dreams I&amp;#8217;d like to try writing a story around. I immediately quit after realizing I have no idea how to extend a scene into a full length novel. Even at work, I had to learn how to configure a software package using a programming language I didn&amp;#8217;t know in a programming paradigm I&amp;#8217;ve never worked in. It felt hopeless when I first started.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m in the middle of &lt;a href=&quot;/projects/365-days-of-art/&quot;&gt;an art project where I do art every day for a year&lt;/a&gt;&amp;quot;. Several times I&amp;#8217;ve felt the same about this project as I have about the stuff above. Every time I stuck to it though, because the project is about daily progress more than it is about results. Every time I found a small crack where I felt I could get a handle on the situation and where I started to see the results I wanted. I used that small glimmer of hope to persevere through, built on top of what got me there, and blew the whole thing wide open.&lt;/p&gt;
&lt;p&gt;The same thing happened at work. Every time I thought I knew what was going on I&amp;#8217;d try something and it would blow up. I felt that I would never get a hold of this task. Until I tried something and it stuck &amp;#8211; it was doing exactly what I wanted it to do, meaning my understanding of the situation was correct. I used that understanding to try more things and as I worked through, I finally figured it out.&lt;/p&gt;
&lt;p&gt;When you&amp;#8217;re faced with a task or goal that seems almost unachievable, find the quickest, smallest win you can. Find the crack in the armor and then use that momentum to do it again, and again, and again. Eventually you&amp;#8217;ll crack the problem and get to where you want to do.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 51</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-51"/>
   <updated>2014-02-20T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-51</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87192035&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140220.png&quot;&gt;&lt;img src=&quot;/images/365/20140220.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I laid down some initial shapes to make this blob at least look a little like a skull. I also outlined a plan of attack to get stuck into the detail work.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&quot;&gt;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-50/&quot;&gt;Day 50&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-52/&quot;&gt;Day 52&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 50</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-50"/>
   <updated>2014-02-19T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-50</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87158454&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140219.png&quot;&gt;&lt;img src=&quot;/images/365/20140219.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A pretty dull video today as I prep for a more accurate representation of my subject by figuring out Photoshop grids and a basic shape.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&quot;&gt;http://2.bp.blogspot.com/-Xth-HVg2l1Q/TVYjmIVt8CI/AAAAAAAAB6c/oAtNwW7wmoA/s1600/real_bone_human_skull_male_s.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-49/&quot;&gt;Day 49&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-51/&quot;&gt;Day 51&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 49</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-49"/>
   <updated>2014-02-18T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-49</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/87062201&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140218.png&quot;&gt;&lt;img src=&quot;/images/365/20140218.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Finishing my hands painting, and looking back and what I have (and haven&amp;#8217;t) learned.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/541417186424884930/&quot;&gt;http://www.pinterest.com/pin/541417186424884930/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-48/&quot;&gt;Day 48&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-50/&quot;&gt;Day 50&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 48</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-48"/>
   <updated>2014-02-17T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-48</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86967822&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140217.png&quot;&gt;&lt;img src=&quot;/images/365/20140217.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After struggling a little with painting the hands on my last painting, I&amp;#8217;m going to focus specifically on painting hands.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/541417186424884930/&quot;&gt;http://www.pinterest.com/pin/541417186424884930/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-47/&quot;&gt;Day 47&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-49/&quot;&gt;Day 49&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 47</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-47"/>
   <updated>2014-02-16T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-47</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86870836&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140216.png&quot;&gt;&lt;img src=&quot;/images/365/20140216.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Still feeling under the weather, I decide to stop working on the Patrick Stewart painting even though there&amp;#8217;s still a lot of work to do.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/496592296382219241/&quot;&gt;http://www.pinterest.com/pin/496592296382219241/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-46/&quot;&gt;Day 46&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-48/&quot;&gt;Day 48&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 46</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-46"/>
   <updated>2014-02-15T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-46</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86808049&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140215.png&quot;&gt;&lt;img src=&quot;/images/365/20140215.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Continuing work on my Patrick Stewart portrait whilst being sick. That&amp;#8217;s putting in the work, which is what this whole thing is about.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/496592296382219241/&quot;&gt;http://www.pinterest.com/pin/496592296382219241/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-45/&quot;&gt;Day 45&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-47/&quot;&gt;Day 47&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 45</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-45"/>
   <updated>2014-02-14T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-45</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86753413&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140214.png&quot;&gt;&lt;img src=&quot;/images/365/20140214.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Continuing to build on the things I&amp;#8217;ve learnt through my last couple of paintings, I&amp;#8217;m trying a painting of Patrick Stewart with a soft brush for organic shading. So far it&amp;#8217;s doing fairly well and I&amp;#8217;m fairly happy with it.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/496592296382219241/&quot;&gt;http://www.pinterest.com/pin/496592296382219241/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-44/&quot;&gt;Day 44&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-46/&quot;&gt;Day 46&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 44</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-44"/>
   <updated>2014-02-13T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-44</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86618595&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140213.png&quot;&gt;&lt;img src=&quot;/images/365/20140213.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I tried to use what I had learnt from the last image about painting forms and layering for blending. I think I did an OK job, and although I thought I would have to take 2 days to get this to a place I liked, I think I got there in one. Tomorrow I&amp;#8217;m going to experiment with soft edge brushes for organic shapes, and hard edge brushes for building texture.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &amp;#8220;http://www.pinterest.com/pin/333970128588507051/&amp;#8221;http://www.pinterest.com/pin/333970128588507051/&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-43/&quot;&gt;Day 43&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-45/&quot;&gt;Day 45&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 43</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-43"/>
   <updated>2014-02-12T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-43</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86582814&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140212.png&quot;&gt;&lt;img src=&quot;/images/365/20140212.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Though I ended with a disappointing result, I think I learnt a lot in this painting. I attempted to achieve an economy of painting strokes, but didn&amp;#8217;t do enough layering. In addition, I painted light as I saw it in the photo, not as it would interact with 3D elements. I also fell victim to having the wrong aspect ratio again.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589220648/&quot;&gt;http://www.pinterest.com/pin/333970128589220648/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-42/&quot;&gt;Day 42&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-44/&quot;&gt;Day 44&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 42</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-42"/>
   <updated>2014-02-11T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-42</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86485768&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140211.png&quot;&gt;&lt;img src=&quot;/images/365/20140211.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Another &amp;#8220;speed&amp;#8221; painting, this time of a forest. I struggled with this one a lot, and learnt about layering the painting. I still struggle with texture and pushing texture far enough. I&amp;#8217;m thinking I need to research rendering texture.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128589078882/&quot;&gt;http://www.pinterest.com/pin/333970128589078882/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-41/&quot;&gt;Day 41&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-43/&quot;&gt;Day 43&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 41</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-41"/>
   <updated>2014-02-10T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-41</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86388667&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140210.png&quot;&gt;&lt;img src=&quot;/images/365/20140210.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I&amp;#8217;m trying something new. I&amp;#8217;m a little frustrated by how long it&amp;#8217;s taking me to get each of my paintings for February done. Tonight I painted an interior scene and only gave myself tonight to do it. I wanted to limit the amount of time I had to stuff around and increase my economy of painting. I really like the results and so I&amp;#8217;ll keep doing it from this point on, giving myself a single session to finish a painting.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588376215/&quot;&gt;http://www.pinterest.com/pin/333970128588376215/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-40/&quot;&gt;Day 40&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-42/&quot;&gt;Day 42&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 40</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-40"/>
   <updated>2014-02-09T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-40</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86259477&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140209.png&quot;&gt;&lt;img src=&quot;/images/365/20140209.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Finishing up with the landscape I started a few days ago, and talking a little bit about what I&amp;#8217;ve done so far and where I&amp;#8217;m going.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588208962/&quot;&gt;http://www.pinterest.com/pin/333970128588208962/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-39/&quot;&gt;Day 39&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-41/&quot;&gt;Day 41&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 39</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-39"/>
   <updated>2014-02-08T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-39</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86225796&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140208.png&quot;&gt;&lt;img src=&quot;/images/365/20140208.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I think I&amp;#8217;ve cracked how to paint texture in a more representational/impressionistic way. I&amp;#8217;ve gotten back into the swing of things tonight, and I&amp;#8217;m looking forward to finishing the painting tomorrow.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588208962/&quot;&gt;http://www.pinterest.com/pin/333970128588208962/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-38/&quot;&gt;Day 38&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-40/&quot;&gt;Day 40&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 38</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-38"/>
   <updated>2014-02-07T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-38</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86171744&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140207.png&quot;&gt;&lt;img src=&quot;/images/365/20140207.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Struggled today to keep up the enthusiasm for this painting &amp;#8211; still, just have to put in the work&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588208962/&quot;&gt;http://www.pinterest.com/pin/333970128588208962/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-37/&quot;&gt;Day 37&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-39/&quot;&gt;Day 39&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Nobody Cares So Don't Worry About Screwing Up</title>
   <link href="http://www.timgittos.com/blog/nobody-cares-so-dont-worry-about-screwing-up"/>
   <updated>2014-02-06T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/nobody-cares-so-dont-worry-about-screwing-up</id>
   <content type="html">&lt;p&gt;Often, people won&amp;#8217;t start something because they&amp;#8217;re afraid of screwing up. They&amp;#8217;re afraid that if they try and fail, people will mock them and criticize them. These are unpleasant events and so they&amp;#8217;ll do everything to avoid them including not starting at all.&lt;/p&gt;
&lt;p&gt;Other times, as is the case with me, this can manifest as a fear of success. I feel very uncomfortable in any kind of spotlight as I&amp;#8217;m constantly fearful of criticism and confrontational interactions. I worry about the things I&amp;#8217;m doing becoming successful because success might draw a spotlight which might draw these negative interactions I fear.&lt;/p&gt;
&lt;p&gt;If these fears resonate with you, this is something that will hold you back. But there is good news &amp;#8211; it&amp;#8217;s something that is simple (but not easy) to combat.&lt;/p&gt;
&lt;p&gt;When was the last time you really cared about a stranger&amp;#8217;s failure? Assuming you&amp;#8217;ve noticed it at all? You probably can&amp;#8217;t remember. You&amp;#8217;ll be able to remember when someone failed at something you had a stake in, but for something that is totally foreign to you, you probably can&amp;#8217;t remember.&lt;/p&gt;
&lt;p&gt;The truth is is that it&amp;#8217;s hard to get people to care about anything, period. Entire industries are built around the art of getting people to notice and care about something. If it&amp;#8217;s so hard to get someone to care about something you want them to care about, what are the chances that they&amp;#8217;ll care about something you don&amp;#8217;t want them to?&lt;/p&gt;
&lt;p&gt;Even if they do notice your screw up, and even if they criticize or mock you, that interaction usually goes one of two ways:&lt;/p&gt;
&lt;p&gt;1. They forget about you entirely and utterly, and it doesn&amp;#8217;t matter&lt;br /&gt;
2. They dwell on it, and you get to live rent free in their mind.&lt;/p&gt;
&lt;p&gt;#1 is more likely, but hope for #2 &amp;#8211; because you&amp;#8217;ll have their attention and they&amp;#8217;ll care about what you&amp;#8217;re doing. This gives you an opportunity to improve their opinion of you and win them over. It&amp;#8217;s like the saying goes: &amp;#8220;There&amp;#8217;s no such thing as bad publicity.&amp;#8221; You&amp;#8217;ll never win everyone over, nor should you try, but as long as someone hasn&amp;#8217;t made it obvious you can&amp;#8217;t change their mind, you can keep trying to change their mind!&lt;/p&gt;
&lt;p&gt;So if you&amp;#8217;re worried about what people will say when you screw something up, remember you&amp;#8217;ll be lucky if anyone even notices &amp;#8211; most likely it will disappear in the sands of time.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 37</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-37"/>
   <updated>2014-02-06T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-37</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/86090546&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140206.png&quot;&gt;&lt;img src=&quot;/images/365/20140206.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve started a new painting, this time a colour painting of a landscape. I&amp;#8217;ve picked a photo that&amp;#8217;s relatively low in texture and colours, so I have a chance at getting it right. Tonight was a short exploration of layout and proportions, and tomorrow I&amp;#8217;ll get stuck into the detail work.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588208962/&quot;&gt;http://www.pinterest.com/pin/333970128588208962/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-36/&quot;&gt;Day 36&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-38/&quot;&gt;Day 38&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 36</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-36"/>
   <updated>2014-02-05T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-36</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85991821&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140205.png&quot;&gt;&lt;img src=&quot;/images/365/20140205.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;They say no work of art is finished, the artist only gives up. I think I&amp;#8217;ve pushed this as far as I can given my current skill level, and any more work will be diminishing returns. I learnt a lot with this picture and improved so much in my painting technique over the 4 days. Tomorrow I&amp;#8217;ll start it all again with a new picture.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588966124/&quot;&gt;http://www.pinterest.com/pin/333970128588966124/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-35/&quot;&gt;Day 35&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-37/&quot;&gt;Day 37&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 35</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-35"/>
   <updated>2014-02-04T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-35</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85889208&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140204.png&quot;&gt;&lt;img src=&quot;/images/365/20140204.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m nearly at the finish line for this picture. I fixed a few of the errors that were obvious to me, and worked more on fixing the light/shade of her neck, then did some blending. Tomorrow I&amp;#8217;m going to do more blending, finish her hair and then do some detail work, like eyelashes and eyebrow hairs.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588966124/&quot;&gt;http://www.pinterest.com/pin/333970128588966124/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-34/&quot;&gt;Day 34&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-36/&quot;&gt;Day 36&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 34</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-34"/>
   <updated>2014-02-03T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-34</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85798771&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140203.png&quot;&gt;&lt;img src=&quot;/images/365/20140203.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I made more progress on my portrait. I was concentrating on fleshing out a little more of the major parts of her face and fixing the likeness. I&amp;#8217;m still not at a point where I&amp;#8217;m satisfied, but I&amp;#8217;m close. I think I&amp;#8217;ll do another hour on getting the major light/shadow blocks done, then spend about half an hour blending hard edges into soft edges.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588966124/&quot;&gt;http://www.pinterest.com/pin/333970128588966124/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-33/&quot;&gt;Day 33&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-35/&quot;&gt;Day 35&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 33</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-33"/>
   <updated>2014-02-02T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-33</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85685312&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140202.png&quot;&gt;&lt;img src=&quot;/images/365/20140202.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I threw out the work I did on the portrait painting yesterday as I was very unhappy with it, and it was clear I didn&amp;#8217;t know what I was doing (I still don&amp;#8217;t, but that&amp;#8217;s beside the point). The second try builds on the lessons I learnt from the first try, and I think I get a little closer to the mark this time.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588966124/&quot;&gt;http://www.pinterest.com/pin/333970128588966124/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-32/&quot;&gt;Day 32&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-34/&quot;&gt;Day 34&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 32</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-32"/>
   <updated>2014-02-01T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-32</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85640129&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140201.png&quot;&gt;&lt;img src=&quot;/images/365/20140201.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Drawing has it&amp;#8217;s place in the art work flow, but rarely as a final product. With that in mind, I want to try working on painting. Today I kick that off by trying to work with value only and paint a black and white photo, after watching the ConceptArt Color 1.1 video.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588966124/&quot;&gt;http://www.pinterest.com/pin/333970128588966124/&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of ConceptArt thread: &lt;a href=&quot;http://www.conceptart.org/forums/forumdisplay.php?f=269&quot;&gt;http://www.conceptart.org/forums/forumdisplay.php?f=269&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-31/&quot;&gt;Day 31&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-33/&quot;&gt;Day 33&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 31</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-31"/>
   <updated>2014-01-31T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-31</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85580819&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140131.png&quot;&gt;&lt;img src=&quot;/images/365/20140131.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I finished the arm study, and realized that I didn&amp;#8217;t have much fun doing it, so I don&amp;#8217;t think I&amp;#8217;m going to draw the rest.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of reference: &lt;a href=&quot;http://canadian-rainwater.deviantart.com/art/Anatomy-Human-Arm-Muscles-260160580&quot;&gt;http://canadian-rainwater.deviantart.com/art/Anatomy-Human-Arm-Muscles-260160580&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-30/&quot;&gt;Day 30&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-32/&quot;&gt;Day 32&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 30</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-30"/>
   <updated>2014-01-30T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-30</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85510445&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140130.png&quot;&gt;&lt;img src=&quot;/images/365/20140130.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I decided to do some anatomy studies of the arm, based on a coloured reference I found. Initially the plan was to draw the car I drew on day 2 tommorrow, so today was just to practice and kill some time, but I think I&amp;#8217;ll push that back to 180 days and finish this study instead. Didn&amp;#8217;t get a lot of drawing done, but some days are like that. You just need to push through and keep working.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of reference: &lt;a href=&quot;http://canadian-rainwater.deviantart.com/art/Anatomy-Human-Arm-Muscles-260160580&quot;&gt;http://canadian-rainwater.deviantart.com/art/Anatomy-Human-Arm-Muscles-260160580&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of ConceptArt lessons: &lt;a href=&quot;http://www.conceptart.org/forums/forumdisplay.php?f=269&quot;&gt;http://www.conceptart.org/forums/forumdisplay.php?f=269&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-29/&quot;&gt;Day 29&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-31/&quot;&gt;Day 31&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Book Notes: The ONE Thing</title>
   <link href="http://www.timgittos.com/books/book-notes-the-one-thing"/>
   <updated>2014-01-30T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/books/book-notes-the-one-thing</id>
   <content type="html">&lt;div class=&quot;review-header&quot;&gt;
&lt;p class=&quot;left&quot;&gt;&lt;img src=&quot;/images/books/the_one_thing.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Amazon&lt;/strong&gt;: &lt;a href=&quot;http://www.amazon.com/gp/product/1885167776/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1885167776&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;The &lt;span class=&quot;caps&quot;&gt;ONE&lt;/span&gt; Thing: The Surprisingly Simple Truth Behind Extraordinary Results&lt;/a&gt;&lt;img src=&quot;http://ir-na.amazon-adsystem.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=1885167776&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;br /&gt;
 (referral link &amp;#8211; help me buy new books!)&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;ISBN&lt;/span&gt;&lt;/strong&gt;: 1885167776&lt;br /&gt;
&lt;strong&gt;Read&lt;/strong&gt;: 2013-12-18 (stopped)&lt;/p&gt;
&lt;p&gt;I stopped reading this book about 30% in. Not because I thought it was bad, or the advice in the book was bad, but because I feel like I&amp;#8217;d extracted the major point of the book &amp;#8211; working on the one most important thing that reaches your goals will be more productive than trying to get lots of irrelevant tasks finished faster.&lt;/p&gt;
&lt;p&gt;After transcribing my notes, however, I realise I was learning more from reading than I thought, so I will probably revisit this book as soon as I&amp;#8217;m done with what I&amp;#8217;m currently reading.&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Notes&lt;/h2&gt;
&lt;p&gt;Like &lt;a href=&quot;/books/book-notes-the-creative-habit&quot;&gt;The Creative Habit&lt;/a&gt; , I intended to synthesize my one sentence excerpts into cohrerent sentences, but didn&amp;#8217;t. Also, due to the fact that I didn&amp;#8217;t finish this book, I don&amp;#8217;t think that I could do it justice to do so.&lt;/p&gt;
&lt;p&gt;Following are one sentence notes/excerpts from the book that I wrote down in my notebook as I read, in their raw form. They still probably contain some value.&lt;br /&gt;
&amp;#8212;&lt;/p&gt;
&lt;p&gt;&amp;#8220;What&amp;#8217;s the one thing you can do this week such that by doing it everything else would be easier or unnecessary?&amp;#8221;&lt;br /&gt;
Success follows focus- success varies when focus does&lt;br /&gt;
Go small &amp;#8211; do less things that have a large effect instead of many things that have a small effect&lt;br /&gt;
Geometric progressions of dominoes &amp;#8211; a dominoe can knock down another dominoe 50% larger &amp;#8211; tasks are dominoes&lt;br /&gt;
Find the first (dominoe) and work on knocking it over&lt;br /&gt;
Success is built sequentially over time &amp;#8211; not simultaneously&lt;br /&gt;
One thing manifests in many ways:&lt;br /&gt;
  &amp;#8211; One person&lt;br /&gt;
  &amp;#8211; One passion/skill&lt;br /&gt;
(The one thing can change)&lt;br /&gt;
Passion &amp;#8594; Skill &amp;#8594; Results &amp;#8594; Enjoyment &amp;#8594; back to Passion&lt;br /&gt;
One thing should be specific, not generic &amp;#8211; &amp;#8220;be totally awesome&amp;#8221; is not valid&lt;br /&gt;
Don&amp;#8217;t trust everything you hear &amp;#8211; especially if it sounds true.&lt;br /&gt;
6 lies between you &amp;amp; success -&lt;br /&gt;
  1. Everything is equal&lt;br /&gt;
  2. Multitasking&lt;br /&gt;
  3. A disciplined life&lt;br /&gt;
  4. Willpower is always on Will-Call&lt;br /&gt;
  5. A balanced life&lt;br /&gt;
  6. Big is bad&lt;/p&gt;
&lt;p&gt;1. Everything is equal&lt;br /&gt;
Not everything important is urgent &amp;#8211; when everything feels urgent &amp;amp; important, everything seems equal. Active &amp;amp; busy != productive&lt;br /&gt;
Achievers work with a clear sense of priority&lt;br /&gt;
Instead of todo list, succes list &amp;#8211; list of stuff that will make you successful&lt;br /&gt;
What matters most right now?&lt;br /&gt;
A todo list with Paretos principle applied is a success list&lt;br /&gt;
Apply Pareto continuously until left with one thing&lt;br /&gt;
Say &amp;#8220;no&amp;#8221; more often &amp;#8211; doesn&amp;#8217;t matter whether it&amp;#8217;s &amp;#8220;not now&amp;#8221; or &amp;#8220;never&amp;#8221;&lt;/p&gt;
&lt;p&gt;2. Multitasking&lt;br /&gt;
Multitasking is merely the opportunity to screw up more than one thing at a time&lt;br /&gt;
The cost in terms of extra time from having to task switch depends on how complex or simple the tasks are &amp;#8211; it can range from time increases of 25% or less for simple tasks to well over 100% or more for very complicated tasks&lt;br /&gt;
Our brain has channels, and as a result we&amp;#8217;re able to process different kinds of data in different parts of our brain&lt;br /&gt;
Take on two things and your attention gets divided. Take on a third and something gets dropped.&lt;br /&gt;
The problem of trying to focus on two things at once shows up when one task demands more attention or if it crosses into a channel already in use (senses &amp;#8211; sight, smell, hearing, touch, taste)&lt;br /&gt;
Multitasking short-circuits us:&lt;br /&gt;
  1. Limited brain capability &amp;#8211; dividing tasks up incurs cost in time and effectiveness&lt;br /&gt;
  2. The longer you&amp;#8217;re switched from a task, less likely to switch back. Loose ends pile up&lt;br /&gt;
  3. Lose time switching tasks. Lose 28% of avg. workday to context switch.&lt;br /&gt;
  4. Chronic multitaskers think tasks take longer to complete than actually required&lt;br /&gt;
  5. Multitasking causes mistakes &amp;#8211; make poorer decisions by favoring new information over old, even if old is more valuable&lt;br /&gt;
  6. Causes stress&lt;br /&gt;
Multitasking can be fatal &amp;#8211; surgeosn and pilots are expected to focus on their jobs.&lt;br /&gt;
Rest of us live by another standard &amp;#8211; is our job less valuable or important?&lt;br /&gt;
Your work deserves no less respect&lt;/p&gt;
&lt;p&gt;3. A disciplined life&lt;br /&gt;
Achievement doesn&amp;#8217;t require full time discipline &amp;#8211; sprint of discipline for long enough for habit to take over&lt;br /&gt;
We need just enough dicipline to build the habit&lt;br /&gt;
Disciplined people have just trained habits&lt;br /&gt;
Success is about doing the right thing, not doing everything right&lt;br /&gt;
Takes an average of 66 days to acquire a new habit&lt;br /&gt;
Build one habit at a time (no multitasking!)&lt;/p&gt;
&lt;p&gt;4. Willpower is always on Will-Call&lt;br /&gt;
Powerful motivation won&amp;#8217;t guarantee willpower&lt;br /&gt;
Using willpower effectively should be a high priority&lt;br /&gt;
When you have will, harness it&lt;br /&gt;
Willpower has limited battery lif, can be recharged with downtime&lt;br /&gt;
Each act of will decreases available willpower&lt;br /&gt;
When willpower fails, fallback on default behavior&lt;br /&gt;
What are your default behaviors? (linking back to habit)&lt;br /&gt;
Make doing what matters most a priority when your willpower is highest&lt;/p&gt;
&lt;p&gt;5. A balanced life&lt;br /&gt;
Viewed wistfully as a noun, balance is lived practically as a verb (not something you have, something you do)&lt;br /&gt;
If balance is middle, out of balance is when away from middle&lt;br /&gt;
Living in middle is unextraordinary&lt;br /&gt;
Knowing when to pursue middle and when to pursue extremes is wisdom&lt;br /&gt;
Magic never happens in the middle &amp;#8211; magic happens at the extremes&lt;br /&gt;
Don&amp;#8217;t strive for balance &amp;#8211; strive for counterbalance&lt;br /&gt;
Never go so far in one direction that you can&amp;#8217;t find your way back, or stay so long that there is nothing waiting for you when you return (don&amp;#8217;t neglect one aspect so long it atrophies)&lt;br /&gt;
Act on priority, automatically go out of balance&lt;br /&gt;
Challenge is in how long you stay on priority&lt;/p&gt;
&lt;p&gt;6. Big is bad&lt;br /&gt;
Fear that big success causes pressure and stress&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Book Notes: The Creative Habit</title>
   <link href="http://www.timgittos.com/books/book-notes-the-creative-habit"/>
   <updated>2014-01-30T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/books/book-notes-the-creative-habit</id>
   <content type="html">&lt;div class=&quot;review-header&quot;&gt;
&lt;p class=&quot;left&quot;&gt;&lt;img src=&quot;/images/books/creative-habit.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Amazon&lt;/strong&gt;: &lt;a href=&quot;http://www.amazon.com/gp/product/0743235274/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0743235274&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;The Creative Habit: Learn It and Use It for Life&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=0743235274&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;br /&gt;
 (referral link &amp;#8211; help me buy new books!)&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;ISBN&lt;/span&gt;&lt;/strong&gt;: 0743235274&lt;br /&gt;
&lt;strong&gt;Read&lt;/strong&gt;: 2013-09-02&lt;/p&gt;
&lt;p&gt;I struggled to finish this book, for reasons I can&amp;#8217;t quite put my finger on. I initially started to figure out how to reign in my creativity and put it more &amp;#8220;on tap&amp;#8221; than it&amp;#8217;s been before. This book definitely helped do that, but I still struggled to focus. I think because the author relied a lot on anecdotes from her career as a choreographer and dancer, I found it difficult to extract the moral from some stories.&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Notes&lt;/h2&gt;
&lt;p&gt;I have a notebook full of about 3 pages of excerpts from, and single sentence ideas inspired by, this book. I intended to go back and form them into coherrent paragraphs of notes based on what I recalled from the book, but seeing as how I didn&amp;#8217;t get around to it and it&amp;#8217;s 4 months later, I can&amp;#8217;t string my notes together well enough.&lt;/p&gt;
&lt;p&gt;Rather than procrastinating on this and letting the notes languish in my notebook, I&amp;#8217;m just going to dump the notes here raw. There&amp;#8217;s still a lot of great ideas here, and if you want to find out more about what the notes mean, buy the book!&lt;/p&gt;
&lt;p&gt;I will do better with writing my notes in the future (I hope).&lt;/p&gt;
&lt;p&gt;&amp;#8212;&lt;/p&gt;
&lt;p&gt;Creativity is a habit&lt;br /&gt;
In order to be creative, you have to know how to prepare to be creative&lt;br /&gt;
Everything that happens in a day is a transaction between the external world and your internal world&lt;br /&gt;
Everything is relevant and usable&lt;br /&gt;
Establish rituals at beginning of creative process &amp;#8211; when you are most likely to give up &amp;amp; chicken out. Remove the question &amp;#8220;Why am I doing this?&amp;#8221;&lt;br /&gt;
To get the creative habit, you need a work environment that is habit forming&lt;br /&gt;
Making the start automatic replaces doubt &amp;amp; fear with comfort &amp;amp; routine&lt;br /&gt;
Combat fears by confronting &amp;amp; analyzing them&lt;br /&gt;
Combat distractions by avoiding them&lt;br /&gt;
Artists have &amp;#8220;creative &lt;span class=&quot;caps&quot;&gt;DNA&lt;/span&gt;&amp;#8221; that characterizes their work&lt;br /&gt;
Artists have a &amp;#8220;focal length&amp;#8221; in their work &amp;#8211; how they view the world. Distant, medium &amp;amp; close.&lt;br /&gt;
Zoe &amp;#8211; distant, from a far &amp;#8211; zoology&lt;br /&gt;
Bios &amp;#8211; close ,detail &amp;#8211; biology&lt;br /&gt;
Stretch &amp;amp; endure discomfort to grow, but don&amp;#8217;t go against your nature&lt;br /&gt;
Mine your memory for inspiration&lt;br /&gt;
Creativity is about connecting memories and creating metaphors&lt;br /&gt;
Copying is a way to learn skill, as long as you focus on the method, not the result.&lt;br /&gt;
When inspiration strikes, plumb it&amp;#8217;s depths and explore it &amp;#8211; like a brainstorm. Create metaphors.&lt;br /&gt;
Don&amp;#8217;t worry about pivoting &amp;#8211; if you feel a pivot, do it&lt;br /&gt;
&amp;#8220;A photo is a memory captured&amp;#8221; &amp;#8211; shadow your heroes/inspirations, absorb the memory from their work, turn it into &lt;span class=&quot;caps&quot;&gt;YOUR&lt;/span&gt; memory. Draw from it when you&amp;#8217;re stuck.&lt;br /&gt;
Write everything down &amp;amp; organize it&lt;br /&gt;
Everyone uses reference material&lt;br /&gt;
Pre-idea: When you&amp;#8217;re interested in something but you don&amp;#8217;t know why&lt;br /&gt;
Begin each project with a stated goal&lt;br /&gt;
Ideas &amp;amp; research are not replacements for creativity&lt;br /&gt;
The quality of research determines the quality of your output&lt;br /&gt;
Scratching helps you find ideas &amp;#8211; search for something that catches your attention&lt;br /&gt;
A good idea is one that expands upon itself. A bad one shuts itself off.&lt;br /&gt;
You don&amp;#8217;t &amp;#8220;scratch&amp;#8221; for big ideas &amp;#8211; they grow from small ones, or strike you unbidden.&lt;br /&gt;
You can&amp;#8217;t think your way into a dance &amp;#8211; you can only generate ideas by doing something physical (when in programming &amp;#8211; &lt;span class=&quot;caps&quot;&gt;REPL&lt;/span&gt; = better than thinking)&lt;br /&gt;
The act of restraining defeats the purpose of scratching &amp;#8211; sketchbooks should be private&lt;br /&gt;
Scratching methods include:&lt;br /&gt;
  &amp;#8211; Reading &amp;#8211; ImagineFX, novels, magazines&lt;br /&gt;
  &amp;#8211; Conversation&lt;br /&gt;
  &amp;#8211; Other people&amp;#8217;s handiwork &amp;#8211; art, music, etc&lt;br /&gt;
  &amp;#8211; Mentors &amp;amp; heroes &amp;#8211; footsteps (create, don&amp;#8217;t imitate)&lt;br /&gt;
  &amp;#8211; Nature&lt;br /&gt;
Don&amp;#8217;t stop scratching at 1 idea&lt;br /&gt;
A + B = C &amp;#8211; need to combine 2 ideas to have a concept&lt;br /&gt;
Rules of scratching:&lt;br /&gt;
  &amp;#8211; be in shape&lt;br /&gt;
  &amp;#8211; scratch in the best places&lt;br /&gt;
  &amp;#8211; never scratch in the same place twice&lt;br /&gt;
  &amp;#8211; maintain the white hot pitch&lt;br /&gt;
Scratching is unleashing furious, wordless energy&lt;br /&gt;
(Riff back and forth with a friend or colleague)&lt;br /&gt;
Productive artists know what they&amp;#8217;re going to do, how to do it, what to do when something goes wrong&lt;br /&gt;
Be prepared to be lucky&lt;br /&gt;
Don&amp;#8217;t sacrifice creativity for the plan&lt;br /&gt;
Don&amp;#8217;t overplan &amp;#8211; leave room for luck/accidents&lt;br /&gt;
Limited resources (time) enhance creativity. &amp;#8220;Give me a writer who thinks he has all the time in the world and I&amp;#8217;ll show you a writer who never delivers&amp;#8221;&lt;br /&gt;
Mistakes in overplanning:&lt;br /&gt;
  &amp;#8211; Rely too much on others&lt;br /&gt;
  &amp;#8211; Waiting for perfect setup *&lt;br /&gt;
  &amp;#8211; Overthinking structure&lt;br /&gt;
  &amp;#8211; Feeling obligated to finish what you started *&lt;br /&gt;
  &amp;#8211; Working with the wrong materials&lt;br /&gt;
Scratch to find spine&lt;br /&gt;
Spine is core idea of work, keeps you on track&lt;br /&gt;
Spine doesn&amp;#8217;t need to be obvious, but can be&lt;br /&gt;
Spine can be theme, technique, idea&lt;br /&gt;
All works of art have a story, a theme and a spine. Spine &amp;amp; theme can be the same.&lt;br /&gt;
Creativity does not eliminate need for skill&lt;br /&gt;
Deliberate practice&lt;br /&gt;
Beginners mind&lt;br /&gt;
Sometimes find self in a rut&lt;br /&gt;
Rut != creative block&lt;br /&gt;
Fix creative block by doing something&lt;br /&gt;
Rut is false start&lt;br /&gt;
Caused by bad idea, bad timing, bad luck&lt;br /&gt;
Fix by seeing rut, admitting in rut, get out with new idea:&lt;br /&gt;
  &amp;#8211; Identify concept not working&lt;br /&gt;
  &amp;#8211; Write down assumptions&lt;br /&gt;
  &amp;#8211; Challenge assumptions&lt;br /&gt;
  &amp;#8211; Act on challenge&lt;br /&gt;
Getting out of a rut is not getting into groove &amp;#8211; avoiding bad idea is not coming up with good idea&lt;br /&gt;
Failing is healthy, but do it in private&lt;br /&gt;
Forget the pain of failure, remember lessons&lt;br /&gt;
Create bubble &amp;lt;=&amp;gt; startups&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 29</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-29"/>
   <updated>2014-01-29T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-29</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85409270&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140129.png&quot;&gt;&lt;img src=&quot;/images/365/20140129.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Drawing hands! I&amp;#8217;ve always felt that drawing hands was very therapeutic and relaxing. I noticed while drawing today that my strokes are getting more confident, which is a good thing. I still struggle to draw what I really see, instead of what my brain is telling me I&amp;#8217;m seeing.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-28/&quot;&gt;Day 28&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-30/&quot;&gt;Day 30&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 28</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-28"/>
   <updated>2014-01-28T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-28</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85321105&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140128.png&quot;&gt;&lt;img src=&quot;/images/365/20140128.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Finally finished the portrait today. I had a lot of trouble rendering the leather arm in a way that wasn&amp;#8217;t distracting &amp;#8211; it&amp;#8217;s such a large mass that&amp;#8217;s textured in a way that makes it difficult to render. I also struggled a little with the background, and ultimately decided against one for reasons stated in the video. Tomorrow I&amp;#8217;ll probably try some anatomy exercises for hands.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;: &lt;a href=&quot;http://www.pinterest.com/pin/205124958001518518/&quot;&gt;http://www.pinterest.com/pin/205124958001518518/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-27/&quot;&gt;Day 27&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-29/&quot;&gt;Day 29&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Skeletal Animation</title>
   <link href="http://www.timgittos.com/articles/graphics/animation/skeletal-animation"/>
   <updated>2014-01-27T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/articles/graphics/animation/skeletal-animation</id>
   <content type="html">&lt;p&gt;http://www.3dkingdoms.com/weekly/weekly.php?a=4&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Inverse Kinematics</title>
   <link href="http://www.timgittos.com/articles/graphics/animation/inverse-kinematics"/>
   <updated>2014-01-27T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/articles/graphics/animation/inverse-kinematics</id>
   <content type="html">&lt;p&gt;http://www.3dkingdoms.com/ik.htm&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 27</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-27"/>
   <updated>2014-01-27T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-27</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85223361&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140127.png&quot;&gt;&lt;img src=&quot;/images/365/20140127.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I continued my portrait of Peter Dinklage, and made some very questionable rendering decisions that I&amp;#8217;ll deal with tomorrow.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;: &lt;a href=&quot;http://www.pinterest.com/pin/205124958001518518/&quot;&gt;http://www.pinterest.com/pin/205124958001518518/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-26/&quot;&gt;Day 26&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-28/&quot;&gt;Day 28&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 26</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-26"/>
   <updated>2014-01-26T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-26</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85130332&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140126.png&quot;&gt;&lt;img src=&quot;/images/365/20140126.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I decided to try my hand at another portrait from a photo. It started really slow and frustrating as I struggled to get a grip on the size of the canvas, but once I got the ball rolling, it really fell into place nicely. Initially I wasn&amp;#8217;t planning on continuing this tomorrow, but I like it too much to give up on it now.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;: &lt;a href=&quot;http://www.pinterest.com/pin/205124958001518518/&quot;&gt;http://www.pinterest.com/pin/205124958001518518/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-25/&quot;&gt;Day 25&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-27/&quot;&gt;Day 27&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 25</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-25"/>
   <updated>2014-01-25T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-25</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85054601&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140125.png&quot;&gt;&lt;img src=&quot;/images/365/20140125.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now that I&amp;#8217;ve wrapped up the lips study, I copied from a bargue drawing of a statue&amp;#8217;s nose and lips from various angles, as a way to cap off the last 4 days of studies. Not sure what I&amp;#8217;m going to do tomorrow.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;: &lt;a href=&quot;http://www.pinterest.com/pin/564638872002840196/&quot;&gt;http://www.pinterest.com/pin/564638872002840196/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-24/&quot;&gt;Day 24&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-26/&quot;&gt;Day 26&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 24</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-24"/>
   <updated>2014-01-24T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-24</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/85016343&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140124.png&quot;&gt;&lt;img src=&quot;/images/365/20140124.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Not much to say about today other than that I finished my lip study. I also tried warming up to see if it helps with the initial mistakes I make at the start of each session, and I feel it did. Definitely reduced some of the frustration I feel at the start.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;: &lt;a href=&quot;http://www.pinterest.com/pin/564638872002840227/&quot;&gt;http://www.pinterest.com/pin/564638872002840227/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-23/&quot;&gt;Day 23&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-25/&quot;&gt;Day 25&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 23</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-23"/>
   <updated>2014-01-23T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-23</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84925178&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140123.png&quot;&gt;&lt;img src=&quot;/images/365/20140123.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I got a start on studying lips. Again, I didn&amp;#8217;t get as much done as I had wanted, but I think it&amp;#8217;s best to take it slow and make sure I understand what I&amp;#8217;m drawing.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;: &lt;a href=&quot;http://www.pinterest.com/pin/564638872002840271/&quot;&gt;http://www.pinterest.com/pin/564638872002840271/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-22/&quot;&gt;Day 22&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-24/&quot;&gt;Day 24&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 22</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-22"/>
   <updated>2014-01-22T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-22</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84831235&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140122.png&quot;&gt;&lt;img src=&quot;/images/365/20140122.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I finished studying noses and did a little bit of hatching rendering. I discovered that I&amp;#8217;m really not very good at rendering through hatching, especially on the graphics tablet. Tomorrow I&amp;#8217;m going to start on lips and the mouth.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;: &lt;a href=&quot;http://www.pinterest.com/pin/564638872002861091/&quot;&gt;http://www.pinterest.com/pin/564638872002861091/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-21/&quot;&gt;Day 21&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-23/&quot;&gt;Day 23&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 21</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-21"/>
   <updated>2014-01-21T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-21</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84748536&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140121.png&quot;&gt;&lt;img src=&quot;/images/365/20140121.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I continue addressing weaknesses in my last drawing from imagination, this time focusing on the nose. I didn&amp;#8217;t quite get as much done as I wanted to do, so I&amp;#8217;ll finish the rest tomorrow.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;: &lt;a href=&quot;http://www.pinterest.com/pin/564638872002861091/&quot;&gt;http://www.pinterest.com/pin/564638872002861091/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-20/&quot;&gt;Day 20&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-22/&quot;&gt;Day 22&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 20</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-20"/>
   <updated>2014-01-20T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-20</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84650586&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140120.png&quot;&gt;&lt;img src=&quot;/images/365/20140120.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After identifying weak areas from the last drawing, today I begin working on fixing those weak areas. First up is, copying some eye bargue drawings to get familiar with a human eye from various angles.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt;: &lt;a href=&quot;http://www.pinterest.com/pin/564638872003754000/&quot;&gt;http://www.pinterest.com/pin/564638872003754000/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-19/&quot;&gt;Day 19&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-21/&quot;&gt;Day 21&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 19</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-19"/>
   <updated>2014-01-19T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-19</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84551540&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140119.png&quot;&gt;&lt;img src=&quot;/images/365/20140119.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I completed the drawing from yesterday. My line quality is awful, and the guy&amp;#8217;s face looks so generic and ridiculous that it&amp;#8217;s given me a direction. All in all, it wasn&amp;#8217;t as terrifying as I was axious about it being, but it definitely didn&amp;#8217;t end up great. Still, it&amp;#8217;s a step in the right direction.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-18/&quot;&gt;Day 18&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-20/&quot;&gt;Day 20&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 18</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-18"/>
   <updated>2014-01-18T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-18</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84497605&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140118.png&quot;&gt;&lt;img src=&quot;/images/365/20140118.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After yesterday, I&amp;#8217;ve decided that a more &amp;#8220;project&amp;#8221; based approach might be beneficial. My first project is to draw my current D&amp;amp;D character. I struggled a bit with the pose, like I was anxious I would, but in the end I think I got some kind of flow going.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-17/&quot;&gt;Day 17&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-19/&quot;&gt;Day 19&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 17</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-17"/>
   <updated>2014-01-17T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-17</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84451094&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140117.png&quot;&gt;&lt;img src=&quot;/images/365/20140117.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today was tough. I got bored of finishing the castle staircase, and due to fatigue wasn&amp;#8217;t really feeling drawing. But the whole point of this exercise is to put in the work and draw regularly, so I pushed through with some anatomy studies from Bridgmans.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-16/&quot;&gt;Day 16&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-18/&quot;&gt;Day 18&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 16</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-16"/>
   <updated>2014-01-16T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-16</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84400903&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140116.png&quot;&gt;&lt;img src=&quot;/images/365/20140116.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After a Windows Update took out my Wacom driver and fighting for an hour to get it installed again, I didn&amp;#8217;t make as much progress on the final drawing as I&amp;#8217;d have liked. At 2am I decided to stop and finish it the next day.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image I drew: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588701224/&quot;&gt;http://www.pinterest.com/pin/333970128588701224/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-15/&quot;&gt;Day 15&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-17/&quot;&gt;Day 17&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 15</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-15"/>
   <updated>2014-01-15T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-15</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84285573&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140115.png&quot;&gt;&lt;img src=&quot;/images/365/20140115.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After yesterday&amp;#8217;s revelation, I&amp;#8217;m trying my hand at drawing from another photo, this time taking a lot of effort to make sure I get it as close as possible. I chose an interesting castle staircase from Pinterest for this one, and realized it had some challenging perspective after the fact.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of image I drew: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588701224/&quot;&gt;http://www.pinterest.com/pin/333970128588701224/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-14/&quot;&gt;Day 14&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-16/&quot;&gt;Day 16&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>You Build a Wall One Brick at a Time</title>
   <link href="http://www.timgittos.com/blog/you-build-a-wall-one-brick-at-a-time"/>
   <updated>2014-01-14T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/you-build-a-wall-one-brick-at-a-time</id>
   <content type="html">&lt;p&gt;Back in 2013, I promised that I would &lt;a href=&quot;/blog/do-the-work&quot;&gt;show up and do the work&lt;/a&gt; and subsequently didn&amp;#8217;t do it. The fear of starting took hold and I got too caught up in not sucking to get good at anything:&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;854&quot; height=&quot;510&quot; src=&quot;//www.youtube.com/embed/DN43sCyEanA&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;However, I made a snap decision to &amp;#8220;show up and do the work&amp;#8221; around Christmas while talking to some friends about New Years resolutions. Normally my go to &amp;#8220;resolution&amp;#8221; is to resolve to not make any resolutions. Instead of answering with that when asked though, I answered with a plan to draw a little every day and record it.&lt;/p&gt;
&lt;p&gt;Normally I believe that if you want to make a change in your life, you should just make the change. Not hang it on some &amp;#8220;significant&amp;#8221; time, like next week, next month or next year. But with the new year coming up, restricting the drawing thing to a year seemed like a great idea. At the end of the year, I should have at least 100 hours of video and over 300 drawings with which to show the power of the idea of putting in the work.&lt;/p&gt;
&lt;p&gt;Tonight I&amp;#8217;ll have my 14th session, sticking with this plan for 2 weeks, and it&amp;#8217;s amazing. I can already see progress and I&amp;#8217;ve opened the idea up to doing &amp;#8220;art&amp;#8221; at least once per day. That way I&amp;#8217;m not restricted to just drawing. In fact, the idea is so great that I&amp;#8217;ve started applying it to other areas of my life.&lt;/p&gt;
&lt;p&gt;Anyone who is following along with my blog (nobody as far as I&amp;#8217;m aware, haha) will know that I&amp;#8217;m also working on a business with some friends. As of about a week ago, I spend every lunch time I have free from work at a coffee shop working on the business. I&amp;#8217;m only working about 45 minutes a day, not even a full working day through the week but I&amp;#8217;m already getting a lot done. I completed something I&amp;#8217;ve been wanting to do for a few months and it only took about a week of lunch times.&lt;/p&gt;
&lt;p&gt;If you have a large task or goal that seems imposing, commit to doing a little bit every day and don&amp;#8217;t be afraid of being terrible at it. This isn&amp;#8217;t the first time I&amp;#8217;ve repeated such advice but it is the first time I do so from a position of (admitedly little) experience. If you have any doubt, come back next year and see where I am with my art and business. The proof of the pudding is in the eating.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 14</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-14"/>
   <updated>2014-01-14T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-14</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84192304&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140114.png&quot;&gt;&lt;img src=&quot;/images/365/20140114.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I drew from some photo references, focusing on the anatomy of the neck from an actual real person.&lt;/p&gt;
&lt;p&gt;I discovered that I&amp;#8217;m still not very good at drawing from life/photo reference, and that I&amp;#8217;m not seeing shapes as 3D volumes. I also think I need to work value into my art sooner rather than later.&lt;/p&gt;
&lt;p&gt;URLs of images I drew:&lt;br /&gt;
First guy: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588436241/&quot;&gt;http://www.pinterest.com/pin/333970128588436241/&lt;/a&gt;&lt;br /&gt;
Second guy: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588346197/&quot;&gt;http://www.pinterest.com/pin/333970128588346197/&lt;/a&gt;&lt;br /&gt;
Third guy: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588965142/&quot;&gt;http://www.pinterest.com/pin/333970128588965142/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-13/&quot;&gt;Day 13&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-15/&quot;&gt;Day 15&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 13</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-13"/>
   <updated>2014-01-13T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-13</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84098722&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140113.png&quot;&gt;&lt;img src=&quot;/images/365/20140113.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I kept going with the Bridgman neck studies today, this time focusing on the neck abstraction and looking at how everything moves together.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-12/&quot;&gt;Day 12&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-14/&quot;&gt;Day 14&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 12</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-12"/>
   <updated>2014-01-12T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-12</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/84014269&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140112.png&quot;&gt;&lt;img src=&quot;/images/365/20140112.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;More Bridgman studies as today I tackle the neck/clavicle region, and how it all fits together.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-11/&quot;&gt;Day 11&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-13/&quot;&gt;Day 13&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 11</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-11"/>
   <updated>2014-01-11T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-11</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83943170&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140111a.png&quot;&gt;&lt;img src=&quot;/images/365/20140111a.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140111b.png&quot;&gt;&lt;img src=&quot;/images/365/20140111b.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I followed Mr. Bridgman around and we examined the construction of the human jaw and how it interacts and moves.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-10/&quot;&gt;Day 10&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-12/&quot;&gt;Day 12&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 10</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-10"/>
   <updated>2014-01-11T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-10</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83907894&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140110.png&quot;&gt;&lt;img src=&quot;/images/365/20140110.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Drawing from a photo reference today. I thought I&amp;#8217;d get some portraiture in, and work on some eyes given what I covered yesterday. I picked the image I picked due to the fact that it&amp;#8217;s greyscale and her hair isn&amp;#8217;t crazy difficult to draw.&lt;/p&gt;
&lt;p&gt;The image of the girl I drew can be found here: &lt;a href=&quot;http://www.pinterest.com/pin/333970128588720306/&quot;&gt;http://www.pinterest.com/pin/333970128588720306/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-9/&quot;&gt;Day 9&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-11/&quot;&gt;Day 11&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 9</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-9"/>
   <updated>2014-01-10T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-9</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83859112&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140109.png&quot;&gt;&lt;img src=&quot;/images/365/20140109.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Before I draw anymore faces or figures, I want to look at how a human eye is constructed, not just how to draw what I see on the eye. This will help to come up with unique angles that I may not have a reference for.&lt;/p&gt;
&lt;p&gt;The eye tutorial I used: &lt;a href=&quot;http://conceptcookie.deviantart.com/art/Eye-Tutorial-Resource-327176361&quot;&gt;http://conceptcookie.deviantart.com/art/Eye-Tutorial-Resource-327176361&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-8/&quot;&gt;Day 8&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-10/&quot;&gt;Day 10&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 8</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-8"/>
   <updated>2014-01-09T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-8</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83741300&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140108.png&quot;&gt;&lt;img src=&quot;/images/365/20140108.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Time for some more photo reference practice. This time I drew a bust of a statue that I found on sxc.hu. Things got tricky as I realized that I need to use value to describe some of the shapes.&lt;/p&gt;
&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; for the stock photo I drew: &lt;a href=&quot;http://www.sxc.hu/photo/1431577&quot;&gt;http://www.sxc.hu/photo/1431577&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-7/&quot;&gt;Day 7&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-9/&quot;&gt;Day 9&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 7</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-7"/>
   <updated>2014-01-08T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-7</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83656383&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140107.png&quot;&gt;&lt;img src=&quot;/images/365/20140107.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Continuing with the theme of proportions for the human body, I looked at proportions and methods to draw the human head. As it turns out, my knowledge of head construction leaves a lot to be desired. It&amp;#8217;s an area that I&amp;#8217;m going to want to focus more on.&lt;/p&gt;
&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of the proportions I was using: &lt;a href=&quot;http://nattosoup.blogspot.com/2012/03/facial-anatomy-and-construction.html&quot;&gt;http://nattosoup.blogspot.com/2012/03/facial-anatomy-and-construction.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-6/&quot;&gt;Day 6&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-8/&quot;&gt;Day 8&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 6</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-6"/>
   <updated>2014-01-07T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-6</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83554271&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140106.png&quot;&gt;&lt;img src=&quot;/images/365/20140106.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I did the back view of the proportional guy, and explored some abstraction techniques for drawing figures.&lt;/p&gt;
&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of the proportions I was using: &lt;a href=&quot;http://www.goregoregore.com/steps/bodypattern1.jpg&quot;&gt;http://www.goregoregore.com/steps/bodypattern1.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-5/&quot;&gt;Day 5&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-7/&quot;&gt;Day 7&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 5</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-5"/>
   <updated>2014-01-06T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-5</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83476701&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140105.png&quot;&gt;&lt;img src=&quot;/images/365/20140105.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Continuing on from yesterday, I drew the proportions of a man from the side view.&lt;/p&gt;
&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of the proportions I was using: &lt;a href=&quot;http://www.goregoregore.com/steps/bodypattern1.jpg&quot;&gt;http://www.goregoregore.com/steps/bodypattern1.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-4/&quot;&gt;Day 4&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-6/&quot;&gt;Day 6&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 4</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-4"/>
   <updated>2014-01-05T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-4</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83404317&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140104.png&quot;&gt;&lt;img src=&quot;/images/365/20140104.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I took a crack at relearning human proportion. Wow, am I rusty. I was expecting to get through more, but it totally kicked my butt.&lt;/p&gt;
&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of the proportions I was using: &lt;a href=&quot;http://www.goregoregore.com/steps/bodypattern1.jpg&quot;&gt;http://www.goregoregore.com/steps/bodypattern1.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And the &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of the page I found it linked from: &lt;a href=&quot;http://figure-drawings.blogspot.com/2008/10/human-anatomy-for-artists.html&quot;&gt;http://figure-drawings.blogspot.com/2008/10/human-anatomy-for-artists.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-3/&quot;&gt;Day 3&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-5/&quot;&gt;Day 5&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 3</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-3"/>
   <updated>2014-01-04T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-3</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83368940&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140103.png&quot;&gt;&lt;img src=&quot;/images/365/20140103.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I applied a technique from Betty Edward&amp;#8217;s &amp;#8220;Drawing on the Right Side of the Brain&amp;#8221;, where I draw something upside down to stop the brain interfering with while drawing what I see. It removes the association of the image and lets you concentrate on shapes. I drew the car again, this time upside down!&lt;/p&gt;
&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of the image I drew (you&amp;#8217;ll need to turn it upside down): &lt;a href=&quot;http://img2.netcarshow.com/Gumpert-Apollo_2008_1024x768_wallpaper_01.jpg&quot;&gt;http://img2.netcarshow.com/Gumpert-Apollo_2008_1024x768_wallpaper_01.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-2/&quot;&gt;Day 2&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-4&quot;&gt;Day 4&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 2</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-2"/>
   <updated>2014-01-03T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-2</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83317033&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140102.png&quot;&gt;&lt;img src=&quot;/images/365/20140102.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Today I set a &amp;#8216;benchmark&amp;#8217; of sorts to establish a base level of starting skill, by drawing a supercar. I screwed up the mic volume on this one, so you can&amp;#8217;t hear me ramble on about drawing what you see. Also, the file was really big and I had to halve the size. This might happen frequently.&lt;/p&gt;
&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of the image I drew: &lt;a href=&quot;http://img2.netcarshow.com/Gumpert-Apollo_2008_1024x768_wallpaper_01.jpg&quot;&gt;http://img2.netcarshow.com/Gumpert-Apollo_2008_1024x768_wallpaper_01.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-1/&quot;&gt;Day 1&lt;/a&gt; | &lt;a href=&quot;/projects/365-days-of-art/day-3/&quot;&gt;Day 3&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>365 Days of Art - Day 1</title>
   <link href="http://www.timgittos.com/projects/365-days-of-art/day-1"/>
   <updated>2014-01-02T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/365-days-of-art/day-1</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;//player.vimeo.com/video/83208514&quot; width=&quot;700&quot; height=&quot;394&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/images/365/20140101.png&quot;&gt;&lt;img src=&quot;/images/365/20140101.png&quot; style=&quot;width: 700px;&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s the first day! Introductions and nervous, timid pen control exercises are the agenda for today.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/365-days-of-art/day-2/&quot;&gt;Day 2&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>2013 In Review, And a Look Forward to 2014</title>
   <link href="http://www.timgittos.com/blog/2013-in-review-and-a-look-forward-to-2014"/>
   <updated>2014-01-02T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/2013-in-review-and-a-look-forward-to-2014</id>
   <content type="html">&lt;p&gt;As should be obvious to me by now, 2013 was very different from &lt;a href=&quot;/blog/2012-in-review-and-a-look-forward-to-2013/&quot;&gt;what I expected in 2012&lt;/a&gt; . I gave myself pretty much free reign to do whatever I wanted, as long as I was &lt;em&gt;creating&lt;/em&gt;. So naturally, I read a few books, did half of some MOOCs and didn&amp;#8217;t actually create much of anything (sort of).&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s what I did:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Travelled to the UK and Ireland in a whirlwind tour of London, Edinburgh and Dublin. Ate haggis, got mistaken for an exhibit at the Edinburgh castle (and scared some poor tourist half to death) and prayed for my life during the flight from Edinburgh to Dublin aboard a &lt;a href=&quot;http://en.wikipedia.org/wiki/ATR_72#Accidents_and_incidents&quot;&gt;&lt;span class=&quot;caps&quot;&gt;ATR&lt;/span&gt;-72&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Travelled domestically in the US to LA, Colorado Springs and Las Vegas (only Las Vegas was a revisit) for work and pleasure.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Read books and wrote notes/thoughts about them. There are notes on 5 books on my blog, and notes for 2 more books in my little reading notepad. I&amp;#8217;m half way through a 3rd that&amp;#8217;s not on the site yet.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Attended &lt;span class=&quot;caps&quot;&gt;SXSW&lt;/span&gt; and started something crazy that I&amp;#8217;ll get into in a bit&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Started 2 personal projects: &lt;a href=&quot;https://github.com/tgittos/pdfstitcher&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; Stitcher&lt;/a&gt; and &lt;a href=&quot;https://github.com/tgittos/annot8&quot;&gt;annot8&lt;/a&gt; . &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; Stitcher was finished and &lt;a href=&quot;http://pdfstitcher.com/&quot;&gt;deployed&lt;/a&gt; but annot8 hasn&amp;#8217;t gone anywhere.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Started and abandoned 2 more MOOCs: &lt;a href=&quot;http://localhost:4000/learning/princeton-algorithms-part-1&quot;&gt;Algorithms, Part 1&lt;/a&gt; and &lt;a href=&quot;http://localhost:4000/learning/coursera-functional-programming-principles-in-scala&quot;&gt;Functional Programming Principles in Scala&lt;/a&gt; .&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Had close to $14k worth of dental work performed after 4 years of no dental checkups. At last count it was 3 root canals and 7 crowns along with various other procedures. Taking care of your teeth is crazy important.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Continued use of a physical journal&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even though the year was fairly different from how I intended to spend it, I&amp;#8217;m happy with how it turned out. I realized a few lessons that I think were important, and I finally took the plunge to do something I&amp;#8217;ve wanted to do for years but was always scared to.&lt;/p&gt;
&lt;p&gt;I learnt that it&amp;#8217;s OK to stop doing something if the situation changes. I started the MOOCs with every intention of finishing them, but life changed around me. My workload increased suddenly due to a co-workers relocation, and I didn&amp;#8217;t have the time to finish. So instead of causing myself a whole bunch of stress by trying to spread myself too thin, I stopped doing non-essential stuff, which meant the MOOCs. I do intend to go back and retake/finish them when it&amp;#8217;s more convenient, but for now I&amp;#8217;m glad I didn&amp;#8217;t force myself to finish.&lt;/p&gt;
&lt;p&gt;After hanging out with my friend Mark at &lt;span class=&quot;caps&quot;&gt;SXSW&lt;/span&gt;, in May, he, myself, and 3 other friends started a company with the intention of helping tabletop &lt;span class=&quot;caps&quot;&gt;RPG&lt;/span&gt; gamers to create &lt;a href=&quot;http://ad.ventur.in/?utm_source=timgittos.com&amp;amp;utm_medium=blog&amp;amp;utm_campaign=referral&quot;&gt;custom miniatures&lt;/a&gt; easily. A long time ago I realized that my career as-is is going to cap out and that business ownership is the next logical step. I&amp;#8217;ve been saturated in the startup world for 3 or 4 years now, and only &lt;strong&gt;now&lt;/strong&gt; have decided to give it a crack myself with more than a little prodding from Mark.&lt;/p&gt;
&lt;p&gt;This was a pivotal part of the year for me, as the product we&amp;#8217;re developing has pretty much taken all my time from that point on. It&amp;#8217;s interesting tech, we&amp;#8217;re at the forefront of a new industry and it&amp;#8217;s a product I would defenitely use myself. I&amp;#8217;ve already made a lot of mistakes and learnt a lot of things and I look forward to making more.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m going to approach 2014 with a similar philosophy that I wanted for 2013. I&amp;#8217;m not going to stick to any rules other than &amp;#8220;create things that are fun.&amp;#8221; Right now, I&amp;#8217;m having fun trying to build a product for a new company and imagining where we can go. I&amp;#8217;ll push that as far as I can while still having fun and then see what happens.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m also starting a &lt;a href=&quot;/projects/365-days-of-art/&quot;&gt;new project&lt;/a&gt; as well. I intend to put in work on creating art every day, and record it. I want to be able to look back on 365 recordings at the end of the year, and see progress on a skill that I&amp;#8217;ve been meaning to recapture for a few years.&lt;/p&gt;
&lt;p&gt;Finally, I&amp;#8217;m going to keep journaling, keep reading and taking notes and uploading them to this site.&lt;/p&gt;
&lt;p&gt;Until 2015, when we do this all again.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Hack Weekends</title>
   <link href="http://www.timgittos.com/blog/hack-weekends"/>
   <updated>2013-12-10T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/hack-weekends</id>
   <content type="html">&lt;p&gt;For a while now, I&amp;#8217;ve been sitting on a bunch of small projects that I&amp;#8217;ve wanted to knock out. Things like a simple marching cubes implementation and a quick tech demo of a simple guitar distortion effect to name a few. Small things that would probably take 4 or 5 hours over a weekend to knock out.&lt;/p&gt;
&lt;p&gt;Until now, I&amp;#8217;ve kind of just let the ideas sit in my mind until I either forget them, or they grow into a bigger project idea that I can justify adding to my queue of stuff to do. That I never get around to doing.&lt;/p&gt;
&lt;p&gt;Now I have another idea, and this one is about how to get these small ideas to fruition. Every now and then I find myself burnt out or stuck on my usual hobbies and side projects, and have a few hours to kill. I&amp;#8217;ve decided that it would be awesome to spend this time to just implement one of my small ideas in it&amp;#8217;s infancy. Just spend a few hours to have a crack, record the code and then write my thoughts on the experience.&lt;/p&gt;
&lt;p&gt;It doesn&amp;#8217;t matter if I produce anything worth while or just end up with a pile of mistakes. It&amp;#8217;s all still learning, and it&amp;#8217;s all still progress in something that interests me.&lt;/p&gt;
&lt;p&gt;In the odd chance that you&amp;#8217;re like me and you have these fleeting ideas that you sit on to grow or die, maybe try to take a quick crack at them document your experience. The worst case scenario is you kill a few hours to learn more about something you didn&amp;#8217;t know much about. The sky&amp;#8217;s the limit on the best case.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>You're an Adult - It's OK to be a Quitter</title>
   <link href="http://www.timgittos.com/blog/youre-an-adult-its-ok-to-be-a-quitter"/>
   <updated>2013-10-18T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/youre-an-adult-its-ok-to-be-a-quitter</id>
   <content type="html">&lt;p&gt;Since April, I&amp;#8217;ve been working on an &lt;span class=&quot;caps&quot;&gt;MVP&lt;/span&gt; for &lt;a href=&quot;http://ad.ventur.in/?utm_source=timgittos.com&amp;utm_medium=blog&amp;utm_campaign=referral&quot;&gt;Adventurin&amp;#8217;&lt;/a&gt;, mostly before work and on weekends. Then I got an email from &lt;a href=&quot;http://coursera.org&quot;&gt;Coursera&lt;/a&gt; stating that two of the courses on my watch list were being offered again. I enrolled in both, and started watching lectures, taking notes and completing assignments at work, during lunches and late afternoon downtime when your brain starts to feel like mush.&lt;/p&gt;
&lt;p&gt;I was plugging along for nearly a month in this fashion, then work hit me like a tonne of bricks. All of a sudden I had projects to finish on tight deadlines, and I started to starve the online courses so that I could finish actual work. Before I knew it, I found myself 3 weeks behind on one of my courses, and I&amp;#8217;m currently 2 weeks behind on the other. Until recently, I was determined to finish everything, and it was causing me a lot of stress.&lt;/p&gt;
&lt;p&gt;I started to have trouble sleeping, and was constantly preoccupied by what I should be doing at any given moment. I had so much to do and so many deadlines. Then it occurred to me one night that half of my deadlines are self imposed. Not only are they self imposed, but they&amp;#8217;re for things that don&amp;#8217;t really matter right now.&lt;/p&gt;
&lt;p&gt;So I quit the online courses.&lt;/p&gt;
&lt;p&gt;Yes, I would have loved to finish. I think they&amp;#8217;re worthwhile and will help me improve my day-to-day programming. But the amount of stress they were causing me was robbing my family and myself out of piece of mind and ultimately wasn&amp;#8217;t doing me any good. I can always go back and pick them up where I left them off.&lt;/p&gt;
&lt;p&gt;When we&amp;#8217;re growing up, a lot of us a taught that quitting something is bad. That you should be ashamed that you couldn&amp;#8217;t follow through with an obligation. While I&amp;#8217;m not going to analyze that in much depth, I can see some merit &amp;#8211; you&amp;#8217;re teaching grit and building a character that won&amp;#8217;t just quit because something is hard. Some of those feelings carry into adult life and it&amp;#8217;s important to recognize that the same rules no longer apply.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s not to say that you can just drop all your obligations when things do get hard. I didn&amp;#8217;t quit my job and I&amp;#8217;m not stopping work on the &lt;span class=&quot;caps&quot;&gt;MVP&lt;/span&gt;. I&amp;#8217;m quitting the extra stuff that isn&amp;#8217;t essential. I&amp;#8217;m not letting anyone else down but myself, and that&amp;#8217;s OK because I&amp;#8217;m gaining piece of mind. In fact I&amp;#8217;m also helping my family &amp;#8211; I&amp;#8217;m not a pleasant person to be around when I&amp;#8217;m distracted or stressed out.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s easy sometimes to push yourself past your limits, to a point where it&amp;#8217;s negatively affecting your life. If you ever find yourself in that situation, it&amp;#8217;s OK to quit doing some of the things that are causing stress. Just be mindful of who you might be disappointing. You don&amp;#8217;t need to be ashamed that you quit if you&amp;#8217;re doing it for the right reasons.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Coursera Functional Programming Principles in Scala - Week 3</title>
   <link href="http://www.timgittos.com/learning/coursera-functional-programming-principles-in-scala/week-3"/>
   <updated>2013-10-09T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/learning/coursera-functional-programming-principles-in-scala/week-3</id>
   <content type="html">&lt;h2&gt;Class Hierarchies&lt;/h2&gt;
&lt;p&gt;In the last few lectures, we have looked in depth at a lot of different aspects of a single class. In this lecture, we&amp;#8217;re going to generalize these apsects for class hierarchies. A class hierarchy is when more than one class cooperates to achieve a certain task.&lt;/p&gt;
&lt;p&gt;We&amp;#8217;re going to explore class hierarchies through implementing a set of classes that implements sets of integers with the following operations:&lt;/p&gt;
&lt;/notextile&gt;

Note the above class is marked abstract - that means one or more of it's methods is unimplemented, and you cannot directly create an instance of it. Abstract classes in Scala work the same as abstract classes in Java and C#.

We're going to implement the &lt;code&gt;IntSet&lt;/code&gt; class using a binary tree. A binary tree is a data structure that contains a root element, and two subtrees. Given that it's possible to have a subtree that has no subtrees (only a root element), we're also going to have to implement an empty tree.

When implementing the non-empty tree, we're going to keep to the following invariant: each node has a subtree on the left with values less than integer at the root, and a subtree on the right with values larger than integer at the root.

Following are implementations of the Empty tree, and the non-empty tree:

&lt;notextile&gt;&lt;p&gt;With the above implementation, note that if the left or the right subtree is an &lt;code&gt;Empty&lt;/code&gt; object, then the call for &lt;code&gt;contains&lt;/code&gt; will return false. If you ask an empty tree or subtree if an element is in it, the answer will always be false. Also note that adding an element to an &lt;code&gt;Empty&lt;/code&gt; tree will result in a &lt;code&gt;NonEmpty&lt;/code&gt; tree, with &lt;code&gt;Empty&lt;/code&gt; subtrees on the left and the right.&lt;/p&gt;
&lt;p&gt;The above classes are purely functional &amp;#8211; they involve no mutation. Each call to &lt;code&gt;incl&lt;/code&gt; returns a &lt;em&gt;new&lt;/em&gt; tree, not mutated trees. This makes the data structure what is called a &lt;em&gt;persistent data structure&lt;/em&gt;. A persistant data structure is so called because even when the data structure changes, the old version doesn&amp;#8217;t change &amp;#8211; still there until it goes out of scope. This will aid the implementation of some recursive methods.&lt;/p&gt;
&lt;p&gt;Also note that &lt;code&gt;Empty&lt;/code&gt; and &lt;code&gt;NonEmpty&lt;/code&gt; extend &lt;code&gt;IntSet&lt;/code&gt;. They conform to &lt;code&gt;IntSet&lt;/code&gt;, meaning they can be swapped out for each other. &lt;code&gt;IntSet&lt;/code&gt; is superclass of &lt;code&gt;Empty&lt;/code&gt; and &lt;code&gt;NonEmpty&lt;/code&gt;, and &lt;code&gt;Empty&lt;/code&gt; and &lt;code&gt;NonEmpty&lt;/code&gt; are subclasses of &lt;code&gt;IntSet&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In Scala, all user defined classes have a superclass. If no superclass is given, &lt;code&gt;java.lang.Object&lt;/code&gt; object is used. Every class has a set of &lt;em&gt;bases classes&lt;/em&gt; that are all of it&amp;#8217;s direct or indirect superclasses. For example, the base classes of &lt;code&gt;NonEmpty&lt;/code&gt; are &lt;code&gt;IntSet&lt;/code&gt; and &lt;code&gt;Object&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In our implementations above, &lt;code&gt;contains&lt;/code&gt; and &lt;code&gt;incl&lt;/code&gt; in &lt;code&gt;Empty&lt;/code&gt; and &lt;code&gt;NonEmpty&lt;/code&gt; implement the abstract functions in the base trait &lt;code&gt;IntSet&lt;/code&gt;. It&amp;#8217;s also possible to re-define existing, non-abstract definitions in subclasses using the &lt;code&gt;override&lt;/code&gt; keyword.&lt;/p&gt;
&lt;p&gt;Consider the following trivial example:&lt;/p&gt;
&lt;/notextile&gt;

&lt;code&gt;override&lt;/code&gt; is required in Scala when redefining method that has alredy been defined. In this way, Scala is more picky than Java (I assume &lt;code&gt;override&lt;/code&gt; is optional in Java). Requiring the &lt;code&gt;override&lt;/code&gt; provides additional compile time safety, as it will generate a compiler error if you try to implement a method that has already been defined, or try to override a method that doesn't exist on a base class. You can also use &lt;code&gt;override&lt;/code&gt; when implementing abstract methods, but this usage is optional.

h3. Singleton Objects

In the above implementation of &lt;code&gt;IntSet&lt;/code&gt;, one could argue there is only one single empty IntSet - we don't need to require the implementor to create many instances of it. Scala provides support for these semantics through an _object definition_.

For example:

&lt;notextile&gt;&lt;p&gt;The above example will define a singleton object, not a class. You can&amp;#8217;t create instances of it with &lt;code&gt;new&lt;/code&gt;. The object itself is created the first time it&amp;#8217;s referenced. Singleton objects are values themselves, so when applying an evaluation model, the singleton object evaluates to itself.&lt;/p&gt;
&lt;h3&gt;Scala Applications&lt;/h3&gt;
&lt;p&gt;So far we have executed Scala code from a &lt;span class=&quot;caps&quot;&gt;REPL&lt;/span&gt; or worksheet. This is convenient for rapid development, however not for creating applications. Fortunately, it is possible to create standalone applications in Scala. A standalone application is a Scala object that contains a &lt;code&gt;main&lt;/code&gt; method.&lt;/p&gt;
&lt;p&gt;As an example, the following defines the typical &amp;#8220;Hello World!&amp;#8221; application:&lt;/p&gt;
&lt;/notextile&gt;

After the source has been compiled, you can run the application with &lt;code&gt;scala Hello&lt;/code&gt;, rr &lt;code&gt;java Hello&lt;/code&gt; in a terminal.

h3. IntSet Union

Lets implement a few more methods on the &lt;code&gt;IntSet&lt;/code&gt; implementations we built above. The first method we're going to implement is &lt;code&gt;union&lt;/code&gt;. We need to add &lt;code&gt;union&lt;/code&gt; to both &lt;code&gt;Empty&lt;/code&gt; and &lt;code&gt;NonEmpty&lt;/code&gt;:

&lt;notextile&gt;&lt;p&gt;Notice that &lt;code&gt;union&lt;/code&gt; for &lt;code&gt;NonEmpty&lt;/code&gt; is a recursive function. It unions the left and right subtrees of the first tree, then unions that with the other tree, then finally adds the existing root element to the tree.&lt;/p&gt;
&lt;p&gt;How do we know if this recursion terminates?&lt;/p&gt;
&lt;p&gt;Every call to union is on something smaller than starting set. The left subtree is smaller than the entire set, and the left and right subtrees combined are also smaller than the entire set. Due to this, at some point we union empty set, thus recursion terminates.&lt;/p&gt;
&lt;h3&gt;Dynamic Dispatch&lt;/h3&gt;
&lt;p&gt;Object oriented (OO) languages, including Scala, implement &lt;em&gt;dynamic method dispatch&lt;/em&gt; to resolve overriden methods. This means that the code invoked depends on the runtype type of object that contains the method.&lt;/p&gt;
&lt;p&gt;Example of evaluating with dynamic method dispatching:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/func/eval-empty.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Another example using &lt;code&gt;NonEmpty&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/func/eval-nonempty.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Notice that the dynamic dispatch of methods is analgous to calls to higher-order functions. Can we implement one in terms of the other?&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Objects in terms of higher-order functions?&lt;/li&gt;
	&lt;li&gt;Higher-order functions in terms of objects?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is not something we&amp;#8217;re going to answer in the lecture, however it&amp;#8217;s an interesting topic to think on.&lt;/p&gt;
&lt;h2&gt;How Classes are Organized&lt;/h2&gt;
&lt;p&gt;In Scala (and Java), classes and objects organized in packages. To put class or object in package, use the &lt;code&gt;package&lt;/code&gt; directive at the top of the source file:&lt;/p&gt;
&lt;/notextile&gt;

This puts the &lt;code&gt;Hello&lt;/code&gt; object into the package &lt;code&gt;progfun.examples&lt;/code&gt;. You can refer to &lt;code&gt;Hello&lt;/code&gt; by it's _fully qualified name_ &lt;code&gt;progfun.examples.hello&lt;/code&gt;. You can use this fully qualified name in code when referring to the object, or when invoking it from a terminal or REPL:

&lt;notextile&gt;&lt;p&gt;To use code in other files, you can &lt;code&gt;import&lt;/code&gt; their namespaces to avoid typing fully qualified name. You can import single entities from package using it&amp;#8217;s fully qualified name or multiple entities by using braces (both known as named imports):&lt;/p&gt;
&lt;/notextile&gt;

Or, you can import everything in a package (known as a wildcard import):

&lt;notextile&gt;&lt;p&gt;Some entities are auto imported into any Scala program:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Members of &lt;code&gt;scala&lt;/code&gt; package&lt;/li&gt;
	&lt;li&gt;Members of &lt;code&gt;java.lang&lt;/code&gt; package&lt;/li&gt;
	&lt;li&gt;Members of singleton object &lt;code&gt;scala.Predef&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here are fully qualified names for some types and functions:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;code&gt;Int&lt;/code&gt; &amp;#8211; &lt;code&gt;scala.Int&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;Boolean&lt;/code&gt; &amp;#8211; &lt;code&gt;scala.Boolean&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;Object&lt;/code&gt; &amp;#8211; &lt;code&gt;java.lang.Object&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;require&lt;/code&gt; &amp;#8211; &lt;code&gt;scala.Predef.require&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;assert&lt;/code&gt; &amp;#8211; &lt;code&gt;scala.Predef.assert&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To find out what entities are available to a Scala program by default, you can explore the standard Scala library at http://www.scala-lang.org/api/current&lt;/p&gt;
&lt;h3&gt;Traits&lt;/h3&gt;
&lt;p&gt;In Java and Scala, a class can only have one superclass. This can be limiting when implementing real-world applications. Luckily, iff a class has several natural supertypes, you can use &lt;code&gt;traits&lt;/code&gt;. A trait is declared like an abstract class, only it uses the &lt;code&gt;trait&lt;/code&gt; keyword instead of &lt;code&gt;abstract class&lt;/code&gt;:&lt;/p&gt;
&lt;/notextile&gt;

Classes, objects and traits can only inheret from one class, but they can implement many traits. For example:

&lt;notextile&gt;&lt;p&gt;Scala traits resemble Java interfaces, only they are more powerful. Traits can contain fields and concrete methods, unlike abstract classes. However, traits cannot have value parameters &amp;#8211; only classes (including abstract classes) can have value parameters.&lt;/p&gt;
&lt;h3&gt;Scala&amp;#8217;s Class Hierarchy&lt;/h3&gt;
&lt;p&gt;In most object oriented languages, there exists a class hierarchy. Often there is a root class, that every other class is a subclass of. Scala is no different, and a part of it&amp;#8217;s class hierarchy looks as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/func/scala-hierarchy.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the diagram above, the dotted lines mean the classes are in a conversion relationship, not a subtype relationship. The difference is when converting to a supertype from a subtype, no change in data is required. The inverse does not hold for the conversion relationship &amp;#8211; the data representation may change, and information may be lost.&lt;/p&gt;
&lt;p&gt;Looking at the diagram, we can see that:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;code&gt;Any&lt;/code&gt; is the base type of all types. &lt;code&gt;Any&lt;/code&gt; defines many core methods available on all objects: &lt;code&gt;==&lt;/code&gt;, &lt;code&gt;!=&lt;/code&gt;, &lt;code&gt;equals&lt;/code&gt;, &lt;code&gt;hashCode&lt;/code&gt;, &lt;code&gt;toString&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;code&gt;AnyRef&lt;/code&gt; is the base type of all reference types. It is an alias of &lt;code&gt;java.lang.Object&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;code&gt;AnyVal&lt;/code&gt; is the base type of all primitive value types.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;code&gt;Nothing&lt;/code&gt; is subtype of every other type. It has no value. How is it useful?
	&lt;ul&gt;
		&lt;li&gt;Can be used to signal abnormal termination &amp;#8211; useful in throwing exceptions&lt;/li&gt;
		&lt;li&gt;Can be used as an element type of empty collections&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In Scala, every reference class type also has &lt;code&gt;null&lt;/code&gt; as a value. The type of &lt;code&gt;null&lt;/code&gt; is &lt;code&gt;Null&lt;/code&gt; &lt;code&gt;Null&lt;/code&gt; is a subtype of every class that inherits from &lt;code&gt;Object&lt;/code&gt; and is incompatible with subtypes of &lt;code&gt;AnyVal&lt;/code&gt;. &lt;code&gt;Null&lt;/code&gt; allows us to have missing values, which can be useful in a variety of ways.&lt;/p&gt;
&lt;p&gt;An example of &lt;code&gt;Null&lt;/code&gt; compatability:&lt;/p&gt;
&lt;/notextile&gt;

h2. Polymorphism

So far we've seen many kinds of types, such as primitives likes Integers and Floats, and class types like Rational. Next we're going to look at polymorphism, which is a flexible way to express and parameterize types.

h3. Cons-List

To explore polymorphism, we're going to implement a staple of many functional languages: the cons-list. A cons-list is an immutable linked list, which we're gonig to build from the 2 following building blocks

* Nil - an empty list
* Cons - cell containing first element and pointer ref to rest of list.

For example:

!/images/func/cons-list.png!

This can be outlined in Scala as follows:

&lt;notextile&gt;&lt;p&gt;In the case of implementing a cons-list, every list is either:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;an empty list (&lt;code&gt;new Nil&lt;/code&gt;) or&lt;/li&gt;
	&lt;li&gt;a list (&lt;code&gt;new Cons(x, xs)&lt;/code&gt;) considting of a head element &lt;code&gt;x&lt;/code&gt; and a tail list &lt;code&gt;xs&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note above we&amp;#8217;ve introduced new Scala syntax &amp;#8211; passing &lt;code&gt;val&lt;/code&gt; with a parameter both defines a parameter of the class and a field of the class itself. This means that:&lt;/p&gt;
&lt;/notextile&gt;

is equivalent to:

&lt;notextile&gt;&lt;p&gt;where &lt;code&gt;_head&lt;/code&gt; and &lt;code&gt;_tail&lt;/code&gt; are otherwise unused names.&lt;/p&gt;
&lt;h3&gt;Type Parameters&lt;/h3&gt;
&lt;p&gt;The cons-list defined above is good only for use with &lt;code&gt;Integer&lt;/code&gt; types. It&amp;#8217;s too narrow to define lists with only &lt;code&gt;Int&lt;/code&gt; elements, because we may need a list for &lt;code&gt;String&lt;/code&gt; types, or any custom type we might introduce. Instead of implementing multiple different lists for each type, we can generalize the list using generics through a type parameter:&lt;/p&gt;
&lt;/notextile&gt;

Where type parameters in Java are in angle braces, in Scala they are square brackets.

h3. Scala Implementation of List

With generics in mind, we can define a cons-list as follows:

&lt;notextile&gt;&lt;p&gt;We&amp;#8217;ve included &lt;code&gt;isEmpty&lt;/code&gt; to allow clients to differentiate between objects of &lt;code&gt;Cons&lt;/code&gt; and objects of &lt;code&gt;Nil&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We can then implement this const-list with the following two classes:&lt;/p&gt;
&lt;/notextile&gt;

Note that we don't have to override the &lt;code&gt;head&lt;/code&gt; and &lt;code&gt;tail&lt;/code&gt; methods in &lt;code&gt;Cons&lt;/code&gt;, as &lt;code&gt;val&lt;/code&gt; is doing that for us. Note also that for the &lt;code&gt;Nil&lt;/code&gt; class, we're throwing an exception when trying to access the &lt;code&gt;head&lt;/code&gt; or &lt;code&gt;tail&lt;/code&gt;. This makes sense, as trying to get the &lt;code&gt;head&lt;/code&gt; or &lt;code&gt;tail&lt;/code&gt; of an empty list doesn't make sense. This works because the type of a thrown exception is &lt;code&gt;Nothing&lt;/code&gt; -subtype of all types. So even though the trait specifies that &lt;code&gt;head&lt;/code&gt; should be a &lt;code&gt;T&lt;/code&gt; type, and &lt;code&gt;tail&lt;/code&gt; should be a &lt;code&gt;List[T]&lt;/code&gt; type, we can use &lt;code&gt;Nothing&lt;/code&gt; in place of both of those types.

h3. Generic Functions

Like classes, functions can also have type paramaters. For example, the following function creates a list of a single element:

&lt;notextile&gt;&lt;p&gt;Scala can infer the type of a method from the value arguments of a function call. This means that the type argument can often be ommitted. The above can be replaced with:&lt;/p&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;h3&gt;Types and Evaluation&lt;/h3&gt;
&lt;p&gt;Type params do not affect evaluation in Scala. When using an evaluation model to analyze an algorithm, you can assume all type params and type arguments are removed. The types are only relevant to the compiler to verify programs satisfy certain correctness properties. This property of ignoring types during evaluation is known as &lt;em&gt;type erasure&lt;/em&gt; Languages that use type erasure include Java, Scala, Haskell, ML, OCaml, and languages keep the type paramater information at run time, including C++, C#, F#&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;The above generics and type parameters are a form of polymorphism. Polymorphism refers to functions whose type comes in &amp;#8220;many forms&amp;#8221;, that the function can be applied to arguments of many types and that types can have instances of many types&lt;/p&gt;
&lt;p&gt;So far we have seen two principlal forms of polymorphism&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;subtyping &amp;#8211; instances of a subclass can be used as it&amp;#8217;s base class&lt;/li&gt;
	&lt;li&gt;generics &amp;#8211; instances of a function or class are created by type parameterization&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These two mechanics work well together to allow us to write concise and flexible code.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Coursera Functional Programming Principles in Scala - Week 2</title>
   <link href="http://www.timgittos.com/learning/coursera-functional-programming-principles-in-scala/week-2"/>
   <updated>2013-10-04T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/learning/coursera-functional-programming-principles-in-scala/week-2</id>
   <content type="html">&lt;h2&gt;Higher-Order functions&lt;/h2&gt;
&lt;p&gt;Functional languages treat functions as first-class values. This means that they can be passwed as a parameter and returned as a result just like any other value. This provides a flexible way to compose functions. Functions that take other functions as parameters or that return functions as results are called &lt;em&gt;higher order functions&lt;/em&gt;. This is the opposte of a &lt;em&gt;first order function&lt;/em&gt;, which only operates on non-function value types like ints, booleans, etc.&lt;/p&gt;
&lt;p&gt;Consider the example of taking the sum of the integers between a and b:&lt;/p&gt;
&lt;/notextile&gt;

Note that this is a recursive function.

Next, consider the sum of the cubes of all integers between a and b:

&lt;notextile&gt;&lt;p&gt;This is essentially the same tail recursion, only instead of summing the int, we sum the cube.&lt;/p&gt;
&lt;p&gt;Next, consider the sum of the factorials of all integers between a and b:&lt;/p&gt;
&lt;/notextile&gt;

where &lt;code&gt;fact&lt;/code&gt; is a method for computing factorials.

Each of these 3 examples above are special cases of a generic function that we can represent mathematically as:

$$
\sum^b_{n = a} f(n)
$$

for different values of \(f\).

We can use higher-order functions to generalize the above examples programmatically, like we would be able to mathematically:

&lt;notextile&gt;&lt;p&gt;Notice that the &lt;code&gt;sum&lt;/code&gt; takes an applies a function given to it, which we use to implement our previous examples.&lt;/p&gt;
&lt;p&gt;Notice the new Scala syntax introduced above, known as a function type. The type &lt;code&gt;A =&amp;gt; B&lt;/code&gt; is the type of &lt;em&gt;any&lt;/em&gt; function that takes an argument of type A and returns a result of type B. &lt;code&gt;Int =&amp;gt; Int&lt;/code&gt; is the type of all functions that map integers to integers.&lt;/p&gt;
&lt;p&gt;Passing functions as parameters can lead to the create of many small functions, which is tedious and cluttery in the source code. However, just as you can pass a string literal to a function that takes a string, Scala lets you pass a &amp;#8220;function literal&amp;#8221; to a higher-order function through the anonymous function syntax.&lt;/p&gt;
&lt;p&gt;To demonstrate, we can show the anonymous version of the &lt;code&gt;cube&lt;/code&gt; function above:&lt;/p&gt;
&lt;/notextile&gt;

If an anonymous function takes multiple arguments, they're separated by commas:

&lt;notextile&gt;&lt;p&gt;We can use anonymous functions to further refactor our example above:&lt;/p&gt;
&lt;/notextile&gt;

Note that you can ommit the type in a function type if it can be inferred by the compiler from the context of the function.

h2. Currying

Recall the refactored example above. Even though we are now passing an anonymous function to our sum function, there is still some inefficiency as we pass the parameters &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; unchanged into the sum function.

We can rewrite the sum function as follows:

&lt;notextile&gt;&lt;p&gt;&lt;code&gt;sum&lt;/code&gt; is now a function that returns a function.&lt;/p&gt;
&lt;p&gt;We can then simplify the rest:&lt;/p&gt;
&lt;/notextile&gt;

However, we don't even need to define this intermediary sum functions - we can pass the functions directly to the &lt;code&gt;sum&lt;/code&gt; function and evaluate the results:

&lt;notextile&gt;&lt;p&gt;To put it into English, &lt;code&gt;sum(cube)&lt;/code&gt; applies the &lt;code&gt;sum&lt;/code&gt; function to the &lt;code&gt;cube&lt;/code&gt; function and returns the &lt;em&gt;sum of cubes&lt;/em&gt; function, which is functionally equivalent to &lt;code&gt;sumCubes&lt;/code&gt;. This function returned is then applied to &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;10&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The definition of functions that return functions is so useful in functional programming that there is a special syntax for it in Scala. Rather than having to define an interior function, we can pass the outer function argument (the function type) and the inner function argument (two integers) in one definition:&lt;/p&gt;
&lt;/notextile&gt;

Generally, we can define a function with multiple parameter lists:

$$
def \; f(args_1) ... (args_n) = E
$$

is equivalent to the following, where \(n &gt; 1\):

$$
def f(args_1) ... (args_{n-1}) = { def g(args_n) = E; g }
$$

where \(g\) is a fresh identifier. This in turn is equivalent to:

$$
def f(args_1) ... (args_{n - 1}) = (args_n =&gt; E)
$$

which returns an anonymous function. This expands until all the arguments have been converted into functions:

$$
def f = (args_1 =&gt; (args_2) =&gt; ... (args_n =&gt; E) ... ))
$$

This process is known _currying_, named for Haskell Brooks Curry (1900 - 1982).

Given the following function definition:

&lt;notextile&gt;&lt;p&gt;the type of the &lt;code&gt;sum&lt;/code&gt; function is &lt;code&gt;(Int =&amp;gt; Int) =&amp;gt; (Int, Int) =&amp;gt; Int&lt;/code&gt;. That is to say, it&amp;#8217;s a function that takes a function that maps an int to an int, and returns a function that takes 2 ints and maps it to a single int. Functional types associate to the right.&lt;/p&gt;
&lt;h2&gt;Example: Finding Fixed Points&lt;/h2&gt;
&lt;p&gt;The &lt;em&gt;fixed point&lt;/em&gt; of a function \(f\) is the number \(x\) such that:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
f(x) = x&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;For example, the fixed point of:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
1 + \frac{x}{2}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;is \(2\).&lt;/p&gt;
&lt;p&gt;For some functions, we can locate the fixed point by starting with an initial estimate and then apply the function in a repetitive way until the value either does not change, or changes by some small acceptable value.&lt;/p&gt;
&lt;p&gt;For functions that satisfy this properly, we can write a function to find the fixed point as follows:&lt;/p&gt;
&lt;/notextile&gt;

We can use this to improve the &lt;code&gt;sqrt&lt;/code&gt; function from &quot;week 1&quot;:/learning/coursera-functional-programming-principles-in-scala/week-2/ , based on the following insights:

If \(y = \sqrt{x}\), then \(y \times y = x \). This is equivalent to \(y = \frac{x}{y}\), which means that the square root of \(x\) is the fixed point of the function \(y = \frac{x}{y}). We can therefore use &lt;code&gt;y =&gt; x / 2&lt;/code&gt; as the &lt;code&gt;f&lt;/code&gt; parameter above to calculate the square root:

&lt;notextile&gt;&lt;p&gt;Unfortunately, this ends up not converging, and instead the guess oscillates between 1 and 2. The solution to this oscillation is to prevent the estimation from varying too much by averaging successive values of the original sequence:&lt;/p&gt;
&lt;/notextile&gt;

The examples so far have shown that the expressive power of a language is greatly increased if we can pass functions as arguments to other functions. The following example shows that functions that return functions can make a language equally expressive.

Consider again the iteration toward a fixed point above. We dampened the guesses using the average of the last guess and the new guess. This technique of stabilizing by averaging is general enough to merit being abstracted into it's own function:

&lt;notextile&gt;&lt;h2&gt;Functions and Data&lt;/h2&gt;
&lt;p&gt;So far the functions we have written deal with primitive types, such as integers, booleans and doubles. As the complexity of the programming task at hand rises, so too will the data we deal with. Thus we&amp;#8217;re going to need more complex data types, and functions to create an encapsulate these data structures.&lt;/p&gt;
&lt;p&gt;Take the example of working with rational numbers. As a refresher, a rational number is a number \(frac{x}{y}\) represented by two integers:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;the numerator, \(x\)&lt;/li&gt;
	&lt;li&gt;the denominator, \(y\)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We are going to design a package for doing rational arithmetic&lt;/p&gt;
&lt;p&gt;First, lets implement the addition of two rational numbers. We could use two functions to add the numerator and denominator of two rational number separately, as follows:&lt;/p&gt;
&lt;/notextile&gt;

However, with a lot of rational numbers, it will quickly become difficult to manage all the numerators and denominators. An alternative approach would be to combine the numerator and denominator fo a rational number into a single data structure:

&lt;notextile&gt;&lt;p&gt;The above class definition introduces two entities:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;A new &lt;em&gt;type&lt;/em&gt; named &lt;code&gt;Rational&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;A &lt;em&gt;constructor&lt;/em&gt; &lt;code&gt;Rational&lt;/code&gt; to create elements of this type&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Scala keeps the names of the types and values in a different namespace so there is no conflict between the two definitions of &lt;code&gt;Rational&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We can create objects of the &lt;code&gt;Rational&lt;/code&gt; object by calling the constructor with the keyword &lt;code&gt;new&lt;/code&gt;:&lt;/p&gt;
&lt;/notextile&gt;

The members of &lt;code&gt;Rational&lt;/code&gt; are called by using the &lt;code&gt;.&lt;/code&gt; infix operator, similar to Java.

Before we go any further, lets review our rational number arithmetic:

$$
\begin{align}
\frac{n_1}{d_1} + \frac{n_2}{d_2} &amp;= \frac{n_1d_2 + n_2d_1}{d_1d_2} \\
\frac{n_1}{d_1} - \frac{n_2}{d_2} &amp;= \frac{n_1d_2 - n_2d_1}{d_1d_2} \\
\frac{n_1}{d_1} \times \frac{n_2}{d_2} &amp;= \frac{n_1d_2}{d_1}{n_2} \\
\frac{\frac{n_1}{d_2}}{n_2}{d_2} &amp;= \frac{n_1d_2}{d_1}{n_2} \\
\frac{n_!}{d_1} &amp;= \frac{n_2}{d_2} \quad \text{iff} \quad n_1d_2 = d_1n_2
\end{align}
$$

We could implement the class as a pure data type, where it simply holds data and allows us to retrieve data. We would then need to define additional functions to use with this data type:

&lt;notextile&gt;&lt;p&gt;Another approach is to package functions operating on a data abstraction in the data abstraction itself &amp;#8211; these are known as methods. We would implement all the arithmetic operations we want directly on the &lt;code&gt;Rational&lt;/code&gt; class: &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;sub&lt;/code&gt;, &lt;code&gt;mul&lt;/code&gt;, &lt;code&gt;div&lt;/code&gt;, &lt;code&gt;equal&lt;/code&gt; and &lt;code&gt;toString&lt;/code&gt;:&lt;/p&gt;
&lt;/notextile&gt;

Note that we're overriding the toString, which works exactly the same as C# or Java overriding.

h2. More Fun with Rationals

Continuing with the code above, if we define &lt;code&gt;y&lt;/code&gt; such that:

&lt;notextile&gt;&lt;p&gt;We can see that the result rational number isn&amp;#8217;t represented in it&amp;#8217;s simplest form. When doing rational arithmetic, we usually simply the the rational number. To simply a rational, you reduce both of them to teir smallest numerator and denominator by dividing both with a divisor.&lt;/p&gt;
&lt;p&gt;While we could implement this as a method on the &lt;code&gt;Rational&lt;/code&gt; class, it&amp;#8217;s easy to forget to use this simplification method. Instead, we can implement it as part of the constructor for the &lt;code&gt;Rational&lt;/code&gt; class, and do it when objects are constructed.&lt;/p&gt;
&lt;/notextile&gt;

Notice that &lt;code&gt;gcd&lt;/code&gt; and &lt;code&gt;g&lt;/code&gt; are private members of the &lt;code&gt;Rational&lt;/code&gt; class. This is so that clients of this class cannot access these values directly. We could have written the &lt;code&gt;number&lt;/code&gt; and &lt;code&gt;denom&lt;/code&gt; as:

&lt;notextile&gt;&lt;p&gt;or even as:&lt;/p&gt;
&lt;/notextile&gt;

In the first example, the &lt;code&gt;numer&lt;/code&gt; and &lt;code&gt;denom&lt;/code&gt; are computed on demand, and we save on memory required to store the data at the cost of computation time. This would be useful if we're expecting it to be called infrequently. In the second example, they're evaluated immediately, and we save the time required to compute it each time, at the cost of storing the value. This is useful if we're expecting it to be called frequently.

Next, we're going to implement &lt;code&gt;less&lt;/code&gt; and &lt;code&gt;max&lt;/code&gt;:

&lt;notextile&gt;&lt;p&gt;Right now, it&amp;#8217;s possible to create a &lt;code&gt;Rational&lt;/code&gt; that is illegal &amp;#8211; something like \(\frac{1}{0}\). This will yield division by zero errors when trying to perform arithmetic operations on the &lt;code&gt;Rational&lt;/code&gt;. The solution is to add a &lt;code&gt;require&lt;/code&gt; call to assert that a certain condition holds true:&lt;/p&gt;
&lt;/notextile&gt;

The above &lt;code&gt;Rational&lt;/code&gt; will now throw an &lt;code&gt;IllegalArgumentException&lt;/code&gt; exception when we try to create a &lt;code&gt;Rational&lt;/code&gt; that is invalid.

&lt;code&gt;require&lt;/code&gt; is a check on preconditions in code, similar to &lt;code&gt;assert&lt;/code&gt;. &lt;code&gt;require&lt;/code&gt; is intended to enforce a precondition on the caller of a function or the instantiation of an object. &lt;code&gt;assert&lt;/code&gt; checks the internal consistency or code of an object or function itself - if it fails, it's not necessarily the user's fault.

Just like in all OO languages, classes in Scala can have constructors. If you do not provide a constructor, the class implicitly introduces a _primary constructor_. The primary constructor will take the parameters of the class and execute all the statements in the class body.

Just like in Java, you can define multiple constructors for a class that takes a different parameter signature. For example, if we wanted to give our &lt;code&gt;Rational&lt;/code&gt; class a constructor that only sets the denominator, we can do:

&lt;notextile&gt;&lt;p&gt;The &lt;code&gt;def&lt;/code&gt; defines the new constructor, and the invocation of &lt;code&gt;this(x, 1)&lt;/code&gt; calls the primary constructor with the parameter list given.&lt;/p&gt;
&lt;h2&gt;Evaluation and Operators&lt;/h2&gt;
&lt;p&gt;In &lt;a href=&quot;learning/coursera-functional-programming-principles-in-scala/week-2/&quot;&gt;week 1&lt;/a&gt; , we defined the meaning of a function application using a computation model based on substitution. Now it&amp;#8217;s time to extend this model to classes and objects.&lt;/p&gt;
&lt;p&gt;Firstly, we can look at the instantiation of a class (&lt;code&gt;new C(e_1, ... e_m)&lt;/code&gt;). This expression&amp;#8217;s arguments &lt;code&gt;e_1, ... e_m&lt;/code&gt; are evaluated like the arguments of a normal function. That is the arguments are evaluated to values, and indeed the whole expression itself is a value.&lt;/p&gt;
&lt;p&gt;Next, suppose that we have a class definition:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;class C(x_1, ..., x_m){ ... def f(y_1, ..., y_n) = b ... }&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That is, we have a class which as the formal parameters &lt;code&gt;x_1, ... x_m&lt;/code&gt; and the class defines a method &lt;code&gt;f&amp;lt;/codE&amp;gt; with formal parameters &amp;lt;code&amp;gt;y_1, ..., y_n&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For the sake of simplicity, we have omitted the parameter types, and the list of function parameters could be absent if the function requires no parameters.&lt;/p&gt;
&lt;p&gt;How is the following expression evaluated?&lt;/p&gt;
&lt;p&gt;&lt;code&gt;new C(v_1, ..., v_m).f(w_1, ..., w_n)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The expression is rewritten to:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
  [w_1/y_1, ... w_n/y_n][v_1,x_1, ..., v_m, x_m][new C(v_1, ... v_m)/this]b
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Unlike a function application, there are 3 substitutions at work here:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;The substitution of the formal parameters &lt;code&gt;y_1, ..., y_n&lt;/code&gt; of the function &lt;code&gt;f&lt;/code&gt; by the arguments &lt;code&gt;w_1, ..., w_n&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;The substituion of the formal aprameters &lt;code&gt;x_1, ..., x_m&lt;/code&gt; of the class &lt;code&gt;C&lt;/code&gt; by the class arguments &lt;code&gt;v_1, ..., v_m&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;The substitution of the self reference this by the value of the object &lt;code&gt;new C(v_1, ..., v_n)&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We can demonstrate this with the &lt;code&gt;Rational&lt;/code&gt; class we have been using this week:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/func/reduction.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Note that the second to last reduction in the above image is actually applying the first reduction.&lt;/p&gt;
&lt;h3&gt;Operators&lt;/h3&gt;
&lt;p&gt;In principle, the rational numbers defined by the &lt;code&gt;Rational&lt;/code&gt; class are as natural as integers. But for the user of these abstractions, there is a noticeable difference:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;we write &lt;code&gt;x + y&lt;/code&gt; if &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; are integers, but&lt;/li&gt;
	&lt;li&gt;we write &lt;code&gt;r.add(s)&lt;/code&gt; if &lt;code&gt;r&lt;/code&gt; and &lt;code&gt;s&lt;/code&gt; are rational numbers.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In Scala, it is possible to eliminate this difference.&lt;/p&gt;
&lt;p&gt;Firstly, we need to know that in Scala, it&amp;#8217;s possible to write any method with a parameter as an infix operator. For example:&lt;/p&gt;
&lt;/notextile&gt;

Secondly, we need to know that In Scala, an identifier can take more forms than other programming languages. An identifier can be:

* _Alphanumeric_: starting with a letter, followed by a sequence of letters or numbers
* _Symbolic_: starting with an operator symbol, followed by other operator simbols

With the above rules, an underscore character counds as a letter, and alphanumeric itentifiers can also end in an underscore, followed by some oeprator symbols.

Here are examples of valid identifiers in Scala:

* x1
* *
* +?%&amp;
* vector_++
* counter_=

With those two facts, it's simple to apply them and simplify our &lt;code&gt;Rational&lt;/code&gt; arithmetic:

&lt;notextile&gt;&lt;p&gt;Note the &lt;code&gt;unary_&lt;/code&gt; method identifier prefix &amp;#8211; this special prefix allows the method to be used prefix, like you would during a mathematical expression.&lt;/p&gt;
&lt;p&gt;One thing that needs to be addressed when writing operators in this fashion is the precedence rules. In Scala, the precedence of an operator is determined by its first character. The following list of operator precedence is in increasing order of priority:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;all letters&lt;/li&gt;
	&lt;li&gt;|&lt;/li&gt;
	&lt;li&gt;^&lt;/li&gt;
	&lt;li&gt;&amp;amp;&lt;/li&gt;
	&lt;li&gt;&amp;lt; &amp;gt;&lt;/li&gt;
	&lt;li&gt;= !&lt;/li&gt;
	&lt;li&gt;:&lt;/li&gt;
	&lt;li&gt;+ -&lt;/li&gt;
	&lt;li&gt;* / %&lt;/li&gt;
	&lt;li&gt;all other special characters&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Coursera Functional Programming Principles in Scala - Week 1</title>
   <link href="http://www.timgittos.com/learning/coursera-functional-programming-principles-in-scala/week-1"/>
   <updated>2013-09-21T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/learning/coursera-functional-programming-principles-in-scala/week-1</id>
   <content type="html">&lt;h2&gt;Programming Paradigms&lt;/h2&gt;
&lt;p&gt;Functional programming is a paradigm that is quite different from imperative or OO programming. Scala is a hybrid, and can provide a gradual transition to functional programming from OO programming. This course will take a clean break and teach functional programing from first principles, teaching a new way to think and reason about programs.&lt;/p&gt;
&lt;p&gt;In science, a paradigm is a set of distinct concepts or thought patterns. In programming, there are 3 main programming paradigms:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Imperative programming&lt;/li&gt;
	&lt;li&gt;Functional programming&lt;/li&gt;
	&lt;li&gt;Logic programming&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some people assert that object oriented programming is a paradigm, however the instructor believes that OO is orthogonal, and can be used effectively with both imperative programming, which is that state of the art, and with functional programming.&lt;/p&gt;
&lt;h3&gt;Imperative Programming&lt;/h3&gt;
&lt;p&gt;Imperative programming is about modifying mutable variables, using assignments and controlling the flow of the program using control structures such as if statements, loops and breaking/continuing them, and returning.&lt;/p&gt;
&lt;p&gt;The most common informal way of understanding imperative programs is as instruction sequences for a Von Neumann computer.&lt;/p&gt;
&lt;p&gt;A simplified Von Neumann computer consists of a processor, some memory and a bus that transmits data between the two. The width of the bus is the word width of the processor &amp;#8211; 32 bit, or commonly these days, 64 bits. More can be found out about the Von Neumann architecture on it&amp;#8217;s &lt;a href=&quot;http://en.wikipedia.org/wiki/Von_Neumann_architecture&quot;&gt;Wikipedia page&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Von Neumann architecture has had a strong impact on the development of imperative computer programs.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Mutable variables correspond strongly to memory cells&lt;/li&gt;
	&lt;li&gt;Variable dereferences correspond strongly to load instructions&lt;/li&gt;
	&lt;li&gt;Variable assignments correspond strongly to store instructions&lt;/li&gt;
	&lt;li&gt;Control structures correspond strongly to jumps&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The problem with this is that it makes conceptualizing programs at higher levels of abstraction hard. This was the idea behind John Bakus&amp;#8217; lecture entitled &lt;a href=&quot;http://www.thocp.net/biographies/papers/backus_turingaward_lecture.pdf&quot;&gt;&amp;#8216;Can Programming Be Liberated from the von Neumann Style?&amp;#8217;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bakus argued that pure, imperative programming had become limited by the &amp;#8220;Von Neumann&amp;#8221; bottleneck of reasoning about data structures word-by-word. He asserted that we needed techniques for defining higher levels of abstractions such as collections, polynomials, geometric shapes, strings, documents, etc. Not only that, but we also need theories with which to reason about these higher abstractions.&lt;/p&gt;
&lt;h3&gt;Theories&lt;/h3&gt;
&lt;p&gt;In mathematics, a theory describes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;one or more data types&lt;/li&gt;
	&lt;li&gt;operations on these types&lt;/li&gt;
	&lt;li&gt;laws that describe relationships between values and operations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It should be noted that these theories do not describe mutations. Operatons on data types result in new types and values, with a different identity.&lt;/p&gt;
&lt;p&gt;For example, the theory of polynomials defines the sum of two polynomials by laws such as:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  (a \; x + b) + (c \; x + d) = (a + c) \; x + (b + d)&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;It does not define an operator to &lt;em&gt;change&lt;/em&gt; a coefficient while keeping a polynomial the same. However, in imperative programming, we can do exactly that:&lt;/p&gt;
&lt;pre&gt;
  class Polynomial { double[] coefficient; }
  Polynomial p = ...
  p.coefficient[0] = 42;
&lt;/pre&gt;
&lt;p&gt;That fragment of code will allow us to change the coefficient, but leave the identity of the polynomial the same.&lt;/p&gt;
&lt;h3&gt;Consequences for Programming&lt;/h3&gt;
&lt;p&gt;If we want to implement high-level concepts that follow mathematical theories, we need to do away with mutation. Mutation does not fit with any mathematical theories, and allowing mutation can break useful laws in theories.&lt;/p&gt;
&lt;p&gt;Therefore we want to concentrate on defining operators expressed as functions, avoid mutation and create powerful ways to abstract and compose functions.&lt;/p&gt;
&lt;p&gt;In a &lt;em&gt;restricted&lt;/em&gt; sense, functional programming is programming without mutable variables, assignments and imperative control statements. A functional programming language will not have support for these features.&lt;br /&gt;
Examples of these languages are Pure Lisp, &lt;span class=&quot;caps&quot;&gt;XSLT&lt;/span&gt;, XPath, XQuery, FP and Haskell without the I/O monad or UnsafePerformIO.&lt;/p&gt;
&lt;p&gt;In a &lt;em&gt;wider&lt;/em&gt; sense, functional programming is a focus on functions, where functions can be values that are produced, consumed and composed. A functional language will support functions as first class objects, meaning they can be:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;declared anywhere, even inside other functions&lt;/li&gt;
	&lt;li&gt;passed as arguments and returned as results of other functions&lt;/li&gt;
	&lt;li&gt;have a set of operators defined for their composition&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Examples of these languages are Lisp and lisp-like languages like Scheme, Racket and Clojure, &lt;span class=&quot;caps&quot;&gt;SML&lt;/span&gt;, OCaml, F#, Haskell (full language), Scala, Smalltalk and Ruby.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;SICP&lt;/span&gt; is recommended reading for this course. &lt;a href=&quot;http://mitpress.mit.edu/sicp/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;SICP&lt;/span&gt; can be read online for free&lt;/a&gt; .&lt;/p&gt;
&lt;h3&gt;Why Functional Programming?&lt;/h3&gt;
&lt;p&gt;Functional programming is becoming increasingly popular because it can offer the following benefits:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;simpler reasoning principles&lt;/li&gt;
	&lt;li&gt;better modularity&lt;/li&gt;
	&lt;li&gt;good for exploiting parallelism for multicore and cloud computing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To find out more, watch Martin Odersky&amp;#8217;s OScon 2011 Keynote &amp;#8220;Working Hard to Keep It Simple&amp;#8221;:&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube-nocookie.com/embed/3jg1AheF4n0?rel=0&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Elements of Programming&lt;/h2&gt;
&lt;p&gt;Every non-trivial programming language provides support for primitive expressions containing the simplest elements (primitive types of the language), ways to combine expressions, and ways to abstract expressions by assigning them an identifier, and allowing us to refer to that expression by it&amp;#8217;s identifier.&lt;/p&gt;
&lt;p&gt;Scala, and many other functional programming languages, comes with a &lt;span class=&quot;caps&quot;&gt;REPL&lt;/span&gt; (Read-Evaluate-Print-Loop) that allows us to interact with the programming environment live so that you dont have to compile and run source files.&lt;/p&gt;
&lt;p&gt;Evaluation in Scala is performed with infix notation. That is, the operands are evaluated in a left to right order, and operators are applied to those operand values, left before right. Named references like variables are replaced with the value on their right hand side. The evaluation stops once it results in a value.&lt;/p&gt;
&lt;p&gt;Following is an example of the evaluation of a non-primitive expression, where &lt;code&gt;def pi = 3.14159&lt;/code&gt; and &lt;code&gt;def radius = 10&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;(2 * pi) * radius&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;(2 * 3.14159) * radius&lt;/code&gt; &amp;#8211; first, the reference to the second operand of the first operator, &lt;code&gt;pi&lt;/code&gt;, is evaluated&lt;br /&gt;
&lt;code&gt;6.28318 * radius&lt;/code&gt; &amp;#8211; next, the first operator is evaluated&lt;br /&gt;
&lt;code&gt;6.28318 * 10&lt;/code&gt; &amp;#8211; then the reference to the second operand of the second operator, &lt;code&gt;radius&lt;/code&gt;, is evaluated&lt;br /&gt;
&lt;code&gt;62.8318&lt;/code&gt; &amp;#8211; lastly, the expression is evaluated. The result is a value, so the evaluation is terminated.&lt;/p&gt;
&lt;p&gt;In Scala, definitions can have parenthesis, which define functions:&lt;/p&gt;
&lt;/notextile&gt;

This results in the square function. Functions can call other functions:

&lt;notextile&gt;&lt;p&gt;When functions are evaluated, the evaluation is similar to that of a non-primitive expression. All the function arguments are evaluated, left to right, all function applications (aka function calls) are replaced by the function&amp;#8217;s right hand side (it&amp;#8217;s body) and at the same time, all formal arguments are replaced by the values of the real arguments.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre&gt;sumOfSquares(3, 2+2)&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;sumOfSquares(3, 4)&lt;/code&gt; &amp;#8211; first, the arguments are evaluated&lt;br /&gt;
&lt;code&gt;square(3) + square(4)&lt;/code&gt; &amp;#8211; next, the function application is replaced by the functions body&lt;br /&gt;
&lt;code&gt;3 * 3 + square(4)&lt;/code&gt; &amp;#8211; this is repeated for each function application&lt;br /&gt;
&lt;code&gt;9 + square(4)&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;9 + 4 * 4&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;9 + 16&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;25&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This expression evaluation method is known as the &lt;em&gt;substitution model&lt;/em&gt;, and has been formalized as the \(&lt;br /&gt;
\lambda\)-calculus, which is the foundation of all functional programming.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;substitution model&lt;/em&gt; works on the concept of reducing expressions down to values, then applying those values in other expressions until all that is left is a value. It can be applied to all expressions so long as those expressions do not have side effects.&lt;/p&gt;
&lt;p&gt;Note that it is possible that the substitution will never halt. Consider the example of a recursive program with no termination condition. That program will continue to have it&amp;#8217;s reference reduced back to itself until the computer suffers a stack overflow.&lt;/p&gt;
&lt;p&gt;The method of substitution that Scala uses, of evaluating arguments before substitution, is not the only method available. It is also possible to evaluate the arguments at the very end of substitution.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre&gt;sumOfSquares(3, 2+2)&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;square(3) + square(2+2)&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;3 * 3 + square(2+2)&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;9 + square(2+2)&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;9 + (2+2) * (2+2)&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;9 + 4 * (2+2)&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;9 + 4 * 4&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;9 + 16&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;25&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The first evaluation strategy that Scala uses is called &lt;em&gt;call-by-value&lt;/em&gt;, whereas the second is known as &lt;em&gt;call-by-name&lt;/em&gt;. Both strategies are guaranteed to reduce to the same value assuming that the reduced expression consists of pure functions, and all evaluations terminate.&lt;/p&gt;
&lt;p&gt;The benefits of call-by-value is that function arguments are only evaluated once. The benefits of call-by-name are that function arguments may not be evaluated at all if they aren&amp;#8217;t used in the function body.&lt;/p&gt;
&lt;h2&gt;Evaluation Strategies and Termination&lt;/h2&gt;
&lt;p&gt;As stated above, both call-by-value (&lt;span class=&quot;caps&quot;&gt;CBV&lt;/span&gt;) and call-by-name (&lt;span class=&quot;caps&quot;&gt;CBN&lt;/span&gt;) strategies reduce expressions to the same value, as long as those expressions terminate. What happens if they don&amp;#8217;t terminate?&lt;/p&gt;
&lt;p&gt;If an expression \(e\) terminates under the &lt;span class=&quot;caps&quot;&gt;CBV&lt;/span&gt; strategy, then it will always terminate under the &lt;span class=&quot;caps&quot;&gt;CBN&lt;/span&gt; strategy. However, the reverse is not true.&lt;/p&gt;
&lt;p&gt;Consider the following example:&lt;/p&gt;
&lt;/notextile&gt;

Under CBN, the loop function application is never evaluated, and so the function terminates. Under CBV, the loop function application is evaluated and never terminates, thus &lt;code&gt;first&lt;/code&gt; never terminates.

Scala uses CBV over CBN despite the prevention of non-terminating functions because in real world practice, CBV reduces the evaluation of arguments and results in significant computational savings. Also it makes analysis of programs easier as you know where arguments will be evaluated.

However, if you do want Scala to pass an argument by name rather than value, you can prepend it's type signature with &lt;code&gt;=&gt;&lt;/code&gt;:

&lt;notextile&gt;&lt;h2&gt;Conditionals and Value Definitions&lt;/h2&gt;
&lt;p&gt;As all programming languages need support for choosing between two alternatives, Scala supports &lt;code&gt;if-else&lt;/code&gt; conditional expressions. The difference between Scala and Java conditionals is that in Scala, conditionals are used for expressions, not as statements.&lt;/p&gt;
&lt;/notextile&gt;

Scala conditionals take boolean predicates.

h3. Boolean Expressions

Boolean expressions can be composed of:

* true, false //constants
* !b //negation
* b &amp;&amp; b //conjunction
* b || b //disjunction

as well as the usual comparison operators:

e &lt; e, e &lt;= e, e == e, e != e, e &gt;= e, e &gt; e

Boolean expressions reduce as follows:

* !true == false
* !false == true
* true &amp;&amp; e == e
* false &amp;&amp; e == false
* true || e == true
* false || e == e

Boolean predicates are dealt with by using &quot;short-circuit evaluation&quot;, that is, if the first half of the predicate returns true, the rest of the predicate is not evaluated.

h3. Value Definitions

As function arguments can be passed by value or by name (by reference in .NET), so too can definitions. Using the &lt;code&gt;def&lt;/code&gt; syntax is essentially a &quot;by-name&quot; definition. Everytime you apply the function, you replace the function name by it's body. You can also use the &lt;code&gt;val&lt;/code&gt; syntax to define a value &quot;by-value&quot;, similar to assigning a variable (the difference is, variables are mutable - these values are not). The right hand side of a &lt;code&gt;val&lt;/code&gt; definition is evaluated before the definition.

&lt;notextile&gt;&lt;p&gt;You can observe the differences clearly when trying to use each syntax to define an infinite recursion:&lt;/p&gt;
&lt;/notextile&gt;

h2. Example: Square Roots with Newton's Method

Lets use what we have learnt so far to implement a function that calculates the square root of a number using Newton's approximation method. The function signature should look like this:

&lt;notextile&gt;&lt;p&gt;Newton&amp;#8217;s method is as follows:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Start with an estimate y. Y can be any positive number, though the closer it is, the faster the square root will calculate&lt;/li&gt;
	&lt;li&gt;Repeatedly improve the estimate by taking the mean of y, and \(\frac{x}{y}\).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;table&gt;
	&lt;tr&gt;
		&lt;th&gt;Estimation&lt;/th&gt;
		&lt;th&gt;Quotient&lt;/th&gt;
		&lt;th&gt;Mean&lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;1&lt;/td&gt;
		&lt;td&gt;\(\frac{2}{1} = 2\)&lt;/td&gt;
		&lt;td&gt;1.5&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;1.5&lt;/td&gt;
		&lt;td&gt;\(\frac{2}{1.5} = 1.333\)&lt;/td&gt;
		&lt;td&gt;1.4167&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;1.4167&lt;/td&gt;
		&lt;td&gt;\(\frac{2}{1.4167} = 1.4118\)&lt;/td&gt;
		&lt;td&gt;1.4142&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;1.4142&lt;/td&gt;
		&lt;td&gt;..&lt;/td&gt;
		&lt;td&gt;..&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;So how would we turn this algorithm into a Scala function.&lt;/p&gt;
&lt;h3&gt;Define a Function for Estimation&lt;/h3&gt;
&lt;p&gt;One good method to implement an algorithm is to build it step by step. That means that first, we need to define a function that does one step of this iterative process:&lt;/p&gt;
&lt;/notextile&gt;

As you can see, we're implementing at a relatively high level of abstraction. We're not worring about how we improve a guess, nor how we determine if a guess is good enough. All that we're worrying about is making the decision to improve the guess, or return what we have. Note that &lt;code&gt;sqrtIter&lt;/code&gt; is recursive, and in Scala, recursive functions require return type signatures. For other functions, they are optional. However it is good practice to include them for all functions.

h3. Go Further Down the Abstraction

Now we can worry about how we're going to determine if a guess is good enough:

&lt;notextile&gt;&lt;p&gt;and how we&amp;#8217;re going to improve our guess:&lt;/p&gt;
&lt;/notextile&gt;

Note that we're using the &lt;code&gt;abs&lt;/code&gt; function defined above.

h3. Square Root Itself

Now that we can perform an estimation given an operator and a guess, we just have to wrap that in a function that initializes the guess:

&lt;notextile&gt;&lt;h2&gt;Blocks and Lexical Scope&lt;/h2&gt;
&lt;p&gt;While it&amp;#8217;s good to decompose a program into it&amp;#8217;s logical steps, and write functions to perform those logical steps, this can lead to &amp;#8220;namespace pollution&amp;#8221; where we expose auxiliary functions that matter only to the implementation of a single function.&lt;/p&gt;
&lt;p&gt;Consider our &lt;code&gt;sqrt&lt;/code&gt; function above. We created the &lt;code&gt;isGoodEnough&lt;/code&gt;, &lt;code&gt;improve&lt;/code&gt; and &lt;code&gt;sqrtIter&lt;/code&gt; functions just to support the implementation of &lt;code&gt;sqrt&lt;/code&gt;. Outside the context of the &lt;code&gt;sqrt&lt;/code&gt; function, these other functions don&amp;#8217;t make sense.&lt;/p&gt;
&lt;p&gt;We can use the concept of blocks and lexical scope to nest these functions inside &lt;code&gt;sqrt&lt;/code&gt; so that we don&amp;#8217;t expose them to the user and pollute the namespace.&lt;/p&gt;
&lt;/notextile&gt;

This is possible due to the block syntax available in Scala. A block is delineated by braces ({ }) and contains a sequence of expressions or definitions. The last expression in the block is the one that defines it's value, but other expressions can precede the last one. A block is itself an expression, and can be declared and used anywhere an expression can.

Variables defined in a higher scope than the block are visible in the block, and variables defined inside the block are available only to the block. Variables redefined in the block will shadow those in a higher scope (makes sense, since there is no mutation).

This means that we can simplify our &lt;code&gt;sqrt&lt;/code&gt; function:

&lt;notextile&gt;&lt;h2&gt;Tail Recursion&lt;/h2&gt;
&lt;p&gt;Recall the substitution model. We can formalize this model by considering it as a rewriting of the program itself. Consider the function:&lt;/p&gt;
&lt;/notextile&gt;

where &lt;code&gt;f&lt;/code&gt; is the function definition and &lt;code&gt;f()&lt;/code&gt; is the function evalution. We can model the substitution by rewriting the function itself:

&lt;notextile&gt;&lt;p&gt;where &lt;code&gt;[v_1/x_1, ..., v_n/x_n]B&lt;/code&gt; means the expression B where all occurances of \(x_i\) have been replaced by \(v_i\). The &lt;code&gt;[v_1/x_1, ..., v_n/x_n]&lt;/code&gt; is known as a substitution.&lt;/p&gt;
&lt;p&gt;This is just a formalization of the substitution model we discussed above.&lt;/p&gt;
&lt;p&gt;Consider the example of computing the greatest common divisor:&lt;/p&gt;
&lt;/notextile&gt;

If we call this function with &lt;code&gt;gcd(14, 21)&lt;/code&gt; and perform the substitution on it described above, we get the following results (remember, we're substituting but not evaluating - at each stage, the functions calls are the same in terms of the value):

&lt;pre&gt;
gcd(14, 21)
if (21 == 0) 14 else gcd(21, 14 % 21)
gcd(21, 14 % 21)
gcd(21, 14)
if (14 == 0) 21 else gcd(14, 21 % 14)
gcd(14, 21 % 14)
gcd(14, 7)
...
gcd(7, 0)
if (0 == 0) 7 else gcd(0, 7 % 0)
7
&lt;/pre&gt;

Notice the cyclical nature of the substitution - the function substitutes down to a call to the same function that looks exactly the same.

Next, consider the example of computer a factorial:

&lt;notextile&gt;&lt;p&gt;If we call this function with &lt;code&gt;factorial(4)&lt;/code&gt; and trace the substitution:&lt;/p&gt;
&lt;pre&gt;
factorial(4)
if (4 == 0) 1 else 4 * factorial(4 - 1)
4 * factorial(4 - 1)
4 * factorial(3)
4 * if (3 == 0) 1 else 3 * factorial(3 - 1)
4 * (3 * factorial(3 - 1))
4 * (3 * factorial(2))
...
4 * (3 * (2 * factorial(1)))
...
4 * (3 * (2 * (1 * 1)))
120
&lt;/pre&gt;
&lt;p&gt;Notice how the substituted expression grows, and we build on it.&lt;/p&gt;
&lt;p&gt;If a function calls itself as it&amp;#8217;s last action, it can reuse that stack frame and save memory. This is called &lt;em&gt;tail recursion&lt;/em&gt;. Because tail recursion allows us to reuse the stack frame, and the stack frame consumes a constant amount of space, it operates similarly to an iterative loop in an imperative language.&lt;/p&gt;
&lt;p&gt;Generally, if the last action of a function consists of calling a function (either the same or different), one stack frame would be sufficient for both functions. This is known as a &lt;em&gt;tail call&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Above, &lt;code&gt;gcd&lt;/code&gt; calls itself as it&amp;#8217;s last action, which is a tail recursive call and will execute in constant space. In &lt;code&gt;factorial&lt;/code&gt;, after we evaluated the recursive call to &lt;code&gt;factorial&lt;/code&gt;, we still need to multiply the value by &lt;code&gt;n&lt;/code&gt;. This means we&amp;#8217;re going to have to keep all those intermediary steps in memory, and this is not a tail recursive function.&lt;/p&gt;
&lt;h3&gt;Tail Recursion in Scala&lt;/h3&gt;
&lt;p&gt;Despite the memory savings, not all functions should be written tail recursive. This is due to the fact that tail recursive functions can be less clear than their non-tail recursive implementations, and unless you have a specific performance need to implement a function using tail calls, you should opt for the most readable implementation.&lt;/p&gt;
&lt;p&gt;Functions should be made tail recursive if you expect the data could possibly form deep recursion stacks, and possibly cause a stack overflow.&lt;/p&gt;
&lt;p&gt;In Scala, only directly recursive calls to the current function are optimized. If you want to ensure a function is tail recursive, you can add the &lt;code&gt;tailrec&lt;/code&gt; attribute to the function, and the compiler will throw an error if it&amp;#8217;s not tail recursive:&lt;/p&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Coursera Functional Programming Principles in Scala</title>
   <link href="http://www.timgittos.com/learning/coursera-functional-programming-principles-in-scala"/>
   <updated>2013-09-16T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/learning/coursera-functional-programming-principles-in-scala</id>
   <content type="html">&lt;h2&gt;What is this?&lt;/h2&gt;
&lt;p&gt;I&amp;#8217;ve been interested in learning about functional programming ever since I first heard about it, but could never dedicate the time to do so. I&amp;#8217;m taking this course to ensure that I at least get some exposure to functional programming.&lt;/p&gt;
&lt;div id=&quot;post-list&quot;&gt;












&lt;section&gt;


&lt;article&gt;
          &lt;h3&gt;&lt;a href=&quot;/learning/coursera-functional-programming-principles-in-scala/week-3&quot; rel=&quot;bookmark&quot; title=&quot;Coursera Functional Programming Principles in Scala - Week 3&quot;&gt;Coursera Functional Programming Principles in Scala &amp;#8211; Week 3&lt;/a&gt;&lt;/h3&gt;
          &lt;p class=&quot;description&quot;&gt;Data and Abstraction&lt;/p&gt;
&lt;footer&gt;
&lt;span class=&quot;timestamp&quot;&gt;Last updated 09 Oct 2013&lt;/span&gt;
&lt;/footer&gt;
&lt;/article&gt;



&lt;article&gt;
          &lt;h3&gt;&lt;a href=&quot;/learning/coursera-functional-programming-principles-in-scala/week-2&quot; rel=&quot;bookmark&quot; title=&quot;Coursera Functional Programming Principles in Scala - Week 2&quot;&gt;Coursera Functional Programming Principles in Scala &amp;#8211; Week 2&lt;/a&gt;&lt;/h3&gt;
          &lt;p class=&quot;description&quot;&gt;Higher order functions&lt;/p&gt;
&lt;footer&gt;
&lt;span class=&quot;timestamp&quot;&gt;Last updated 04 Oct 2013&lt;/span&gt;
&lt;/footer&gt;
&lt;/article&gt;



&lt;article&gt;
          &lt;h3&gt;&lt;a href=&quot;/learning/coursera-functional-programming-principles-in-scala/week-1&quot; rel=&quot;bookmark&quot; title=&quot;Coursera Functional Programming Principles in Scala - Week 1&quot;&gt;Coursera Functional Programming Principles in Scala &amp;#8211; Week 1&lt;/a&gt;&lt;/h3&gt;
          &lt;p class=&quot;description&quot;&gt;Functions &amp;amp; Evaluations&lt;/p&gt;
&lt;footer&gt;
&lt;span class=&quot;timestamp&quot;&gt;Last updated 21 Sep 2013&lt;/span&gt;
&lt;/footer&gt;
&lt;/article&gt;


&lt;/section&gt;





&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Vlondara</title>
   <link href="http://www.timgittos.com/art/vlondara"/>
   <updated>2013-09-09T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/art/vlondara</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/art/sketch___003.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Vlondara was an evil cleric of Llolth who joined one of my characters, Khara, during her rise to power.&lt;/p&gt;
&lt;p&gt;She was a level 12 drow cleric follower in a Dungeons and Dragons (D&amp;amp;D) campaign a long time ago. The drawing was done at least 6 years ago.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Khara</title>
   <link href="http://www.timgittos.com/art/khara"/>
   <updated>2013-09-09T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/art/khara</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/art/Khara_06.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Khara was probably my favorite character. She battled her way out of Ravenloft, and eventually fell under the sway of an evil, demonic sword. Her days of good over, she started to accumulate power until stopped during a war with the wizard whom she used to call her friend.&lt;/p&gt;
&lt;p&gt;This drawing was probably the last one I did of Khara, having done at least 5 previous. It was done a while ago, at least 6 years.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Harak and the Mirror</title>
   <link href="http://www.timgittos.com/art/harak-and-the-mirror"/>
   <updated>2013-09-09T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/art/harak-and-the-mirror</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/art/Harak_and_the_Mirror.jpg&quot; style=&quot;width: 800px;&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Harak was an evil wizard who joined one of my characters, Khara, during her rise to power.&lt;/p&gt;
&lt;p&gt;He was a level 12 wizard follower in a Dungeons and Dragons (D&amp;amp;D) campaign a long time ago. The drawing was done at least 6 years ago, purely digital.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>At the Rose Portal</title>
   <link href="http://www.timgittos.com/art/at-the-rose-portal"/>
   <updated>2013-09-09T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/art/at-the-rose-portal</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/art/At_the_Rose_Portal.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;At the Rose Portal&lt;/h2&gt;
&lt;p&gt;Gilaen Giluial was a simple rose gardener, until he was pulled through a portal into a strange new city.&lt;/p&gt;
&lt;p&gt;He was an elven sorcerer in the Dungeons and Dragons Planescape campaign setting. Originally from Faerun, he was busy tending a rose garden when a thief ran through his garden. Chasing the thief, he entered a portal to Sigil which promptly closed behind him.&lt;/p&gt;
&lt;p&gt;This drawing was done at least 6 years ago, I can&amp;#8217;t remember when to be exact.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ashan-Ri</title>
   <link href="http://www.timgittos.com/art/ashan-ri"/>
   <updated>2013-09-09T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/art/ashan-ri</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/art/finished___003.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Ashan-Ri was a mechalus hacker specialist in a short lived Alternity game.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t remember much about this character, and the drawing must be at least 6 years old.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Adventurin</title>
   <link href="http://www.timgittos.com/blog/adventurin"/>
   <updated>2013-09-03T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/adventurin</id>
   <content type="html">&lt;p&gt;Back in April I wrote about &lt;a href=&quot;http://localhost:4000/blog/sxsw-and-side-projects-oh-my&quot;&gt;my experiences at &lt;span class=&quot;caps&quot;&gt;SXSW&lt;/span&gt;, and plans to start something with some friends&lt;/a&gt; . I&amp;#8217;ve been slowly working on that, and now I am prepared to reveal a little about it.&lt;/p&gt;
&lt;p&gt;Ever since I was a young teenager, I&amp;#8217;ve been fascinated by table top pen &amp;amp; paper role playing games (RPGs). I&amp;#8217;d heard of this one called Dungeons &amp;amp; Dragons, and looked on the internet for rules to play it. I found bits here and there, but realized you had to buy a book of rules. I went to my local game store and found out it cost $70! My parents wouldn&amp;#8217;t buy it for me, so I saved up my lunch money at school for 6 months and went off and bought it myself. Convincing the group of guys at my school who played to let me join them took a little more effort but once they said yes I was hooked.&lt;/p&gt;
&lt;p&gt;As I played through high school, univeristy, working full time and dating, I slowly stopped playing as it became a lower priority for me in my life. Although we had a lot of fun it was very time consuming to prep both as a player and a game master (GM). I&amp;#8217;ve spent time on both sides of the table. I&amp;#8217;ve written 20 page backstories and invented a host of supporting characters to flesh out a level 1 character. I&amp;#8217;ve spent hours crafting a story to run my players through, making it as open ended as possible. I have a 13 story unfinished &amp;#8220;Vampire: The Masquerade&amp;#8221; chronicle sitting on my harddrive that&amp;#8217;s in excess of 100 pages.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t think this is unique. In fact, I know it&amp;#8217;s not. Players and GMs put in so much time to create fantastic stories together that are experienced by a group of 5 or 6 people over the course of a handful of hours. Then they die. Then the stories languish on hard drives or in notebooks in drawers if they&amp;#8217;re lucky, thrown out and destroyed if not. Really dedicated players and GMs might put their content online but that&amp;#8217;s not always easy.&lt;/p&gt;
&lt;p&gt;All that time, and the story is experienced once.&lt;/p&gt;
&lt;p&gt;I want to make it easy for players and GMs to share their work. I want to build something that will make it possible to make money from their work. I want to build something that will enable people from all over the world to play with each other easily.&lt;/p&gt;
&lt;p&gt;The first step is &lt;strong&gt;miniatures&lt;/strong&gt;. I started playing again a few years ago, and found play with miniatures to be superior for visualizing action than the way we used to play, just sitting around a table. But finding a good miniature to represent the character I spent hours crafting was difficult, if not impossible. Many compromises were made.&lt;/p&gt;
&lt;p&gt;With the rising popularity and ubiquity of 3D printing, I shouldn&amp;#8217;t have to settle for someone else&amp;#8217;s idea of my character. I should be able to mould my character exactly as I see it, in plastic, to play with. Right now I can&amp;#8217;t, and that&amp;#8217;s something that my friends and I want to fix.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s time to start &lt;a href=&quot;http://ad.ventur.in/?utm_source=timgittos.com&amp;amp;utm_medium=blog&amp;amp;utm_campaign=referral&quot;&gt;Adventurin&amp;#8217;&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Princeton Algorithms, Part 1</title>
   <link href="http://www.timgittos.com/learning/princeton-algorithms-part-1"/>
   <updated>2013-08-22T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/learning/princeton-algorithms-part-1</id>
   <content type="html">&lt;h2&gt;What is this?&lt;/h2&gt;
&lt;p&gt;While studying Software Engineering at school, I did most of my theoretical computer science work in the first year. That was over 10 years ago &amp;#8211; suffice to say, I don&amp;#8217;t remember much.&lt;/p&gt;
&lt;p&gt;I think it&amp;#8217;s important to periodically review things you&amp;#8217;ve learnt, otherwise you will forget them. I&amp;#8217;m taking this course both as a refresher now, and to build a set of notes I can use to refresh myself later.&lt;/p&gt;
&lt;div id=&quot;post-list&quot;&gt;
















&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>PDF Stitcher - Combine multiple PDFs into one</title>
   <link href="http://www.timgittos.com/projects/pdf-stitcher"/>
   <updated>2013-06-26T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/pdf-stitcher</id>
   <content type="html">&lt;h2&gt;Description&lt;/h2&gt;
&lt;p&gt;For a while I&amp;#8217;ve had a little utility script that will leverage Ghostscript and combine multiple &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; files into a single &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt;. This script came about after finding a few really great free textbooks online that were broken up by chapter. This is both annoying to download and annoying to read.&lt;/p&gt;
&lt;p&gt;After logging into my &lt;span class=&quot;caps&quot;&gt;VPS&lt;/span&gt; for the third time just to stitch some &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; files together, I decided to turn my little script into a little service.&lt;br /&gt;
A few hours and a domain registration later, and I have the service available.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s available here: &lt;a href=&quot;http://pdfstitcher.com&quot;&gt;&lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; Stitcher &amp;#8211; Stitch Multiple &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; files into one&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s super easy to use &amp;#8211; paste the &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; of a page that has a list of links to &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; files in the box, and press the button. The service will fetch all the linked files and stitch them together.&lt;/p&gt;
&lt;p&gt;The source code for this service can also be found on &lt;a href=&quot;http://github.com/tgittos/pdfstitcher&quot;&gt;my Github account&lt;/a&gt; just in case you want to self host.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Book Notes: The Launch Pad</title>
   <link href="http://www.timgittos.com/books/book-notes-the-launch-pad"/>
   <updated>2013-06-04T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/books/book-notes-the-launch-pad</id>
   <content type="html">&lt;div class=&quot;review-header&quot;&gt;
&lt;p class=&quot;left&quot;&gt;&lt;img src=&quot;/images/books/launchpad.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Amazon:&lt;/strong&gt; &lt;span&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/1591845297/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1591845297&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;The Launch Pad: Inside Y Combinator, Silicon Valley&amp;#8217;s Most Exclusive School for Startups&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=1591845297&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
 (referral link &amp;#8211; help me buy new books!)&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;ISBN&lt;/span&gt;:&lt;/strong&gt; 1591845297&lt;br /&gt;
&lt;strong&gt;Read:&lt;/strong&gt; 2013-05-13&lt;/p&gt;
&lt;p&gt;After reading &lt;a href=&quot;http://42floors.com/blog/yc-without-being-in-yc&quot;&gt;this post about &lt;span class=&quot;caps&quot;&gt;DIY&lt;/span&gt; Y-Combinator&lt;/a&gt; I wanted to find out exactly what happens in YC.&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Notes&lt;/h2&gt;
&lt;p&gt;When considering an idea, figure out how it expands. When doing so, think about how it affects the world as it is, not what the idea does. Example: app that gathers photos from a users Facebook profile and creates a photo book. Can eventually be expanded to replace yearbooks.&lt;/p&gt;
&lt;p&gt;Also ask, would someone pay for that? Nobody would pay to save themselves a single click (full text of links in Twitter stream)&lt;/p&gt;
&lt;p&gt;Look at competitors and figure out what they do that hurts them. Then don&amp;#8217;t do that.&lt;/p&gt;
&lt;p&gt;Beginners mind in all things &amp;#8211; don&amp;#8217;t dwell on how hard starting up will be (if you even know).&lt;/p&gt;
&lt;p&gt;Sell pixaxes during a gold rush. That is, when people are creating software startups and services, sell tools they&amp;#8217;ll need to build it. Your success is independent of theirs.&lt;/p&gt;
&lt;p&gt;Reduce drag on things that are important. Remove obstacles that will increase resistance to doing things that move you forward. Remove distractions.&lt;/p&gt;
&lt;p&gt;The best way to learn something is to do it.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s better to be a small fish in a big pond. Makes you hungrier.&lt;/p&gt;
&lt;p&gt;Know when you create a start up that you&amp;#8217;re competing against the odds. And do it anyway, because it&amp;#8217;s what you want to do.&lt;/p&gt;
&lt;p&gt;Make something that people want &amp;#8211; something of incredible value to a niche of users who will pay.&lt;/p&gt;
&lt;p&gt;Each time you swing the bat, you increase your odds of success. Ergo, each time you do something other than swining the bat, you theoretically decrease your odds.&lt;/p&gt;
&lt;p&gt;Startups must be designed for scale.&lt;/p&gt;
&lt;p&gt;&amp;#8220;Ask yourself: &amp;#8216;What do I wish someone would start a startup to do for me?&amp;#8217;&amp;#8221; or something for someone else that you know is a problem.&lt;/p&gt;
&lt;p&gt;&amp;#8220;Do you ever, in your work, say, &amp;#8216;Boy, I wish somebody would just &amp;#8211; blank&amp;#8217;?&amp;#8221;&lt;/p&gt;
&lt;p&gt;Pick something you&amp;#8217;re passionate about that you have domain knowledge in.&lt;/p&gt;
&lt;p&gt;What will people in the future say was an unmet need today? &amp;#8211; look forward&lt;/p&gt;
&lt;p&gt;Solve a burning need&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re excited about an idea that most people are bored by, and it&amp;#8217;s a problem, that&amp;#8217;s an advantage.&lt;/p&gt;
&lt;p&gt;Pick ideas where the cost of failure is low, and is basically just time.&lt;/p&gt;
&lt;p&gt;&amp;#8220;Friends will use stuff because they&amp;#8217;re friends &amp;#8230; the true test is if they start bringing other people into it &amp;#8230; that&amp;#8217;s something that they won&amp;#8217;t do out of obligation to you&amp;#8221;&lt;/p&gt;
&lt;p&gt;Launch fast, get feedback, people can only tell you what they want when they see what you don&amp;#8217;t do. Iterate.&lt;/p&gt;
&lt;p&gt;You make what you can measure.&lt;/p&gt;
&lt;p&gt;Every week, set a specific target for growth.&lt;/p&gt;
&lt;p&gt;Imagine five years out you&amp;#8217;re a huge company, guess why you&amp;#8217;re a big company. That will give direction.&lt;/p&gt;
&lt;p&gt;Find an industries influencers and influence them &amp;#8211; that&amp;#8217;s valuable to suppliers of that industry.&lt;/p&gt;
&lt;p&gt;Don&amp;#8217;t worry about domain names &amp;#8211; it won&amp;#8217;t break a good idea, and you&amp;#8217;ll have money to buy the right one later.&lt;/p&gt;
&lt;p&gt;Do work on things that matter &amp;#8211; refactoring your code or dealing with databases is &amp;#8216;work&amp;#8217; that won&amp;#8217;t move you forward.&lt;/p&gt;
&lt;p&gt;Doing the wrong thing is better than doing nothing at all.&lt;/p&gt;
&lt;p&gt;Think 5 years down the track, what is success? What would you put on your resume saying what you did?&lt;/p&gt;
&lt;p&gt;Rejection is inevitible, and frequent. When selling, no means not yet. There is no definitive no, only a to-be-continued.&lt;/p&gt;
&lt;p&gt;Seeing how users interact with your product/idea and why they are rejecting you is valuable.&lt;/p&gt;
&lt;p&gt;Start selling before your product is completed.&lt;/p&gt;
&lt;p&gt;&amp;#8220;Err on the side of sales. Just spend all your time doing sales and treating hacking as this side project&amp;#8221;&lt;/p&gt;
&lt;p&gt;Sell source code for failed startup/ideas/projects&lt;/p&gt;
&lt;p&gt;When pivoting, if you have 2 ideas, work on both. Pick the best, or if both good, spin up 2 startups.&lt;/p&gt;
&lt;p&gt;Look forward, but have a plan to make money now.&lt;/p&gt;
&lt;p&gt;A startup can change it&amp;#8217;s idea quickly, but not it&amp;#8217;s cofounders. &amp;#8220;Startups do to the relationship between the founds what a dog does to a sock; if it can be pulled apart, it will be.&amp;#8221;&lt;/p&gt;
&lt;p&gt;Your startup is never someone&amp;#8217;s top priority but your own. Get their email address and treat them as a lead.&lt;/p&gt;
&lt;p&gt;&amp;#8220;When VCs decide they don&amp;#8217;t like you, it&amp;#8217;s based on gut feel&amp;#8221; &amp;#8211; the reason they give is an excuse.&lt;/p&gt;
&lt;p&gt;Pitching the startup:&lt;/p&gt;
&lt;p&gt;If it doesn&amp;#8217;t feel wrong, you&amp;#8217;re talking too fast.&lt;/p&gt;
&lt;p&gt;Don&amp;#8217;t use a slide that could work in another startup&amp;#8217;s deck.&lt;/p&gt;
&lt;p&gt;People aren&amp;#8217;t going to work to understand you. You need to grab their attention and be simple and easy to understand.&lt;/p&gt;
&lt;p&gt;Why you? Why not someone else?&lt;/p&gt;
&lt;p&gt;Don&amp;#8217;t go into too much detail.&lt;/p&gt;
&lt;p&gt;You don&amp;#8217;t want to be animated the whole time, and you don&amp;#8217;t want to not be animated. Choose when you are animated. You tend to speak animatedly about the most important thing about your startup.&lt;/p&gt;
&lt;p&gt;If a statement is not surprising, it&amp;#8217;s probably not an insight.&lt;/p&gt;
&lt;p&gt;Investors will often walk away from your pitch with a single noun in their mind.&lt;/p&gt;
&lt;p&gt;Be excited about your product.&lt;/p&gt;
&lt;p&gt;Being better (UX) than your competition is valuable in itself.&lt;/p&gt;
&lt;p&gt;30% of YC companies will experience a split among cofounders.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Book Notes: LLC vs. S-Corp vs. C-Corp Explained in 100 Pages or Less</title>
   <link href="http://www.timgittos.com/books/book-notes-llc-vs-s-corp-vs-c-corp-explained-in-100-pages-or-less"/>
   <updated>2013-04-30T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/books/book-notes-llc-vs-s-corp-vs-c-corp-explained-in-100-pages-or-less</id>
   <content type="html">&lt;div class=&quot;review-header&quot;&gt;
&lt;p class=&quot;left&quot;&gt;&lt;img src=&quot;/images/books/llc-scorp-ccorp.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Amazon:&lt;/strong&gt; &lt;span&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/0981454275/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0981454275&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;&lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; vs. S-Corp vs. C-Corp Explained in 100 Pages or Less&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=0981454275&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt;&lt;br /&gt;
 (referral link &amp;#8211; help me buy new books!)&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;ISBN&lt;/span&gt;:&lt;/strong&gt; 0981454275&lt;br /&gt;
&lt;strong&gt;Read:&lt;/strong&gt; 2013-04-30&lt;/p&gt;
&lt;p&gt;A no-nonsense whirlwind tour of the essential difference between LLCs, S-Corps and C-Corps. A great foundation for going to talk to an attorney or accountant or someone who actually knows what they&amp;#8217;re doing. I wouldn&amp;#8217;t recommend doing any of the work yourself beyond forming an &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;, but then I&amp;#8217;m pretty risk adverse.&lt;/p&gt;
&lt;p&gt;The notes below are a condensed version of the book above, so that I can quickly and easily access the content without having to dig the book out on my Kindle.&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Notes&lt;/h2&gt;
&lt;h3&gt;Brief Outline&lt;/h3&gt;
&lt;p&gt;Part 1: A discussion of sole proprietorships and partner ships &amp;#8211; it&amp;#8217;s most likely than a currently operating business is one of the two. Chapters 1 &amp;#8211; 7.&lt;/p&gt;
&lt;p&gt;Part 2: &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; vs. S-Corp vs. C-Corp, and ramifications. Chapters 8 &amp;#8211; 15.&lt;/p&gt;
&lt;p&gt;Part 3: Related topics such as ramifications of becoming an employee of your business as a result of electing corporate tax treatment. Chapters 16 &amp;#8211; 17.&lt;/p&gt;
&lt;h3&gt;Sole Proprietorships&lt;/h3&gt;
&lt;p&gt;From a federal standpoint, any business started by a single person is automatically a sole proprietorship, unless the owner decides to take some action, such as incorporating, in order to become a different type of entity.&lt;br /&gt;
State, county or city may have extra requirements, such as licenses.&lt;/p&gt;
&lt;p&gt;An Employer Identification Number (&lt;span class=&quot;caps&quot;&gt;EIN&lt;/span&gt;) is not required, however is convenient. &lt;span class=&quot;caps&quot;&gt;EIN&lt;/span&gt; is to a business as a &lt;span class=&quot;caps&quot;&gt;SSN&lt;/span&gt; is to an individual. Sole proprieterships can use the owners &lt;span class=&quot;caps&quot;&gt;SSN&lt;/span&gt;, but an &lt;span class=&quot;caps&quot;&gt;EIN&lt;/span&gt; can protect the &lt;span class=&quot;caps&quot;&gt;SSN&lt;/span&gt; from identity theft.&lt;/p&gt;
&lt;p&gt;Most states require a &amp;#8220;Doing Business As&amp;#8221; (&lt;span class=&quot;caps&quot;&gt;DBA&lt;/span&gt;) if your name and the business name don&amp;#8217;t match.&lt;/p&gt;
&lt;p&gt;Sole proprietorships are a &amp;#8220;pass-through&amp;#8221; entity, meaning owner is responsible for profits and losses. File taxes as normal, profits are taxed as income (added to owners 1040 from calculation on Schedule C), with added self employement tax (calculated on Schedule SE) of 15.3%.&lt;br /&gt;
Half of the self employement tax can be deducted as an &amp;#8220;above the line&amp;#8221; deduction.&lt;/p&gt;
&lt;p&gt;Sole proprietorships have &amp;#8220;unlimited liability&amp;#8221;, that is, owner is personally liable for debts of business.&lt;/p&gt;
&lt;h3&gt;Partnerships&lt;/h3&gt;
&lt;p&gt;Partnerships start similarly to sole proprietorships, by multiple people doing business as a unit, but require an &lt;span class=&quot;caps&quot;&gt;EIN&lt;/span&gt; and a &lt;span class=&quot;caps&quot;&gt;DBA&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Much more likely for local requirements on a partnership, so check city hall.&lt;/p&gt;
&lt;p&gt;Also recommended is a partnership agreement. This is a contract that specifies how expenses are divided, profits allocated, how and when profits allocated, which partners are responsible for which tasks, under what circumstances a partner can sell his or her interest to someone else, how disagreements will be resolved. At least. Anything else that might come up.&lt;/p&gt;
&lt;p&gt;Partnerships are taxed like sole proprietorships, only with the inclusion of Form 1065 to calculate the partnerships profit/loss. At the end of Form 1065 is a Schedule K where income is broken down into categories, and each member of partnership fills out a Schedule K-1 for their share of those incomes. These then show up on regular income tax return (Form 1040).&lt;/p&gt;
&lt;p&gt;Partnership taxation is based on the concept of &amp;#8220;tax basis&amp;#8221;. Generally, owners of a partnership are taxed upon their share of the taxable income, regardless of how much is distributed. A partner is not taxed upon distributions from the partnership as long as the distributions don&amp;#8217;t exceed the partner&amp;#8217;s tax basis.&lt;/p&gt;
&lt;p&gt;A partner&amp;#8217;s tax basis in a partnership is:&lt;/p&gt;
&lt;p&gt;1. Increased by any amount s/he invests in the business&lt;br /&gt;
2. Increased by his/her share of the partnership&amp;#8217;s taxable income (and decreased by his/her share of the partnership losses)&lt;br /&gt;
3. Decreased by the amount of any distributions s/he recieves&lt;br /&gt;
4. Increased by his/her share of the debt owed by the partnership.&lt;/p&gt;
&lt;p&gt;Partnerships have unlimited liability, and a partner is responsible for the partnerships liabilities in total, even if created by another partner.&lt;/p&gt;
&lt;p&gt;Thus far, the term partnership refers to a general partnership. Concept of limited partnership also exists. Limited partners are only liable up to their investment in the partnership, but cannot engage in management or day to day operations. Usually reserved for outside investors.&lt;/p&gt;
&lt;h3&gt;LLC&amp;#8217;s&lt;/h3&gt;
&lt;p&gt;An &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; has pass-through tax treatment with limited liability protection. It is a state level entity, and requirements will vary state to state. In most states, an &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; is formed by filing a document known as articles of organization with the Secretary of State. Generally, articles must include:&lt;/p&gt;
&lt;p&gt;1. LLC&amp;#8217;s name and address of it&amp;#8217;s principal place of business&lt;br /&gt;
2. Names of the owners (members) of the &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;&lt;br /&gt;
3. Nature of the LLC&amp;#8217;s business&lt;br /&gt;
4. The name and address of the LLC&amp;#8217;s registered agent (party authorized to accept delivery of legal documents on behalf of &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;)&lt;/p&gt;
&lt;p&gt;If you wish to have a physical presence in another state, you will need to &amp;#8220;qualify&amp;#8221; or &amp;#8220;foreign qualify&amp;#8221; the &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; with the Secretary of State in those states.&lt;/p&gt;
&lt;p&gt;If the &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; will have multiple owners, as per a partnership, should include an operating agreement and have an &lt;span class=&quot;caps&quot;&gt;EIN&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Converting between a sole proprietorship and an &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;, or between a partnership and an &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; is a non-taxable event given how LLCs are taxed.&lt;/p&gt;
&lt;p&gt;If the &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; is single-member with no employees, owner should continue to use &lt;span class=&quot;caps&quot;&gt;SSN&lt;/span&gt; instead of &lt;span class=&quot;caps&quot;&gt;EIN&lt;/span&gt; for taxation.&lt;/p&gt;
&lt;p&gt;An &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; is a &amp;#8220;disregarded entity&amp;#8221;, meaning for federal taxation requirements, it doesn&amp;#8217;t exist, and is instead treated as a sole proprietorship or partnership.&lt;/p&gt;
&lt;p&gt;An &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; can opt to be taxed as a corporation. This can be done by either forming a corporation and transfering all assets from the &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; to the corporation, or by filling out a form (form 8832 for C-Corp, form 2553 for S-Corp) electing for corporate tax treatment.&lt;/p&gt;
&lt;p&gt;LLCs may be taxed differently in different states, and that may affect the viability of forming an &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;LLCs are usually formed for their limited liability, but it&amp;#8217;s not perfect. Here are some situations where you are still liable for the actions of the &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;1. Signing personally for business debt&lt;br /&gt;
2. Liability resulting from tort of the &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt; owner (where &amp;#8220;tort&amp;#8221; refers to wrongful acts other than breach of contract)&lt;/p&gt;
&lt;h3&gt;C-Corporations&lt;/h3&gt;
&lt;p&gt;A C-corp is similar to an &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;, and differs only in how it is taxed. Accountaints, doctors, engineers, lawyers and social workers are usually not allowed to form a regular C-corp, though this varies from state to state.&lt;/p&gt;
&lt;p&gt;A C-corp itself is subject to income tax, as opposed to the owner/partners of an &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;. The taxation rate is unaffected by how many owners (shareholders) there are.&lt;/p&gt;
&lt;p&gt;Taxation rates for a C-corp can vary year to year. For 2012, here are the rates:&lt;/p&gt;
&lt;table&gt;
	&lt;tr&gt;
		&lt;th&gt;Income range&lt;/th&gt;
		&lt;th&gt;Rate&lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; $0 &amp;#8211; $50,000 &lt;/td&gt;
		&lt;td&gt; 15% &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; $50,001 &amp;#8211; $75,000 &lt;/td&gt;
		&lt;td&gt; 25% &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; $75,001 &amp;#8211; $100,000 &lt;/td&gt;
		&lt;td&gt; 34% &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; $100,001 &amp;#8211; $335,000 &lt;/td&gt;
		&lt;td&gt; 39% &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; $335,001 &amp;#8211; $10,000,000 &lt;/td&gt;
		&lt;td&gt; 34% &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; $10,000,001 &amp;#8211; $15,000,000 &lt;/td&gt;
		&lt;td&gt; 35% &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; $15,000,001 &amp;#8211; $18,333,333 &lt;/td&gt;
		&lt;td&gt; 38% &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt; $18,333,334+ &lt;/td&gt;
		&lt;td&gt; 35% &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;When a corporation makes a distribution to it&amp;#8217;s owners, the payment is known as a divident, and is taxable to the recipient. That is, corporate profits are taxed twice.&lt;/p&gt;
&lt;p&gt;To get around the double taxation, the corporation can pay the owners a salary or end of year bonus that will leave the corporation with zero income. This will be taxed on the owners at their income tax rates, as per an &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Double taxation can be leveraged to save money, by paying a portion of income as salary rather than all of it. This can cause both the employees and the corporation to be in lower tax brackets, and save money. However, be aware of the 15% accumulated earnings tax charged on top of income tax on income that accumulates (not distributed) beyond the corporations reasonable needs. Keeping accumulation under $250,000 is a good rule of thumb.&lt;/p&gt;
&lt;p&gt;Corporate losses are also not passed to the owners as an LLCs are. Instead, C-corp losses can be used to offset taxable income from the two prior years, or up to twenty years in the future.&lt;/p&gt;
&lt;p&gt;Form 1120 is filed for a C-corps tax return. The second page (Schedule C) is only applicable if the corporation owns shares in other businesses. The third page (Schedule J) is where any tax credits are applied. The fourth page (Schedule K) is a mixed bag of questions, such as the number and nature of shareholders, whether the necessary forms have been filed, etc. The last pages (Schedules L, M-1 and M-2) are only required if the corporation has assets greater than $250,000 at the end of the year or total receipts of $250,000 or more for the year.&lt;/p&gt;
&lt;p&gt;For liability, coprorations are distinct entities that can own things, rent things, sue or be sued.&lt;/p&gt;
&lt;p&gt;In order for a corporation to keep it&amp;#8217;s classification, a few legal requirements need to be met. For example, whenever a major decision is made, it must be recorded in a document known as a &amp;#8220;resolution&amp;#8221;. Also, most states require an annual meeting of the directors and shareholders of the corporation, and a record of everything that was discussed.&lt;/p&gt;
&lt;p&gt;As in an &lt;span class=&quot;caps&quot;&gt;LLC&lt;/span&gt;, it&amp;#8217;s possible for the owners of a corporation to be liable as a result of any torts they personally commit.&lt;/p&gt;
&lt;p&gt;The term &amp;#8220;piercing the corporate veil&amp;#8221; refers to breaking the separation between the owners of a corporation and the corporation itself.&lt;br /&gt;
Some factors that may lead to a court piercing the corporate veil:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Intermingling of funds between corporate accounts and personal accounts&lt;/li&gt;
	&lt;li&gt;Disregard for corporate formatlities&lt;/li&gt;
	&lt;li&gt;Undercapitalization of the corporation (corp. lacks capital to satisfy obligations)&lt;/li&gt;
	&lt;li&gt;Absence of corporate financial records&lt;/li&gt;
	&lt;li&gt;Anything else a court believes would mean that the corp. is just a formality and not materially distinct from it&amp;#8217;s owners.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;S-Corporations&lt;/h3&gt;
&lt;p&gt;S-corporations are similar to C-corporations, and differ only in taxation and a few rules of ownership:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Must be a domestic corporation&lt;/li&gt;
	&lt;li&gt;No more than 100 shareholders/members&lt;/li&gt;
	&lt;li&gt;Shareholders can only be individuals, estates or tax-exempt organizations. No corporations or partnerships.&lt;/li&gt;
	&lt;li&gt;No non-resident alient shareholders&lt;/li&gt;
	&lt;li&gt;Can only have one class of stock&lt;/li&gt;
	&lt;li&gt;Cannot be a bank or insurance company&lt;/li&gt;
	&lt;li&gt;All shareholders must consent to the election&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An S-corp, like a partnership, is a pass-through entity. Taxes are filed on Form 1120S. Unlike a partnership, S-corps are not subject to the self employment tax, however each owner who also works as an employee must be paid a &amp;#8220;reasonable&amp;#8221; salary, which will be subject to Social Security and Medicare taxes to be paid half by the employee, and half by the corporation. This means the benefits from not having a self-employment tax only kick in once the S-corp is making enough money to pay it&amp;#8217;s owners a reasonable salary.&lt;/p&gt;
&lt;p&gt;Each state has it&amp;#8217;s own rules regarding S-corp taxation, so check with the state the S-corp is incorporated in.&lt;/p&gt;
&lt;h3&gt;Being an Employee of Your Business&lt;/h3&gt;
&lt;p&gt;Being an employee of your corporation has rammifications.&lt;/p&gt;
&lt;p&gt;As a business with employees, you will have to register as an employer in your state to pay unemployement tax.&lt;/p&gt;
&lt;p&gt;You will also have federal and possible state level reporting requirements, such as needing to file:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Form 940 annually to report the Federal Unemployment Tax Act (&lt;span class=&quot;caps&quot;&gt;FUTA&lt;/span&gt;) tax for wages paid,&lt;/li&gt;
	&lt;li&gt;Form 941 quarterly to report Social Security, Medicare and withheld income taxes on wages paid,&lt;/li&gt;
	&lt;li&gt;Form W-2 annually to report wages paid, taxes withheld and other related information.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also need to make monthly payments of the employers share of Social Security and Medicare taxes on wages, plus amount withheld for employee&amp;#8217;s share of taxes as well as income tax.&lt;/p&gt;
&lt;p&gt;Another drawback to corporate taxation is the limitation imposed on the amount allowed to be contributed to a business retirement plan. For example, a sole proprieter can contribute to a &lt;span class=&quot;caps&quot;&gt;SEP&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;IRA&lt;/span&gt; for 2012 the lesser of $50,000 or 25% of the net earnings from self employment, but as an employee the most you can contribute is the lesser of $50,000 or 25% of your salary.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Book Notes: Start Small, Stay Small - A Developer's Guide to Launching a Startup</title>
   <link href="http://www.timgittos.com/books/book-notes-start-small-stay-small"/>
   <updated>2013-04-15T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/books/book-notes-start-small-stay-small</id>
   <content type="html">&lt;div class=&quot;review-header&quot;&gt;
&lt;p class=&quot;left&quot;&gt;&lt;img src=&quot;/images/books/start-small-stay-small.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Amazon:&lt;/strong&gt; &lt;span&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/0615373968/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0615373968&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;Start Small, Stay Small: A Developer&amp;#8217;s Guide to Launching a Startup&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=0615373968&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt; (referral link &amp;#8211; help me buy new books!)&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;ISBN&lt;/span&gt;:&lt;/strong&gt; 0615373968&lt;br /&gt;
&lt;strong&gt;Read:&lt;/strong&gt; 2013-04-15&lt;/p&gt;
&lt;p&gt;I actually read this one a while ago, but I think it deserves some note taking, so I re-read it.&lt;/p&gt;
&lt;p&gt;In my opinion, one of the best ways to start a business is to bootstrap. This is probably due to the fact that I am fairly risk adverse, but that&amp;#8217;s neither here nor there. This book covers some important information about bootstrapping, and provides a great balance between theory and practical advice.&lt;/p&gt;
&lt;/div&gt;
&lt;h2&gt;Notes&lt;/h2&gt;
&lt;h3&gt;Chapter 1 &amp;#8211; The Chasm Between Developer and Entrepreneur&lt;/h3&gt;
&lt;p&gt;Aimed at developers who want to bootstrap. Not for VC funded, ultra fast growth startups.&lt;/p&gt;
&lt;p&gt;Fast growth, VC funded startups have pressure to go after larger markets fast, which is hard, due to investors wanting a return. Bootstrapped startups can go after smaller niches and own them, and take their time to figure it out.&lt;/p&gt;
&lt;p&gt;A bootstrapper needs to be a developer who can sell. They need to be able to manage a website and market, including finding a market.&lt;/p&gt;
&lt;p&gt;Venture backed = high risk, high payoff. Bootstrapped = low risk, lower payoff (though still nice, otherwise why do it?)&lt;/p&gt;
&lt;p&gt;The wrong reasons to build a software product:&lt;/p&gt;
&lt;p&gt;Reason #1: Having a product idea&lt;br /&gt;
Beware product vs. project. A product is a software project with a market of people who want to buy it.&lt;/p&gt;
&lt;p&gt;Reason #2: To get rich&lt;br /&gt;
Bootstrapping will not likely bring a million dollar payday. Venture backed startups or the lottery may, with terrible odds.&lt;/p&gt;
&lt;p&gt;Reason #3: Because it sounds like fun&lt;br /&gt;
It&amp;#8217;s only fun at the end. It&amp;#8217;s hard work most of the time.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Break the link between dollars and hours. Make money from software, not time.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Set goals to harden your resolve during tough times:&lt;/p&gt;
&lt;p&gt;1. Write goals down&lt;br /&gt;
2. Make a public commitment&lt;br /&gt;
3. Become accountable&lt;/p&gt;
&lt;p&gt;Last 2 are reasons for a cofounder or entrepreneur community&lt;/p&gt;
&lt;p&gt;Biggest roadblocks to success:&lt;/p&gt;
&lt;p&gt;Roadblock #1: No market&lt;br /&gt;
You probably don&amp;#8217;t have the clout to create a market. Don&amp;#8217;t build a product if you don&amp;#8217;t know there&amp;#8217;s a market for it already.&lt;/p&gt;
&lt;p&gt;Roadblock #2: Fear&lt;br /&gt;
Lean in. Fear means you&amp;#8217;re growing.&lt;/p&gt;
&lt;p&gt;Roadblock #3: Lack of goals&lt;br /&gt;
Use the steps above to manage goals.&lt;/p&gt;
&lt;p&gt;Roadblock #4: Inconsistency&lt;br /&gt;
Make sure everything you&amp;#8217;re doing is relevant. Stick to an information diet.&lt;/p&gt;
&lt;p&gt;Roadblock #5: Believing you have to do everything yourself&lt;br /&gt;
Get someone who charges less for their time per hour than you do. You&amp;#8217;ll always save money in the long run.&lt;/p&gt;
&lt;p&gt;&amp;#8220;Dollarize&amp;#8221; &amp;#8211; show how a price is less expensive due to the amount of money saved in the long run.&lt;/p&gt;
&lt;p&gt;Dollarize your time to validate outsourcing &amp;#8211; see roadblock #5. Calculate time value based on freelancing rates or salary. Keep in mind desired earnings isn&amp;#8217;t actual earnings.&lt;/p&gt;
&lt;p&gt;Shoot for a $100/hr rate in the long run. Your startup won&amp;#8217;t start there, but once you have a firm dollar rate, you can work on increasing it.&lt;/p&gt;
&lt;p&gt;Realizations of dollarizing time:&lt;/p&gt;
&lt;p&gt;Realization #1: Outsourcing is a bargain, as long as they charge less per hour than your dollarized hour.&lt;/p&gt;
&lt;p&gt;Realization #2: Keep work and play separate&lt;br /&gt;
Don&amp;#8217;t do both at the same time, you&amp;#8217;ll suck at both.&lt;/p&gt;
&lt;p&gt;Realization #3: Wasting time is bad&lt;br /&gt;
Each wasted hour is $xx.&lt;/p&gt;
&lt;p&gt;Realization #4: Information consumption is only good when it produces something.&lt;br /&gt;
Unless you do it for play.&lt;/p&gt;
&lt;p&gt;Realizations from transition from developer to entrepreneur:&lt;/p&gt;
&lt;p&gt;Realization #1: Being a good technician is not enough&lt;br /&gt;
As per &amp;#8220;The E-Myth Revisited&amp;#8221; by Michael Gerber, ned to be entrepreneur (dreamer, visionary), manager (business stuff), technician.&lt;/p&gt;
&lt;p&gt;Realization #2: Market comes first, marketing second, aesthetic third, functionality fourth.&lt;/p&gt;
&lt;p&gt;Realization #3: Things will never be as clear as you want them to be.&lt;br /&gt;
Selling (and anything fuzzy involving humans) involves lots of guesswork, lots of iteration. Guess, measure, tweak.&lt;/p&gt;
&lt;p&gt;Realization #4: You can&amp;#8217;t specify everything&amp;#8230; but you do need a plan.&lt;br /&gt;
Be agile.&lt;/p&gt;
&lt;p&gt;Realization #5: You need to fail fast and recover.&lt;br /&gt;
BE &lt;span class=&quot;caps&quot;&gt;AGILE&lt;/span&gt;!&lt;/p&gt;
&lt;p&gt;Realization #6: You will never be done.&lt;br /&gt;
An artist never finishes a work, he just stops working on it.&lt;/p&gt;
&lt;p&gt;Realization #7: Don&amp;#8217;t expect instant gratification.&lt;br /&gt;
Inertia. Starting for the first time is way harder than doing it for the second time.&lt;/p&gt;
&lt;p&gt;Realization #8: Process is king.&lt;br /&gt;
Lighten your mental load by storing information in process.&lt;/p&gt;
&lt;p&gt;Realization #9: Nothing about a startup is a one-time effort.&lt;br /&gt;
Most startups won&amp;#8217;t be automated. They&amp;#8217;ll require maintenance and tweaking.&lt;/p&gt;
&lt;h3&gt;Chapter 2 &amp;#8211; Why Niches Are the Name of the Game&lt;/h3&gt;
&lt;p&gt;The single most important factor to a product&amp;#8217;s success is whether there&amp;#8217;s a group of people willing to pay for it.&lt;/p&gt;
&lt;p&gt;Luck is the exception. Sites like Hot or Not and Plenty of Fish.&lt;/p&gt;
&lt;p&gt;Find a niche to avoid big player competition and make a larger impact.&lt;/p&gt;
&lt;p&gt;Reasons you must go niche:&lt;/p&gt;
&lt;p&gt;Reason #1: A niche requires you to narrow your product focus.&lt;br /&gt;
The narrower you make your product while still maintaining a large enough market, the more profit you will generate. Selling software to 100% of the people in a 5,000 person niche is better than selling to 10% of the people in a 50,000 person niche. Advertising will be cheaper, communities easier to build, competition lower.&lt;/p&gt;
&lt;p&gt;Reason #2: Nice advertising is more cost effective.&lt;br /&gt;
Niche advertising space is usually cheaper. This is true from magazines to Google AdWords.&lt;/p&gt;
&lt;p&gt;Reason #3: Niches have less competition.&lt;br /&gt;
Big companies like big markets.&lt;/p&gt;
&lt;p&gt;Reason #4: Niches have higher profit margins.&lt;br /&gt;
Owning your niche allows you to charge higher prices (but don&amp;#8217;t price gouge).&lt;/p&gt;
&lt;p&gt;Reason #5: Niche markets are not used to good marketing.&lt;br /&gt;
Good marketing will have a bigger impact.&lt;/p&gt;
&lt;p&gt;Reason #6: It&amp;#8217;s easier for prospects to trust you.&lt;br /&gt;
Easier to build a name/reputation in smaller markets.&lt;/p&gt;
&lt;p&gt;A warm niche is a niche where you have some kind of association. You or someone you know is involved in it.&lt;/p&gt;
&lt;p&gt;You can work your network to turn a cold niche into a warm niche by finding someone with experience.&lt;/p&gt;
&lt;p&gt;Coming up with niches:&lt;/p&gt;
&lt;p&gt;Approach #1: Look at all areas of your life&lt;br /&gt;
Think of problems with hobbies, interests, jobs, and those of people you know.&lt;/p&gt;
&lt;p&gt;Approach #2: Look at occupations&lt;/p&gt;
&lt;p&gt;Approach #3: Cheat&lt;br /&gt;
http://www.entrepreneur.com/businessideas/ &amp;#8211; search Category &amp;#8594; Online Businesses&lt;br /&gt;
http:www.sixmonthmba.com/2009/02/999ideas.html&lt;br /&gt;
http://www.ahbbo.com/ideas.html&lt;br /&gt;
http://ycombinator.com/ideas.html&lt;/p&gt;
&lt;p&gt;Find niches based on experiences. For example, examine keyword entrances on your blog or website. Large segments of people entering a single page on a set of keywords might be a niche.&lt;/p&gt;
&lt;p&gt;If your target market is not online, you have no chance of succeeding using the methodologies you&amp;#8217;ll find in this book. Target market must be online.&lt;/p&gt;
&lt;p&gt;Evaluate the size of a market by finding cheap advertising opportunities, either online or offline. Also look at competition. If you can&amp;#8217;t find competitors, you haven&amp;#8217;t found a market.&lt;/p&gt;
&lt;p&gt;Determine if you can reach them inexpensively.&lt;/p&gt;
&lt;p&gt;Vertical markets (dedicated to a single industry or hobby) are better than horizontal markets that cut across many:&lt;/p&gt;
&lt;p&gt;Reason #1: Members of a vertical have similar behavior&lt;br /&gt;
Marketing and sales approach is simpler.&lt;/p&gt;
&lt;p&gt;Reason #2: Members of a vertical talk to one another&lt;br /&gt;
Word of mouth, convincing thought leaders is easier.&lt;/p&gt;
&lt;p&gt;Reason #3: Members of a vertical &amp;#8220;hang out&amp;#8221; together&lt;br /&gt;
Each marketing opportunity will reach more people.&lt;/p&gt;
&lt;p&gt;Reason #4: Members of a vertical have similar needs.&lt;br /&gt;
Easier to narrow scope of product.&lt;/p&gt;
&lt;p&gt;Determine pain in a niche that can be solved with software, either yourself of by talking to a contact.&lt;/p&gt;
&lt;p&gt;Measure demand using&lt;/p&gt;
&lt;p&gt;*Google AdWords Keyword Suggestion Tool: https://adwords.google.com/select/KeywordToolExternal&lt;br /&gt;
*SEO Logs Keyword Difficulty Tool&lt;br /&gt;
*Micro Niche Finder (paid)&lt;/p&gt;
&lt;p&gt;Steps:&lt;/p&gt;
&lt;p&gt;Step #1:&lt;br /&gt;
Enter main phrase without quotes, include synonyms, run search, change to &amp;#8220;exact match&amp;#8221;, search again. Results show search volume. Assuming you can rank #1 for that keyword, you would get roughly 50% of those hits. Then multiply this by 4, to account for long tail searches and other traffic streams. Estimate a reasonable conversion rate, and plug in your price: [volume] * [conversion rate] * [cost] = [revenue].&lt;/p&gt;
&lt;p&gt;Step #2:&lt;br /&gt;
Choose valuable keywords, and any related terms.&lt;/p&gt;
&lt;p&gt;Step #3:&lt;br /&gt;
Enter each keyword from above step one at a time. Score returned is measure of difficulty in ranking. 39 and below is good. 60 and above is bad.&lt;/p&gt;
&lt;p&gt;Step #4:&lt;br /&gt;
Sanity check the keywords you&amp;#8217;ve chosen by searching for them, clicking on the first page, checking it&amp;#8217;s page rank with the Google Toolbar. Check &lt;span class=&quot;caps&quot;&gt;SEO&lt;/span&gt;, domain age, and back links from PageRank meter on Google Toolbar. This determines the strength of your competition.&lt;/p&gt;
&lt;p&gt;When final niche and keywords have been selected, set up AdWords/mini sales site with a monetary commitment attached. When user tries to buy, tell them it&amp;#8217;s not ready, offer to put on mailing list.&lt;/p&gt;
&lt;h3&gt;Chapter 3 &amp;#8211; Your Product&lt;/h3&gt;
&lt;p&gt;Success of product relies on product, market, execution.&lt;/p&gt;
&lt;p&gt;Test pricing by doing A/B tests and tracking metrics.&lt;/p&gt;
&lt;h3&gt;Chapter 4 &amp;#8211; Building a Killer Sales Website&lt;/h3&gt;
&lt;p&gt;When thinking about sales funnels, increasing conversion rate is usually easier than increasing size of funnel.&lt;/p&gt;
&lt;p&gt;Don&amp;#8217;t plan on selling to customers on their first visit.&lt;/p&gt;
&lt;p&gt;Expect conversion rates between 0.5% &amp;#8211; 4% depending on the price point of your product.&lt;/p&gt;
&lt;p&gt;Primary goal of sales website should be to turn visitors into prospects, by getting an email address.&lt;/p&gt;
&lt;p&gt;Getting an email address requires trust, relevance and a reward. A free download or a free trial.&lt;/p&gt;
&lt;p&gt;Single call to action.&lt;/p&gt;
&lt;p&gt;Home page may not be the most visited page. Deep linking. Every page needs a call to action. Every page needs a single purpose. Everything should be within 2 clicks. Make buttons look like buttons. Text sucks, people like images and video.&lt;/p&gt;
&lt;p&gt;Find a hook that solves a pain point.&lt;/p&gt;
&lt;p&gt;Email has a high conversion rate. Build your list by giving something away or have a short email course.&lt;/p&gt;
&lt;p&gt;Email content relevant to your niche every 2-4 weeks. Possibly automate this, with emails being sent at days since sign up milestones. Send product updates.&lt;/p&gt;
&lt;p&gt;Email tips:&lt;br /&gt;
1. Test and optimize when you send your emails.&lt;br /&gt;
2. Send &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; and text email.&lt;br /&gt;
3. No attachments&lt;br /&gt;
4. Pay attention to the &amp;#8220;from&amp;#8221; name and address&lt;br /&gt;
5. Good subjects&lt;br /&gt;
6. One goal for each email&lt;br /&gt;
7. Test&lt;/p&gt;
&lt;h3&gt;Chapter 5 &amp;#8211; Startup Marketing&lt;/h3&gt;
&lt;p&gt;Not all traffic is the same, depending on source. Sources for quality traffic change as niche changes.&lt;/p&gt;
&lt;p&gt;Use &lt;span class=&quot;caps&quot;&gt;PPC&lt;/span&gt; to find &lt;span class=&quot;caps&quot;&gt;SEO&lt;/span&gt; terms and optimize. Do not sustain a business on &lt;span class=&quot;caps&quot;&gt;PPC&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Maintain a mailing list.&lt;/p&gt;
&lt;p&gt;Blog.&lt;/p&gt;
&lt;p&gt;Work on organic search results with &lt;span class=&quot;caps&quot;&gt;SEO&lt;/span&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>SXSW and Side Projects, Oh My!</title>
   <link href="http://www.timgittos.com/blog/sxsw-and-side-projects-oh-my"/>
   <updated>2013-04-02T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/sxsw-and-side-projects-oh-my</id>
   <content type="html">&lt;p&gt;This year I was lucky to be sent to &lt;a href=&quot;http://www.sxsw.com/&quot;&gt;&lt;span class=&quot;caps&quot;&gt;SXSW&lt;/span&gt;&lt;/a&gt; by my awesome employer. Along with some other co-workers, one of my personal friends was also going. Normally I attend conferences and stick strictly to sessions that are directly and clearly related to my work. After doing some reading about creativity, I decided to broaden my horizons this time and attend any session that caught my eye.&lt;/p&gt;
&lt;p&gt;While attending, I took plenty of notes for each session for a total of 30 pages of a 3.5&amp;#8243; &amp;#215; 5.5&amp;#8243; notebook. My original intention was to sketchnote all the talks from these notes, but I think I might skip it. One thing &lt;a href=&quot;/books/the-sketchnote-handbook/&quot;&gt;The Sketchnote Handbook&lt;/a&gt; showed me was that caputuring the gist of a presentation, either in text or images, was the most important principle. Eventually I may transfer all my notes from my notebook to the site, however that probably isn&amp;#8217;t too likely since I heard a lot of the talks were recorded and will be available online.&lt;/p&gt;
&lt;p&gt;Back to the conference itself, I had a blast and felt very inspired through the whole thing. I saw sessions on a variety of topics, from particle physics to virtual reality to 3D printing to game design. I learned a lot from each session, and can probably find principles and ideas to apply to my day to day work in each one.&lt;/p&gt;
&lt;p&gt;One of the best things to come out of the conference was clarification of a side project I&amp;#8217;ve had in my mind for a while. My friend and I talked things through over the 5 days of the conference, and based on some of the sessions we saw, we have a clear roadmap for the development of the side project, one that may even lead it to becoming a fully fledged, adult business. To say we&amp;#8217;re both excited is a bit of an understatement.&lt;/p&gt;
&lt;p&gt;I said at the start of the year that I would make things that seem cool to me. This side project is definitely something that&amp;#8217;s cool. As we progress, I&amp;#8217;ll probably share some details, but to &lt;a href=&quot;http://sivers.org/zipit&quot;&gt;avoid putting the idea at risk&lt;/a&gt; , I won&amp;#8217;t share anything I haven&amp;#8217;t done yet. On the plus side, that will mean a more comprehensive write up, possibly with pictures. I can reveal that it&amp;#8217;s a hardware project, which will be my first real hardware project.&lt;/p&gt;
&lt;p&gt;I also have an &lt;span class=&quot;caps&quot;&gt;RSS&lt;/span&gt; related idea that I may bump to the front of the queue as well given the imminent shutting down of Google Reader. That one would definitely be a case of eating my own dog food, however it requires other people to use it as well. Again, I won&amp;#8217;t share details until I&amp;#8217;ve done the work, but that one I will definitely do some write ups on.&lt;/p&gt;
&lt;p&gt;As a side note, I recently started taking notes on books I&amp;#8217;m reading, and haven&amp;#8217;t posted any lately. That&amp;#8217;s because my wife decided that now was the time for me to read all 7 Harry Potter books, so I&amp;#8217;m slowly working my way through those. I&amp;#8217;m onto book 4, so I anticipate being done in a few months. I will however try to squeak in the odd non-fiction book reading here and there. The next book I want to read is &amp;#8220;The Creative Habit&amp;#8221; by Twyla Tharp.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Book Notes: The Sketchnote Handbook</title>
   <link href="http://www.timgittos.com/books/book-notes-the-sketchnote-handbook"/>
   <updated>2013-02-24T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/books/book-notes-the-sketchnote-handbook</id>
   <content type="html">&lt;div class=&quot;review-header&quot;&gt;
&lt;p class=&quot;left&quot;&gt;&lt;img src=&quot;/images/books/sketchnote-handbook.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Amazon:&lt;/strong&gt; &lt;span&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/0321885112/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321885112&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;The Sketchnote Handbook&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=0321885112&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt; (referral link &amp;#8211; help me buy new books!)&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;ISBN&lt;/span&gt;:&lt;/strong&gt; 0321885112&lt;br /&gt;
&lt;strong&gt;Read:&lt;/strong&gt; 2013-02-22&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Sketchnotes are a great way to visually record the analysis of a presentation. They are beautiful in and of themselves, but their real magic is in encoding a personal interpretation of presented material. This book goes into how to create them and gives tips. It also comes with a 70 minute video, which is similar in content to the book, however the live sketchnoting video is illuminating.&lt;/p&gt;
&lt;h2&gt;Notes&lt;/h2&gt;
&lt;p&gt;Should I sketchnote about The Sketchnote Handbook? How meta do I want to go?&lt;/p&gt;
&lt;p&gt;Sketchnoting is enhanced note taking. It focuses on capturing the big ideas behind a presentation. It helps retention by getting the mind and the body to act together. It also infuses notes with personality, making them easier to read.&lt;/p&gt;
&lt;h3&gt;The Theory&lt;/h3&gt;
&lt;p&gt;Sketchnoting is about drawing ideas, not artwork.&lt;/p&gt;
&lt;p&gt;The Dual Coding theory, formulated in 1970 by Allan Paivo, states that the brain processes information using 2 channels:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Verbal&lt;/li&gt;
	&lt;li&gt;Visual&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When both channels are used at the same time, the brain creates mental cross references.&lt;/p&gt;
&lt;h3&gt;Creating Sketchnotes&lt;/h3&gt;
&lt;p&gt;When creating sketchnotes, the key is to listen actively. Try to spot patterns in the presentation and cache ideas as you draw, so that you can add them when you have time.&lt;/p&gt;
&lt;p&gt;It helps to research the presentation and presenter before hand.&lt;br /&gt;
Sketch the title and determine layout before the presentation starts.&lt;/p&gt;
&lt;p&gt;A good structure is the core of a sketchnote. Consider the structure is meat and potatoes &amp;#8211; art would then be the gravy.&lt;/p&gt;
&lt;p&gt;Patterns:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/rohdesign/7801877840/in/set-72157629385456752/&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;/images/books/sketchnote-handbook-patterns.jpg&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Tools:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Typography&lt;/li&gt;
	&lt;li&gt;Diagrams&lt;/li&gt;
	&lt;li&gt;Bullets&lt;/li&gt;
	&lt;li&gt;Drawing&lt;/li&gt;
	&lt;li&gt;Dividers&lt;/li&gt;
	&lt;li&gt;Icons&lt;/li&gt;
	&lt;li&gt;Handwriting&lt;/li&gt;
	&lt;li&gt;Arrows&lt;/li&gt;
	&lt;li&gt;Containers&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Remember to build hierarchy and personality into sketchnotes.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Book Notes: How to Read a Book</title>
   <link href="http://www.timgittos.com/books/book-notes-how-to-read-a-book"/>
   <updated>2013-02-12T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/books/book-notes-how-to-read-a-book</id>
   <content type="html">&lt;div class=&quot;review-header&quot;&gt;
&lt;p class=&quot;left&quot;&gt;&lt;img src=&quot;/images/books/how-to-read-a-book.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Amazon:&lt;/strong&gt; &lt;span&gt;&lt;a href=&quot;http://www.amazon.com/gp/product/0671212095/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0671212095&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;How to Read a Book&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=0671212095&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt; (referral link &amp;#8211; help me buy new books!)&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;ISBN&lt;/span&gt;:&lt;/strong&gt; 0671212095&lt;br /&gt;
&lt;strong&gt;Read:&lt;/strong&gt; 2013-02-12&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;A good analytical approach to reading books with purpose. Readers for leisure need not apply. Although the author references scientific and mathematical works, the book shines when discussing how to gain meaning and understanding from books that are more concerned with the humanities.&lt;/p&gt;
&lt;h2&gt;Notes&lt;/h2&gt;
&lt;p&gt;Goals of reading books:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Entertainment&lt;/li&gt;
	&lt;li&gt;Gain information&lt;/li&gt;
	&lt;li&gt;Gain knowledge/understanding&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are four levels of reading, wich higher levels encompassing and including lower levels of reading:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;elementary reading&lt;/li&gt;
	&lt;li&gt;inspectional reading&lt;/li&gt;
	&lt;li&gt;analytical reading&lt;/li&gt;
	&lt;li&gt;syntopical reading&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Analytical reading is only required when the goal of reading is to gain understanding. For entertainment or informational reading, elementary or inspectional reading is sufficient.&lt;/p&gt;
&lt;h3&gt;Elementary Reading&lt;/h3&gt;
&lt;p&gt;Reading learnt in school. Great for reading for entertainment.&lt;/p&gt;
&lt;h3&gt;Inspectional Reading&lt;/h3&gt;
&lt;p&gt;Inspectional reading is performed in 2 parts. Experienced readers can accomplish both simultaneously, however for beginners it&amp;#8217;s best to do them separately.&lt;/p&gt;
&lt;h4&gt;Systematic skimming or prereading&lt;/h4&gt;
&lt;ol&gt;
	&lt;li&gt;Look at the title page &amp;amp; preface&lt;/li&gt;
	&lt;li&gt;Study the table of contents&lt;/li&gt;
	&lt;li&gt;Check the index&lt;/li&gt;
	&lt;li&gt;Read the publisher&amp;#8217;s blurb&lt;/li&gt;
	&lt;li&gt;Look at chapters that seem pivotal to the book&amp;#8217;s argument, and read the chapter summary statements (if they exist)&lt;/li&gt;
	&lt;li&gt;Turn pages of the book and dip in here and there, reading a paragraph or two. Look for signs of the main contention&lt;/li&gt;
	&lt;li&gt;Read the book&amp;#8217;s conclusion&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The purpose of prereading is to attempt to figure out the book&amp;#8217;s general theme or idea.&lt;/p&gt;
&lt;h4&gt;Superficial reading&lt;/h4&gt;
&lt;p&gt;Read through the book without stopping to look up or think about concepts that aren&amp;#8217;t immediately understood. Read relatively fast &amp;#8211; some speed reading techniques may apply here.&lt;/p&gt;
&lt;h3&gt;Analytical reading&lt;/h3&gt;
&lt;p&gt;Before you read the book, determine what kind of book it is: theoretical or practical.&lt;/p&gt;
&lt;p&gt;As you read the book, ask the following questions of it:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;What is the book about as a whole? What is the leading theme &amp;amp; how is it developed by division into sub themes or topics
	&lt;ol&gt;
		&lt;li&gt;Classify the book according to kind &amp;amp; subject matter&lt;/li&gt;
		&lt;li&gt;State what the whole book is about as succinctly as possible&lt;/li&gt;
		&lt;li&gt;Enumerate major parts in their order and relation, construct an outline&lt;/li&gt;
		&lt;li&gt;Define the problem or problems being solved&lt;/li&gt;
	&lt;/ol&gt;&lt;/li&gt;
	&lt;li&gt;What is being said in detail, and how? What are the main ideas, assertions and arguments of the book?
	&lt;ol&gt;
		&lt;li&gt;Come to terms with the author &amp;#8211; understand key words&lt;/li&gt;
		&lt;li&gt;Grasp leading propositions by dealing with the most important sentences&lt;/li&gt;
		&lt;li&gt;Know the arguments by finding them in, or constructing them from, sequences of sentences&lt;/li&gt;
		&lt;li&gt;Determine which problems were solved, which were not, and of the ones not solved, which the author knows he/she failed at.&lt;/li&gt;
	&lt;/ol&gt;&lt;/li&gt;
	&lt;li&gt;Is the book true, in whole or in part? Make up your mind about the book.
	&lt;ol&gt;
		&lt;li&gt;Don&amp;#8217;t criticize until you understand the book as per above&lt;/li&gt;
		&lt;li&gt;Do not disagree disputatiously or contensiously&lt;/li&gt;
		&lt;li&gt;Demonstrate knowledge of difference between knowledge &amp;amp; opinion by presenting good reasons for any critical judgement.&lt;br /&gt;
  &lt;strong&gt;When crticising a book&lt;/strong&gt;:&lt;/li&gt;
		&lt;li&gt;Show wherin the author is uninformed&lt;/li&gt;
		&lt;li&gt;Show wherin the author is misinformed&lt;/li&gt;
		&lt;li&gt;Show wherin the author is illogical&lt;/li&gt;
		&lt;li&gt;Show wherin the authors analysis or account is incomplete&lt;br /&gt;
  &lt;strong&gt;If you cannot show the above, you must agree with the author.&lt;/strong&gt;&lt;/li&gt;
	&lt;/ol&gt;&lt;/li&gt;
	&lt;li&gt;What of it? What is the significance of the book to you? Is it important for you to know?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As you read analytically, take notes about both the books structure and the books concepts.&lt;/p&gt;
&lt;h3&gt;Syntopical reading&lt;/h3&gt;
&lt;p&gt;The purpose of syntopical reading is to analyze the contention in a subject. Do not defend an opinion, merely conduct a survey. Do this by reading multiple books on a single subject.&lt;/p&gt;
&lt;p&gt;Before getting started, you must use elementary and inspectional reading to:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Create a tentative bibliography&lt;/li&gt;
	&lt;li&gt;Inspect all books and determine if they are relevant&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These tasks can be performed in unison, building bibliographies from books determined to be relevant to the subject.&lt;/p&gt;
&lt;p&gt;Once a bibliography has been created, read books using a combination of elementary, inspectional and analytical reading simultaneously. While reading, perform the following steps:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Find the relevant passages in each book&lt;/li&gt;
	&lt;li&gt;Bring the authors to terms with each other &amp;#8211; construct a neutral argument to frame multiple authors terms to a single &amp;#8220;language&amp;#8221;&lt;/li&gt;
	&lt;li&gt;Get the questions in a subject clear&lt;/li&gt;
	&lt;li&gt;Define the issues central to the subject&lt;/li&gt;
	&lt;li&gt;Analyze the discussion of these issues across books.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Remember to be objective.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>80/20 Expertise</title>
   <link href="http://www.timgittos.com/blog/80-20-expertise"/>
   <updated>2013-01-09T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/80-20-expertise</id>
   <content type="html">&lt;p&gt;In his article &lt;a href=&quot;http://norvig.com/21-days.html&quot;&gt;&amp;#8220;Teach Yourself Programming in Ten Years&amp;#8221;&lt;/a&gt; , Peter Norvig asserted that it takes around 10 years, or 10,000 hours of deliberate practice to achieve expertise in anything. I am 28 years old, and if I&amp;#8217;m lucky I will live until I&amp;#8217;m around 78. Probably. Which gives me around 5 things that I can become an expert in between now and when I die. That sure doesn&amp;#8217;t sound like much.&lt;/p&gt;
&lt;p&gt;But what if I don&amp;#8217;t want to become an expert? What if I just want to be OK at something, or just want to get some experience in it? Can I apply the Pareto Principle to get more bang for my time?&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Pareto_principle&quot;&gt;Pareto Principle&lt;/a&gt; states that 80% of the effects come from 20% of the causes. I wouldn&amp;#8217;t be surprised if that extended to the above 10,000 hour rule. Surely someone who spent 2,000 hours practicing something would be significantly better at it than someone who had spent 0 hours on it. Granted, you wouldn&amp;#8217;t be an expert in that activity, but you would be knowledgeable in 5 times the activities as the expert.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s something to keep in mind as I scramble to do as much stuff as I can.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Do the Work</title>
   <link href="http://www.timgittos.com/blog/do-the-work"/>
   <updated>2013-01-06T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/do-the-work</id>
   <content type="html">&lt;p&gt;In my &lt;a href=&quot;/blog/2012-in-review-and-a-look-forward-to-2013/&quot;&gt;2012 year review&lt;/a&gt; post, I mentioned that one of my goals for 2013 was to make more, and do the work. I mentioned that I would expand upon what I mean when I say &amp;#8220;do the work&amp;#8221;.&lt;/p&gt;
&lt;p&gt;In 2012, I challenged myself to do more art, and set a bunch of goals and milestones to track how well I was succeeding. I managed to hit none of them. I didn&amp;#8217;t do a single meaningful thing. I think I filled 3 or 4 pages in a sketch book with sketches.&lt;/p&gt;
&lt;p&gt;The reason I didn&amp;#8217;t do anything, I think, is two fold. Firstly, I was putting things off until I felt I was good enough to do them. Secondly, I was waiting for inspiration to strike before doing any practice. This combination had me spinning my wheels in place for an entire year, where nothing I wanted to get done was done.&lt;/p&gt;
&lt;p&gt;&amp;#8220;I&amp;#8217;ll finish that painting when I&amp;#8217;m better at painting&amp;#8221;, I would tell myself. By waiting until I was better, I never got any better. It would have been far better if I had screwed the painting up and tried again, and screwed up and restarted 10 times than what I did. Derek Sivers covers it well in his article, &lt;a href=&quot;http://sivers.org/qlq&quot;&gt;Quantity + Learning = Quality&lt;/a&gt; . Except I didn&amp;#8217;t get any practice done, due to my other problem.&lt;/p&gt;
&lt;p&gt;I was waiting for a great idea of something to express to come to me, and let it flow out of me and into the paper. But that&amp;#8217;s not how it works. I&amp;#8217;ve heard or read it before from a variety of sources, but it was a quote by Chuck Close in the book &amp;#8220;Inside the Painter&amp;#8217;s Studio&amp;#8221; (found via &lt;a href=&quot;http://www.brainpickings.org/index.php/2012/12/27/chuck-close-on-creativity/&quot;&gt;this post&lt;/a&gt;) that really resonated with me:&lt;/p&gt;
&lt;blockquote&gt;
Inspiration is for amateurs &amp;#8211; the rest of us just show up and get to work. And the belief that things will grow out of the activity itself and that you will &amp;#8211; through work &amp;#8211; bump into other possibilities and kick open other doors that you would never have dreamt of if you were just sitting around looking for a great &amp;#8216;art idea&amp;#8217;
&lt;/blockquote&gt;
&lt;p&gt;That&amp;#8217;s exactly what I was doing! I was just sitting around, waiting, and look at how I did &amp;#8211; I did nothing.&lt;/p&gt;
&lt;p&gt;Doing the work is my answer at solving the second problem, which should also overlap and solve problem one. Just show up, start working and build fundamental skills. I&amp;#8217;ll get more done by making crap and learning from it and enjoying the process than I will by waiting for the perfect combination of inspiration and skill to fall into place.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>2012 In Review, And a Look Forward to 2013</title>
   <link href="http://www.timgittos.com/blog/2012-in-review-and-a-look-forward-to-2013"/>
   <updated>2013-01-03T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/2012-in-review-and-a-look-forward-to-2013</id>
   <content type="html">&lt;p&gt;2012 is really easy to review, in terms of &lt;a href=&quot;/blog/2011-in-review-and-a-look-forward-to-2012/&quot;&gt;the goals I set last year&lt;/a&gt; : it was a bust. I didn&amp;#8217;t complete a single goal I set myself. The painting remains unfinished, nothing was sold, nothing was submitted to Spectrum. Here is what I did manage to do:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Completed 2 more MOOCs &amp;#8211; &lt;a href=&quot;/learning/udacity-ai-for-robotics&quot;&gt;&amp;#8216;AI for Robotics&amp;#8217; from Udacity&lt;/a&gt; , and &lt;a href=&quot;/learning/edx-foundations-of-computer-graphics&quot;&gt;&amp;#8216;Foundations of Computer Graphics&amp;#8217; from edX&lt;/a&gt; .&lt;/li&gt;
	&lt;li&gt;Wrote a raytracer in the course of the edX class above&lt;/li&gt;
	&lt;li&gt;Actually wrote a full (but simple) game in C++ and half of another (and &lt;a href=&quot;http://blog.confirmedcrit.com&quot;&gt;started a blog for it&lt;/a&gt; ).&lt;/li&gt;
	&lt;li&gt;Started and maintained a physical journal&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&amp;#8217;s all I can remember! I don&amp;#8217;t remember what I read or what I saw, beyond a few things that I&amp;#8217;m not going to bother to post. This lets me know 2 things:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;I wasn&amp;#8217;t serious enough about my goals for 2012&lt;/li&gt;
	&lt;li&gt;I didn&amp;#8217;t hold myself accountable for how I spent my time&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I was going to post this year in review a few days ago, but I held off for some reason, and I&amp;#8217;m glad I did. Yesterday, I can&amp;#8217;t remember how, I came across this &lt;a href=&quot;http://gapingvoid.com/2004/07/25/how-to-be-creative/&quot;&gt;great page on creativity&lt;/a&gt; and more specifically, the &lt;a href=&quot;http://www.gapingvoid.com/Moveable_Type/archives/000889.html&quot;&gt;&amp;#8220;Sex &amp;amp; Cash Theory&amp;#8221;&lt;/a&gt; . The theory is as follows: every creative person has two kinds of jobs &amp;#8211; sex and cash. The sexy job is what you want to do, the cash one is what you do to pay the bills.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m lucky in that I find my cash job pretty sexy. Yet I spend so much time trying to create a lifestyle where I don&amp;#8217;t have to do it. I noted in my journal yesterday that I spend a lot of time trying to create a lifestyle where I have more time, time that I would spend making things. That seems kind of dumb. Why not just make them in the first place?&lt;/p&gt;
&lt;p&gt;This has influenced my goals for 2013. In 2013, I&amp;#8217;m going to make things, and track my time better. Specifically, I&amp;#8217;m not going to be restricted by making things that make money, or otherwise lead to a lifestyle where I don&amp;#8217;t have to work. I&amp;#8217;m happy with the cash part of my lifestyle &amp;#8211; it&amp;#8217;s the sex part I&amp;#8217;m not doing too well.&lt;/p&gt;
&lt;p&gt;In 2013, I&amp;#8217;m going to make whatever grabs my fancy. Robots, eletronics, art, music, games, books, whatever. As long as I&amp;#8217;m creating, and keeping track of my time, I&amp;#8217;ll be happy. Concretely, these are my goals:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;make/do the work&lt;/li&gt;
	&lt;li&gt;read more&lt;/li&gt;
	&lt;li&gt;write more&lt;/li&gt;
	&lt;li&gt;learn more&lt;/li&gt;
	&lt;li&gt;track time expenditure, what I read, what I wrote, what I learnt&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I feel the first one needs a little more explaining, and I will probably do it in another blog post, but basically, you can never do anything good if you don&amp;#8217;t do anything.&lt;/p&gt;
&lt;p&gt;There are a few more loose goals in mind, but I feel the specificity of last years goals hurt my attempts to follow them rather than helped.&lt;/p&gt;
&lt;p&gt;As always, in 2014 I will review the year and do it all again!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>edX Foundations of Computer Graphics postmortem</title>
   <link href="http://www.timgittos.com/blog/edx-foundations-of-computer-graphics-postmortem"/>
   <updated>2012-12-20T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/edx-foundations-of-computer-graphics-postmortem</id>
   <content type="html">&lt;p&gt;I have recently finished the &lt;a href=&quot;https://www.edx.org/courses/BerkeleyX/CS184.1x/2013_Spring/about&quot;&gt;&amp;#8220;Foundations of Computer Graphics&amp;#8221;&lt;/a&gt; massively open online class (&lt;span class=&quot;caps&quot;&gt;MOOC&lt;/span&gt;) offered by edX, and I had a lot of fun and learnt a lot about ray tracing. In the following post, I will highlight what I liked about the course, what I didn&amp;#8217;t like about the course, and offer suggestions to anyone who does the course when the offer it next in March, 2013 or anytime later.&lt;/p&gt;
&lt;p&gt;As you can see on the course website, it covers 4 major topics: required math, transformations, OpenGL and lighting and ray tracing.&lt;/p&gt;
&lt;h2&gt;Unit 1 &amp;#8211; Math&lt;/h2&gt;
&lt;p&gt;The first topic was largely review for me, and will be for anyone who knows linear algebra, or has worked with computer graphics before. Vectors and their operations, matrices and their operations and coordinate frames were covered. The assigment here was to get your programming environment set up with their code framework. While I&amp;#8217;m sure it was helpful for those new to programming, anyone who has worked with C++ before probably doesn&amp;#8217;t need to worry about this homework.&lt;/p&gt;
&lt;h2&gt;Unit 2 &amp;#8211; Transformations and Projection&lt;/h2&gt;
&lt;p&gt;Next, 2D and 3D transformations were covered, including 2D scaling, shearing, rotation and translation and 3D scaling, rotation and translation, as well as final transform matrix composition and orthographic and perspective projection.&lt;br /&gt;
This section was very useful to me, though the pace was fairly fast. I had to do a lot of self learning on this topic, including how to derive perspective projection and a few other theorems.&lt;br /&gt;
The homework for this class was to implement a number of 3D transforms and a perspective projection in the framework, which was pretty much plug and chug. It was useful from the perspective of interpreting mathematical formula in code, but it didn&amp;#8217;t particularly tax me.&lt;/p&gt;
&lt;h2&gt;Unit 3 &amp;#8211; OpenGL and Shading&lt;/h2&gt;
&lt;p&gt;Once we covered the theory, we started into practice. The next section was on OpenGL programming and computer graphics theory, such as the Gouraud, Phong and Blinn-Phong shading models. I preferred other sources on OpenGL syntax, as there are much better sources that go into more depth that I&amp;#8217;ve linked to from &lt;a href=&quot;/learning/edx-foundations-of-computer-graphics/unit-2/&quot;&gt;my notes on the unit&lt;/a&gt; . Again, I had to do a fair bit of self learning on light scattering and the shading algorithms and how they were derived and what they mean.&lt;br /&gt;
The homework again was to insert code into their framework, this time shading code and some file reading and scene set up. Again, I didn&amp;#8217;t feel I learnt much from this homework, as you don&amp;#8217;t really get to write your own full stack. I didn&amp;#8217;t have to hook up shader variables and buffer vertices, because all that was done. I just had to shade them.&lt;/p&gt;
&lt;h2&gt;Unit 4 &amp;#8211; Ray tracing&lt;/h2&gt;
&lt;p&gt;Up to this point, I was feeling fairly disappointed. I have done some self study in graphics, but have never gotten around to implementing what I learnt. I thought this would be a great way to be forced to do some implementing, but up to this point, I was wrong.&lt;/p&gt;
&lt;p&gt;Then we started learning about ray tracers. If the previous 3 units could be faulted for excessive hand holding, this unit definitely threw you into the deep end. In one unit, we covered ray tracing theory and tips to ray tracing implementation. The theory extended to generating rays from a camera definition, ray object intersection and recursion and reflectance. The tips on impementation were on how to calculate rays from a camera, a repetition of the intersection theory, impelemting shading and recursion.&lt;/p&gt;
&lt;p&gt;The homework was to write a ray tracer from scratch, including a file parser, from just a handful of lectures and the code from the previous homeworks. The goal was to render a series of images, one of which had 50,000 vertices and took some over 24 hours to render. To say this was challenging was an understatement. However, this is also where I felt I learnt the most, and it&amp;#8217;s the homework that I&amp;#8217;m most satisfied with. This section alone makes the course worth taking, to me.&lt;/p&gt;
&lt;h2&gt;Tips&lt;/h2&gt;
&lt;p&gt;For those of you who will take this course, here are some tips when writing your ray tracer:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;when checking if a point on a surface is in light, don&amp;#8217;t forget to discard surface collisions that occur behind the light&lt;/li&gt;
	&lt;li&gt;inverting matrices is expensive. When you invert a matrix, cache the result. This will speed things up significantly&lt;/li&gt;
	&lt;li&gt;when casting a ray from the camera, find the nearest intersection. When casting for lighting, any intersection will do&lt;/li&gt;
	&lt;li&gt;use floats for everything. If you think something can be implemented with an integer, use a float anyway&lt;/li&gt;
	&lt;li&gt;clamp your lighting values, the shading equations can cause numbers out of range and will give you weird renders&lt;/li&gt;
	&lt;li&gt;implement some sort of acceleration structure. Rendering the Stanford Dragon is painful to debug when it takes 3-4 hours to render.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Overall, I enjoyed the course, though mostly for the ray tracing part. I still feel like I didn&amp;#8217;t get enough practice at actual OpenGL programming. If you&amp;#8217;re not interested in ray tracing, skip the course and find some better stuff on iTunes U, such as &lt;a href=&quot;https://itunes.apple.com/us/itunes-u/csci-e-234-introduction-to/id428958018&quot;&gt;&amp;#8220;&lt;span class=&quot;caps&quot;&gt;CSCI&lt;/span&gt; E-234 Introduction to Computer Graphics and &lt;span class=&quot;caps&quot;&gt;GPU&lt;/span&gt; programming&amp;#8221;&lt;/a&gt; and &lt;a href=&quot;https://itunes.apple.com/us/itunes-u/computer-graphics-fall-2009/id457893733&quot;&gt;&amp;#8220;Computer Graphics&amp;#8221;&lt;/a&gt; .&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>edX Foundations of Computer Graphics - Unit 3</title>
   <link href="http://www.timgittos.com/learning/edx-foundations-of-computer-graphics/unit-3"/>
   <updated>2012-11-29T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/edx-foundations-of-computer-graphics/unit-3</id>
   <content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Ray tracing is an offline rendering technique (though research is being done in making it real-time) that aims to accurately simulate the interaction of light and the physical world. This involves the simulation of a number of effects that are difficult to do in real time rendering, such as:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Soft shadows with penumbras&lt;/li&gt;
	&lt;li&gt;Reflections&lt;/li&gt;
	&lt;li&gt;Transparency&lt;/li&gt;
	&lt;li&gt;Interreflections and color bleeding&lt;/li&gt;
	&lt;li&gt;Complex illumination such as global illumination, area lights&lt;/li&gt;
	&lt;li&gt;Realistic materials such as velvet, paint surfaces and glass&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In real-time systems such as OpenGL, an image is calculated by rasterizing. Rasterizing starts from the objects in a scene, and determines which pixels belong to that object. Ray tracing operats on the pixels, determining which object is being displayed in the pixel. This makes the above affects easier to compute.&lt;/p&gt;
&lt;h2&gt;History of Raytracing&lt;/h2&gt;
&lt;p&gt;Appel 68&lt;br /&gt;
&amp;#8220;An improved illumination model for shaded display&amp;#8221;, T. Whitted 80 introduced recursive ray tracing.&lt;/p&gt;
&lt;p&gt;Geometric intersections&lt;br /&gt;
Accelerations structures&lt;/p&gt;
&lt;p&gt;Modern history:&lt;br /&gt;
&lt;span class=&quot;caps&quot;&gt;NVIDIA&lt;/span&gt; Optix contains real time raytracer&lt;/p&gt;
&lt;h2&gt;Theory of Ray Tracing&lt;/h2&gt;
&lt;p&gt;Before we get into the nuts-and-bolts of creating a ray tracer, we need to learn a little about ray tracing theory first.&lt;/p&gt;
&lt;h3&gt;Outline of Process&lt;/h3&gt;
&lt;p&gt;Psuedocode:&lt;/p&gt;
&lt;pre&gt;
Image Raytrace(Camera cam, Scene scene, int width, int height) {
  Image image = new Image(width, height);
  for(int i = 0; i &amp;lt; height; i++) {
    for(int j = 0; j &amp;lt; width; j++) {
      Ray ray = RayThroughPixel(cam, i, j);
      Intersection hit = Intersect(ray, scene);
      image[i][j] = FindColor(hit);
    }
  }
  return image;
}
&lt;/pre&gt;
&lt;h3&gt;Raycasting&lt;/h3&gt;
&lt;p&gt;Produces images similar to OpenGL.&lt;br /&gt;
Cast a ray through the pixel into the scene, determine what object is nearest to that pixel. Calculate lighting as per lighting algorithm, for example Phong or Blinn-Phong.&lt;/p&gt;
&lt;p&gt;Alternative to rasterization, in that operating from the pixel eliminates need for visiblity and depth testing (or rather, acts in it&amp;#8217;s place)&lt;/p&gt;
&lt;p&gt;Costly when more pixels than images, however when using acceleration structures for scenes with more objects than pixels, performance can be higher than with rasterization.&lt;/p&gt;
&lt;h3&gt;Shadows &amp;amp; Reflections&lt;/h3&gt;
&lt;p&gt;We can add shadows and reflections to our scene by adding some simple functionality onto the ray caster.&lt;/p&gt;
&lt;h4&gt;Shadows&lt;/h4&gt;
&lt;p&gt;Building on ray casting, we can calculate shadows by sending a ray from the point of intersection of the first ray and the surface to the light source. If this ray intersects a surface before it intersects the light source, then the pixel is in shadow. Otherwise it is lit as per normal.&lt;/p&gt;
&lt;p&gt;Something to keep in mind though is that we are dealing with floating point numbers, which are inherently inaccurate. To cope with this, the shadow ray is often cast from a distance above the intersection surface as a tolerance to inaccuracy errors.&lt;/p&gt;
&lt;p&gt;In rasterization, shadowing not as straight forward. One method is to use something called a shadow map, where the scene is rendered as if the light source was a camera, and the depth information for that is stored. When each object is rasterized, the shadow map is consulted to see if the object is in shadow. This is complicated and can introduce artifacts into the image.&lt;/p&gt;
&lt;h4&gt;Reflections&lt;/h4&gt;
&lt;p&gt;Similar to the improvements made in shadowing, we can add reflection to our scene by sending a ray from the point of intersection of the first ray and the surface along the angle of reflection. If that ray intersects with an object, then that object will contribute lighting value to the original pixel. Otherwise it is lit as per normal.&lt;/p&gt;
&lt;h3&gt;Recursive Ray Tracing&lt;/h3&gt;
&lt;p&gt;Adding shadows and reflections to the ray casting introduces the need for a recursive algorithm for ray tracing, which is introduced in Whitted&amp;#8217;s 1980&amp;#8217;s paper.&lt;/p&gt;
&lt;p&gt;If we revisit the pseudocode above, the method &lt;code&gt;FindColor&lt;/code&gt; is responsible for generating a color from an intersection. In the case of a reflective material, the color of the pixel depends on the the color of the secondary intersection. To determine this color, we need to determine any shadows and reflections for that object. This is done with recursion.&lt;/p&gt;
&lt;p&gt;As always, the recursion needs to have a guarantee that it will stop. This is usually done by limiting the depth of the recursion, or by setting some cut off value such that if the contribution of a surface is below some intensity threshold, it is ignored and ray tracing for that surface stops.&lt;/p&gt;
&lt;h3&gt;Ray-Surface Intersections&lt;/h3&gt;
&lt;p&gt;Properly calculating the intersection between rays and surfaces is the heart of a raytracer, and much of the early research in ray tracing was in this area. As a result, there are a number of highly optimized algorithms for calculating the intersection of a ray and various shapes.&lt;/p&gt;
&lt;p&gt;Note that different types of rays need different information. For example, a shadow ray just needs to know if it intersected or not. A primary ray (from the pixel to the scene) needs to know the exact point of intersection, the surface normal and the texture coordinates to name just a few.&lt;/p&gt;
&lt;h4&gt;Ray-Sphere Intersection&lt;/h4&gt;
&lt;p&gt;In order to calculate a ray-sphere intersection, we first need a way of defining both a ray and a sphere mathematically. Consider the following diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/edxcg/ray-sphere.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can express the ray and the sphere with the following equations:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
ray \equiv \overrightarrow{P} = \overrightarrow{P_0} + \overrightarrow{P_1}t \\&lt;br /&gt;
sphere \equiv (\overrightarrow{P} &amp;#8211; \overrightarrow{C})\; . (\overrightarrow{P} &amp;#8211; \overrightarrow{C}) &amp;#8211; r^2 = 0&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Where the ray is defined by \(\overrightarrow{P_0}\), a starting point, and \(\overrightarrow{P_1}t\), a point along the ray at distance \(t\), and the sphere is defined by the vector from the center \(\overrightarrow{C}\) to some point \(\overrightarrow{P}\) such that the dot product of itself is equal to the radius of the sphere, \(r^2\).&lt;/p&gt;
&lt;p&gt;To solve the ray-sphere intersection, we need to subsittude the ray equation into the sphere equation and determine for what \(t\) does the equation have an answer:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  (\overrightarrow{P_0} + \overrightarrow{P_1}t &amp;#8211; \overrightarrow{C})\; . (\overrightarrow{P_0} + \overrightarrow{P_1}t &amp;#8211; \overrightarrow{C}) &amp;#8211; r^2 = 0&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can substitude \(\overrightarrow{P_0} &amp;#8211; \overrightarrow{C}\) with a variable \(x\) for the following:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    (\overrightarrow{P_1}t + x)\; . (\overrightarrow{P_1}t + x) &amp;#8211; r^2 &amp;amp;= 0 \\&lt;br /&gt;
    \overrightarrow{P_1}t^2 + 2\overrightarrow{P_1}tx + x^2 &amp;#8211; r^2 &amp;amp;= 0 \\&lt;br /&gt;
    t^2(\overrightarrow{P_1}\;.\overrightarrow{P_1}) + 2t\overrightarrow{P_1}\;.x + (x\;.x) &amp;#8211; r^2 &amp;amp;= 0&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which we can substitute \(\overrightarrow{P_0} &amp;#8211; \overrightarrow{C}\) back in:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  t^2(\overrightarrow{P_1}\;.\overrightarrow{P_1}) + 2t\overrightarrow{P_1}\;.(\overrightarrow{P_0} &amp;#8211; \overrightarrow{C}) + (\overrightarrow{P_0} &amp;#8211; \overrightarrow{C})\;.(\overrightarrow{P_0} &amp;#8211; \overrightarrow{C}) &amp;#8211; r^2 = 0&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is a simple quadratic equation when solving for t, and the roots of the answer can tell us much about the solution:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;If the answer is 2 real positive roots, the smaller value is the closest intersection&lt;/li&gt;
	&lt;li&gt;If both roots are the same, the ray is tangental to the sphere&lt;/li&gt;
	&lt;li&gt;If one root is positive and the other is negative, the ray originated from inside the sphere&lt;/li&gt;
	&lt;li&gt;If the roots are complex, there is no intersection. This can be avoided by checking the &lt;a href=&quot;http://en.wikipedia.org/wiki/Discriminant&quot;&gt;discriminant&lt;/a&gt; of equation first.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you need to know the co-ordinates of the intersection point, you can substitute the value for \(t\) found above back into the ray equation. The normal can be found by subtracting the center of the sphere from the intersection point and normalizing the vector:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  normal = \frac{\overrightarrow{P} &amp;#8211; \overrightarrow{C}}{|\overrightarrow{P} &amp;#8211; \overrightarrow{C}}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h4&gt;Ray-Triangle Intersection&lt;/h4&gt;
&lt;p&gt;The ray-triangle intersection is one of the most common ray intersections due to the fact that most geometry is created as a collection of triangular faces. As a result, there are many fast implementations.&lt;/p&gt;
&lt;p&gt;One approach is to first use a more generic ray-plane instersection, then check to determine if the plane is actually a triangle.&lt;/p&gt;
&lt;p&gt;Consider the following triangle:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/edxcg/Triangle_2.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;A plane can be defined by the equation:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    plane &amp;amp;\equiv \overrightarrow{n}\;.(\overrightarrow{P} &amp;#8211; \overrightarrow{A}) = 0 \\&lt;br /&gt;
    &amp;amp;\equiv \overrightarrow{P}\;.\overrightarrow{n} &amp;#8211; \overrightarrow{A}\;.\overrightarrow{n} = 0&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which shows that the dot product between any vector in the plane and the normal of the plan is 0. We can find the normal of a triangle using the following:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \overrightarrow{n} = \frac{(C &amp;#8211; A) \times (B &amp;#8211; A)}{|(C &amp;#8211; A) \times (B &amp;#8211; A)|}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which shows that the normal is the cross product of any two vectors in the triangle, normalized.&lt;/p&gt;
&lt;p&gt;In order to solve the intersection, we can substitute in the equation for the ray into the equation for the plane:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    (\overrightarrow{P_0} + \overrightarrow{P_1}t)\;.\overrightarrow{n} &amp;#8211; \overrightarrow{A}\;.\overrightarrow{n} &amp;amp;= 0 \\&lt;br /&gt;
    (\overrightarrow{P_0} + \overrightarrow{P_1}t)\;.\overrightarrow{n} &amp;amp;= \overrightarrow{A}\;.\overrightarrow{n} \\&lt;br /&gt;
    \overrightarrow{P_0}\;.\overrightarrow{n} + t\overrightarrow{P_1}\;.\overrightarrow{n} &amp;amp;= \overrightarrow{A}\;.\overrightarrow{n} \\&lt;br /&gt;
    t\overrightarrow{P_1}\;.\overrightarrow{n} &amp;amp;= \overrightarrow{A}\;.\overrightarrow{n} &amp;#8211; \overrightarrow{P_0}\;.\overrightarrow{n} \\&lt;br /&gt;
    t &amp;amp;= \frac{\overrightarrow{A}\;.\overrightarrow{n} &amp;#8211; \overrightarrow{P_0}\;.\overrightarrow{n}}{\overrightarrow{P_1}\;.\overrightarrow{n}}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Note that if \(\overrightarrow{P_1}\;.\overrightarrow{n} = 0\), that is \(\overrightarrow{P_1}\) is orthogonal to \(\overrightarrow{n}\), the equation is undefined and has no solution. This makes sense, as if \(\overrightarrow{P_1}\) is orthogonal to \(\overrightarrow{n}\), then it is parallel with the plane and will never intersect.&lt;/p&gt;
&lt;p&gt;If the ray intersects with the plane that the triangle, or indeed any polygon lies in, we can use a variety of methods to determine if the intersection point lies in the triangle.&lt;/p&gt;
&lt;p&gt;First, let us consider the general case for a given polygon. If a line is taken from the point of intersection into the polygon to infinity, the number of intersections of that line will tell us if the item is in the polygon. If the number of intersections is even, the point is outside the polygon. If the number of intersections is odd, the point is inside the polygon.&lt;/p&gt;
&lt;p&gt;To determine if the point lies in a triangle, we can use a variety of methods. First, we can use cross products to determine what side of a vector the point lies on. Consider the triangle above, and lets assume some point Q inside the triangle. Consider the vector \(B &amp;#8211; A\), and the vector \(Q &amp;#8211; A\). By the right hand rule, if the cross product of these two vectors should be in the same direction as the normal of the triangle. That is, if:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  ((B &amp;#8211; A) \times (Q &amp;#8211; A))\;.\overrightarrow{n} \ge 0&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;holds true, the point is inside the \(B &amp;#8211; A\) edge of the triangle. We can extrapolate this to all edges, so that if all of the following hold:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  ((B &amp;#8211; A) \times (Q &amp;#8211; A))\;.\overrightarrow{n} \ge 0 \\&lt;br /&gt;
  ((C &amp;#8211; B) \times (Q &amp;#8211; B))\;.\overrightarrow{n} \ge 0 \\&lt;br /&gt;
  ((A &amp;#8211; C) \times (Q &amp;#8211; C))\;.\overrightarrow{n} \ge 0 \\&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;then the point lies inside the circle.&lt;/p&gt;
&lt;p&gt;From here, we can generate the barycentric coordinates for this intersection. This can be seen in &lt;a href=&quot;http://www.cs.washington.edu/education/courses/cse457/07sp/lectures/triangle_intersection.pdf&quot;&gt;this&lt;/a&gt; university handout.&lt;/p&gt;
&lt;h4&gt;Ray-Transformed Objects intersections&lt;/h4&gt;
&lt;p&gt;Often, you will want to test a ray against a primitive that has been transformed. For example, the scene may have a sphere that has been transformed into an ellipsoid, and you may want to take a ray intersection of that shape. Rather than perform a special ray-ellipsoid or ray-quadric intersection test, another method that can be used is to apply the inverse transformation to the ray, and test as if it were a sphere.&lt;/p&gt;
&lt;p&gt;Intuitively, this works by thinking of applying the inverse transformation to the whole scene temporarily. The ellipsoid becomes a sphere again, and the ray gets the inverse transformation. If the ray hits the untransformed sphere while inverse transformed, then it will hit the transformed sphere when not under the effects of the inverse transformation.&lt;/p&gt;
&lt;p&gt;To get the untransformed intersection, you merely apply the transformation to the the intersection. This is kind of like resetting the world back to normal.&lt;/p&gt;
&lt;h3&gt;Optimizations&lt;/h3&gt;
&lt;p&gt;Ray tracing has historically been a slow process due to the number of rays cast during rendering, especially since some objects are tested multiple times for multiple rays.&lt;/p&gt;
&lt;p&gt;To speed up ray tracing, there are a number of optimizations you can apply, most of which fall under a few categories:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Cast fewer rays &amp;#8211; adaptive sampling, depth control, etc&lt;/li&gt;
	&lt;li&gt;Cast generalized rays &amp;#8211; rays that apply to more than one pixel, beam tracing, cone tracing, pencil tracing, etc&lt;/li&gt;
	&lt;li&gt;Faster intersection calculation &amp;#8211; optimized algorithms, perform fewer intersections&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Casting fewer rays involves the use of acceleration structures. It doesn&amp;#8217;t make sense to test objects on the left side of a scene when you know the ray is cast into the right side of the scene.&lt;/p&gt;
&lt;p&gt;Acceleration structures are data structures that can encapsulate bounding boxes for groups of objects. Most of these bounding boxes are created by dividing space up hierarchically. If a ray intersects with a bounding box in the hierarchy, it needs to be tested against any sub-bounding boxes. Eventually the ray will need to be tested only against a few objects.&lt;/p&gt;
&lt;p&gt;The most simple acceleration structure is a grid, where the scene is divided into a 3D grid of a certain resolution. Casting the ray involves marking it through cells of the grid, and checking if the grid contains any objects. If it does, test the ray against the object. If no intersection occurs, continue marching through the grid.&lt;/p&gt;
&lt;p&gt;More sophisticated examples of these structures are oct-trees, kd trees, &lt;span class=&quot;caps&quot;&gt;BSP&lt;/span&gt; trees.&lt;/p&gt;
&lt;h2&gt;Ray Tracer Implementation&lt;/h2&gt;
&lt;p&gt;Now that we have a solid basis of ray tracing theory, we can look at some approaches to implementing a ray tracer.&lt;/p&gt;
&lt;h3&gt;Camera Ray Casting&lt;/h3&gt;
&lt;p&gt;Going back to the psuedocode at the start of the unit, camera ray casting involves the details of the function &lt;code&gt;RayThroughPixel&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you think back to OpenGL, we had a camera and a projection plane. This set up is the same for ray tracing. In ray tracing, we need to figure out the vector that represents a ray as it travels through one pixel of the projection plane that we are rendering onto. This angle is going to change for each pixel, and will also change if we move the camera.&lt;/p&gt;
&lt;p&gt;To do this, we transform all the objects into a single world coordinate system, including the camera location, and calculate rays based in that coordinate system, the camera origin and the coordinates of the pixels in the world coordinates.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;RayThroughPixel&lt;/code&gt; function is given a camera and a pixel coordinate, &lt;code&gt;i&lt;/code&gt; and &lt;code&gt;j&lt;/code&gt;. To implement the function, first we need to to construct a coordinate frame based on the camera&amp;#8217;s location and it&amp;#8217;s up direction, which was covered in unit 1 during the derivation of &lt;code&gt;gluLookAt&lt;/code&gt;, and will not be covered again.&lt;/p&gt;
&lt;p&gt;Next, we need to determine the vector representing the ray that originates from the camera origin to the pixel given by &lt;code&gt;i, j&lt;/code&gt;. With the coordinate frame \((u, v, w)\) given from the camera, the center of the image will be given by the camera&amp;#8217;s look at vector. That is, the center of the image will be at one unit along the -w direction. Each pixel will be calculated as a delta of this vector.&lt;/p&gt;
&lt;p&gt;As the ray moves horizontally, it changes its \(u\) coordinate by an amount \(\alpha\) and as it moves vertically, it changes its \(v\) coordinate by an amount \(\beta\). To determine the vector for the ray, we need to find \(\alpha\) and \(\beta\).&lt;/p&gt;
&lt;p&gt;First, lets consider our projection plane to be a 2D coordinate system, with 2 axes \(j\) and \(i\), similar to the cartesian system, where \(j\) maps to \(x\) and \(i\) maps to \(y\). If the image is of \(w\) length and \(h\) height, then the origin will be at \((\frac{w}{2}, \frac{h}{2})\). In order to treat this like a standard co-ordinate system, and due to the fact pixels are ranged from \(0 \to w\) and \(0 \to h\), we need the origin to be at \((0, 0)\), so every pixel \(j\) is actually at \(j &amp;#8211; \frac{w}{2}\) in this coordinate system, and every \(i\) is at \(\frac{h}{2} &amp;#8211; i\). Because the plane is set at one unit along the \(-w\) axis, we need to normalize the coordinate frame, so each pixel \(j\) is actually at \(\frac{j &amp;#8211; \frac{w}{2}}{\frac{w}{2}}\) and each \(i\) is given by \(\frac{\frac{h}{2} &amp;#8211; i}{\frac{h}{2}}\).&lt;/p&gt;
&lt;p&gt;This will give our pixel as a proportion of change along half of the field of view in that axis. Which means we can compute the final distance with the following set of equations:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \alpha = tan\left(\frac{fovx}{2}\right)\left(\frac{j &amp;#8211; \frac{w}{2} }{\frac{w}{2}}\right) \\&lt;br /&gt;
  \beta = tan\left(\frac{fovy}{2}\right)\left(\frac{\frac{h}{2} &amp;#8211; i}{\frac{h}{2}}\right)&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;With \(\alpha\) and \(\beta\) we can now move the eye coordinate by \(\alpha u\), \(\beta v\) and \(-w\) components, to give a normalized ray:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  ray = eye + \frac{\alpha u + \beta v &amp;#8211; w}{|\alpha u + \beta v &amp;#8211; w|}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Ray-Object Intersections&lt;/h3&gt;
&lt;p&gt;The implementation is mostly just converting the theory to actual code, so there is not much to say.&lt;/p&gt;
&lt;h3&gt;Lighting Calculations&lt;/h3&gt;
&lt;p&gt;Much of this is similar to the theory discussed earlier, and using the same Blinn-Phong shading model discussed in Unit 2. There are however a number of small changes. Consider the following formula:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  I = K_a + K_e + \sum^n_{i=1}V_iL_i(K_dmax(I_i\;.n, 0) + K_s(max(h_i\;.n, 0))^s)&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is the same as discussed in unit 2, with the exception of the \(V_i\) term, which represents visiblity. In a simple ray tracer, this will either be 1 or 0, for visible or not visible. However, if we were calculating particle effects, such as smoke or fog, then this visibility may be somewhere betwee 0 and 1, so a light blocked by smoke will contribute less color.&lt;/p&gt;
&lt;p&gt;Also remember, this is evaluated per pixel per light, as opposed to fragments when implemented in a fragment shader.&lt;/p&gt;
&lt;h3&gt;Recursive Ray Tracing&lt;/h3&gt;
&lt;p&gt;As above in the theory section, when computing lighting on a point that has reflection, you need to recursively determine the reflected object&amp;#8217;s color. This introduces some new terms to the lighting formula as given above:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  I = K_a + K_e + \sum^n_{i=1}V_iL_i(K_dmax(I_i\;.n, 0) + K_s(max(h_i\;.n, 0))^s) + K_sI_R + K_TI_T&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where \(K_sI_R\) is the specularity of the reflected ray, and \(K_TI_T\) is the transmission of the surface, which is not required in the homework for this unit.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>edX Foundations of Computer Graphics - Unit 2</title>
   <link href="http://www.timgittos.com/learning/edx-foundations-of-computer-graphics/unit-2"/>
   <updated>2012-11-25T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/edx-foundations-of-computer-graphics/unit-2</id>
   <content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In order to write 3D graphics programs, you need to know how to write 3D graphics programs. This involves interfacing with the computers graphics hardware through a higher level &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;. This course will use OpenGL to teach aspects of programming 3D graphics systems.&lt;/p&gt;
&lt;p&gt;Created in 1992 by Silicon Graphics, OpenGL was initially a fixed function pipeline. The &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; was a giant state machine, and you interacted with it by setting state, drawing pixels and flushing it to the rasterizer (scan conversion), which would then calculate the pixels that went into the framebuffer.&lt;/p&gt;
&lt;p&gt;In 2003, with the release of OpenGL 1.5, OpenGL supported a programmable pipeline. With the programmable pipeline, a programmer interacted with the &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; by loading vertices into a buffer, sending them to a programmable shader called a vertex shader. Then the vertices were rasterized and passed into another programmable shader, the fragment shader, and from there the rendered pixels would be placed in the framebuffer.&lt;/p&gt;
&lt;p&gt;This unit is about the programmable pipeline, and we will cover vertex and fragment shaders and &lt;span class=&quot;caps&quot;&gt;GLSL&lt;/span&gt; in depth.&lt;/p&gt;
&lt;h2&gt;OpenGL &amp;amp; &lt;span class=&quot;caps&quot;&gt;GLUT&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Now, I&amp;#8217;m going to go a little bit meta here and talk about the course itself. The instructor shows and explains some code, which is the skeleton code of Homework 0. At the start of Lecture 6, he talks about the old fixed function pipeline and the newer programmable pipeline. He says the course is about the newer programmable pipeline, but then shows code that uses &lt;code&gt;glMatrixMode&lt;/code&gt;, which is a fixed function method.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m thinking at this stage that this course probably isn&amp;#8217;t the best for learning how to code actual OpenGL programs. There ar far better sources to follow along with:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.arcsynthesis.org/gltut/&quot;&gt;Learning Modern 3D Graphics Programming by Jason L. McKesson&lt;/a&gt; , aka the Arcsynthesis turtorial.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://ogldev.atspace.co.uk/&quot;&gt;OpenGL Development on Linux&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Table-of-Contents.html&quot;&gt;An Intro to Modern OpenGL&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://open.gl/&quot;&gt;Modern OpenGL&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://openglbook.com/&quot;&gt;OpenGLBook.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The lecturer also goes into depth on how to use &lt;span class=&quot;caps&quot;&gt;GLUT&lt;/span&gt;. To save space and effort, I&amp;#8217;m going to link to a good &lt;span class=&quot;caps&quot;&gt;GLUT&lt;/span&gt; tutorial:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.lighthouse3d.com/tutorials/glut-tutorial/?5&quot;&gt;Lightouse3d.com &lt;span class=&quot;caps&quot;&gt;GLUT&lt;/span&gt; tutorial&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Shading&lt;/h2&gt;
&lt;p&gt;Shading is important because our world is defined by how we see it. Correct and accurate lighting and shading will define the shapes of objects we see. The same geometry can be rendered with 2 different shading models and the resultant image can be different, as is the case with flat shading vs. Gouraud shading.&lt;/p&gt;
&lt;p&gt;Shading can be done in either the vertex shader or the fragment shading. Shading performed in the vertex shader must be calculated on a vertex by vertex basis, and typically must be interpolated later in the fragment shader. The lighting can be calculated based on the vertex itself, or the normal at the vertex.&lt;/p&gt;
&lt;p&gt;This can cause problems when geometry has large faces and relatively small highlights, however it is relatively fast. An example of this kind of shading is Gouraud shading, where lighting is calculated at the pixel and interpolated across the face.&lt;/p&gt;
&lt;p&gt;Shading performed in the fragment shader is calculated on a fragment/pixel. Shading is calculated at a much finer detail and with more accuracy, however it involves more calculation and complexity. An example of this is the Phong shading model, which interpolates normals across a surface between it&amp;#8217;s vertices, and calculate the lighting based on those interpolated normals for each pixel.&lt;/p&gt;
&lt;p&gt;Note that Phong shading is different from Phong illumination, and you can use Phong shading with a different illumination model. A shading model determines how to determine how much light hits a pixel, an illumination model determines the characteristics of the light that hits that pixel (that is, the actualy determination of how much light and what color it is).&lt;/p&gt;
&lt;h3&gt;Gouraud Shading&lt;/h3&gt;
&lt;p&gt;Gouraud shading is performed by interpolating a pixel&amp;#8217;s color from it&amp;#8217;s bounding vertices during rasterization. Because OpenGL does the rasterization automatically, to use Gouraud shading in OpenGL you simply need to specify &lt;code&gt;glShadeModel(GL_SMOOTH)&lt;/code&gt; and set the color at each vertex in the vertex shader.&lt;/p&gt;
&lt;p&gt;For the sake of completeness, however, it is helpful to know what OpenGL is doing under the covers. Consider the following diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/edxcg/gouraud.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The goal of Gouraud shading in this example is to find the colour of \(I_p\). In order to find the colour at \(I_p\), first we must find the colour at point \(I_a\) and \(I_b\) and linearly interpolate between them. First, we will find point \(I_a\) by linearly interpolating between points \(I_1\) and \(I_2\), then we will find \(I_b\) by interpolating between \(I_1\) and \(I_3\).&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  I_a = \frac{I_1(y_s &amp;#8211; y_2) + I_2(y_1 &amp;#8211; y_s)}{y_1 &amp;#8211; y_2}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Similarly, we can solve for \(I_b\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  I_b = \frac{I_1(y_s &amp;#8211; y_3) + I_3(y_1 &amp;#8211; y_s)}{y_1 &amp;#8211; y_3}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\(I_a\) and \(I_b\) were solved by only considering the \(y\) coordinates. To solve for \(I_p\), we need to consider the \(x\) coordinates:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  I_p = \frac{I_a(x_b &amp;#8211; x_p) + I_b(x_p &amp;#8211; x_a)}{x_b &amp;#8211; x_a}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;In practice, the algorithm is much faster, as all the results of the previous calculation can be cached &amp;#8211; this reduces the problem to a series of additions of each steps values.&lt;/p&gt;
&lt;p&gt;Gouraud shading has problems when the lighting at a pair of vertices is 0 &amp;#8211; any interpolated values will also be 0. This can happen if the light bounces away from the camera at a given vertex.&lt;/p&gt;
&lt;p&gt;Gouraud shading also has problems when it comes to highlights. Before Phong shading, highlights had to be performed using triangle subdivision and tesselation. The pixels were then calculated from the subdivision triangle vertices. This was often inaccurate.&lt;/p&gt;
&lt;h3&gt;Phong Illumination and Shading Models&lt;/h3&gt;
&lt;p&gt;The Phong illumination model is different from the Phong shading model. The Phong illumination model describes how objects are lit, and specifically deals with specular lighting, which is the highlights on reflective materials. Phong shading attempts to mimic reality when it comes to specular lighting. For example, dielectric surfaces such as plastic reflect light differently from metallic reflective surfaces. The highlight on a reflective plastic will be the same colour as the lighting. the highlight on a metallic surface depends on the surface&amp;#8217;s colour. These properties are encoded as variables in the algorithm, however the physics of decided what values to give these variables is a separate topic.&lt;/p&gt;
&lt;p&gt;The Phong shading model is often used in conjunction with the Phong illumination model (but not always), and both of them together can define highlights well. The idea behind the Phong shading model is interpolating between vertex normals, instead of vertex colours. Then Phong illumination kicks in, and calculates the lighting at each pixel based on the interpolated normal for that pixel. This can be performed in the fragment shader.&lt;/p&gt;
&lt;h2&gt;Lighting and Shading&lt;/h2&gt;
&lt;p&gt;Lighting and shading in computer graphics is all a model of the physics of reality. The more closely lighting and shading models match the physics, the more accurate and more correct they are going to look. This course will cover some relatively basic models intuitively to teach the general approach, however it is possible to come up with more accurate models.&lt;/p&gt;
&lt;p&gt;Alright, going meta again. The lecturer says that he&amp;#8217;s going to cover some basics of lighting and shading, and boy is he not kidding. He discusses only a single light before moving onto materieals. The book &lt;a href=&quot;http://www.amazon.com/gp/product/1568814240/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1568814240&amp;linkCode=as2&amp;tag=gebloftigi-20&quot;&gt;Real-Time Rendering&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=1568814240&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt; discusses lighting in a much more detailed fashion.&lt;/p&gt;
&lt;p&gt;I will be writing notes on the lighting the lecturer discusses, because it is important for the assignment, however I would not refer to it for any real project.&lt;/p&gt;
&lt;h3&gt;Point light&lt;/h3&gt;
&lt;p&gt;A point light is a basic model of many types of lighting. In reality, there&amp;#8217;s no such thing as a point light &amp;#8211; everything has a non-zero size, and so the concept of a point light is an approximation.&lt;/p&gt;
&lt;p&gt;To define a point light, it needs a position in the world which is specified by a homogenous 4-vector, and a colour value.&lt;br /&gt;
In the real world, lights attenuate based on the distance the camera is from the light. The model used to attenuate light changes based on the type of light being considered.&lt;/p&gt;
&lt;p&gt;Point lights attenuate based directly off of physics, with an inverse-squared relationship:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  atten_p = \frac{1}{d^2}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Lights based on lines, such as a flourescent tube, attenuate on a direct inverse relationship:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  atten_l = \frac{1}{d}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and area based lights are often modelled as attenuating based on a constant:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  atten_a = \frac{1}{k}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Keep in mind these are rough models of lighting, and there are far more accurate models available.&lt;/p&gt;
&lt;p&gt;These can be rolled up into one general purpose attenuation model which is parameterized:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  atten = \frac{1}{k_c + k_ld + k_qd^2}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\(k_c\) would be the constant attenuation for an area light, and \(k_l\) and \(k_q\) would be set to 0. \(k_l\) would be the coefficient for attenuation of a line based light, where \(k_c\) and \(k_q\) would be set to 0, and \(k_q\) would be the coefficient for attenuation of a point light.&lt;/p&gt;
&lt;h3&gt;Materials&lt;/h3&gt;
&lt;p&gt;A material in computer graphics is a description of how the object reflects light. This is more complex than it sounds, as even many things can happen on a surface that affect the amount of light returned by a surface. For example, a matte surface can scatter the light, which would soften the highlight on the surface. Different coloured materials will absorb certain wavelengths of light, and reflect the rest, changing the colour of the reflected light. Some materials will be transparent, and refract/totally internally reflect light, leaving very little light to return. Some materials scatter the light underneath it&amp;#8217;s surface, giving it a kind of glow as light escapes in places other than where the light struck. The accurate simulation of how light interacts with a material is complex, however algorithms light the Phong lighting algorithm and the Blinn-Phong lighting algorithm attempt to approximate this phenomenon.&lt;/p&gt;
&lt;p&gt;In order to perform these complex calculations, algorithms need the normals of the vertices involved, and these normals are interpolated across the surface for each fragment. In the situation where you don&amp;#8217;t have normals at each vertex, but instead each surface, you can average the normals at each surrounding face to determine a vertices normal.&lt;/p&gt;
&lt;p&gt;The reflection of light can be specified by 4 terms: ambient reflection diffuse reflection, specular reflection and emissive reflection. The values of these terms are additive, and describe a proportion of incoming light that comes out.&lt;/p&gt;
&lt;p&gt;The emissive reflection term describes how much light the material produces itself. This is for objects such as lights and phosphorescent materials. It does not affect the way light reflects from that material otherwise. In OpenGL, you have to render geometry in order to render an emissive light source &amp;#8211; if there&amp;#8217;s no geometry, nothing will be rendered, though it&amp;#8217;s effects in the scene can be seen otherwise.&lt;/p&gt;
&lt;p&gt;The ambient term describes how light in general reflects about the scene. This is light that is bouncing around the room, and may not be light that explicitly hits the surface under consideration. The process of actually calculating the bouncing of light in a scene is known as global illumination, and there is much research into how to accurately and efficiently calculate it. Simpler algorithms such as Phong and Blinn-Phong approximate this, often with a low value such as 0.1 or 0.2.&lt;/p&gt;
&lt;p&gt;The diffuse term describes matte surfaces that scatter light on the reflection surface, and don&amp;#8217;t perfectly reflect light in an ideal model. These surfaces are known as Lambertian surfaces. In the ideal model, &lt;strong&gt;light that is scattered is scattered equally&lt;/strong&gt; &amp;#8211; there is no weighting to certain directions. This of course doesn&amp;#8217;t happen in real life, however due to the complexity of these calculations, often we have to make approximate models.&lt;/p&gt;
&lt;p&gt;Consider the following diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/edxcg/lambertian.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The light reflected in all directions is given by the following equation:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  I_D &amp;amp;= L . N\,C\,I_L \\&lt;br /&gt;
  &amp;amp;= |N| |L| cos\,\alpha \, C \, I_L \\&lt;br /&gt;
  &amp;amp;= cos\,\alpha \, C \, I_L&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where \(I_D\) is the intensity of the reflected light, \(C\) is the color and \(I_L\) is the intensity of the incoming light. The \(cos\,\alpha\) is given by the fact that the reflection of the light is strongest when the light vector is perpendicular to the surface, that is, the angle between the normal and the light vector is 0 &amp;#8211; \(cos\,0 = 1\). It is weakest when the light vector is perpendicular to the surface normal, that is, the angle between the normal and the light vector is 90 &amp;#8211; \(cos\,90 = 0\). The direction of the eye doesn&amp;#8217;t matter, because the light is equal in all directions under Lambertian reflectance.&lt;/p&gt;
&lt;p&gt;The specular term describes the highlights on a smooth surface where light is reflected more along the angle of reflection, similar to a mirror. It models glossy objects such as glass. When calculating specular reflection, the angle of the eye with respect to the surface matters, as the difference between the angle of reflection and the viewing angle will change the amount of light entering the eye or camera. The Phong and Blinn-Phong algorithms model this phenomenon.&lt;/p&gt;
&lt;h2&gt;Phong Reflection Models&lt;/h2&gt;
&lt;p&gt;The Phong, and the enhanced Blinn-Phong models take into account all of the terms described above. It can be visualized using this great Wikipedia image:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://upload.wikimedia.org/wikipedia/commons/6/6b/Phong_components_version_4.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In Phong reflection, each light in the scene has 2 components: \(i_s\), the specular intensity of the material and \(i_d\), the diffuse intensity of the material. The ambient lighting of the scene is given by the term \(i_a\). Sometimes this term is a sum of all lighting contributions in the scene.&lt;/p&gt;
&lt;p&gt;For each material in the scene, the following parameters are defined:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;\(k_s\): the specular reflection constant, representing the ratio of reflection of the specular term of the incoming light&lt;/li&gt;
	&lt;li&gt;\(k_d\): the diffuse version of \(k_s\) (the Lambertian reflectance defined above)&lt;/li&gt;
	&lt;li&gt;\(k_a\): the ambient version of \(k_s\) and \(k_d\), coming from all lights in the scene&lt;/li&gt;
	&lt;li&gt;\(\alpha\): A shininess constant of the materia. The larger this is, the more perfect the reflection from a surface.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Futher, \(lights\) is the set of all lights in the scene, and for each light, \(\bar{L_m}\) is the vector from the point on the surface toward each light (\(m\) is the light), \(\bar{N}\) is the normal of this point, \(\bar{R_m}\) is the vector representing the perfect reflectance from the point, and \(\bar{V}\) represents the vector from the point to the viewer.&lt;/p&gt;
&lt;p&gt;Using all these values, the Phong reflection model is given by the following formula:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  I_p = k_a i_a + \sum_{m \in lights}(k_d(\bar{L_m} . \bar{N})i_{m,d} + k_s(\bar{R_m} . \bar{V})^\alpha i_{m,s})&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where the vector \(\bar{R_m}\) is calculated as the reflection of \(\bar{L_m}\) on the surface by the surface normal \(\bar{N}\) given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \bar{R_n} = 2(\bar{L_m} . \bar{N}) \bar{N} &amp;#8211; \bar{L_m}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Remember, as above the dot product between two vectors can be calculated using the cosine of their angle.&lt;/p&gt;
&lt;h2&gt;Blinn-Phong Reflection Model&lt;/h2&gt;
&lt;p&gt;The downside to the Phong reflection model is that \(\bar{R} . \bar{V}\) needs to be recalculated for each light. This can be approximated by replacing \(\bar{R} . \bar{V}\) with H:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  H = \frac{\bar{L} + \bar{V}}{|\bar{L} + \bar{V}|}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which can be simplified to half the cosine of the angle between \(\bar{L} . \bar{V}\) if \(\bar{L}\), \(\bar{R}\) and \(\bar{V}\) all lie in the same plane.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>edX Foundations of Computer Graphics - Unit 1</title>
   <link href="http://www.timgittos.com/learning/edx-foundations-of-computer-graphics/unit-1"/>
   <updated>2012-11-13T16:29:00-08:00</updated>
   <id>http://www.timgittos.com/learning/edx-foundations-of-computer-graphics/unit-1</id>
   <content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;There are many co-ordinate systems in any computer graphics system. There can be world co-ordinates, model co-ordinates, body co-ordinates, etc. When building a scene, each of these co-ordinate systems will need to be transformed into a common system to be rendered correctly.&lt;/p&gt;
&lt;p&gt;Even when rendering a single object, we need to transform co-ordinates to place an object in the correct location, or to make it bigger or smaller.&lt;/p&gt;
&lt;p&gt;If we add interactivity, viewing that object from different angles actually involves transforming it to the correctr perspective, which is the goal of homework 1.&lt;/p&gt;
&lt;p&gt;Tranformations are represented with matrices, and they transform points through matrix-vector multiplication.&lt;/p&gt;
&lt;p&gt;All examples in this unit involve geometric figures in model space, which will be transformed to world space and then operated on using various different transforms. Vertices are represented as vectors, and transformations as matrices, as noted earlier.&lt;/p&gt;
&lt;h2&gt;2D Transformations&lt;/h2&gt;
&lt;h3&gt;Scale&lt;/h3&gt;
&lt;p&gt;The scale transformation can be represented as the following matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  s_x &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; s_y&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and it&amp;#8217;s inverse is given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  s^{-1}_x &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; s^{-1}_y&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;If both \(s_x\) and \(s_y\) are the same, the transformation is uniform. Otherwise, it is non-uniform.&lt;/p&gt;
&lt;p&gt;In 3D this transformation is as follows:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  s_x &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; s_y &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; s_z&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Shear&lt;/h3&gt;
&lt;p&gt;The shear transformation can be represented as the following matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; a \\&lt;br /&gt;
  0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where \(a\) is the amount you want to shear the object by. It&amp;#8217;s inverse is given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; -a \\&lt;br /&gt;
  0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Rotation&lt;/h3&gt;
&lt;p&gt;Rotation in 2D is simple, rotation in 3D is fairly complicated, with issues like gimbal lock and so on which can be solved with quaternions.&lt;/p&gt;
&lt;p&gt;Rotating the result of a vector addition is the same as adding the rotation of the components:&lt;/p&gt;
&lt;p&gt;\(R(X + Y) = R(X) + R(Y)\)&lt;/p&gt;
&lt;p&gt;Rotations in a linear operation, meaning it preserves the operations of vector addition and scalar multiplication, and they are commutative in 2D but not in 3D.&lt;/p&gt;
&lt;p&gt;A 2D rotation can be derived as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/edxcg/rotation2d.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Represent \(P\) as a polar coordinate:&lt;/p&gt;
&lt;p&gt;$$ P = r \: cos\,\alpha, r \: sin\,\alpha $$&lt;/p&gt;
&lt;p&gt;\(P&amp;#8217;\) can be expressed in polar coordinates as follows:&lt;/p&gt;
&lt;p&gt;$$ P&amp;#8217; = r \: cos\,(\alpha + \theta), r \: sin\,(\alpha + \theta) $$&lt;/p&gt;
&lt;p&gt;Using trig identities to convert from polar to cartesion coordinates:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    P&amp;#8217;_x &amp;amp;= r \: cos\,\alpha \: cos\,\theta \; &amp;#8211; r \: sin\,\alpha \: sin\,\theta \\&lt;br /&gt;
         &amp;amp;= x \: cos\,\theta \; &amp;#8211; y \: sin\,\theta \\&lt;br /&gt;
    P&amp;#8217;_y &amp;amp;= r \: sin\,\alpha \: cos\,\theta \; + r \: cos\,\alpha \: sin\,\theta \\&lt;br /&gt;
         &amp;amp;= y \: cos\,\theta \; + x \: sin\,\theta&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Thus, this can be represented by the following matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    cos\,\theta &amp;amp; -sin\,\theta \\&lt;br /&gt;
    sin\,\theta &amp;amp; cos\,\theta&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;NOTE&lt;/span&gt;: \(\theta\) has to be in radians, not in degrees. If given \(\theta\) in degrees, multply by \(\frac{\pi}{180}\).&lt;/p&gt;
&lt;h2&gt;Composing Transforms&lt;/h2&gt;
&lt;p&gt;Often in computer graphics, you will want to combine several different transformations into a single transfermation. For example, if you want to place a model at a given co-ordinate and then rotate it, you would need to translate all the vertices, and then rotate them. Or, you could construct a single transform to do both.&lt;/p&gt;
&lt;p&gt;The act of combining transforms is simply matrix multiplication, and the result will always be a single matrix. Keep in mind that matrix multiplation is not commutative, meaning that the order matters.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;Consider the matrix \(x_1\), and a scale matrix \(S\) and a rotation matrix \(R\).&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    x_2 &amp;amp;= Sx_1 \\&lt;br /&gt;
    x_3 &amp;amp;= Rx_2 \\&lt;br /&gt;
    \therefore x_3 &amp;amp;= R(Sx_1) = (RS)x_1 \\&lt;br /&gt;
    x_3 &amp;amp;\ne SRx_1&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Likewise, if you have 3 transformations on a vector, you can invert those transformations in one of two ways.&lt;/p&gt;
&lt;p&gt;Consider the following 3 transforms transformed into the matrix \(M\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  M = M_1 M_2 M_3&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Your options are as follows:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Calculate the composite matrix and invert it&lt;br /&gt;
  \[&lt;br /&gt;
    X = (XM) M^{-1}&lt;br /&gt;
  \]&lt;/li&gt;
	&lt;li&gt;Invert each individual transform and then apply them in the reverse order&lt;br /&gt;
  \[&lt;br /&gt;
    X = (XM) (M_3^{-1}(M_2^{-1}(M_1^{-1}M_1)M_2)M_3)&lt;br /&gt;
  \]&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;It is helpful to think of transformations applying to a vector to be a stack operation &amp;#8211; the last transformation applied must be the first one undone.&lt;/p&gt;
&lt;h2&gt;3D Transformations&lt;/h2&gt;
&lt;p&gt;One important thing to note about 2D rotations is that they are orthogonal, meaning that \(R^TR = I\) holds:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      cos\,\theta &amp;amp; -sin\,\theta \\&lt;br /&gt;
      sin\,\theta &amp;amp; cos\,\theta&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      cos\,\theta &amp;amp; sin\,\theta \\&lt;br /&gt;
      -sin\,\theta &amp;amp; cos\,\theta&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      cos^2\theta + sin^2\theta &amp;amp; -cos\,\theta \; sin\,\theta + cos\,\theta \; sin\,\theta \\&lt;br /&gt;
      -sin\,\theta \; cos\,\theta + sin\,\theta \; cos\,\theta &amp;amp; sin^2\theta + cos^2\theta&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      1 &amp;amp; 0 \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Simple Rotations around X, Y, Z Axis&lt;/h3&gt;
&lt;p&gt;To begin with rotations in 3D, let us consider 2D rotations as 3D rotations around the \(z\) axis. If you think of a rotation where the \(x\) and \(y\) axes change, then if you suddenly introduce the \(z\) axis, it doesn&amp;#8217;t change. So a 2D rotation is essentially a 3D rotation about the \(z\) axis.&lt;/p&gt;
&lt;p&gt;Therfore, we can represent a 3D rotation about the \(z\) axis as follows:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    cos\,\theta &amp;amp; -sin\,\theta &amp;amp; 0 \\&lt;br /&gt;
    sin\,\theta &amp;amp; cos\,\theta &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;A 3D rotation about the \(x\) axis is similarly simple, as we just hold \(x\) constant and treat it exactly the same:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; cos\,\theta &amp;amp; -sin\,\theta \\&lt;br /&gt;
    0 &amp;amp; sin\,\theta &amp;amp; cos\,\theta&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;A 3D rotation about the \(y\) axis is a little more complicated due to the \(y\) axis being given by \(z \times x\), however it&amp;#8217;s still pretty close:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    cos\,\theta &amp;amp; 0 &amp;amp; sin\,\theta \\&lt;br /&gt;
    0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
    -sin\,\theta &amp;amp; 0 &amp;amp; cos\,\theta&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can derive the rotation matrix around the \(z\) axis as follows:&lt;/p&gt;
&lt;p&gt;Consider the rotation around the \(x\) axis, as discussed earlier, in cartesian co-ordinates:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    x&amp;#8217; &amp;amp;= x\;cos\,\theta &amp;#8211; y\;sin\,\theta \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= x\;sin\,\theta + y\;cos\,\theta \\&lt;br /&gt;
    z&amp;#8217; &amp;amp;= z&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;A rotation around the \(y\) axis is similar to a \(z\) axis rotation if we replace the (\x\) axis with the \(z\) axis, the \(y\) axis with the \(x\) axis and the \(z\) axis with the \(y\) axis:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    z&amp;#8217; &amp;amp;= z\;cos\,\theta &amp;#8211; x\;sin\,\theta \\&lt;br /&gt;
    x&amp;#8217; &amp;amp;= z\;sin\,\theta + x\;cos\,\theta \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= y&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;If we put these equations into matrix form, that gives us:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    cos\,\theta &amp;amp; 0 &amp;amp; sin\,\theta \\&lt;br /&gt;
    0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
    &amp;#8211; sin\,\theta &amp;amp; 0 &amp;amp; cos\,\theta&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;These basic 3D rotations are orthogonal, like 2D rotations.&lt;/p&gt;
&lt;p&gt;We can think of a rotation matrix as representing a new orthonormal basis, with each row of the matrix representing one of the unit vectors forming the basis:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  R_{uvw} =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    x_u &amp;amp; y_u &amp;amp; z_u \\&lt;br /&gt;
    x_v &amp;amp; y_v &amp;amp; z_v \\&lt;br /&gt;
    x_w &amp;amp; y_w &amp;amp; z_w&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;\(x_u\) is the \(x\) coordinate of the \(u\) vector&lt;/li&gt;
	&lt;li&gt;\(y_u\) is the \(y\) coordinate of the \(u\) vector&lt;/li&gt;
	&lt;li&gt;\(z_u\) is the \(z\) coordinate of the \(u\) vector&lt;/li&gt;
	&lt;li&gt;similarly for the \(v\) and \(w\) vectors.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The above matrix represents a transformation from the an orthonormal basis that represents the rotation transformed into the cartesion basis we&amp;#8217;re used to.&lt;/p&gt;
&lt;p&gt;We can consider, instead, the rotation from a higher dimensionality, and consider a vector of unit vectors. What happens if we multiply this by a single point?&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{pmatrix}&lt;br /&gt;
    \bar{u} \\&lt;br /&gt;
    \bar{v} \\&lt;br /&gt;
    \bar{w}&lt;br /&gt;
  \end{pmatrix}&lt;br /&gt;
  \begin{pmatrix}&lt;br /&gt;
    \bar{P}&lt;br /&gt;
  \end{pmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{pmatrix}&lt;br /&gt;
    \bar{u}.\bar{P} \\&lt;br /&gt;
    \bar{v}.\bar{P} \\&lt;br /&gt;
    \bar{w}.\bar{P}&lt;br /&gt;
  \end{pmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is thinking about a rotation not as an operation, but as a subspace that we are projecting a point into. Multiplying this vector with a point will result in a new point that lives in the subspace of the rotation.&lt;/p&gt;
&lt;p&gt;This approach will allow us to construct rotation matrices in any orthonormal basis, allowing us to do 3D rotations about arbitrary vectors.&lt;/p&gt;
&lt;p&gt;3D rotation is not commutative like 2D rotations are, given that matrix multiplication is not commutative.&lt;/p&gt;
&lt;h3&gt;3D Rotations Around Arbitrary Vector Using Axis-Angle Rotations&lt;/h3&gt;
&lt;p&gt;Consider rotationg a vector \(b\) by an angle of \(\theta\) about a vector \(a\).&lt;/p&gt;
&lt;p&gt;The vector \(b\) can be thought of being composed of components of two vectors: \(a\), and a vector orthogonal to \(a\). We will label these as \(b_\|\) and \(b_\perp\) respectively. \(b_\|\) lies along \(a\), and is unchanged through a rotation.&lt;/p&gt;
&lt;p&gt;\(b_\|\) can be given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  b_\| = (a \; . b) \bar{a}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;assuming \(a\) and \(b\) are both unit vectors. This follows from the intuition about dot products as measuring components of vectors/projecting vectors.&lt;/p&gt;
&lt;p&gt;\(b_\perp\) can be given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  b_\perp = b \; &amp;#8211; b_\|&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Because the rotation is occurring in 3D, we need an orthonormal base to perform the rotation in. If we consider \(a\) and \(b\) to be two vectors in this space, we can use them to define the space by finding vector \(c\), which is the vector orthogonal to \(a\) and \(b\).&lt;/p&gt;
&lt;p&gt;\(c\) can be given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  c = a \times b&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Now that we have these components, we can determine the result of the rotation. The new vector will be given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  b&amp;#8217; = \begin{bmatrix}&lt;br /&gt;
    \bar{c} sin\,\theta \\&lt;br /&gt;
    b_\perp cos\,\theta \\&lt;br /&gt;
    b_\|&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is due to the fact that the \(\bar{c}\) and \(b_\perp\) components of \(b&amp;#8217;\) will be determined by the angle of rotation, and \(b_\|\) lies along the rotation axis, and so doesn&amp;#8217;t change.&lt;/p&gt;
&lt;p&gt;In matrix form, this is given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  R(a, \theta) = I\;cos\,\theta + sin\,\theta[a]_\times + (1 &amp;#8211; cos\,\theta)a \otimes a&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  a \otimes a =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    a^2_x &amp;amp; a_x a_y &amp;amp; a_x a_z \\&lt;br /&gt;
    a_x a_y &amp;amp; a^2_y &amp;amp; a_y a_z \\&lt;br /&gt;
    a_x a_z &amp;amp; a_y a_z &amp;amp; a_z^2&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \lbrack a \rbrack_\times =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    0 &amp;amp; -a_z &amp;amp; a_y \\&lt;br /&gt;
    a_z &amp;amp; 0 &amp;amp; -a_x \\&lt;br /&gt;
    -a_y &amp;amp; a_x &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;In matrix operations, \(a \otimes a\) can be calculated with \(aa^T\).&lt;/p&gt;
&lt;p&gt;Details about the derivation can be found on &lt;a href=&quot;http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula&quot;&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can check the results of the rotation by relating it to a similar rotation in cartesian coordinate space. Relate vector \(b\) to the \(x\) axis and vector \(a\) to the \(z\) axis to see if the rotation is what you would expect intuitively. The result of this will be rotating a point on the \(x\) axis towards the \(y\) axis.&lt;/p&gt;
&lt;h2&gt;Homogenous Coordinates&lt;/h2&gt;
&lt;p&gt;Homogenous coordinates solved a number of problems in computer graphics. The need for homogenous coordinates can be demonstrated by trying to translate a vector.&lt;/p&gt;
&lt;p&gt;Consider the following equation:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      x&amp;#8217; \\ y&amp;#8217; \\ z&amp;#8217;&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    T&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      x \\ y \\ z&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      x + 5 \\ y \\ z&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where \(T\) is a translation matrix that moves the vector by 5 units along the \(x\) axis. What is the matrix \(T\)?&lt;/p&gt;
&lt;p&gt;From matrix multiplcation, we know that it must be a 3&amp;#215;3 matrix. We know that it adds 5 to the \(x\) value, and leaves the \(y\) and \(z\) values unchanged. So it must look something like this:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;However, this is the identity matrix. Where does the 5 come from?&lt;/p&gt;
&lt;p&gt;The solution to this is homogenous coordinates. If we add an extra coordinate, \(w\), we can use a 4&amp;#215;4 matrix to add in extra values:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      x&amp;#8217; \\ y&amp;#8217; \\ z&amp;#8217; \\ w&amp;#8217;&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 5 \\&lt;br /&gt;
      0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
      0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
      0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      x \\ y \\ z \\ 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      x + 5 \\ y \\ z \\ 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Homogenous coordinates enable the use of a variety of operations upon vectors and vertices in computer graphics, from all the transformations discussed above, to projection and view matrix calculation.&lt;/p&gt;
&lt;p&gt;The only thing to remember with homogenous coordinates is the need to dehomegenize the result of these operations to get the point in cartesian space. This is done by dividing by the result by the \(w\) coordinate.&lt;/p&gt;
&lt;h3&gt;Translation Using Homogenous Coordinates&lt;/h3&gt;
&lt;p&gt;Following is the general form for a translation in 3D using homogenous coordinates:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    T &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      1 &amp;amp; 0 &amp;amp; 0 &amp;amp; T_x \\&lt;br /&gt;
      0 &amp;amp; 1 &amp;amp; 0 &amp;amp; T_y \\&lt;br /&gt;
      0 &amp;amp; 0 &amp;amp; 1 &amp;amp; T_z \\&lt;br /&gt;
      0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix} \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      I_3 &amp;amp; t \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where \(I_3\) is the 3&amp;#215;3 identity matrix, and \(t\) is the 3&amp;#215;1 translation vector.&lt;/p&gt;
&lt;p&gt;This can be used as follows:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    P&amp;#8217; &amp;amp;= TP \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      1 &amp;amp; 0 &amp;amp; 0 &amp;amp; T_x \\&lt;br /&gt;
      0 &amp;amp; 1 &amp;amp; 0 &amp;amp; T_y \\&lt;br /&gt;
      0 &amp;amp; 0 &amp;amp; 1 &amp;amp; T_z \\&lt;br /&gt;
      0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      x \\ y \\ z \\ 1&lt;br /&gt;
    \end{bmatrix} \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      x + T_x \\ y + T_y \\ z + T_z \\ 1&lt;br /&gt;
    \end{bmatrix} \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    P + T&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Combining 3D Translation and Rotation&lt;/h3&gt;
&lt;p&gt;When combining translations and rotations, the order matters. A rotation followed by a translation is not the same as a translation followed by a rotation.&lt;/p&gt;
&lt;p&gt;Typically, because it&amp;#8217;s easier to think about rotations in terms of the origin, rotation will usually come before translation, however it is possible to do it in the opposite order.&lt;/p&gt;
&lt;p&gt;We can see this as follows. Consider the case of rotating first, and then translating. Combining those operations into matrix \(M\), we get:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    M &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      I_3 &amp;amp; T \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      R &amp;amp; 0 \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      R &amp;amp; T \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which when applied to a point \(P\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    P&amp;#8217; &amp;amp;= MP \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      R &amp;amp; T \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      P \\ 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \\\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      RP + T \\&lt;br /&gt;
      1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Now consider the case of translating first, and then rotating. Combining those operations into the matrix \(M\), we get:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    M &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      R &amp;amp; 0 \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      I_3 &amp;amp; T \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      R &amp;amp; RT \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which when applied to a point \(P\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    P&amp;#8217; &amp;amp;= MP \\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      R &amp;amp; RT \\&lt;br /&gt;
      0 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      P \\ 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \\\&lt;br /&gt;
    &amp;amp;=&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
      RP + RT \\&lt;br /&gt;
      1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;As we can see, when applying the translation first, and then a rotation, the translation itself is rotated, which means you end up translating around a different axis. This is unintuitive, however is clearly demonstrated with math.&lt;/p&gt;
&lt;h2&gt;Transforming Normals&lt;/h2&gt;
&lt;p&gt;A surface normal is a vector that is perpendicular with a surface. They are used to determine which way the surface faces, as well as how light bounces off of the surface in lighting.&lt;/p&gt;
&lt;p&gt;Normals do not transform the same way as surface diagrams. If you consider a surface being sheared, althought the shape of the surface changes, it&amp;#8217;s orientation does not change, and thus it&amp;#8217;s normal does not change.&lt;/p&gt;
&lt;p&gt;We can use some algebra to find out how normals transform.&lt;/p&gt;
&lt;p&gt;Consider a surface, defined by a normal \(n\) and a set of points tangent to that normal, \(t\). This surface is undergoing some transformation, \(M\).&lt;/p&gt;
&lt;p&gt;As mentioned above, the surface is defined by a normal and a set of tangental points. The normal must be perpendicular to the tangental points:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  n^Tt = 0&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We know that the tangents undergo transformation as per normal, as they are geometry:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  t&amp;#8217; = Mt&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We also know that the normal undergoes a separate transform, \(Q\), such that:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  n&amp;#8217; = Qn&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The goal is to find out what Q is. As it happens, we can use algebra to solve this:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    n&amp;#8217;^Tt&amp;#8217; &amp;amp;= 0 \\&lt;br /&gt;
    (Qn)^Tt&amp;#8217; &amp;amp;= 0 \\&lt;br /&gt;
    (Qn)^TMt &amp;amp;= 0 \\&lt;br /&gt;
    n^TQ^TMt &amp;amp;= 0 \\&lt;br /&gt;
    \therefore Q^TM &amp;amp;= I \because n^Tt = 0 \\&lt;br /&gt;
    Q^T &amp;amp;= M^{-1} \\&lt;br /&gt;
    Q &amp;amp;= (M^{-1})^T&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;So the normal transformation is given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  Q = (M^{-1})^T&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where \(M\) is some transformation acting upon geometry.&lt;/p&gt;
&lt;p&gt;Note that the inverse transposition above is applied only to the upper 3&amp;#215;3 matrix. It does not apply to the homogenous coordinates, because the normal is never acted onto by translations.&lt;/p&gt;
&lt;h2&gt;Coordinate Frames&lt;/h2&gt;
&lt;p&gt;As discussed earlier in 3D rotations, a 3D rotation can be viewed in two ways:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;A rotation of vertices in a given coordinate frame&lt;/li&gt;
	&lt;li&gt;A projection of vertices from one coordinate frame to another (aka rotation of the coordinate frame)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is relevant because there are a number of coordinate frames in computer graphics: world view, camera view, model view, etc.&lt;/p&gt;
&lt;p&gt;This generalizes to 2D in a similar way as it does for 3D.&lt;/p&gt;
&lt;h2&gt;Derivation of gluLookAt&lt;/h2&gt;
&lt;p&gt;The gluLookAt is a function that is used a lot in OpenGL code to position the camera in space, and point it to along a vector.&lt;/p&gt;
&lt;p&gt;The function takes the camera&amp;#8217;s 3D coordinates, the coordinates of the point the camera should look at, and the coordinates of the up direction for the camera. It outputs a 4&amp;#215;4 matrix that will transform points in the world coordinate space so that they lie in the camera coordinate space.&lt;/p&gt;
&lt;p&gt;The arguments passed in help define 2 vectors that will form the orthonormal basis for the camera&amp;#8217;s coordinate frame. These vectors can be used to find the third vector.&lt;/p&gt;
&lt;p&gt;These two vectors are the vector \(a\), which is given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  a = \begin{bmatrix}camera_x \\ camera_y \\ camera_z\end{bmatrix} &amp;#8211; \begin{bmatrix}center_x \\ center_y \\ center_z\end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and \(b\), given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  b = \begin{bmatrix}up_x \\ up_y \\ up_z\end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;From these vectors, we can calculate an orthonormal basis defined by the vectors \(w\), \(u\) and \(v\), where:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  w = \frac{a}{\|a\|}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  u = \frac{b \times w}{\| b \times w \|}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  v = w \times u&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re not sure what&amp;#8217;s going on here, see &lt;a href=&quot;/learning/edx-foundations-of-computer-graphics/unit-0/&quot;&gt;the notes for Unit 0&lt;/a&gt; which discuss how to form a basis from 2 arbitrary vectors.&lt;/p&gt;
&lt;p&gt;Once you have the new orthonormal basis, you can create a rotation matrix easily. Recall that a rotation can be interpretted as a pojection into a new coordinate frame. This means that the vectors \(u\), \(v\) and \(w\) define the rotation matrix that will do the projection:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  R_{uvw} = \begin{bmatrix}&lt;br /&gt;
    x_u &amp;amp; y_u &amp;amp; z_u \\&lt;br /&gt;
    x_v &amp;amp; y_v &amp;amp; z_v \\&lt;br /&gt;
    x_w &amp;amp; y_w &amp;amp; z_w&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;However, the camera itself has a location, so you must combine a translation to the camera&amp;#8217;s coordinates first, then apply the rotation. Because we&amp;#8217;re acting on the world, rather directly on the camera, we need to apply the inverse translation to move the points of the world instead of moving the camera, so the camera is considered at origin:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  T_{uvw} = \begin{bmatrix}&lt;br /&gt;
    -camera_x \\&lt;br /&gt;
    -camera_y \\&lt;br /&gt;
    -camera_z&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;ˇYou can combine these into a matrix in a method similar to how we did above. I&amp;#8217;ll skip the details and go straight to the final form:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  M = \begin{bmatrix}&lt;br /&gt;
    R_{uvw} &amp;amp; R_{uvw} . T_{uvw} \\&lt;br /&gt;
    0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h2&gt;Projection&lt;/h2&gt;
&lt;p&gt;Projection is the act of projecting a 3D world onto a 2D image plane. This is also known as viewing transformation. In computer graphics, there are 2 main types of pojection:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;orthographic projection&lt;/li&gt;
	&lt;li&gt;perspective projection&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Until now, 3D transformations have all transformed within the same dimension, and have been formatted as 4&amp;#215;4 homogenous matrices.&lt;/p&gt;
&lt;p&gt;In order to perform orthographic projection, we will continue to use 4&amp;#215;4 homogenous matrices. To perform the projection, we will utilize the last row of the 4&amp;#215;4 matrix that was previous an identity row.&lt;/p&gt;
&lt;h3&gt;Orthographic projection&lt;/h3&gt;
&lt;p&gt;Orthographic projection preserves the angles between vertices, and simply ignores a dimension.&lt;/p&gt;
&lt;p&gt;In OpenGL, this is implemented as a function called glOrtho. Mathematically, the general approach is as follows.&lt;/p&gt;
&lt;p&gt;Consider the world we want to project to be encompassed by a cuboid. That is, a 3D box that is not necessarily a cube. To perform the projection, we translate the cuboid so that it&amp;#8217;s center lies at origin, and we scale it so that it becomes a unit cube. Then we drop the \(z\) dimension.&lt;/p&gt;
&lt;p&gt;This world cuboid is defined by \(l\) the left most viewing edge, \(r\) the right most viewing edge, \(t\) the top most viewing edge, \(b\), the bottom most viewing edge, \(f\) the far clipping plane and \(n\), the near clipping plane.&lt;/p&gt;
&lt;p&gt;We perform the projection in two steps: translation, then a scale.&lt;/p&gt;
&lt;p&gt;The translation can be given by the matrix \(T\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  T = \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 &amp;amp; -\frac{r + l}{2} \\&lt;br /&gt;
    0 &amp;amp; 1 &amp;amp; 0 &amp;amp; -\frac{t + b}{2} \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 1 &amp;amp; -\frac{f + n}{2} \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;As you can see, the matrix \(T\) simply moves the cuboid to the origin.&lt;/p&gt;
&lt;p&gt;Similarly, the scale can be given by the matrix \(S\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  S = \begin{bmatrix}&lt;br /&gt;
    \frac{2}{r-l} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; \frac{2}{t-b} &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; \frac{2}{f-n} &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Given we want the resultant cube to have a width, height and depth of 2, we need to convert the cuboid to that ratio.&lt;/p&gt;
&lt;p&gt;The resultant projection matrix \(M\) is:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  M = \begin{bmatrix}&lt;br /&gt;
    \frac{2}{r &amp;#8211; l} &amp;amp; 0 &amp;amp; 0 &amp;amp; -\frac{r + l}{r &amp;#8211; l} \\&lt;br /&gt;
    0 &amp;amp; \frac{2}{t-b} &amp;amp; 0 &amp;amp; -\frac{t + b}{t &amp;#8211; b} \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; \frac{2}{f-n} &amp;amp; -\frac{f + n}{f &amp;#8211; n} \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Lastly, because in OpenGL the camera looks down the \(-z\) axis, \(f &amp;#8211; n\) will be a negative number. Therefore in \(M\), you need to replace \(n\) with \(-n\) and \(f\) with \(-f\). This will give you \(glOrtho\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  glOrtho =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    \frac{2}{r &amp;#8211; l} &amp;amp; 0 &amp;amp; 0 &amp;amp; -\frac{r + l}{r &amp;#8211; l} \\&lt;br /&gt;
    0 &amp;amp; \frac{2}{t-b} &amp;amp; 0 &amp;amp; -\frac{t + b}{t &amp;#8211; b} \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; \frac{-2}{f-n} &amp;amp; -\frac{f + n}{f &amp;#8211; n} \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Perspective projection&lt;/h3&gt;
&lt;p&gt;Perspective projection modifies the angles between vertices and most closely models how we see the world around us. An example of this is the optical illusion of parallel lines meeting under perspective to a vanishing point.&lt;/p&gt;
&lt;p&gt;Consider the following diagram, which is a top-down view of a perspective projection:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/edxcg/perspectiveproj.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The camera lies at \((0, 0, 0)\) and a projection plane of the image. Some point \((x, y, z)\) projects to point \((x&amp;#8217;, y&amp;#8217;, d)\). From similar triangles, we can see that:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \frac{x&amp;#8217;}{d} = \frac{x}{z}&lt;br /&gt;
  \quad \quad \quad \quad&lt;br /&gt;
  \frac{y&amp;#8217;}{d} = \frac{y}{z}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Therefore, we can see that:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  x&amp;#8217; = \frac{d \, x}{z}&lt;br /&gt;
  \quad \quad \quad \quad&lt;br /&gt;
  y&amp;#8217; = \frac{d \, y}{z}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can use homogenous coordinates to perform this division in a matrix during the dehomogenization process. If we make the resultant \(w\) parameter equal to \(\frac{z}{d}\), then when it comes to dehomogenizing, each element will be multiplied by the inverse. We can easily craft such a matrix, \(P\), the perspective transformation matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  P = \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; \frac{1}{d} &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The matrix \(P\) above can be used as is in coordinate systems where the camera looks into the positive \(z\) axis. Remember with OpenGL the camera looks into the negative \(z\) axis, so \( P_{4,3} = -\frac{1}{d} \).&lt;/p&gt;
&lt;p&gt;Multiplying this perspective matrix with a point gives the following:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  V = \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; \frac{1}{d} &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    x \\ y \\ z \\ w&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    x \\  y \\ z \\ \frac{z}{d}&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Finally, dehomogenizing this resultant vertex gives:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  V = \begin{bmatrix}&lt;br /&gt;
    \frac{x\,d}{z} \\&lt;br /&gt;
    \frac{y\,d}{z} \\&lt;br /&gt;
    d \\&lt;br /&gt;
    1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Of course, we discard the \(z\) coordinate as this is a 3D &amp;#8594; 2D projection.&lt;/p&gt;
&lt;h3&gt;Derivation of gluPerspective&lt;/h3&gt;
&lt;p&gt;The gluPerspective function transforms the 3D world to a 2D perspective projection. This function is usually called after the camera is position, such as with gluLookAt.&lt;/p&gt;
&lt;p&gt;The gluPerspective function takes 4 arguments: the field of view in the y direction, an aspect ratio, the \(z\) coordinate of the near clipping plane and the \(z\) coordinate of the far clipping plane. These 4 arguments help construct a viewing frustum:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/edxcg/vf.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The aspect ratio is the \(\frac{width}{height}\), and \(Z_{near}\) and \(Z_{far}\) are positive numbers, even though the camera is looking down the negative \(z\) axis.&lt;/p&gt;
&lt;p&gt;From these values, we need to determine \(d\) as per the perspective transform above. To compute \(d\).&lt;/p&gt;
&lt;p&gt;If \(\theta\) is the angle between the \(z\) axis and the projected point \((x&amp;#8217;, y&amp;#8217;, d)\), then:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \theta = \frac{fov_y}{2}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and therefore:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    d &amp;amp;= \frac{1}{tan\,\theta} \\&lt;br /&gt;
      &amp;amp;= cot\,\theta \\&lt;br /&gt;
      &amp;amp;= cot\,\frac{fov_y}{2}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This will take care of the perspective projection. However, the gluPerspective function does more than just project: it also fits the image to a given aspect ratio, and clips the rendered image at a near plane and a far plane.&lt;/p&gt;
&lt;p&gt;We can fold these up into the perspective matrix as well.&lt;/p&gt;
&lt;p&gt;First, consider the aspect ratio. The aspect ratio will affect geometry in the \(x\) axis only. As the aspect ratio gets bigger, the elements should become thinner, and appear stretched. So we can add it to the perspective matrix as follows:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  P = \begin{bmatrix}&lt;br /&gt;
    \frac{1}{aspect} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; -\frac{1}{d} &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Before we go further, lets multiply \(P\) with the \(d\) variable, to remove unnecessary fractions:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  P = \begin{bmatrix}&lt;br /&gt;
    \frac{d}{aspect} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; d &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; d &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; -1 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Lastly, we need to consider the clipping planes, which will affect geometry in the \(z\) axis. Because we&amp;#8217;re projecting to a unit square, we need to map \(-Z_{near}\) to -1, and \(-Z_{far}\) to +1. To do this operation in matrices, we&amp;#8217;re going to use \(P_{3,3}\) and \(P_{3,4}\), as these will directly affect the resultant \(z\) coordinate:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  P = \begin{bmatrix}&lt;br /&gt;
    \frac{d}{aspect} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; d &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; A &amp;amp; B \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; -1 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;When multiplying \(P\) with a point, this leaves us with the following \(z\) and \(w\) values (note, we&amp;#8217;re ignoring the rest of the matrix for now):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    A &amp;amp; B \\&lt;br /&gt;
    -1 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    z \\ 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    Az + B \\&lt;br /&gt;
    -z&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which can be dehomogenized to the following function:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \frac{Az + B}{-z} = -A &amp;#8211; \frac{B}{z}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;If you recall above the discussion about mapping \(-Z_{near}\) to -1 and \(-Z_{far}\) to +1, we get the following pair of equations by substituting \(-Z_{near}\) and \(-Z_{far}\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  -A + \frac{B}{Z_{near}} = -1&lt;br /&gt;
  \quad \quad \quad \quad&lt;br /&gt;
  -A + \frac{B}{Z_{far}} = +1&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;These simulatenous equations can be solved as follows. First, solving for \(A\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
    -A + \frac{B}{Z_{near}} = -1 &amp;amp;&lt;br /&gt;
    -A + \frac{B}{Z_{far}} = 1&lt;br /&gt;
    \\&lt;br /&gt;
    \frac{B}{Z_{near}} = A &amp;#8211; 1 &amp;amp;&lt;br /&gt;
    \frac{B}{Z_{far}} = A + 1&lt;br /&gt;
    \\&lt;br /&gt;
    B = Z_{near}(A &amp;#8211; 1) &amp;amp;&lt;br /&gt;
    B = Z_{far}(A + 1)&lt;br /&gt;
    \\&lt;br /&gt;
    B = A\,Z_{near} &amp;#8211; Z_{near} &amp;amp;&lt;br /&gt;
    B = A\,Z_{far} + Z_{far}&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    A\,Z_{near} &amp;#8211; Z_{near} &amp;amp;= A\,Z_{far} + Z_{far}\\&lt;br /&gt;
    A\,Z_{near} &amp;#8211; Z_{near} &amp;#8211; A\,Z_{far} &amp;amp;= Z_{far} \\&lt;br /&gt;
    A\,Z_{near} &amp;#8211; A\,Z_{far} &amp;amp;= Z_{far} + Z_{near}\\&lt;br /&gt;
    A(Z_{near} &amp;#8211; Z_{far}) &amp;amp;= Z_{far} + Z_{near} \\&lt;br /&gt;
    A &amp;amp;= \frac{Z_{far} + Z_{near}}{Z_{near} &amp;#8211; Z_{far}}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Next, solving for \(B\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
    -A + \frac{B}{Z_{near}} = -1 &amp;amp;&lt;br /&gt;
    -A + \frac{B}{Z_{far}} = 1 \\&lt;br /&gt;
    -A = -1 &amp;#8211; \frac{B}{Z_{near}} &amp;amp;&lt;br /&gt;
    -A = 1 &amp;#8211; \frac{B}{Z_{far}} \\&lt;br /&gt;
    A = 1 + \frac{B}{Z_{near}} &amp;amp;&lt;br /&gt;
    A = -1 + \frac{B}{Z_{far}}&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    1 + \frac{B}{Z_{near}} &amp;amp;= -1 + \frac{B}{Z_{far}} \\&lt;br /&gt;
    2 + \frac{B}{Z_{near}} &amp;amp;= \frac{B}{Z_{far}} \\&lt;br /&gt;
    2 &amp;amp;= \frac{B}{Z_{far}} &amp;#8211; \frac{B}{Z_{near}} \\&lt;br /&gt;
    2 &amp;amp;= \frac{Z_{near}B}{Z_{near}Z_{far}} &amp;#8211; \frac{Z_{far}B}{Z_{far}Z_{near}} \\&lt;br /&gt;
    2 &amp;amp;= \frac{Z_{near}B &amp;#8211; Z_{far}B}{Z_{near}Z_{far}} \\&lt;br /&gt;
    2 &amp;amp;= \frac{B(Z_{near} &amp;#8211; Z_{far})}{Z_{near}Z_{far}} \\&lt;br /&gt;
    2\,Z_{near}Z_{far} &amp;amp;= B(Z_{near} &amp;#8211; Z_{far}) \\&lt;br /&gt;
    \frac{2\,Z_{near}Z_{far}}{Z_{near} &amp;#8211; Z_{far}} &amp;amp;= B&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Finally, we can inset this back into our final gluPerspective transformation matrix, \(P\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  P = \begin{bmatrix}&lt;br /&gt;
    \frac{d}{aspect} &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; d &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; \frac{Z_{far} + Z_{near}}{Z_{near} &amp;#8211; Z_{far}} &amp;amp; \frac{2\,Z_{near}Z_{far}}{Z_{near} &amp;#8211; Z_{far}} \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; -1 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Nonlinear mapping&lt;/h3&gt;
&lt;p&gt;The \(z\) mapping discussed just above is a nonlinear mapping, and is actually just one of many different proposed \(z\) mappings. However, all proposed \(z\) mappings are nonlinear.&lt;/p&gt;
&lt;p&gt;This particular mapping has the benefit of being able to handle a wide range of values \(z\) values, as \(\frac{1}{\infty} \to 0\) and \(frac{1}{100} = 0.01\), which are not significantly different from each other. This gives the \(z\) mapping a large degree of flexibility.&lt;/p&gt;
&lt;p&gt;Unfortunately, it also leads to a non-uniform resolution, favoring objects close to the viewing plane. This means that objects that are closer will have more resolution to them, and objects that are further have less.&lt;/p&gt;
&lt;p&gt;However, do not make the mistake of setting the near plane to 0. If you set the near plane to 0, you&amp;#8217;re giving every object in the scene a resolution of 0, and will result in nonsense projections.&lt;/p&gt;
&lt;h2&gt;The Whole Viewing Pipeline&lt;/h2&gt;
&lt;p&gt;The whole viewing pipeline is all of the transformations and steps we&amp;#8217;ve discussed performed in sequence:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/edxcg/pipeline.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Usually these transform matrices will be rolled up into a single matrix, however the transformation into the eye coordinates might be saved separatenly for lighting. Lighting is performed in 3D right at the end before we project to 2D. More details on lighting will be covered in later units.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>edX Foundations of Computer Graphics - Unit 0</title>
   <link href="http://www.timgittos.com/learning/edx-foundations-of-computer-graphics/unit-0"/>
   <updated>2012-11-08T13:56:00-08:00</updated>
   <id>http://www.timgittos.com/learning/edx-foundations-of-computer-graphics/unit-0</id>
   <content type="html">&lt;h2&gt;Goals of the course&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Write complex 3D graphics programs, using both an online real-time OpenGL and an offline raytracer.&lt;/li&gt;
	&lt;li&gt;Learn theory such as mathematical aspects and algorithms that underly 3D computer graphics.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Why study 3D computer graphics?&lt;/h3&gt;
&lt;p&gt;There is a fundamental intellectual challenge behind studying computer graphics. In order to create an interact with a realisitic virtual world, you need to have an understanding of all aspects of the physical world, as well as computing methods, displays and other technology.&lt;/p&gt;
&lt;p&gt;When it comes to implementing these understandings, there are a number of technical challenges. You need to understand various aspects of math, such as projections (especially perspective), curves and surface equations. You need to understand the physics of lighting and shading (optics). Finally, you need to know about 3D graphics software programming and hardware, the algorithms and data structures that you will use to bring it all to life.&lt;/p&gt;
&lt;h3&gt;The 3D graphics pipeline&lt;/h3&gt;
&lt;ol&gt;
	&lt;li&gt;Modeling &amp;#8211; creating a polygon mesh of objects we want to model.&lt;/li&gt;
	&lt;li&gt;Animation &amp;#8211; if you want motion. This course does not deal with this.&lt;/li&gt;
	&lt;li&gt;Rendering &amp;#8211; simulating light in the scene.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Homework&lt;/h3&gt;
&lt;ol&gt;
	&lt;li&gt;Testing knowledge of transformations by building a real time viewer for a 3D teapot.&lt;/li&gt;
	&lt;li&gt;Real time scene viewer with lighting and shading implemented in OpenGL with the &lt;span class=&quot;caps&quot;&gt;GLSL&lt;/span&gt; shading language (rasterization)&lt;/li&gt;
	&lt;li&gt;Create realistic images with an offline ray tracer (ray tracing)&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Ray tracing vs. rasterization&lt;/h3&gt;
&lt;p&gt;Rasterization is essentially going through geometric primitives and determining where on the screen, if at all, it should be drawn. This is in terms of which pixel does this primitive own. Ray tracing does the opposite, and iterates through each pixel in an image and determines which geometric primitive should it belong to.&lt;/p&gt;
&lt;p&gt;More details will be forthcoming in further lectures.&lt;/p&gt;
&lt;h2&gt;History of computer graphics&lt;/h2&gt;
&lt;h3&gt;2D computer graphics&lt;/h3&gt;
&lt;p&gt;The term computer graphics was first coined by Willian Fetter of Boeing in 1960, even though the first graphics systems were developed in the mid 1950s by &lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt; for the US Air Force, used in the &lt;span class=&quot;caps&quot;&gt;SAGE&lt;/span&gt; radar systems.&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;420&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/06drBN8nlWg&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Text itself is a landmark in computer graphics. Turing&amp;#8217;s Manchester Mark 1 had only a bank of &lt;span class=&quot;caps&quot;&gt;LED&lt;/span&gt; lights that represented memory content. The proper display of text and the way fonts are rendered to give a smooth appearance was one of the early problems in 2D computer graphics.&lt;/p&gt;
&lt;p&gt;From text, the next major advance was the concept of the Graphical User Interface, or &lt;span class=&quot;caps&quot;&gt;GUI&lt;/span&gt;, which was invented at Xerox Palo Alto Research Center (Xerox &lt;span class=&quot;caps&quot;&gt;PARC&lt;/span&gt;) around 1975, and used in the Xerox Star released in 1981. After Xerox, Apple released the Apple Lisa, which implemented a &lt;span class=&quot;caps&quot;&gt;GUI&lt;/span&gt; as well as what we know today of a menu bar in 1983. The Apple Lisa was the first computer to offer a &lt;span class=&quot;caps&quot;&gt;GUI&lt;/span&gt; in an inexpensive machine aimed at individual business users.&lt;/p&gt;
&lt;p&gt;In 1963, Ivan Sutherland at &lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt; developed a piece of software called Sketchpad, which was a light pen based software application that allows the user to draw images on a computer. It also introduced many concepts in modern GUIs such as pop up menus, constraint based drawing and hierarchical modeling.&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;420&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/USyoT_Ha_bA&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;420&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/BKM3CmRqK2o&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;After Sketchpad came paint systems, the pioneer of which was SuperPaint, developed by Xerox &lt;span class=&quot;caps&quot;&gt;PARC&lt;/span&gt; in 1973. SuperPaint was the originator of a whole genre of computer graphics software such as Adobe Photoshop and Paint Shop Pro, etc.&lt;/p&gt;
&lt;p&gt;Now, 2D computer graphics are used to manipulate and process images and video. Functions such as cropping, scaling and compositing, in all aspects of like such as television and advertising.&lt;/p&gt;
&lt;h3&gt;3D computer graphics&lt;/h3&gt;
&lt;h4&gt;Geometric modeling&lt;/h4&gt;
&lt;p&gt;Geometric modeling is the process of creating 3D geometry. In the 70&amp;#8217;s and 80&amp;#8217;s, a major development in the field was the creation of spline curves and surfaces. One of the arguably most famouse 3D images is the Utah Teapot, which was made using these techniques, created at the University of Utah.&lt;/p&gt;
&lt;p&gt;Now, most 3D geometry is represented by a mesh of triangles, and advances in this field involve the accurate representation of triangles and tesselation and subdivision algorithms, which increase the level of detail of triangle meshes without increasing the geometry stored.&lt;/p&gt;
&lt;h4&gt;Rendering&lt;/h4&gt;
&lt;p&gt;During the 1960&amp;#8217;s, the main fundemental problem being solved in computer graphics was that of handling visibility and hidden line/surface removal. Through this time, a number of algorithms and techniques were created.&lt;/p&gt;
&lt;p&gt;In 1963, L. G. Roberts published the paper &amp;#8220;Machine Perception of Three Dimensional Solids&amp;#8221;, detailing the first algorithm to solve the problem of hidden line removal. He proposed that &amp;#8220;an edge may be obscured by the volume of an object that lies between the edge and the viewpoint&amp;#8221; Sutherland (1974).&lt;/p&gt;
&lt;p&gt;Robert&amp;#8217;s way was only one way, however, and soon others found more approaches to solve the problem. These can be divided into hidden line removal, and hidden surface removal.&lt;/p&gt;
&lt;p&gt;With respect to hidden line removal, a number of algorithms were created. A. Appel in 1967 with the paper &amp;#8220;The Notion of Quantitative Invisibility and the Machine REndering of Solids&amp;#8221;, P. P. Loutrel in 1967 with the paper &amp;#8220;A Solution to the Hidden-Line Problem for Computer-Drawn Polyhedra&amp;#8221; and R. Galimberti and U. Montanari in 1969 with the paper &amp;#8220;An Algorithm for Hidden Line Elimination&amp;#8221; all proposed testing edges against other edges, and storing edges to compare against other edges that share vertices.&lt;/p&gt;
&lt;p&gt;With respect to hidden surface removal, two standout algorithms were created. J. E. Warnock in 1968 with the paper &amp;#8220;A Hidden-Surface Algorithm for Computer-Generated Halftone Pictures&amp;#8221; describes an algorithm that creates sample areas on the screen and the algorithm traverses each face to be rendered, and checks it&amp;#8217;s interaction with the sample window, and takes action based on that. G. S. Watkins in 1970 with the paper &lt;a href=&quot;http://bitsavers.trailing-edge.com/pdf/univOfUtah/UTECH-CSc-70-101_Watkins_Dissertation_Jun70.pdf&quot;&gt;&amp;#8220;A Real-Time Visible Surface Algorithm&amp;#8221;&lt;/a&gt; describes a similar algorithm.&lt;/p&gt;
&lt;p&gt;Finally, I. E. Sutherland, R. F. Sproull and R. A. Shumacker published a paper in 1974, &lt;a href=&quot;http://design.osu.edu/carlson/history/PDFs/ten-hidden-surface.pdf&quot;&gt;&amp;#8220;A Characterization of Ten Hidden Surface Algorithms&amp;#8221;&lt;/a&gt; outlined algorithms of Sproull and Shumacker that organized surfaces in a priority list, and used the list to determine visibility.&lt;/p&gt;
&lt;p&gt;While visibility was being solved, several advances in the rendering of actual surfaces were also taking place. In 1971, H. Gouraud published a paper entitled &amp;#8220;Computer Display of Curved Surfaces&amp;#8221;, where he described a technique of lighting and rednering geometric survaces as if they were curved. The result is a matte diffusely lit product that looks more round than it is.&lt;/p&gt;
&lt;p&gt;In 1975, Bui Tuong Phong published the paper &amp;#8220;Illumination for Computer Generated Pictures&amp;#8221;, which built on Gouraud&amp;#8217;s work and developed an algorithm to add specular highlighting to geometric models.&lt;/p&gt;
&lt;p&gt;Jim Blinn in turn built on Phong&amp;#8217;s work as well as some of his own. In 1976 he released a paper entitled &amp;#8220;Texture and Reflection In Computer Generated Images&amp;#8221; and a paper &amp;#8220;Simulation of Wrinkled Surfaces, Computer Graphics&amp;#8221; in 1978, both of which introduce texturing and bump mapping, and he improved on Phong&amp;#8217;s lighting algorithm in the 1977 paper &amp;#8220;Models of Light Reflection for Computer Synthesized Pictures&amp;#8221;.&lt;/p&gt;
&lt;p&gt;In 1974, Ed Catmull published the paper &lt;a href=&quot;http://www.pixartouchbook.com/storage/catmull_thesis.pdf&quot;&gt;&amp;#8220;A Subdivision Algorithm for Computer Display of Curved Surfaces&amp;#8221;&lt;/a&gt;&lt;br /&gt;
Ed Catmull. Although the paper is about subdivision of curved surfaces, he outlines the method known today as Z-Buffer hidden surface removal.&lt;/p&gt;
&lt;p&gt;As graphics progressed into the 1980&amp;#8217;s, the focus seemed to shift toward the development of lighting algorithms, specifically, solving problems with global illumination.&lt;/p&gt;
&lt;p&gt;In 1980, T. Whitted introduced the world to ray-tracing in the paper &lt;a href=&quot;https://www.cs.drexel.edu/~david/Classes/CS586/Papers/p343-whitted.pdf&quot;&gt;&amp;#8220;An improved illumination model for shaded display&amp;#8221;&lt;/a&gt; . Ray-tracing was a new method of calculating global illumination that will be covered in detail later in the course.&lt;/p&gt;
&lt;p&gt;The 1984 paper &amp;#8220;Modeling the Interaction of Light Between Diffuse Surfaces&amp;#8221; by C. Goral, K. Torrance, D. Greenberg and B. Battaile described a method of calculating radiosity in computer images. Radiosity is the color bleed effect, when light bouncing off of a colored surface will color other surfaces.&lt;/p&gt;
&lt;p&gt;All of this research culminated in the paper &amp;#8220;The Rendering Equation&amp;#8221;, a paper by J. Kajiya published in 1986. The rendering equation is an integral equation which describes the total amount of light emmitted from a point along a particular viewing direction, given a function for incoming light and a Bidirectional Reflectance Distribution Function (&lt;span class=&quot;caps&quot;&gt;BRDF&lt;/span&gt;).&lt;/p&gt;
&lt;p&gt;There are a number of aspects of lighting that that the rendering equation doesn&amp;#8217;t cover, including&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;phosphorescence &amp;#8211; light absorbed at one moment in time and emitted at another&lt;/li&gt;
	&lt;li&gt;fluorescence &amp;#8211; absorbed and emitted light are different wavelenths (colors)&lt;/li&gt;
	&lt;li&gt;interference &amp;#8211; light displays it&amp;#8217;s wave properties&lt;/li&gt;
	&lt;li&gt;subsurface scattering &amp;#8211; spatial locations of incoming and departing light are different&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These days, advances are made in perfecting the rendering equation (global illumination) to create photo-realistic images, and real time ray tracing.&lt;/p&gt;
&lt;p&gt;More details on the history of computer graphics can be found from these articles:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://design.osu.edu/carlson/history/lessons.html&quot;&gt;http://design.osu.edu/carlson/history/lessons.html&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.cgsociety.org/index.php/CGSFeatures/FeaturePrintable/3d_rendering_history_part_1._humble_beginnings&quot;&gt;http://www.cgsociety.org/index.php/CGSFeatures/FeaturePrintable/3d_rendering_history_part_1._humble_beginnings&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.cgsociety.org/index.php/CGSFeatures/FeaturePrintable/3d_rendering_history_pt.2_-_to_photorealism_and_beyond&quot;&gt;http://www.cgsociety.org/index.php/CGSFeatures/FeaturePrintable/3d_rendering_history_pt.2_-_to_photorealism_and_beyond&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Computer animation&lt;/h3&gt;
&lt;p&gt;Given that the course is about rendering 3D graphics, it doesn&amp;#8217;t delve deeply into the history of computer animation. However, you can find some information in the following videos, which are a cut down and edited version of &amp;#8220;The Science of Animation&amp;#8221;:&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;420&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/LzZwiLUVaKg&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;420&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/S3hqS6JlKEc&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;h2&gt;Math review&lt;/h2&gt;
&lt;h3&gt;Vectors&lt;/h3&gt;
&lt;p&gt;Dot product as growth in a dimension: http://betterexplained.com/articles/vector-calculus-understanding-the-dot-product/&lt;/p&gt;
&lt;p&gt;Cross product as finding a vector orthogonal to two other vectors.&lt;/p&gt;
&lt;h3&gt;Coordinate frames&lt;/h3&gt;
&lt;p&gt;A coordinate frame is any set of n vectors in n dimensional space such that:&lt;br /&gt;
- |u| = |v| = |w| = 1 (unit vectors)&lt;br /&gt;
- u . v = v . w = w . u = 0 (mutually orthogonal)&lt;br /&gt;
- w = u x w (obeys right hand rule via cross product)&lt;/p&gt;
&lt;p&gt;A vector can be written in terms of it&amp;#8217;s projection onto the vectors of the base. Consider vector p.&lt;br /&gt;
p = (p . u)u + (p . v)v + (p . w)w&lt;/p&gt;
&lt;p&gt;Why construct a coordinate frame? Generate camera space from a looking direction and a canonical up direction.&lt;/p&gt;
&lt;p&gt;Construct a coordinate frame from two vectors, a and b, that are not orthogonal or unit vectors.&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Normalize a = w&lt;/li&gt;
	&lt;li&gt;Find u = b x w, normalize&lt;/li&gt;
	&lt;li&gt;Find v = u x w, normalize&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Then both a and b can be expressed as part of the same basis.&lt;/p&gt;
&lt;h3&gt;Matricies&lt;/h3&gt;
&lt;p&gt;For a more detailed dive, check out &lt;a href=&quot;/learning/mit-linear-algebra/&quot;&gt;my &lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt; linear algebra notes&lt;/a&gt; .&lt;/p&gt;
&lt;p&gt;Dot product = a . b = a^T b&lt;br /&gt;
Cross product = a x b = A* b where A* is a dual matrix of A. I haven&amp;#8217;t covered this in linear algebra yet.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>edX Foundations of Computer Graphics</title>
   <link href="http://www.timgittos.com/learning/edx-foundations-of-computer-graphics"/>
   <updated>2012-11-08T13:56:00-08:00</updated>
   <id>http://www.timgittos.com/learning/edx-foundations-of-computer-graphics</id>
   <content type="html">&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;THIS&lt;/span&gt; IS A &lt;span class=&quot;caps&quot;&gt;PLACEHOLDER&lt;/span&gt; SO &lt;span class=&quot;caps&quot;&gt;THAT&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;THE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;APPEARS&lt;/span&gt; IN &lt;span class=&quot;caps&quot;&gt;THE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;PROJECT&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;LIST&lt;/span&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Mind the Taste Gap</title>
   <link href="http://www.timgittos.com/blog/mind-the-taste-gap"/>
   <updated>2012-11-06T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/mind-the-taste-gap</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve been drawing in some form or another for a very long time. I can remember the instant I decided that it was something I wanted to pursue &amp;#8211; I saw a really cool illustration of Nintendo&amp;#8217;s Link in a magazine for the Ocarina of Time release. I started by tracing that picture, and continued from there.&lt;/p&gt;
&lt;p&gt;When my brother and I were young, I remember a few occasions where he would ask me to teach him to draw, because he wanted to draw but couldn&amp;#8217;t. I would try to teach him, and he would try to draw, and eventually he would give up in disgust at his own crappy work.&lt;/p&gt;
&lt;p&gt;I didn&amp;#8217;t realize back then, but he fell into the &amp;#8220;taste gap&amp;#8221;. The &amp;#8220;taste gap&amp;#8221; is the difference between what you like, and what you produce. Ira Glass covers it in this video:&lt;/p&gt;
&lt;p&gt;&lt;iframe width=&quot;420&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/BI23U7U2aUY&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Somehow I made it past the taste gap, after I saw that picture of Link. Whatever caught my brother&amp;#8217;s eye about drawing made him want to try. Maybe it was my work. Maybe not. But he didn&amp;#8217;t make it past the disappointment in his own work.&lt;/p&gt;
&lt;p&gt;If I could go back in time, I would tell him to not worry. I would tell him that it&amp;#8217;s OK to suck, because he was just started. I would tell him to draw as much as he can, to work through all the suck. It&amp;#8217;s why writers write drafts, why concept artists do thumbnails. It&amp;#8217;s why programmers refactor. If you get all the obvious, less than impressive stuff out first, you&amp;#8217;ll start to put out some gems of work.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m very interested in the Zen concept of beginners mind. I can recall several instances where my ignorance into a topic allowed me to perform very well in those topics. When I was 13, I wrote a clone of the then popular children&amp;#8217;s toy the Tamagotchi in Logo. I didn&amp;#8217;t know anything about programming when I started. I think there&amp;#8217;s some relationship between the &amp;#8220;taste gap&amp;#8221; and beginners mind. Maybe the &amp;#8220;taste gap&amp;#8221; defeats beginners mind, by putting a standard which we hold ourselves to.&lt;/p&gt;
&lt;p&gt;Likewise, I think being able to put yourself into the beginners mind can help overcome the &amp;#8220;taste gap&amp;#8221;. If you concentrate on quantity rather than quality, on deliberate practice instead of trying to reach your taste goal, you can overcome that gap, and put yourself onto the road of being able to reach that goal after all. I believe this applies to all aspects of life.&lt;/p&gt;
&lt;p&gt;If you find yourself getting frustrated by the quality of your output, realize it&amp;#8217;s because you&amp;#8217;re running into that &amp;#8220;taste gap&amp;#8221;, and realize that as you work, you are closing that gap. Don&amp;#8217;t give up, just keep on producing.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Becoming a Game Developer</title>
   <link href="http://www.timgittos.com/blog/becoming-a-game-developer"/>
   <updated>2012-06-27T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/becoming-a-game-developer</id>
   <content type="html">&lt;p&gt;Ever since I started programming, I have always been interested in making games. I can remember one of my first major programming experiences was when I was 13, in language called &lt;a href=&quot;http://en.wikipedia.org/wiki/Logo_(programming_language)&quot;&gt;Logo&lt;/a&gt; . I duplicated the functionality of a &lt;a href=&quot;http://en.wikipedia.org/wiki/Tamagotchi&quot;&gt;Tamagotchi&lt;/a&gt; , where the player had to take care of this little critter. I even had evolution, if I remember correctly. My interest in graphics and AI can find it&amp;#8217;s roots in my interest in game development.&lt;/p&gt;
&lt;p&gt;Once I got a professional career in development, and heard some of the horror stories of &lt;span class=&quot;caps&quot;&gt;AAA&lt;/span&gt; game development, I shelved the dream indefinitely. The recent successes of Minecraft and other indie studios/games have reignited my interest in game development. I&amp;#8217;m not about to do anything drastic like quit my day job and go chasing after a game development studio, but tinkering in game development on the side sounds like it might be fun.&lt;/p&gt;
&lt;p&gt;Of course, game development is a very different beast from web development, and I know that I&amp;#8217;ll essentially be starting from scratch, much like many young, aspiring game developers.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;ve ever spent any time at a developer forum or social site, you&amp;#8217;ll be familiar with the throngs of game development newbies who are clamouring for information on how to get started on their huge 3D &lt;span class=&quot;caps&quot;&gt;MMORPG&lt;/span&gt; game idea, before being brought back down to earth by those who know better. The same questions come up time and time again &amp;#8211; what language should I program in? How do I get started?&lt;/p&gt;
&lt;p&gt;The path for each game developer at the learning phase of their careers seems to be similar &amp;#8211; pick a language, start writing some really basic games. Apply proper polish such as saving, menu screens, splash screens, etc and then iterate.&lt;/p&gt;
&lt;p&gt;Due to this, I thought it might be fun to publish my learning experience online, so that maybe these kinds of questions can be answered with &amp;#8220;do what that guy did, he put &lt;span class=&quot;caps&quot;&gt;EVERYTHING&lt;/span&gt; online.&amp;#8221; To that end, I am writing a blog called &lt;a href=&quot;http://blog.confirmedcrit.com&quot;&gt;Confirmed Crit&lt;/a&gt; where I write about everything that happens. So much so that I have a tool that will create blog posts out of git commits. Combine that with Literati, and literally every piece of code I write should be reasonably explained and open for examination.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not intending on shutting this blog down, or not posting here, but I felt my game development trials and tribulations deserved their own home. I&amp;#8217;d love for anyone who reads this blog and is interested in game development to checkout &lt;a href=&quot;http://blog.confirmedcrit.com&quot;&gt;Confirmed Crit&lt;/a&gt; and follow along in my journey.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Free Online Education is Blowing Up</title>
   <link href="http://www.timgittos.com/blog/free-online-education-blowing-up"/>
   <updated>2012-04-19T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/free-online-education-blowing-up</id>
   <content type="html">&lt;p&gt;At the end of 2011, I participated in 2 of 3 free, online courses offered from professors from Stanford University in an experiment in online education. From that experiment, 2 new startups spun out of Stanford &amp;#8211; Udacity and Coursera. Since then, both Coursera and Udacity have started to increase their class offerings, and now a wide variety of university level classes can be taken online for free.&lt;/p&gt;
&lt;p&gt;Those who know about MIT&amp;#8217;s OpenCourseWare program and iTunes U have known for a while that these courses were there for taking anyway. The difference between those and the courses offered by Coursera and Udacity is one of time and deadlines. The &lt;span class=&quot;caps&quot;&gt;OCW&lt;/span&gt; and iTunes U video lectures are available online, always. No time limits. The Coursera and Udacity courses run on a strict time frame, and have weekly deadlines for homework. This helps you stay on track and provides a basic level of accountability.&lt;/p&gt;
&lt;p&gt;I just finished Udacity&amp;#8217;s AI for Robotics class, and as a result of a particularly busy period of work, I&amp;#8217;ve had to miss out on some great courses offered by Coursera. At first I thought the online classes I&amp;#8217;ve been taking were just a one off, a 12 week event that once finished, I walked away from.&lt;/p&gt;
&lt;p&gt;Coursera are offering several computer vision classes, and I&amp;#8217;ve been saving the videos from the natural language processing course. I&amp;#8217;m now starting to realize that this online learning is going to become a regular part of my life, like working and socializing. I&amp;#8217;m more than OK with this, it just means having to juggle things around in my life.&lt;/p&gt;
&lt;p&gt;I think this sort of continuous learning should be a part of everyone&amp;#8217;s life. If you haven&amp;#8217;t checked out the offerings from Coursera or Udacity, I suggest you do so. Chances are one of the courses will pique your interest. Sign up. Spend 2 hours a week watching lectures instead of TV. The worst that can happen is you fail an online class you previously weren&amp;#8217;t thinking of taking.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Udacity AI for Robotics - Week 6</title>
   <link href="http://www.timgittos.com/learning/udacity-ai-for-robotics/week-6"/>
   <updated>2012-03-26T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/learning/udacity-ai-for-robotics/week-6</id>
   <content type="html">&lt;h2&gt;Putting It All Together&lt;/h2&gt;
&lt;p&gt;Localization to determine where in the map you are&lt;br /&gt;
Planning to plot a route from current suspected location to goal&lt;br /&gt;
&lt;span class=&quot;caps&quot;&gt;PID&lt;/span&gt; to smooth the planned route&lt;/p&gt;
&lt;h3&gt;&lt;span class=&quot;caps&quot;&gt;CTE&lt;/span&gt; Revisited&lt;/h3&gt;
&lt;p&gt;Computing &lt;span class=&quot;caps&quot;&gt;CTE&lt;/span&gt; for arbirary vector trajectories&lt;br /&gt;
&lt;img src=&quot;/images/air/ctevector.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span class=&quot;caps&quot;&gt;SLAM&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Every localization technique thus far has required the agent to have predefined knowledge of it&amp;#8217;s environment before being able to navigate it&amp;#8217;s way through it.&lt;/p&gt;
&lt;p&gt;Simultaneous localization and mapping, or &lt;span class=&quot;caps&quot;&gt;SLAM&lt;/span&gt;, removes that constraint. The difficulty of doing this is that robot motion and sensing is uncertain.&lt;/p&gt;
&lt;h3&gt;Linear GraphSLAM&lt;/h3&gt;
&lt;p&gt;Assume an agent starts at a location \(x_0 = 0, y_0 = 0\). The agent has a perfect compass and doesn&amp;#8217;t need to keep a belief state about orientation. The robot has no knowledge of the environment.&lt;/p&gt;
&lt;p&gt;If the agent moves 10 &amp;#8220;units&amp;#8221;, under perfect motion it will be at \(x_1 = 10, y_1 = y_0 \). However, an agent&amp;#8217;s movement is uncertain, so it&amp;#8217;s final location is represented by a Gaussian distribution, centered at \(x_1 = x_0 + 10, y_1 = y_0\):&lt;br /&gt;
&lt;img src=&quot;/images/air/graphslam.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
and the Gaussian is given by the formula:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{1}{\sqrt{2 \pi \sigma^2}} exp &amp;#8211; \frac{1}{2} \frac{(x_1 &amp;#8211; x_0 &amp;#8211; 10)^2}{\sigma^2} \frac{1}{\sqrt{2 \pi \sigma^2}} exp &amp;#8211; \frac{1}{2} \frac{(y_1 &amp;#8211; y_0)^2}{\sigma^2}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This Gaussian is a constraint on the location of the agent. It&amp;#8217;s initial location is a constraint, each relative motion introduces new constraints and every observed landmark introduces a relative measurement constraint.&lt;/p&gt;
&lt;h3&gt;Implementation&lt;/h3&gt;
&lt;p&gt;Implementing GraphSLAM involves tracking the constraints observed above in relation to each other. To do this, a matrix is used.&lt;/p&gt;
&lt;p&gt;Suppose an agent moves from a starting position \(x_0\) to points \(x_1\) and \(x_2\).&lt;br /&gt;
While travelling on this path, it observes 2 landmarks, \(l_0\) and \(l_1\).&lt;/p&gt;
&lt;p&gt;The constraints on each pose and each landmark are represented as follows:&lt;br /&gt;
&lt;img src=&quot;/images/air/gsmatrix.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The matrix, \(\Omega\), represents the constraint between each pose and landmark. The vector, \(\xi\) represents the sum of all constraints on each pose and landmark. Each constraint is initialized as zero, and as movement and observations occur, the constraints are added into the matrix.&lt;/p&gt;
&lt;p&gt;For example, consider an agent starting at \(x_0\). The agent moves 5 units to \(x_1\).&lt;br /&gt;
The position of \(x_1\) subtracted from \(x_0\) should equal -5, which means that \(x_1\) should be 5 units further than \(x_0\). Likewise, \(x_0\) subtracted from \(x_1\) should equal 5.&lt;br /&gt;
&lt;img src=&quot;/images/air/gsmatrix2.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Each additional constraint is added to the last.&lt;/p&gt;
&lt;p&gt;Next, the agent moves 9 units from point \(x_1\) to point \(x_2\). \(\Omega\) and \(\xi\) are updated as follows:&lt;br /&gt;
&lt;img src=&quot;/images/air/gsmatrix3.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When determining the location of each pose and landmark, this operation can be performed with a simple algorithm:&lt;br /&gt;
\[&lt;br /&gt;
  \mu = \Omega^{-1} \xi&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This will use all the constraints collected at that point in time to estimate the location of each pose and landmark. As the matrix fills and is updated, the more accurate these estimations will become.&lt;/p&gt;
&lt;h3&gt;Confidence measure&lt;/h3&gt;
&lt;p&gt;Consider again the formula for a Gaussian distribution:&lt;br /&gt;
\[&lt;br /&gt;
    \frac{1}{\sqrt{2 \pi \sigma^2}} exp &amp;#8211; \frac{1}{2} \frac{(x_1 &amp;#8211; x_0 &amp;#8211; 10)^2}{\sigma^2} &lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The above Gaussian tries to maximize this equation, finding the largest values of \(x_1\) and \(x_0\) that satisfies the constraint of being 10 units apart.&lt;/p&gt;
&lt;p&gt;In the above equation, the first fraction is a constant, and thus can be ignored when considering the core of the formula. Likewise, the exponentail and the second fraction can be ignored.&lt;/p&gt;
&lt;p&gt;What is left is the following relationship:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  &amp;amp;\frac{1}{\sigma^2}(x_1 &amp;#8211; x_0 &amp;#8211; 10)^2 \\&lt;br /&gt;
  &amp;amp;\frac{1}{\sigma}(x_1 &amp;#8211; x_0 &amp;#8211; 10)&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\(\sigma\) is known as the confidence measure, or a measure of uncertainty. When \(\sigma\) is small, GraphSLAM weights the constraint higher, which means it will adhere to that constraint much more heavily than the others. Likewise when it is large, the constraint is relaxed more than the others.&lt;/p&gt;
&lt;p&gt;Previous examples were dealing with a \(\sigma\) of 1, which doesn&amp;#8217;t change the weighting of a constraint.&lt;/p&gt;
&lt;p&gt;The confidence measure is a way of representing noise in the scenario. If a sensor or motion is very noisy, you can give that sensor&amp;#8217;s readings a high \(\sigma\). Each sensor or motion can have a different confidence measure.&lt;/p&gt;
&lt;h3&gt;Drawbacks in GraphSLAM&lt;/h3&gt;
&lt;p&gt;The \(\Omega\) matrix in GraphSLAM grows linearly with the length of the path, no matter the size of the environment the agent is in. This leads to a case where when an agent has been running for a long time, \(\Omega\) is a lot larger than the environment, and it can get so large that the agent will eventually stop.&lt;/p&gt;
&lt;p&gt;The solution is to run &lt;span class=&quot;caps&quot;&gt;SLAM&lt;/span&gt; online &amp;#8211; keep only the most recent position in \(\Omega\):&lt;br /&gt;
&lt;img src=&quot;/images/air/online-slam.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Udacity AI for Robotics - Week 5</title>
   <link href="http://www.timgittos.com/learning/udacity-ai-for-robotics/week-5"/>
   <updated>2012-03-19T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/learning/udacity-ai-for-robotics/week-5</id>
   <content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Previously discrete robot motion was discussed, where the world was split into discrete nodes and a path was found through these discrete nodes. This is impractical for the real world, as the paths and plans found does not suit the actual motion of robots, and are often sub-optimal.&lt;/p&gt;
&lt;h2&gt;Smoothing&lt;/h2&gt;
&lt;p&gt;In order to produce continuous robot motion, a smoothing algorithm is applied to the discrete path found by techniques covered in Week 4, rather than tackling the complex and expensive task of finding a path in a continuous problem space.&lt;/p&gt;
&lt;p&gt;Going back to Week 4, where the world was discretized into cells or nodes. Consider a world of \(n\) nodes, and label each node \(x_i\), where the range of nodes is \(x_0 \ldots x_{n-1}\).&lt;br /&gt;
The general idea behind the smoothing algorithm is as such:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;\(y_i = x_i\)&lt;/li&gt;
	&lt;li&gt;\(min (x_i &amp;#8211; y_i)^2\) and \(min (y_i + y_{i+1})^2 \)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;where \(y_i\) is the new, smoothed \(x_i\). Step 2 is minimizing the difference between the new, smoothed node and the old discrete node, and minimizing the difference between the new smoothed node and the next smoothed node. These minimizations are competing, so they are performed with a weighting so as to control the smoothness of a path vs. the exactness of the path:&lt;br /&gt;
\[&lt;br /&gt;
  y_i = y_i + \alpha (x_i &amp;#8211; y_i)^2&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The last equation can be improved by comparing the points both before and after the current point:&lt;br /&gt;
\[&lt;br /&gt;
  y_i = y_i + \beta (y_{i+1} + y_{i-1} &amp;#8211; 2y_i)&lt;br /&gt;
\]&lt;br /&gt;
The above shows that \(y_i\) is simulatenously close to both \(y_{i+1}\) and \(y_{i-1}\).&lt;/p&gt;
&lt;p&gt;\(\beta\) controls how much smooting is done, and \(\alpha\) controls how close to the original path the smoothed path stays.&lt;/p&gt;
&lt;h3&gt;Code&lt;/h3&gt;
&lt;/notextile&gt;

h2. PID Control

PID control is a vast field, so only the basics will be covered.

h3. P Controller

A P controller will align an agent to a predefined path, called a reference trajectory. It does so by correcting the heading of the agent proportionally to the crosstrack error, giving the P in the P controller The crosstrack error is the error between the desired trajectory and the current trajectory. The larger the CTE, the more the heading is changed to reduce the CTE.

A rough way of modelling this is with the following formula:

\[
  \alpha = - \tau \; \text{CTE}
\]

However, the above equation will overshoot the reference trajectory, as although the wheels will be pointing straight once the agent is on the target trajectory, the agent itself will not be straight.
This will cause it to oscillate between overshooting and undershooting the reference trajectory. This state is known as being marginally stable, or just stable.

To solve the oscillation with the P controller, there is the PD controller

h3. PD Controller

The PD controller is a P controller augmented by taking into consideration the rate of change of the CTE (differential CTE, D in PD controller). If the rate of change of the CTE is high, the steering backs off quite a bit. As the rate of change of the CTE drops, the steering approaches that of a P controller more accurately. This can be modelled as follows:
\[
  \alpha = - \tau_P \; \text{CTE} \; - \tau_D \frac{\delta}{\delta t} \text{CTE}
\]

h3. Bias

A problem with real life agents is one of steering bias. The above models assume the agent is absolutely aligned, however the actual bearing of an agent may not be it's actual bearing - this is a bias in it's steering. This will cause the P and PD controllers to have a consistent CTE error that is proportional to the bias.

The solution is to correct for the observed error over a time window with the PID controller

h3. PID Controller

The PID controller is a PD controller augmented by taking into consideration the integral of the CTE, (I in PID controller) or the observed error over time. This can be modelled with the following:
\[
  \alpha = - \tau_P \; \text{CTE} \; - \tau_D \frac{\delta}{\delta t} \text{CTE} \; - \tau_I \sum \text{CTE}
\]

h3. Coordinate Ascent or Twiddle

Choosing control gains (\(\tau_P, \tau_D, \tau_I\)) poses a small challenge. Coordinate ascent, or 'twiddle' can be used to find the optimal control gains.

Psuedo code for the 'twiddle' algorithm is as follows:

&lt;notextile&gt;&lt;p&gt;This algorithm is doing the following:&lt;/p&gt;
&lt;p&gt;Initialize p to be blank control gains, and dp to be the amount to change the p on each step. Run the &lt;span class=&quot;caps&quot;&gt;PID&lt;/span&gt; controller with blank control gains, and store that error.&lt;br /&gt;
While the sum of the dp is higher than sum threshold (which will indicate how precise the optimisation will be), do the following:&lt;br /&gt;
For each control param independently, add the delta and run the &lt;span class=&quot;caps&quot;&gt;PID&lt;/span&gt; controller. If the result is the best thus far, store it. If not, try subtracting the delta and run the &lt;span class=&quot;caps&quot;&gt;PID&lt;/span&gt; controller. If the result is the best thus far, store it. If not, reduce the delta and wait to try again.&lt;/p&gt;
&lt;p&gt;This will find the optimal control gain within a tolerance threshold.&lt;/p&gt;
&lt;h3&gt;Code:&lt;/h3&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Single Variable Calculus - Week 5</title>
   <link href="http://www.timgittos.com/learning/mit-single-variable-calculus/week-5"/>
   <updated>2012-03-19T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/learning/mit-single-variable-calculus/week-5</id>
   <content type="html">&lt;h2&gt;Approximations&lt;/h2&gt;
&lt;p&gt;Remember from the last lecture the discussion of approximations with an example that related to relativity.&lt;br /&gt;
We discussed the following linear generalization:&lt;br /&gt;
\[&lt;br /&gt;
  T&amp;#8217; = \frac{T}{\sqrt{1 &amp;#8211; \frac{v^2}c^2}} \approx T(1 + \frac{1}{2}\frac{v^2}{c^2})&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This generalization tells us the change in T, divided by T is approx to:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\Delta T}{T} \approx \frac{1}{2} \frac{v^2}{c^2}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This expresses the change, or fraction of error, in time on earth proportional to the time on the satellite is a relationship of the velocity of the satellite, considering that \(c\) is constant.&lt;br /&gt;
Or, you could say that the error fraction is proportional to \(\frac{v^2}{c^2}\) with a factor of \(\frac{1}{2}\). This is a linear relationship, as expressed with our linear generalization.&lt;/p&gt;
&lt;p&gt;These simplifications make designing complex systems easy, as the error between the approximation and the exact value is often negligable. If we tried to build complex systems based on the exact equations, it would be too difficult and complicated to complete the task.&lt;/p&gt;
&lt;h2&gt;Quadratic approximations&lt;/h2&gt;
&lt;p&gt;Quadratic approximations are used when linear approximations are not accurate enough.&lt;br /&gt;
Remember the formula of the quadratic approximation is as follows:&lt;br /&gt;
\[&lt;br /&gt;
  f(x) \approx f(x_0) + f&amp;#8217;(x_0)(x &amp;#8211; x_0) + \frac{f&amp;#8217;&amp;#8217;(x)}{2}(x &amp;#8211; x_0)^2&lt;br /&gt;
\]&lt;br /&gt;
where the base point for the approximation is near 0: \(x \approx 0\).&lt;/p&gt;
&lt;p&gt;Consider a parabola. A parabola is itself a quadratic function. Therefore, it&amp;#8217;s quadratic approximation must equal itself:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    f(x) &amp;amp;= a + bx + cx^2 \\&lt;br /&gt;
    f&amp;#8217;(x) &amp;amp;= b + 2cx \\&lt;br /&gt;
    f&amp;#8217;&amp;#8217;(x) &amp;amp;= 2c&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
We want to recover \(a\), \(b\), \(c\) using the derivatives evaluated at 0:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    f(0) &amp;amp;= a \\&lt;br /&gt;
    f&amp;#8217;(0) &amp;amp;= b \\&lt;br /&gt;
    \frac{f&amp;#8217;&amp;#8217;(0)}{2} &amp;amp;= c&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
This explains why the linear approximation involves half of the second derivative (\(\frac{f&amp;#8217;&amp;#8217;(x)}{2}\)) instead the second derivative entirely.&lt;/p&gt;
&lt;p&gt;Recall some common approximations derived from the basic formula in the last lecture:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    sin \; x &amp;amp;\approx x \\&lt;br /&gt;
    cos \; x &amp;amp;\approx 1 &amp;#8211; \frac{1}{2}x^2 \\&lt;br /&gt;
    e^x &amp;amp;\approx 1 + x + \frac{1}{2}x^2 \\&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
where \(x \approx 0 \)&lt;/p&gt;
&lt;p&gt;Next we will derive the following quadratic approximations:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    ln(1 + x) &amp;amp;\approx x &amp;#8211; \frac{1}{2}x^2 \\&lt;br /&gt;
    (1 + x)^r &amp;amp;\approx 1 + rx + \frac{r(r &amp;#8211; 1)}{2}x^2&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Derivation is as follows:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{array}{ l | l | l | l | l | l | l }&lt;br /&gt;
  f &amp;amp; f&amp;#8217; &amp;amp; f&amp;#8217;&amp;#8217; &amp;amp; f(0) &amp;amp; f&amp;#8217;(0) &amp;amp; f&amp;#8217;&amp;#8217;(0) &amp;amp; f(0) + f&amp;#8217;(0)x + \frac{f&amp;#8217;&amp;#8217;(0)}{2}x^2 \\ \hline&lt;br /&gt;
  ln(1 + x) &amp;amp; \frac{1}{(1 + x)} &amp;amp; \frac{-1}{(1 + x)^2} &amp;amp; 0 &amp;amp; 1 &amp;amp; -1 &amp;amp; x &amp;#8211; \frac{1}{2}x^2 \\&lt;br /&gt;
  (1 + x)^r &amp;amp; r(1 + x)^{r-1} &amp;amp; r(r-1)(x + 1)^{r &amp;#8211; 2} &amp;amp; 1 &amp;amp; r &amp;amp; r(r-1) &amp;amp; 1 + rx + \frac{r(r &amp;#8211; 1)}{2}x^2&lt;br /&gt;
  \end{array}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h2&gt;Applications of quadratic approximations&lt;/h2&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;Consider the equation below&lt;br /&gt;
\[&lt;br /&gt;
  a_k = (1 + \frac{1}{k})^k&lt;br /&gt;
\]&lt;br /&gt;
which tends to \(e\) as \(k\) tends to \(\infty\).&lt;/p&gt;
&lt;p&gt;This equation was solved previously using differentiation, however it can also be solved simply by using linear approximation:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  ln\;a_k &amp;amp;= k(ln(1 + \frac{1}{k})) \\&lt;br /&gt;
  &amp;amp;\approx k(\frac{1}{k}) \\&lt;br /&gt;
  &amp;amp;\approx 1 \\&lt;br /&gt;
  \therefore ln\;a_k &amp;amp;\to 1 \quad \text{(as } k \to \infty \text{)}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
due to the linear approximation of \(ln(1 + x) \approx x\), which holds if we set \(x = \frac{1}{k}\).&lt;/p&gt;
&lt;p&gt;\(a_k\) tends to \(e\) because \(ln\;e \to 1\) and \(ln\;a_k \to 1\).&lt;/p&gt;
&lt;p&gt;If we wanted to find the &lt;b&gt;rate of convergence&lt;/b&gt;, that is, how fast \(ln\;a_k \to 1\), we can use a quadratic approximation. We won&amp;#8217;t be solving this just yet.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;Find the quadratic approximation for the function x near 0, where the function is:&lt;br /&gt;
\[&lt;br /&gt;
  e^{-3x}(1 + x)^{-\frac{1}{2}}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Solving:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    e^{-3x}(1 + x)^{-\frac{1}{2}} &amp;amp;\approx (1 + (-3x) &amp;#8211; \frac{(-3x)^2}{2})(1 + (-\frac{1}{2})x + \frac{1}{2}(-\frac{1}{2})(-\frac{1}{2} &amp;#8211; 1)x^2 \\&lt;br /&gt;
    &amp;amp;\approx 1 &amp;#8211; 3x &amp;#8211; \frac{1}{2}x + \frac{3}{2}x^2 + \frac{9}{2}x^2 + \frac{3}{8}x^2 \quad \text{(dropping higher order terms than} \; x^2 \text{)} \\&lt;br /&gt;
    &amp;amp;\approx 1 &amp;#8211; \frac{7}{2}x + \frac{51}{8}x^2&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Note that the first half of the answer is the solution to the linear approximation for this problem in &lt;a href=&quot;/learning/mit-single-variable-calculus/week-4&quot;&gt;week 4, example 1&lt;/a&gt; . The last fraction is the extra information obtained by performing a quadratic approximation.&lt;/p&gt;
&lt;h2&gt;Curve sketching&lt;/h2&gt;
&lt;p&gt;The goal of curve sketching is to draw the graph of \(f\) using \(f&amp;#8217;\) and \(f&amp;#8217;&amp;#8217;\), whether they&amp;#8217;re positive or negative.&lt;br /&gt;
However, don&amp;#8217;t abandon your precalculus skills and common sense. Common sense often trumps calculus, and calculus is there to fill in the gaps.&lt;/p&gt;
&lt;h3&gt;Principles&lt;/h3&gt;
&lt;p&gt;If \(f&amp;#8217; &amp;gt; 0\) then \(f\) is increasing. Similarly, if \(f&amp;#8217; &amp;lt; 0\), then \(f\) is decreasing.&lt;/p&gt;
&lt;p&gt;If \(f&amp;#8217;&amp;#8217; &amp;gt; 0\) then \(f&amp;#8217;\) is increasing. Similarly, if \(f&amp;#8217;&amp;#8217; &amp;lt; 0\), then \(f&amp;#8217;\) is decreasing. When \(f&amp;#8217;\) is increasing, then \(f\) is said to be concave up. When \(f&amp;#8217;\) is decreasing, \(f\) is said to be concave down.&lt;br /&gt;
The following diagram illustrates the reasoning behind this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/svcalc/slopes.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As you can see at the top the gradients \(f&amp;#8217;\) of \(f\) are decreasing &amp;#8211; thus the curve is concave down.&lt;br /&gt;
The gradients in the curve on the bottom are increasing &amp;#8211; thus the curve is concave up.&lt;/p&gt;
&lt;p&gt;We can use these principles to analyze what a graph should look like, without drawing it. Take for example:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  f &amp;amp;= 3x &amp;#8211; x^3 \\&lt;br /&gt;
  f&amp;#8217; &amp;amp;= 3 &amp;#8211; 3x^2 \\&lt;br /&gt;
  &amp;amp;= 3(1 &amp;#8211; x)(1 + x)&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can see from the above factored form of \(f&amp;#8217;\) that when \(-1 &amp;lt; x &amp;lt; 1\), \(f&amp;#8217; &amp;gt; 0\) and \(f\) is increasing.&lt;br /&gt;
When \(x &amp;lt; -1\) and \(x &amp;gt; 1\), \(f&amp;#8217; &amp;lt; 0\) and \(f\) is decreasing.&lt;/p&gt;
&lt;p&gt;From the example, we can expect our graph to look a little like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/svcalc/slope-example1a.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As we can see from the estimated graph, there are two points where the gradient, \(f&amp;#8217;(x)\) is 0. This is what is called a turning point, or more formally, a critical point.&lt;/p&gt;
&lt;p&gt;If \(f&amp;#8217;(x_0) = 0\), the point at x is called a critical point. Thus \(y_0 = f(x_0)\) is called a critical value.&lt;/p&gt;
&lt;p&gt;So far, everthing we have done can be solved using a graphing calculator. One thing we can&amp;#8217;t solve with a graphic calculator is what happens at the ends of the function, off the screen. To determine this, we can use our principles.&lt;/p&gt;
&lt;p&gt;As \(x\) tends to infinity, we can see \(f(x) \approx -x^3\), and tends to negative infinity.&lt;br /&gt;
As \(x\) tends to negative invinity, we can see that \(f(x)\) tends to infinity.&lt;/p&gt;
&lt;p&gt;To get any more information about this curve, we  need to take the second derivative:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  f&amp;#8217;(x) &amp;amp;= 3 &amp;#8211; 3x^2 \\&lt;br /&gt;
  f&amp;#8217;&amp;#8217;(x) &amp;amp;= -6x&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;From the above, we can see that \(f&amp;#8217;&amp;#8217;(x)\ &amp;lt; 0\) if \(x &amp;gt; 0\) and \(f&amp;#8217;&amp;#8217;(x) &amp;gt; 0\) if \(x &amp;lt; 0\). In the first case it&amp;#8217;s concave down, and in the second case it&amp;#8217;s concave up.&lt;/p&gt;
&lt;p&gt;We can see that the point \(0, 0\) is the point where the function changes from concave down to concave up, and \(f&amp;#8217;&amp;#8217;(x) = 0\). This is known as a point of inflection.&lt;/p&gt;
&lt;p&gt;and the actual graph looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/svcalc/slope-example1b.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Take for example this new function:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  f(x) &amp;amp;= \frac{x + 1}{x + 2} \\&lt;br /&gt;
  f&amp;#8217;(x) &amp;amp;= \frac{1}{(x + 2)^2}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;There is an important thing to note about this example &amp;#8211; \(f(x) \ne 0\), which means there are no critical points&lt;/p&gt;
&lt;p&gt;On the surface, it may look like there&amp;#8217;s nothing to sketch because there are no critical points.&lt;br /&gt;
However, it is useful in a situation like this to start plotting points. The most important points to plot are those where the function is undefined.&lt;/p&gt;
&lt;p&gt;Consider the value \(x = -2\). The function is undefined for this value of x, and we can determine what is happening to the curve at this point by examining points around it.&lt;/p&gt;
&lt;p&gt;First, approach \(x = -2\) from the positive side, with a number that is a little more than \(-2\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    f(-2^{+}) &amp;amp;= \frac{-2^{+} + 1}{-2^{+} + 2} \\&lt;br /&gt;
    &amp;amp;= \frac{-1}{0^{+}} \\&lt;br /&gt;
    &amp;amp;= -\infty&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Remember, the \(x^+\) represents a number that is a small amount larger than \(x\).&lt;/p&gt;
&lt;p&gt;Next, approach \(x = -2\) from the negative side:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    f(-2^{-}) &amp;amp;= \frac{-2^{-} + 1}{-2^{-} + 2} \\&lt;br /&gt;
    &amp;amp;= \frac{-1}{0^{-}} \\&lt;br /&gt;
    &amp;amp;= \infty&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Therfore, there exists an asymptote at \(x = -2\).&lt;/p&gt;
&lt;p&gt;Next, we can analyze what occurs at the ends of the function (\(x \to \pm \infty \)):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    f(x) &amp;amp;= \frac{x + 1}{x + 2} \\&lt;br /&gt;
    &amp;amp;= \frac{1 + \frac{1}{x}}{1 + \frac{2}{x}} \quad \text{dividing numerator and denominator by x} \\&lt;br /&gt;
    &amp;amp;= 1&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This tells us there is another asymptote at \(y = 1 \). We also know that there are no critical points, due to the gradient of the function never equalling 0. This means there are no &amp;#8220;dips&amp;#8221; or &amp;#8220;cross-overs&amp;#8221; of the asymptotes.&lt;/p&gt;
&lt;p&gt;From the above knowledge, the sketch of the function should resemble the actual function:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/svcalc/slope-example2.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We can doublecheck this work by examining the first and second derivative:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  f(x) &amp;amp;= \frac{x + 1}{x + 2} \\&lt;br /&gt;
  f&amp;#8217;(x) &amp;amp;= -\frac{1}{(x + 2)^2} \\&lt;br /&gt;
  f&amp;#8217;&amp;#8217;(x) &amp;amp;= -\frac{2}{(x + 2)^3}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;As you can see, first derivative is positive when \(x \ne -2 \), which the graph reflects.&lt;br /&gt;
The second derivative is negative when \(-2 &amp;lt; x &amp;lt; \infty \) and positive when \( -\infty &amp;lt; x &amp;lt; -2 \), which the graph also reflects.&lt;br /&gt;
It is concave down above \(-2\), and concave up below \(-2\).&lt;/p&gt;
&lt;h3&gt;General strategy&lt;/h3&gt;
&lt;ol&gt;
	&lt;li&gt;Plot
	&lt;ol&gt;
		&lt;li&gt;Discontinuities (especially infinte)&lt;/li&gt;
		&lt;li&gt;end points (or \(x \to \pm \infty \))&lt;/li&gt;
		&lt;li&gt;easy points (optional, just fills out more information)&lt;/li&gt;
	&lt;/ol&gt;&lt;/li&gt;
	&lt;li&gt;
	&lt;ol&gt;
		&lt;li&gt;Solve \(f&amp;#8217;(x) = 0\)
		&lt;ol&gt;
			&lt;li&gt;Plot critical points&lt;/li&gt;
		&lt;/ol&gt;&lt;/li&gt;
	&lt;/ol&gt;&lt;/li&gt;
	&lt;li&gt;Decide whether \(f&amp;#8217;(x)\) is positive or negative for each interval between critical points or discontinuities, consistent with steps 1 &amp;amp; 2. If you can succeed in steps 1 &amp;amp; 2, you won&amp;#8217;t need to do this step, unless you want to doublecheck your answers.&lt;/li&gt;
	&lt;li&gt;Decide whether \(f&amp;#8217;&amp;#8217;(x)\) is positive or negative, and thus whether \(f(x)\) is concave up or down. Determine inflection points, where \(f&amp;#8217;&amp;#8217;(x) = 0\).&lt;/li&gt;
	&lt;li&gt;Combine all the steps.&lt;/li&gt;
&lt;/ol&gt;</content>
 </entry>
 
 <entry>
   <title>Udacity AI for Robotics - Week 4</title>
   <link href="http://www.timgittos.com/learning/udacity-ai-for-robotics/week-4"/>
   <updated>2012-03-12T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/learning/udacity-ai-for-robotics/week-4</id>
   <content type="html">&lt;p&gt;Motion planning enables a robot with a known target location to successfully navigate to that location in a predefined map, without having a predefined path. Motion planning will generate the best path for the robot to get to it&amp;#8217;s location.&lt;/p&gt;
&lt;p&gt;The planning problem can be defined as such: given a map, a starting location, a goal location, and a cost function that will determine the cost of a path, the planning algorithm needs to find a path that minimizes the cost.&lt;/p&gt;
&lt;p&gt;One discrete planning algorithm that can be used is the A* path finding algorithm.&lt;/p&gt;
&lt;h2&gt;A* path finding&lt;/h2&gt;
&lt;p&gt;A* is a path finding algorithm that is effective in finding a path from one location to another. It starts with a basic naiive search, and is then augmented by a heuristic function that improves it&amp;#8217;s efficiency.&lt;/p&gt;
&lt;h3&gt;Search&lt;/h3&gt;
&lt;p&gt;The search that the A* planning algorithm is based on involves considering the environment in discrete nodes. The start node is added to a list of nodes to be explored (or expanded), called an open list, along with the number of nodes that were expanded, called it&amp;#8217;s g-value. In the start case, the node will be added with a g-value of 0.&lt;br /&gt;
The algorithm then selects the node with the smallest g-value from the open list. First it checks if this node is the goal node. If it is, the algorithm terminates. If it is not, the algorithm removes it and adds it to a visited list. Each node the algorithm can reach from the node just expanded is added to the open list, along with it&amp;#8217;s g-value, in this case, 1. If a node found through expansion is in either the open list, or the visited list, it will be ignored.&lt;/p&gt;
&lt;h3&gt;Heuristic function&lt;/h3&gt;
&lt;p&gt;The heuristic function is a function that applies some sort of prior knowledge about the environment to the search algorithm. There are many heuristic functions that can be used, and one of them is to calculate the manhattan distance to the goal.&lt;/p&gt;
&lt;p&gt;The only requirements for a heuristic is that it must be optimistic. That is, the cost of the node must be less than or equal to the actual distance to the goal. The heuristic can underestimate the cost of the node, but not over estimate it.&lt;/p&gt;
&lt;h3&gt;Code&lt;/h3&gt;
&lt;/notextile&gt;

h2. Dynamic programming

Another discrete planning algorithm that can be used is called dynamic programming. It has an advantage over A* in that it can calculate a plan from anywhere in the predefined map, which makes it suitable for use in stochastic environments. Every cell in the discrete world has an optimal action, so that if the agent finds itself in a non-optimal location, the optimal path is easy to find.

This is actually similar to another technique called influence maps, which operate in a similar fashion, but more easily allow multiple obstacles to influence a path.

The optimal action for a given node is determined by the policy. The policy will take a node and return the optimal action.
!/images/air/dynamic.png!

h3. Value function

A value function assigns to each node the number of steps to the goal. Mathematically, it can be expressed as follows:
\[
  f(x,y) = min_{x', y'} f(x', y') + 1
\]
This expresses that the algorithm calculates a node's value by considering it's lowest value neighbour, and adding the number of steps it takes to reach that neighbour.
If the algorithm starts at the goal, it's value is 0. The nodes that are adjacent to the goal node have a value of 1. The nodes adjacent to those adjacent nodes have a value of 2, and so on until every node in the environment has a value.

h3. Code
Note: This code was taken from the Udacity forums, and annotated by me. I can't find the specific thread.

&lt;notextile&gt;</content>
 </entry>
 
 <entry>
   <title>Udacity AI for Robotics - Week 3</title>
   <link href="http://www.timgittos.com/learning/udacity-ai-for-robotics/week-3"/>
   <updated>2012-03-05T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/udacity-ai-for-robotics/week-3</id>
   <content type="html">&lt;h2&gt;Introduction to Particle Filters&lt;/h2&gt;
&lt;p&gt;Along with Histogram filters and Kalman filters, Particle filters are a technique that can be used to track and localize a robotic agent.&lt;br /&gt;
While a Histogram filter is discrete and multimodal algorithm, and has storage requirements that increase exponentially with each dimension of state, and a Kalman filter is a continuous and unimodal algorithm with quadratic storage requirements, Particle filters are continuous, multimodal algorithms. The complexity and storage requirements have not fully been determined.&lt;br /&gt;
All filters are approximate, in that they do not exactly model reality.&lt;/p&gt;
&lt;h2&gt;Global Localization with Particle Filters&lt;/h2&gt;
&lt;p&gt;The robotic agent starts with a known map of the environment. The robot has range finder sensors that can determine the range of obstacles. The particle filter algorithm has the agent make &amp;#8220;guesses&amp;#8221; about it&amp;#8217;s current location, with each guess having an x and y co-ordinate and a heading value. The agent at any given time makes n guesses, where in is a large number such as 1,000. Below is a map of an environment in an initial state, with each guess being represented as a dot. Notice the uniform distribution of guesses:&lt;br /&gt;
&lt;img src=&quot;/images/air/particle.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As the robot moves, and reads from it&amp;#8217;s sensors, the particles begin to converge on it&amp;#8217;s actual location:&lt;br /&gt;
&lt;img src=&quot;/images/air/particle.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The particles survive when they are closer to the measurements made by the robotic agent. As a result, locations of higher probability will collect more particles.&lt;/p&gt;
&lt;h2&gt;Robot World&lt;/h2&gt;
&lt;p&gt;In order to put the particle filter algorithm into practice, a theoretical robot world will be used:&lt;br /&gt;
&lt;img src=&quot;/images/air/robotworld.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This robot world is cyclical, and there are four landmarks the robot can read the distance to. The robot has an x, y value, and a heading.&lt;/p&gt;
&lt;h2&gt;Importance Weight&lt;/h2&gt;
&lt;p&gt;As the robot moves through the world, the random distribution of particles are moved with the robot, along their headings. This movement is subject to noise, so a Gaussian is usually interpolated into the results. When the robot reads it&amp;#8217;s sensors, each particle simulates reading sensors based on it&amp;#8217;s current position and heading.&lt;br /&gt;
&lt;img src=&quot;/images/air/weight.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above diagram, the robot is in blue, and one of the particles is in red. The readings of the robot form a 4-dimension vector, with distances to each of the 4 landmarks, modified by a Gaussian distribution to account for sensor noise. The particle simulates reading it&amp;#8217;s sensors, and another 4-dimension vector is generated. The particle&amp;#8217;s generated sensor reading is comapred to the actual sensor reading, and a weight of likeliness is calculated. The given particle will have a low likeliness, as it&amp;#8217;s sensor readings differ significantly from the actual readings.&lt;/p&gt;
&lt;h2&gt;Resampling&lt;/h2&gt;
&lt;p&gt;Once all the particles have importance weights calculated, resampling occurs. During the process of resampling, n new particles are redrawn, proportional to the prior particle importance weights. That means that particles with a higher importance are more likely to be included in the new set of particles. This means that particles that are closer to the actual robot&amp;#8217;s location tend to survive for many resamplings, and as the robot continues to move, the newer particles start to converge on the robot&amp;#8217;s actual location.&lt;br /&gt;
&lt;img src=&quot;/images/air/resampling.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Each particle&amp;#8217;s importance weight is first normalized, and then a new selection of n particles is drawn from a pool of old particles, at the normalized probabilities. It is possible to draw the same particle multiple times, and that is how particles that are more likely to be correct persist through multiple resamplings.&lt;/p&gt;
&lt;h2&gt;Resampling Wheel&lt;/h2&gt;
&lt;p&gt;The process of sampling particles at their normalized probability is not a straight forward task. However, it can be simplified by imagining the weight of each particle as a portion of a circle:&lt;br /&gt;
&lt;img src=&quot;/images/air/wheel.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;If the weight of each particle can be thought of as a portion of a pie, or a wheel, then the circumference of that circle that belongs to the particle is proportional to the weight. We can then employ the following algorithm:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
  particles = []&lt;br /&gt;
  index = random(0 &amp;#8211; N)&lt;br /&gt;
  b = 0&lt;br /&gt;
  m = max(weights)&lt;br /&gt;
  for i in N&lt;br /&gt;
    b += random(2 * m)&lt;br /&gt;
    while weights[i] &amp;lt; b&lt;br /&gt;
      b -= weights[i]&lt;br /&gt;
      i = (i + 1) % N&lt;br /&gt;
    particles.append(prior[i])&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This algorithm is equivalent to the following:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Randomly pick a particle&lt;/li&gt;
	&lt;li&gt;Rotate around the wheel by a random amount, limited by twice the distance of the largest probability&lt;/li&gt;
	&lt;li&gt;The amount rotated will point to the weight that corresponds to the particle to pick.&lt;/li&gt;
	&lt;li&gt;Repeat steps 2 &amp;amp; 3 n times, until there is a new pool of particles.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Through n iterations, and with a random b, particles with a larger weighted probability are more likely to be picked, and picked more often as well.&lt;/p&gt;
&lt;h2&gt;Orientation through Movement&lt;/h2&gt;
&lt;p&gt;In the above resampling, orientation doesn&amp;#8217;t converge, as the robot has not performed any movement. When the robot moves, the orientation is going to affect the next sensor reading, and thus will affect how a particle gets resampled&lt;/p&gt;
&lt;h2&gt;Math&lt;/h2&gt;
&lt;p&gt;Similar priciples are used in particle filters as were used in histogram filters.&lt;/p&gt;
&lt;p&gt;When performing measurement updates, particle filters leverage Bayes rule:&lt;br /&gt;
\[&lt;br /&gt;
  P(X | Z) \propto P(Z | X) P(X)&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;When performing the motion updates, particle filters leverage conditional probability:&lt;br /&gt;
\[&lt;br /&gt;
  P(X&amp;#8217;) = \sum P(X&amp;#8217; | X) P(X)&lt;br /&gt;
\]&lt;/p&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Linear Algebra - Week 4</title>
   <link href="http://www.timgittos.com/learning/mit-linear-algebra/week-4"/>
   <updated>2012-03-02T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-linear-algebra/week-4</id>
   <content type="html">&lt;h2&gt;Computing the Nullspace (Ax = 0)&lt;/h2&gt;
&lt;p&gt;Consider the matrix \(A\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
  2 &amp;amp; 4 &amp;amp; 6 &amp;amp; 8 \\&lt;br /&gt;
  3 &amp;amp; 6 &amp;amp; 8 &amp;amp; 10&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The means of computing the nullspace is matrix elimination. The difference between this and the row elimination we&amp;#8217;ve done previously, is that this will operate on rectangular matrices, not just square ones, and we&amp;#8217;ll need to possibly deal with \(0\) in the pivot position. Notice that column 2 is not linearly independent, and that row 3 is not linearly independent.&lt;/p&gt;
&lt;p&gt;It is important to note that performing matrix elimination doesn&amp;#8217;t change the nullspace, although it does change the column space. That is, the solution to the equation doesn&amp;#8217;t change.&lt;/p&gt;
&lt;p&gt;Following is matrix elimination to solve the equation: \(Ax = 0\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
  2 &amp;amp; 4 &amp;amp; 6 &amp;amp; 8 \\&lt;br /&gt;
  3 &amp;amp; 6 &amp;amp; 8 &amp;amp; 10&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \to&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 2 &amp;amp; 4 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 2 &amp;amp; 4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Notice above that in the \(2,2\) pivot position there is a zero, and that it&amp;#8217;s not possible to perform a row exchange with the row beneath it, because that too has a zero in the pivot position.&lt;/p&gt;
&lt;p&gt;This tells us that the second column is not linearly independent, and that it can be formed by a combination of another column.&lt;/p&gt;
&lt;p&gt;To continue, we consider \(2,3\) to be our pivot position instead:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 2 &amp;amp; 4 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This gives us the matrix \(u\). It&amp;#8217;s not upper triangular, but it is in echelon form, which describes the structur of the 0&amp;#8217;s in the matrix. We can see that this matrix has 2 pivots &amp;#8211; this means that it has a rank of 2. That is, the rank of a matrix is the number of pivots.&lt;/p&gt;
&lt;p&gt;The matrix \(u\) has 2 pivot columns. A pivot column is a column that holds a pivot. The other columns, that don&amp;#8217;t hold a pivot, are called free columns. They are called free columns because we can assign any value to the unknowns that correspond to those columns, and solve for the unknowns in the pivot colums.&lt;/p&gt;
&lt;p&gt;For example:&lt;br /&gt;
\[&lt;br /&gt;
  x = \begin{bmatrix}&lt;br /&gt;
  ? \\&lt;br /&gt;
  1 \\&lt;br /&gt;
  ? \\&lt;br /&gt;
  0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can break out the rows of the matrixs and represent them into their equation form:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  x_1 + 2x_2 + 2x_3 + 2x_4 &amp;amp;= 0 \\&lt;br /&gt;
  2x_3 + 4x_4 &amp;amp;= 0&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;From here, using the numbers we picked for the unkowns, we can perform back substitution, and get:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  2x_3 + 4(0) &amp;amp;= 0 \\&lt;br /&gt;
  x &amp;amp;= 0&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;To solve for \(x_1\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  x_1 + 2(1) + 2(0) + 2(0) &amp;amp;= 0 \\&lt;br /&gt;
  x_1 + 2 &amp;amp;= 0 \\&lt;br /&gt;
  x_1 &amp;amp;= -2&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The solution to this is a vector in the nullspace:&lt;br /&gt;
\[&lt;br /&gt;
  x = \begin{bmatrix}&lt;br /&gt;
  -2 \\ 1 \\ 0 \\ 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Any multiple of the vector \(x\) will also lie in the nullspace. This describes a line that is in the nullspace.&lt;/p&gt;
&lt;p&gt;We can also flip the position of the 0 and the 1 for the free columns:&lt;br /&gt;
\[&lt;br /&gt;
  x = \begin{bmatrix} ? \\ 0 \\ ? \\ 1 \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;And the result of the back substitution is:&lt;br /&gt;
\[&lt;br /&gt;
  x = \begin{bmatrix} 2 \\ 0 \\ -2 \\ 1 \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
which also lies in the nullspace.&lt;/p&gt;
&lt;p&gt;With two vectors in the nullspace, we can determine the entire nullspace. The nullspace is composed of all the combinations of the two vectors found above, and can be represented as:&lt;br /&gt;
\[&lt;br /&gt;
  c\begin{bmatrix} -2 \\ 1 \\ 0 \\ 0 \end{bmatrix} + d\begin{bmatrix}2 \\ 0 \\ -2 \\ 1\end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;To generalize:&lt;br /&gt;
A matrix \(m \times n\) with a rank of \(r\) will have \(n &amp;#8211; r\) free variables, and it&amp;#8217;s nullspace will be composed of the combinations of \(n &amp;#8211; r\) vectors. You can find these vectors by assigning the value of \(1\) to each free variable while assigning the others a value of \(0\), and performing back substitution. You do this \(n &amp;#8211; r\) times and can derive the nullspace. This is due to the fact that there were only \(r\) equations &amp;#8211; the free variables are the result of non linearly independent equations.&lt;/p&gt;
&lt;p&gt;We can further clean up the matrix \(u\), by expressing it in reduced row echelon form. We will call this matrix \(R\).&lt;br /&gt;
Consider again matrix \(u\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 2 &amp;amp; 4 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Notice the row of zeros &amp;#8211; this comes from the fact that the third row was a combination of the first two rows.&lt;/p&gt;
&lt;p&gt;The reduced row echelon form has zeros both above and below the pivots, and the value of 1 in all the pivots:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 0 &amp;amp; -2 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 2 &amp;amp; 4 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
We subtracted the second row from the first to get a 0 above the second pivot. Now we can divide the second row by 2, which won&amp;#8217;t change the solution (as it&amp;#8217;s part of the combination of vectors):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 0 &amp;amp; -2 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 2 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is the matrix \(R\). Now, we can break out the linear equations, and solve them like we did above:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  x_1 + 2x_2 &amp;#8211; 2x_4 &amp;amp;= 0 \\&lt;br /&gt;
  x_3 + 2x_4 &amp;amp;= 0&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;If we then use the procedure to determine the vectors that define the nullspace:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  x &amp;amp;= \begin{bmatrix}&lt;br /&gt;
    ? \\ 1 \\ ? \\ 0&lt;br /&gt;
  \end{bmatrix} \\&lt;br /&gt;
  x_3 + 2(0) &amp;amp;= 0 \\&lt;br /&gt;
  x_3 &amp;amp;0 0 \\&lt;br /&gt;
  x_1 + 2(1) &amp;#8211; 2(0) &amp;amp;= 0 \\&lt;br /&gt;
  x_1 &amp;amp;= -2&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
which gives us the solution vector:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    -2 \\ 1 \\ 0 \\ 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and for the other free variable:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  x &amp;amp;= \begin{bmatrix}&lt;br /&gt;
    ? \\ 0 \\ ? \\ 1&lt;br /&gt;
  \end{bmatrix} \\&lt;br /&gt;
  x_3 + 2(1) &amp;amp;= 0 \\&lt;br /&gt;
  x_3 &amp;amp;= -2 \\&lt;br /&gt;
  x_1 + 2(0) &amp;#8211; 2(1) &amp;amp;= 0 \\&lt;br /&gt;
  x_1 = 2&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
which gives us the solution vector:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  2 \\ 0 \\ -2 \\ 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
which as you can see is the solution we arrived at before, with \(Ux = 0\). This equation is called \(Rx = 0\).&lt;/p&gt;
&lt;p&gt;Looking at the matrix \(R\), we can see that the identity matrix I exists in the pivot points. And, that the solution to the pivot unknowns exists in the free variables, but with the signs reversed.&lt;/p&gt;
&lt;p&gt;Let us consider a general reduced row echelon form matrix, assuming that the pivot columns are grouped together. It will look like this:&lt;br /&gt;
\[&lt;br /&gt;
  R = \begin{bmatrix}&lt;br /&gt;
  I &amp;amp; F \\&lt;br /&gt;
  0 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
where \(I\) is the identity matrix, and \(F\) are the free variables. There may or may not be a row of zeroes.&lt;br /&gt;
This matrix will have \(r\) pivot rows, \(r\) pivot columns, and \(n &amp;#8211; r\) free columns.&lt;/p&gt;
&lt;p&gt;The nullspace for this general reduced row echelon form matrix can be given by:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    -F \\ I&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
where the columns are the vectors that define the nullspace. These vectors are called the null basis, or the basis of the nullspace.&lt;/p&gt;
&lt;p&gt;Remember that the vectors \(\begin{bmatrix}1 \\ 0 \\ 0 \end{bmatrix}, \begin{bmatrix}0 \\ 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}\) form the basis of the 3 dimensional cartesian space.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Example&lt;/b&gt;&lt;br /&gt;
Convert the matrix \(A\) to reduced row echelon form, and find the solution for the nullspace.&lt;br /&gt;
\[&lt;br /&gt;
  A = \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;
    2 &amp;amp; 4 &amp;amp; 6 \\&lt;br /&gt;
    2 &amp;amp; 6 &amp;amp; 8 \\&lt;br /&gt;
    2 &amp;amp; 8 &amp;amp; 10&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
Performing elimination: &lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
    0 &amp;amp; 4 &amp;amp; 4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \to&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;
    0 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 4 &amp;amp; 4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \to&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 3 \\&lt;br /&gt;
    0 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
The last matrix is the form \(U\), the upper triangular or row echelon form. This matrix has a rank of 2, with 2 pivot columns and 1 free column. &lt;br /&gt;
To compute the special solutions, we can solve the linear equations by setting the free variable to 1:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  2x_2 + 2(1) &amp;amp;= 0 \\&lt;br /&gt;
  x_2 &amp;amp;= -1 \\&lt;br /&gt;
  x_1 + 2(-1) + 3(1) &amp;amp;= 0 \\&lt;br /&gt;
  x_1 +1 &amp;amp;= 0 \\&lt;br /&gt;
  x_1 &amp;amp;= -1&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
This gives us the special solution of:&lt;br /&gt;
\[&lt;br /&gt;
  x = \begin{bmatrix}&lt;br /&gt;
    -1 \\ -1 \\ 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The nullspace is given by the equation: \(c\begin{bmatrix}-1 \\ -1 \\ 1 \end{bmatrix}\). This is a line in 3 dimensional space.&lt;/p&gt;
&lt;p&gt;We could have continued to reduced row echelon form:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix} \to &lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
Here we can see the identity matrix come out, and the solutions to the pivot variables, \(\begin{bmatrix}1 \\ 1 \end{bmatrix}\), with signs inverted.&lt;/p&gt;
&lt;h2&gt;Solving Ax = b&lt;/h2&gt;
&lt;p&gt;We will continue using matrix \(A\) to demonstrate how to solve a system of linear equations.&lt;br /&gt;
The following system of equations is the matrix \(A\) in linear equation form:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  x_1 + 2x_2 + 2x_3 + 2x_4 &amp;amp;= b_1 \\&lt;br /&gt;
  2x_1 + 4x_2 + 6x_3 + 8x_4 &amp;amp;= b_2 \\&lt;br /&gt;
  3x_1 + 6x_2 + 8x_3 + 10x_4 &amp;amp;= b_3&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
and remember the 3rd row is the sum of rows 1 &amp;amp; 2 &amp;#8211; it is not independent. Therefore, \(b_3\) is dependent on \(b_1\) and \(b_2\). A solution such as \(\begin{bmatrix}1 \\ 5 \\ 17\end{bmatrix}\) will not solve this system.&lt;/p&gt;
&lt;p&gt;To solve \(A\), we need to reduce this matrix:&lt;br /&gt;
\[&lt;br /&gt;
  {&lt;br /&gt;
    \left[&lt;br /&gt;
    \begin{matrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
    2 &amp;amp; 4 &amp;amp; 6 &amp;amp; 8 \\&lt;br /&gt;
    3 &amp;amp; 6 &amp;amp; 8 &amp;amp; 10&lt;br /&gt;
    \end{matrix}&lt;br /&gt;
    \left|&lt;br /&gt;
    \begin{matrix}&lt;br /&gt;
    b_1 \\ b_2 \\ b_3&lt;br /&gt;
    \end{matrix}&lt;br /&gt;
    \right.&lt;br /&gt;
    \right]&lt;br /&gt;
  }&lt;br /&gt;
  \rightarrow&lt;br /&gt;
  {&lt;br /&gt;
    \left[&lt;br /&gt;
    \begin{matrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 2 &amp;amp; 4 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 2 &amp;amp; 4&lt;br /&gt;
    \end{matrix}&lt;br /&gt;
    \left|&lt;br /&gt;
    \begin{matrix}&lt;br /&gt;
    b_1 \\ b_2 &amp;#8211; 2b_1 \\ b_3 &amp;#8211; 3b_1&lt;br /&gt;
    \end{matrix}&lt;br /&gt;
    \right.&lt;br /&gt;
    \right]&lt;br /&gt;
  }&lt;br /&gt;
  \rightarrow&lt;br /&gt;
  {&lt;br /&gt;
    \left[&lt;br /&gt;
    \begin{matrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 2 &amp;amp; 2 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 2 &amp;amp; 4 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0&lt;br /&gt;
    \end{matrix}&lt;br /&gt;
    \left|&lt;br /&gt;
    \begin{matrix}&lt;br /&gt;
    b_1 \\ b_2 &amp;#8211; 2b_1 \\ b_3 &amp;#8211; b_2 &amp;#8211; b_1&lt;br /&gt;
    \end{matrix}&lt;br /&gt;
    \right.&lt;br /&gt;
    \right]&lt;br /&gt;
  }&lt;br /&gt;
\]&lt;br /&gt;
The last line of the resultant matrix tells us the solvability condition for matrix \(A\). That is that \(b_3 = b_1 + b_2\). If that doesn&amp;#8217;t hold, then \(b\) is not a solution. This tells us there is a solution to \(A\).&lt;/p&gt;
&lt;p&gt;If we suppose that the \(b\) before elimination is \(\begin{bmatrix} 1 \\ 5 \\ 6 \end{bmatrix} \), then the resultant \(b\) after elimination will be:&lt;br /&gt;
\[&lt;br /&gt;
  b = \begin{bmatrix} 1 \\ 3 \\ 0 \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;To generalize, \(A\) is solvable when \(b\) is in the column space of \(A\), (\(C(A)\)).&lt;/p&gt;
&lt;p&gt;In general, if a combination of rows of \(A\) gives a zero row, the same combination of the entries of \(b\) must give 0.&lt;/p&gt;
&lt;p&gt;To continue finding the complete solution to \(Ax = b\), first we find a single solution by setting all free variables to 0 and then solve \(Ax = b\) for the pivot variables, using the values for \(b\) from above:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    2x_3 + 4(0) &amp;amp;= 3 \\&lt;br /&gt;
    \therefore x_3 &amp;amp;= \frac{3}{2} \\&lt;br /&gt;
    x_1 + 2(0) + 2(\frac{3}{2}) + 2(0) &amp;amp;= 1 \\&lt;br /&gt;
    x_1 + 3 &amp;amp;= 1 \\&lt;br /&gt;
    \therefore x_1 &amp;amp;= -2&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
As we can see, one of the solutions to x is:&lt;br /&gt;
\[&lt;br /&gt;
  x = \begin{bmatrix}&lt;br /&gt;
    -2 \\ 0 \\ \frac{3}{2} \\ 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Now that we have one particular solution, the complete solution will be that particular solution added to all vectors in the nullspace.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The complete for solution for \(A\) (for the given \(b\)) is:&lt;br /&gt;
\[&lt;br /&gt;
  x_{complete} = \begin{bmatrix} -2 \\ 0 \\ \frac{3}{2} \\ 0 \end{bmatrix} &lt;br /&gt;
  + c \begin{bmatrix} -2 \\ 1 \\ 0 \\ 0 \end{bmatrix} + &lt;br /&gt;
  d \begin{bmatrix} 2 \\ 0 \\ -2 \\ 1 \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This result is a 2 dimensional subspace of \(R^4\), that goes through the solution of \(x\) that we found, instead of through the origin.&lt;/p&gt;
&lt;p&gt;Generally, consider an \(m\) by \(n\) matrix \(A\) of rank \(r\). Remember the rank of a matrix is how many pivot columns it has.&lt;br /&gt;
We know that \(r \le m\) and \(r \le n\).&lt;br /&gt;
Full column rank means that \(r = n\). This means that all the columns independent, the columns are all pivot variables, and that there are no free variables, and that the nullspace will only contain the zero vector. The solution to \(Ax = b\) will be unique, if it exists.&lt;br /&gt;
Full row rank means that \(r = m\).  This means that all the rows have pivot variables. This means that we can solve \(Ax = b\) for every \(b\), and that there are \(n &amp;#8211; r\) free variables.&lt;br /&gt;
A matrix that is full rank has \(r = m = n\), and a matrix that is full rank is invertible, it&amp;#8217;s reduced row echelon form is the identity matrix, and there is a unique solution.&lt;/p&gt;
&lt;p&gt;To summarize:&lt;br /&gt;
The rank of a matrix tells you everything about the number of solutions, except what those solutions are.&lt;/p&gt;
&lt;p&gt;When \(r = m = n\) (full rank)&lt;br /&gt;
\[&lt;br /&gt;
  R = I&lt;br /&gt;
\]&lt;br /&gt;
and there is 1 solution to \(Ax = b\)&lt;/p&gt;
&lt;p&gt;When \(r = n &amp;lt; m\) (full column rank)&lt;br /&gt;
\[&lt;br /&gt;
  R = \begin{bmatrix} I \\ 0 \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
and there is 0 or 1 solution to \(Ax = b\)&lt;/p&gt;
&lt;p&gt;When \(r = m &amp;lt; n\) (full row rank)&lt;br /&gt;
\[&lt;br /&gt;
  R = \begin{bmatrix}I &amp;amp; F \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
where \(I\) and \(F\) can be intermingled, and \(I\) will be in pivot columns.&lt;br /&gt;
There are \(\infty\) solutions to \(Ax = b\)&lt;/p&gt;
&lt;p&gt;When \(r &amp;lt; m, r &amp;lt; n\)&lt;br /&gt;
\[&lt;br /&gt;
  R = \begin{bmatrix} I &amp;amp; F \\ 0 &amp;amp; 0 \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
where \(I\) and \(F\) can be intermingled, and \(I\) will be in pivot columns.&lt;br /&gt;
There are 0 or \(\infty\) solutions to \(Ax = b\)&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Udacity AI for Robotics - Week 2</title>
   <link href="http://www.timgittos.com/learning/udacity-ai-for-robotics/week-2"/>
   <updated>2012-02-29T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/udacity-ai-for-robotics/week-2</id>
   <content type="html">&lt;h2&gt;Tracking with Kalman Filters&lt;/h2&gt;
&lt;p&gt;Localization involves orienting a robot in a known environment. When that environment contains moving obstacles, such as other robots, or in the case of a self driving car, pedestrians and other cars, tracking is used to identify those obstacles, and determine how fast they are moving and make predictions about their movements.&lt;/p&gt;
&lt;p&gt;Both Kalman filtering and monte carlo methods can be used for both localization and tracking. &lt;br /&gt;
Kalman filters are a continuous, uni-modal method, while monte carlo is a discrete, multimodal method.&lt;/p&gt;
&lt;p&gt;Later, particle filters will be introduced, which combines both techniques to result in a continuous, multi-modal method.&lt;/p&gt;
&lt;h2&gt;Gaussian distributions&lt;/h2&gt;
&lt;p&gt;Monte carlo localization used a histogram to model the probability the robot was in a given location. This histogram is an approximation to a continuous probability:&lt;br /&gt;
&lt;img src=&quot;/images/air/montecarlo.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The Gaussian distribution is another probability distribution. It is characterized by 2 features:&lt;br /&gt;
- the mean, \(\mu\), or the value of the top of the curve&lt;br /&gt;
- the variance, \(\sigma^2\), or the width of the curve.&lt;br /&gt;
&lt;img src=&quot;/images/air/gaussian.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In Kalman filters, the values of \((\mu, \sigma^2)\) will identify the belief state of the location of a given obstacle.&lt;br /&gt;
This belief is modelled with the function:&lt;br /&gt;
\[&lt;br /&gt;
  f(x) = \frac{1}{\sqrt{2 \pi \sigma^2 }} e^{-\frac{1}{2}\frac{(x &amp;#8211; \mu)^2}{\sigma^2}}&lt;br /&gt;
\]&lt;br /&gt;
\(\frac{1}{\sqrt{2 \pi \sigma^2 }}\) is a constant used to normalize the probability.&lt;/p&gt;
&lt;p&gt;Kalman filtering is called a uni-modal method because the Gaussian distribution is uni-modal. This means that it has a single peak in the graph of the distribution. Gaussian distributions are also symmetrical.&lt;/p&gt;
&lt;p&gt;\(\sigma^2\) is a measure of uncertainty, and in the above equation, it acts to normalize the difference of a value and the mean. The larger the \(\sigma^2\), the more uncertain the distribution is.&lt;/p&gt;
&lt;h2&gt;Stages&lt;/h2&gt;
&lt;p&gt;Similar to the process of localization, Kalman filters involve repetition over two stages of execution: measurement updates and prediction updates. In localization, and in Kalman filters, the measurement update process involves Bayes rule and calculating products of probabilities, and the prediction updates involve total probability and convolution. The main difference is the probability distributions used, in that Kalman filters use a Gaussian distribution.&lt;/p&gt;
&lt;h3&gt;Measurement update&lt;/h3&gt;
&lt;p&gt;As in localization, the robot starts with a prior belief state, which in the case of Kalman filters, is a Gaussian distribution. It is typically very uncertain. If the robot reads it&amp;#8217;s sensors, and obtains a new Gaussian distribution that represents what the sensors detected, it needs to multiply those Gaussians together to get the posterier belief state.&lt;br /&gt;
&lt;img src=&quot;/images/air/gaussianupdate.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is given by the following equation:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{array}{l}&lt;br /&gt;
  \mu&amp;#8217; = \frac{r^2\mu + \sigma^2\nu}{r^2 + \sigma^2} \\&lt;br /&gt;
  {\sigma^2}&amp;#8217; = \frac{1}{\frac{1}{r^2} + \frac{1}{\sigma^2}}&lt;br /&gt;
  \end{array}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Prediction/Motion update&lt;/h3&gt;
&lt;p&gt;Due to the uncertain nature of robot movement, as in localization, when the robot moves, it loses information. In the case of Kalman filters, this means that the new calculated Gaussian belief state has a higher variance than it did before it moved. Otherwise, the move works similar to convolution in localization.&lt;/p&gt;
&lt;p&gt;The update to the Gaussian belief state is given by:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{array}{l}&lt;br /&gt;
  \mu&amp;#8217; = \mu + u \\&lt;br /&gt;
  {\sigma^2}&amp;#8217; = \sigma^2 + r^2 &lt;br /&gt;
  \end{array}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is saying that the resultant mean is the move distance (\(u\)) plus the old mean, and the resultant variance is the old variance plus the new variance (uncertainty value in the motion).&lt;br /&gt;
This succinctly models the loss of certainty involved in moving.&lt;/p&gt;
&lt;h2&gt;Multivariate Gaussians&lt;/h2&gt;
&lt;p&gt;So far, all discussion has been referring to Kalman filtering in 1-D, or one dimension. Real life Kalman filtering will likely take place in 2-D or even 3-D space. To do filtering in these higher dimensions, multivariate Gaussians are used.&lt;/p&gt;
&lt;p&gt;Multivariate Gaussians differ in that the mean value becomes an array of means, and the variance value becomes an array of covariance values, of \(D \times D \) size, where D is the dimensionality of the matrix.&lt;/p&gt;
&lt;p&gt;For more on multivariate Gaussians, see &lt;a href=&quot;http://cs229.stanford.edu/section/gaussians.pdf&quot;&gt;this Stanford handout from the Machine learning class&lt;/a&gt; and my &lt;a href=&quot;http://www.timgittos.com/projects/stanford-machine-learning/&quot;&gt;Machine Learning notes, particularly the notes on unsupervised learning.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To design a Kalman filter in higher dimensions, the Kalman filter needs a state transition function and a measurement function.&lt;/p&gt;
&lt;h3&gt;State transition function&lt;/h3&gt;
&lt;p&gt;When updating the state, as per 1-D Kalman filters, the new location is the old location plus the velocity, and the new velocity is the same as the old velocity. This can be represented by the following equation:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix} x&amp;#8217; \\ \dot{x}&amp;#8217; \end{bmatrix} \leftarrow \begin{bmatrix} 1 &amp;amp; 1 \\ 0 &amp;amp; 1 \end{bmatrix} \begin{bmatrix} x \\ \dot{x} \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The matrix is known as F, and will be used in the update equations.&lt;/p&gt;
&lt;h3&gt;Measurement function&lt;/h3&gt;
&lt;p&gt;Making a measurement involves reading the new location of the object. This can be represented by the following equation:&lt;br /&gt;
\[&lt;br /&gt;
  z \leftarrow \begin{bmatrix} 1 &amp;amp; 0 \end{bmatrix} \begin{bmatrix} x \\ \dot{x} \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The row vector is known as H, and will be used in the update equations.&lt;/p&gt;
&lt;h3&gt;Update equations&lt;/h3&gt;
&lt;p&gt;The following image outlines the general approach to Kalman filtering with multivariate Gaussians:&lt;br /&gt;
&lt;img src=&quot;/images/air/multivariategaussian.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The first step is the prediction step. To update the prediction, the location needs to be updated, and the uncertainty covariance needs to be updated.&lt;br /&gt;
Updating the location involves multiplying the current belief of the location by the state transition matrix, described above, and adding a motion vector that describes external motion acting on the item.&lt;br /&gt;
After updating the location, the uncertainty covariance matrix needs to be updated.&lt;/p&gt;
&lt;p&gt;The last step is the measurement update step. To update the measurement, the location needs to be updated, and the uncertainty covariance needs to be updated.&lt;br /&gt;
First, calculate the error in the previous prediction to the current measurement. Project the previous uncertainty into the measurement function and add in noise. Calculate the Kalman gain which is a function of the uncertainty. Update the estimate by adding the current value to the Kalman gain influenced error, and update the uncertainty by adding a manipulated Kalman gain value to the existing uncertainty covariance.&lt;/p&gt;
&lt;h2&gt;More information&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;/files/air/kalman_intro.pdf&quot;&gt;An Introduction to the Kalman Filter&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;/files/air/maybeck_ch1.pdf&quot;&gt;Stochastic Models, Estimation and Control &amp;#8211; Volume 1, Chapter 1&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://calypso.inesc-id.pt/FCUL/psm/docs/kalman-dan-simon.pdf&quot;&gt;Kalman Filtering&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Single Variable Calculus - Week 4</title>
   <link href="http://www.timgittos.com/learning/mit-single-variable-calculus/week-4"/>
   <updated>2012-02-24T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-single-variable-calculus/week-4</id>
   <content type="html">&lt;h2&gt;Exponents&lt;/h2&gt;
&lt;p&gt;To recap from last time, we took the derivative of&lt;br /&gt;
\[&lt;br /&gt;
  a_k = \left(1 &amp;#8211; \frac{1}{k} \right)^k&lt;br /&gt;
\]&lt;br /&gt;
as \(k\) tends to infinity:&lt;br /&gt;
\[&lt;br /&gt;
  \lim_{k \to \infty} a_k = e&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We came to this result by means of the following (abreviated) process:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{array}{l}&lt;br /&gt;
  ln\;a_k \to 1 \qquad \text{as k approaches infinity} \\&lt;br /&gt;
  e^{ln\;a_k} \to e \qquad \text{as k approaches infinity} \\&lt;br /&gt;
  e^{ln\;a_k} = a_k \quad \text{because} e^{ln\;a} = a&lt;br /&gt;
  \end{array}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We then used that to come up with a formula for \(e\):&lt;br /&gt;
\[&lt;br /&gt;
  e = \lim_{k \to \infty} \left( 1 + \frac{1}{k} \right)^k&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We previously covered solving:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\delta}{\delta x} x^r = r\;x^{r &amp;#8211; 1}&lt;br /&gt;
\]&lt;br /&gt;
for all real r. Now we will cover solving it for all r.&lt;/p&gt;
&lt;p&gt;Method 1: use base e.&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  x^r &amp;amp;= \left(e^{ln\;x} \right)^r\\&lt;br /&gt;
  &amp;amp;= e^{r\;ln\;x} \\&lt;br /&gt;
  \frac{\delta}{\delta x}x^r &amp;amp;= \left( e^{r\;ln\;x} \right)&amp;#8217; \\&lt;br /&gt;
  &amp;amp;= e^{r\;ln\;x}(r\;ln\;x)&amp;#8217; \\&lt;br /&gt;
  &amp;amp;= x^r \frac{r}{x} \\&lt;br /&gt;
  &amp;amp;= r\;x^{r &amp;#8211; 1}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
which shows that it holds for the above.&lt;/p&gt;
&lt;p&gt;Method 2: logarithmic differentiation.&lt;br /&gt;
\[&lt;br /&gt;
  u = x^r, \quad ln\;u = r\;ln\;x&lt;br /&gt;
\]&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{u&amp;#8217;}{u} &amp;amp;= (ln\;u)&amp;#8217; \\&lt;br /&gt;
  &amp;amp;= \frac{r}{x} \\&lt;br /&gt;
  u&amp;#8217; &amp;amp;= u \frac{r}{x} \\&lt;br /&gt;
  &amp;amp;= x^r \frac{r}{x} \\&lt;br /&gt;
  &amp;amp;= r\;x^{r &amp;#8211; 1}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
which shows that it holds for the above.&lt;/p&gt;
&lt;h2&gt;Review&lt;/h2&gt;
&lt;h3&gt;General formulas&lt;/h3&gt;
&lt;p&gt;Practice \((u + v)&amp;#8216;, (c\;u)&amp;#8217;, (u\;v)&amp;#8216;, (\frac{u}{v})&amp;#8217;\), the last two being the product rule and the quotient rule respectively.&lt;br /&gt;
Also know the chain rule:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\delta}{\delta x}f(u) = f&amp;#8217;(u)\;u&amp;#8217;(x) \qquad \text{where} \quad u = u(x)&lt;br /&gt;
\]&lt;br /&gt;
and implicit differentiation &amp;#8211; inverses, logarithmic differentiation.&lt;/p&gt;
&lt;h3&gt;Specific functions&lt;/h3&gt;
&lt;p&gt;\( x^r, sin\;x, cos\;x, tan\;x, sec\;x, e^x, ln\;x, tan^{-1}x, sin{-1}x \)&lt;/p&gt;
&lt;h3&gt;Chain rule&lt;/h3&gt;
&lt;p&gt;We previously didn&amp;#8217;t explain why the chain rule was true. Now we will show it through an example.&lt;br /&gt;
Take the function: \(y = 10x + b\). \(y\) is changing 10 times as fast as x, therefore \(\frac{\delta y}{\delta x} = 10\).&lt;br /&gt;
Now consider: \(x = 5t + a\), then \(\frac{\delta x}{\delta t} = 5\).&lt;br /&gt;
The chain rule says that if \(y\) is increasing 10 times as fast as \(x\), and \(x\) is increasing 5 times as fast as \(t\), then \(y\) is increasing 50 times as fast as \(t\).&lt;/p&gt;
&lt;p&gt;You can use the chain rule to make other rules easier to use.&lt;br /&gt;
For example, the quotient rule:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  f &amp;amp;= \left( \frac{1}{v} \right) \\&lt;br /&gt;
  f&amp;#8217; &amp;amp;= \left( \frac{1}{v} \right)&amp;#8217; \\&lt;br /&gt;
  &amp;amp;= ( v^{-1} )&amp;#8217; \\&lt;br /&gt;
  &amp;amp;= ( v^{-1} )&amp;#8217; v&amp;#8217; \qquad \text{by the chain rule} \\&lt;br /&gt;
  &amp;amp;= -v^{-2}v&amp;#8217;&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
and the full derrivation of the chain rule:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  f &amp;amp;= \left( \frac{u}{v} \right) \\&lt;br /&gt;
  f&amp;#8217; &amp;amp;= \left( \frac{u}{v} \right)&amp;#8217; \\&lt;br /&gt;
  &amp;amp;= (u\;v^{-1})&amp;#8217; \\&lt;br /&gt;
  &amp;amp;= u&amp;#8217;v^{-1} + u(-v^{-2}v&amp;#8217;) \\&lt;br /&gt;
  &amp;amp;= \frac{(u&amp;#8217;v &amp;#8211; uv&amp;#8217;)}{v^2}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Examples&lt;/h3&gt;
&lt;p&gt;Consider: \(\frac{\delta}{\delta x} sec\;x\).&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x} sec\;x &amp;amp;= \frac{\delta}{\delta x}(cos\;x)^{-1} \\&lt;br /&gt;
    &amp;amp;= &amp;#8211; (cos\;x)^{-2} cos&amp;#8217;x \\&lt;br /&gt;
    &amp;amp;= &amp;#8211; (cos\;x)^{-2}( -sin\;x) \\&lt;br /&gt;
    &amp;amp;= \frac{sin\;x}{cos^2x} \\&lt;br /&gt;
    &amp;amp;= \frac{1}{cos\;x} \times \frac{sin\;x}{cos\;x} \\&lt;br /&gt;
    &amp;amp;= sec\;x\:tan\;x&lt;br /&gt;
  \end{align}  &lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Generally, when differentiation trig functions, express the answer in terms of the original trig function if at all possible, as we did above.&lt;/p&gt;
&lt;p&gt;Consider: \(\frac{\delta}{\delta x} ln(sec\;x)&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x}ln(sec\;x) &amp;amp;= ln(sec\;x)&amp;#8216;(sec\;x)&amp;#8217; \\&lt;br /&gt;
    &amp;amp;= \frac{1}{sec\;x}(sec\;x)&amp;#8217; \\&lt;br /&gt;
    &amp;amp;= \frac{1}{sec\;x}(sec\;x\;tan\;x) \\&lt;br /&gt;
    &amp;amp;= tan\;x&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Consider: \(\frac{\delta}{\delta x}(x^{10} + 8x)^6\)&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \frac{\delta}{\delta x}(x^{10} + 8x)^6 = 6(x^{10} + 8x)^5(10x^9 + 8)&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We used the chain rule above because expanding the equation out to the 6th power would have taken a lot of space.&lt;/p&gt;
&lt;p&gt;Consider: \(\frac{\delta}{\delta x}e^{x\;tan^{-1}x}\)&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{\delta}{\delta x}e^{x\;tan^{-1}x} &amp;amp;= e^{x\;tan^{-1}x}(x\;tan^{-1}x)&amp;#8217; \\&lt;br /&gt;
  &amp;amp;= e^{x\;tan^{-1}x}(x(tan^{-1}x)&amp;#8217; + tan^{-1}x) \\&lt;br /&gt;
  &amp;amp;= e^{x\;tan^{-1}x}\left(tan^{-1}x + \frac{x}{1 + x^2}\right)&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Review Continued&lt;/h3&gt;
&lt;p&gt;The definition of the derivative:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\delta}{\delta x}f(x) = lim_{\Delta x \to 0} \frac{f(x + \Delta x) &amp;#8211; f(x)}{\Delta x}&lt;br /&gt;
\]&lt;br /&gt;
We discovered the derivative of the following functions using the first principles of differentiation:&lt;br /&gt;
\(\frac{1}{x}, x^n, sin\;x, cos\;x \text{last two using} \quad x = 0, a^x, (uv), \left(\frac{u}{v}\right)\)&lt;/p&gt;
&lt;p&gt;We also discussed the meaning of a derivative, that is, the rate of change with respect to some variable.&lt;/p&gt;
&lt;p&gt;You can also read the formula for a derivative backwards, and get the function from the limit:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \lim_{u \to 0}\frac{e^u &amp;#8211; 1}{u} &amp;amp;= \frac{e^{u &amp;#8211; 0} &amp;#8211; e^0}{u} \\&lt;br /&gt;
  &amp;amp;= \frac{\delta}{\delta x}e^u \bigg|_{u = 0} \\&lt;br /&gt;
  &amp;amp;= 1&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h2&gt;Applications of Differentiation&lt;/h2&gt;
&lt;h3&gt;Linear approximations&lt;/h3&gt;
&lt;p&gt;The formula for linear approximations:&lt;br /&gt;
\[&lt;br /&gt;
  f(x) \approx (fx_0) + f&amp;#8217;(x_0)(x &amp;#8211; x_0)&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This means that if you have a curve, such as \(y = f(x)\), then it is approximately the same as it&amp;#8217;s tangent line, \(y = f(x_0) + f&amp;#8217;(x_0)(x &amp;#8211; x_0)\).&lt;/p&gt;
&lt;p&gt;For example, consider the function \(f(x) = ln\;x\) and it&amp;#8217;s derivative, \(f&amp;#8217;(x) = \frac{1}{x}\), at \(x = 1\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  f(1) &amp;amp;= ln\;1 = 0 \\&lt;br /&gt;
  f&amp;#8217;(1) &amp;amp;= 1 \\&lt;br /&gt;
  ln\;x &amp;amp;\approx 0 + 1(x &amp;#8211; 1) \\&lt;br /&gt;
  &amp;amp;\approx x &amp;#8211; 1&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This shows that for the function \(ln\;x\), when \(x = 1\), it is approximate to the function \(y = x &amp;#8211; 1\). When \(x\) changes significantly, this is no longer true, and \(ln\;x\) will approximate some other function:&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/approx.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Remember the definition of a derivative is the limit as the change in \(x\) goes to zero, of the ratio of the change in the result of the function and the change in \(x\):&lt;br /&gt;
\[&lt;br /&gt;
  f&amp;#8217;(x) = \lim_{\Delta x \to 0} \frac{\Delta f}{\Delta x}&lt;br /&gt;
\]&lt;br /&gt;
You can also look at this backwards, by looking at the limit and determining the derivative based off of that.&lt;/p&gt;
&lt;p&gt;In linear approximation, what we&amp;#8217;re essentially saying is that as \(\Delta x\) gets close to 0:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\Delta f}{\Delta x} \approx f&amp;#8217;(x_0)&lt;br /&gt;
\]&lt;br /&gt;
That is, the average rate of change (\(\frac{\Delta f}{\Delta x}\)) is close to the infintesimal rate of change (\(f&amp;#8217;(x)\)) as \(x\) approaches some value.&lt;/p&gt;
&lt;p&gt;The formula above is the same as the formula for linear approximation:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\Delta f}{\Delta x} &amp;amp;\approx f&amp;#8217;(x_0) \\&lt;br /&gt;
    \Delta f &amp;amp;\approx f&amp;#8217;(x_0)\Delta x \\&lt;br /&gt;
    f(x) &amp;#8211; f(x_0) &amp;amp;\approx f&amp;#8217;(x_0)(x &amp;#8211; x_0) \\&lt;br /&gt;
    f(x) &amp;amp;\approx f(x_0) + f&amp;#8217;(x_0)(x &amp;#8211; x_0)&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h3&gt;Systematic discussion of linear approximation&lt;/h3&gt;
&lt;p&gt;When performing a systematic discussion, convention is to use \(x_0 = 0\). This will result in the formula for linear approximation:&lt;br /&gt;
\[&lt;br /&gt;
  f(x) \approx f(0) + f&amp;#8217;(0)x&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Below will be an analysis of the linear approximation of a few notable functions:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{array}{ l | l | l | l | l }&lt;br /&gt;
  f &amp;amp; f&amp;#8217; &amp;amp; f(0) &amp;amp; f&amp;#8217;(0) &amp;amp; f(0) + f&amp;#8217;(0)x \\ \hline&lt;br /&gt;
  sin\;x &amp;amp; cos\;x &amp;amp; 0 &amp;amp; 1 &amp;amp; x \\&lt;br /&gt;
  cos\;x &amp;amp; -sin\;x &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 \\&lt;br /&gt;
  e^x &amp;amp; e^x &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 + x \\&lt;br /&gt;
  ln(1 + x) &amp;amp; \frac{1}{1 + x} &amp;amp; 0 &amp;amp; 1 &amp;amp; x \\&lt;br /&gt;
  (1 + x)^r &amp;amp; r(1 + x)^{r &amp;#8211; 1} &amp;amp; 1 &amp;amp; r &amp;amp; 1 + rx \\&lt;br /&gt;
  \end{array}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;And geometrically:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;\(sin\;x\)&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/approx-sinx.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;\(cos\;x\)&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/approx-cosx.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;\(e^x\)&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/approx-ex.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The last two examples are important. Due to the convention of \(x = 0\), we can&amp;#8217;t find the tangent of \(ln\), because the slope of \(ln(0)\) tends \(-\infty\). The slope of \(x^r\) also tends to \(\infty\). To deal with this, we shift the function by starting from a base of one.&lt;/p&gt;
&lt;p&gt;Going back to our earlier approximation of \(ln\), we can consider the following:&lt;br /&gt;
\[&lt;br /&gt;
  ln\;u \approx u &amp;#8211; 1&lt;br /&gt;
\]&lt;br /&gt;
from above, and just set \(u = 1 + x\) to achieve the approximation at \(x = 0\).&lt;/p&gt;
&lt;h3&gt;Applications of linear approximation&lt;/h3&gt;
&lt;p&gt;Consider the following example:&lt;br /&gt;
\[&lt;br /&gt;
  ln\;1.1 \approx \frac{1}{10}&lt;br /&gt;
\]&lt;br /&gt;
We achieved this by using the rule from above:&lt;br /&gt;
\[&lt;br /&gt;
  ln(1 + x) \approx x&lt;br /&gt;
\]&lt;br /&gt;
and just set \(x = \frac{1}{10}\).&lt;/p&gt;
&lt;p&gt;This only holds because \(x\) is sufficiently small. We work with linear approximations of functions because they are easier to calculate than the functions themselves.&lt;/p&gt;
&lt;p&gt;You can see this in the following examples:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Example 1&lt;/b&gt;&lt;br /&gt;
Find the linear approximation &amp;#8220;near \(x = 0\)&amp;#8221; (\(x \approx 0\)) of:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{e^{-3x}}{\sqrt{1 + x}}&lt;br /&gt;
\]&lt;br /&gt;
We can find this from the formulas and their approximations above:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{e^{-3x}}{\sqrt{1 + x}} &amp;amp;= e^{-3x}(1 + x)^{-\frac{1}{2}} \\&lt;br /&gt;
  &amp;amp;\approx (1 &amp;#8211; 3x)(1 &amp;#8211; \frac{1}{2}x) \\&lt;br /&gt;
  &amp;amp;\approx 1 &amp;#8211; 3x &amp;#8211; \frac{1}{2}x + \frac{3}{2}x^2 \\&lt;br /&gt;
  &amp;amp;\approx 1 &amp;#8211; \frac{7}{2}x&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
Note that we discared the quadratic term \(\frac{3}{2}x^2\), because in the transitions above from the functions to their linear approximations, we already discard a lot of quadratic and exponential information, and we&amp;#8217;re only concerned with a linear approximation. It stands to reason that we discard all quadratic information. Also note that when \(x\) is sufficiently small, any quadratic terms are significantly smaller than the linear terms, and can safely be ignored.&lt;/p&gt;
&lt;p&gt;This is kind of the opposite as big O notation in computer science, where we discard smaller terms because we&amp;#8217;re only interested in the high value approximations.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Example 2&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This example is intended to be relatively real life, and model something you&amp;#8217;ll come across in real life.&lt;/p&gt;
&lt;p&gt;Consider the surface of the earth, and a satellite in orbit around the earth at velocity \(v\). The satellite is a &lt;span class=&quot;caps&quot;&gt;GPS&lt;/span&gt; satellite, and requires keeping time, \(T\). On the earth, from our frame of reference, we have time \(T&amp;#8217;\). Special relatively tells us there will be a time dilation between the times \(T\) and \(T&amp;#8217;\), given by:&lt;br /&gt;
\[&lt;br /&gt;
  T&amp;#8217; = \frac{T}{\sqrt{1 &amp;#8211; \frac{v^2}{c^2}}}&lt;br /&gt;
\]&lt;br /&gt;
where \(v\) is the velocity of the satellite, and \(c\) is the speed of light.&lt;br /&gt;
The goal is to determine the difference between times on the satellite and on the earth, or \(\Delta T\)&lt;/p&gt;
&lt;p&gt;We can solve this by using the approximations above, by setting \(u = \frac{v^2}{c^2}\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    T&amp;#8217; &amp;amp;= T(1 &amp;#8211; u)^{-\frac{1}{2}} \\&lt;br /&gt;
    &amp;amp;\approx T(1 + \frac{1}{2}\frac{v^2}{c^2})&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;To show how this is real life based, when putting the &lt;span class=&quot;caps&quot;&gt;GPS&lt;/span&gt; system into orbit, scientists needed to determine whether or not the time dilation would cause errors. The way the satellites are now, \(v = 4km/s\) and \(c = 3 \times 10^5 km/s\), which means that \(\frac{v^2}{c^2} \approx 10^{-10}\). As you can see, this resolves to an error of a few mm of resolution. Therefore it was determined the dilation wouldn&amp;#8217;t cause significant error.&lt;/p&gt;
&lt;h3&gt;Quadratic approximations&lt;/h3&gt;
&lt;p&gt;The quadratic approximation is an extension of linear approximation. The formula for quadratic approximation is:&lt;br /&gt;
\[&lt;br /&gt;
  f(x) \approx f(x_0) + f&amp;#8217;(x_0)(x &amp;#8211; x_0) + \frac{f&amp;#8217;&amp;#8217;(x)}{2}(x &amp;#8211; x_0)^2&lt;br /&gt;
\]&lt;br /&gt;
As you can see, it involves second derrivatives.&lt;/p&gt;
&lt;p&gt;Now we can extend the common functions we did for linear approximation, and fill them for quadratic approximation:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{array}{ l | l | l | l | l }&lt;br /&gt;
  f &amp;amp; f(0) + f&amp;#8217;(0)x &amp;amp; f&amp;#8217;&amp;#8217; &amp;amp; f&amp;#8217;&amp;#8217;(0) &amp;amp; f(0) + f&amp;#8217;(0)x + \frac{f&amp;#8217;&amp;#8217;(0)}{2}x^2 \\ \hline&lt;br /&gt;
  sin\;x &amp;amp; x &amp;amp; -sin\;x &amp;amp; 0 &amp;amp; x \\&lt;br /&gt;
  cos\;x &amp;amp; 1 &amp;amp; -cos\;x &amp;amp; -1 &amp;amp; 1 &amp;#8211; \frac{1}{2}x^2 \\&lt;br /&gt;
  e^x &amp;amp; 1 + x &amp;amp; e^x &amp;amp; 1 &amp;amp; 1 + x + \frac{1}{2}x^2 \\&lt;br /&gt;
  \end{array}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Geometrically, the significance of the quadratic term can be shown in the following graph:&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/quad-approx.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As you can see in the graph, the quadratic approximation is a parabola beneath the linear approximation that more closely fits the cosine wave at \(x = 0\). This tells us more information about the function, such as what it&amp;#8217;s doing on both the positive and negative limits.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Udacity AI for Robotics - Week 1</title>
   <link href="http://www.timgittos.com/learning/udacity-ai-for-robotics/week-1"/>
   <updated>2012-02-22T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/udacity-ai-for-robotics/week-1</id>
   <content type="html">&lt;h2&gt;Localization&lt;/h2&gt;
&lt;p&gt;The problem that localization solves is that of determining the robot&amp;#8217;s position to within a 2 &amp;#8211; 10cm precision. Using &lt;span class=&quot;caps&quot;&gt;GPS&lt;/span&gt; is not sufficient, as it can have a 2 &amp;#8211; 10m precision, which can result in the robotic car crashing on the side of the road.&lt;/p&gt;
&lt;h3&gt;Conceptual Overview&lt;/h3&gt;
&lt;p&gt;Before getting stuck into the specifics of localization, it will help to get a conceptual overview of what localization does. Localization is a way of modeling where in the environment the robot is.&lt;br /&gt;
This is done by way of computing probabilities of possible locations, in a multi step process that involces reading sensor data from the environment, calculating the belief, moving, recalculating belief and then reading from sensor data again, and recalculating belief.&lt;/p&gt;
&lt;p&gt;The following diagram will illustrate this process, and then it will be explained step by step:&lt;br /&gt;
&lt;img src=&quot;/images/air/localization.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;First, we&amp;#8217;re modeling a robot in an environment with 3 doors. The initial belief is called the uniform maximum confusion. This indicates that the robot has absolutely no idea where in the environment it is. It does know what the environment as a whole looks like, however.&lt;/p&gt;
&lt;p&gt;First, it takes a sensor reading from the environment, and detects that it is in front of a door. This reading allows the robot to calculate the probability it is at a given position. As can be seen, it believes it is at one of three positions. Note also that there is a margin of error on the sensors, so there is also a low probability that it could be in a position that is not in front of a door. This is called the posterier belief, because it occurs after a measurement.&lt;/p&gt;
&lt;p&gt;Next, the robot moves a certain distance, and it updates it&amp;#8217;s belief state. This is called a convolution of it&amp;#8217;s belief state. Notice that the probabilities have flattened out somewhat, as there is also a margin of error on the movement. This updated belief state is called the prior belief, because it is a belief before any measurement.&lt;/p&gt;
&lt;p&gt;Lastly, the robot takes another sensor reading of the environment, and detects it is infront of another door. It calculates the probability that it is at a given point, and multiplies it with the prior probability. This has the effect of reinforcing the fact that it saw a door, moved and saw another door. It now strongly believes it&amp;#8217;s currently in front of the second door.&lt;/p&gt;
&lt;p&gt;If it moved, convoluted it&amp;#8217;s belief, and read the environment again and detected another door, then the strong belief that it was in front of the second door would be weakend, representing the fact that the robot could have had a malfunction in movement.&lt;/p&gt;
&lt;h2&gt;Uniform maximum confusion&lt;/h2&gt;
&lt;p&gt;Consider there are 5 discrete locations the robot can be in. The initial uniform maximum confusion will be a uniform probability distributed over the 5 discrete locations, and it will be normalized, meaning it sums to one. Therefore, each location will have a probability of 0.2 of being correct.&lt;/p&gt;
&lt;h2&gt;Posterier update&lt;/h2&gt;
&lt;p&gt;After a measurement, the robot updates the probabilities for each location being considered. The probability in a cell is weighted based on the measurement result. An example of this can be seen below:&lt;br /&gt;
&lt;img src=&quot;/images/air/posterierupdate.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;In the above example, the robot observes it is on a red square. The belief state of all red squares is multiplied by 0.6, which is the probability of measuring red, and the belief state of all green squares is multiplied by 0.2, which is the probability of measuring green.&lt;/p&gt;
&lt;p&gt;These probabilities are not valid, however, as they need to be normalized. Here is the result of the normalization:&lt;br /&gt;
&lt;img src=&quot;/images/air/posteriernorm.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Robot Motion&lt;/h2&gt;
&lt;p&gt;When the robot moves, we typically model this action as uncertain. The robot motion may fail for any number of reasons, and so we assign a probability to the success of the motion. In an exact motion model, the probability of motion is 1.&lt;/p&gt;
&lt;p&gt;When motion is uncertain, the robot&amp;#8217;s position in the world itself because even more uncertain:&lt;br /&gt;
&lt;img src=&quot;/images/air/inexactmotion.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Everytime the robot moves, it loses information. This is because the movement is uncertain.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Robot localization is a loop of move and sense. When the robot senses, it gains information. When the robot moves, it loses information.&lt;br /&gt;
Here is some python code that demonstrates the concepts discussed above:&lt;/p&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;h2&gt;Formal Definition&lt;/h2&gt;
&lt;p&gt;The heart of the localization algorithm is probability and Bayes rule. For the formal definition, please see the &lt;a href=&quot;/files/ai-class/notes-week-02.pdf&quot;&gt;notes on the Stanford online AI class, specifically Week 2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the above Python code, we applied Bayes rule as follows:&lt;/p&gt;
&lt;p&gt;Assume \(X\) is the collection of grid cells, and \(Z\) is the measurement made.&lt;br /&gt;
\[&lt;br /&gt;
  P(X_i|Z) = \frac{P(Z|X_i) P(X_i)}{P(Z)}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The above represents the following statement in Bayes Rule:&lt;br /&gt;
The probability of being in cell \(X_i\) given measurement \(Z\) can be found by multiplying the probability of measuring \(Z\) while in cell \(X_i\) multiplied by the prior belief that the robot is in \(X_i\), normalized by the probability of observing \(Z\) in any cell.&lt;/p&gt;
&lt;p&gt;We represented it programatically as:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \bar{P}(X_i|Z) &amp;amp;\leftarrow P(Z|X_i) P(X_i) \\&lt;br /&gt;
    \alpha &amp;amp;\leftarrow \sum \bar{P}(X_i|Z) \\&lt;br /&gt;
    P(X_i|Z) &amp;amp;\leftarrow \frac{1}{\alpha} \bar{P}(X_i|Z)&lt;br /&gt;
  \end{align}&lt;br /&gt;
\] &lt;br /&gt;
where \(\alpha\) is the sum of the probabilities of observing \(Z\). This was programmed in the sense function of the Python code above.&lt;/p&gt;
&lt;p&gt;Motion in localization is covered by the concept of total probability:&lt;br /&gt;
\[&lt;br /&gt;
  P(X_i^t) = \sum_j P(X_j^{t-1}) . P(X_i | X_j)&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This says that the probability of being in cell \(X_i\) at time \(t\) is the sum of the probabilities of being in that cell at \(t-1\) times the probability of getting to that cell from any other cells, \(X_j\).&lt;/p&gt;
&lt;p&gt;You can see this programmed into the move function of the Python code above.&lt;/p&gt;
&lt;p&gt;This can be generalized to:&lt;br /&gt;
\[&lt;br /&gt;
  P(A) = \sum_B P(A|B) P(B)&lt;br /&gt;
\]&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Udacity AI for Robotics</title>
   <link href="http://www.timgittos.com/learning/udacity-ai-for-robotics"/>
   <updated>2012-02-21T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/udacity-ai-for-robotics</id>
   <content type="html">&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;THIS&lt;/span&gt; IS A &lt;span class=&quot;caps&quot;&gt;PLACEHOLDER&lt;/span&gt; SO &lt;span class=&quot;caps&quot;&gt;THAT&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;THE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;APPEARS&lt;/span&gt; IN &lt;span class=&quot;caps&quot;&gt;THE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;PROJECT&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;LIST&lt;/span&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Linear Algebra - Week 3</title>
   <link href="http://www.timgittos.com/learning/mit-linear-algebra/week-3"/>
   <updated>2012-02-18T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-linear-algebra/week-3</id>
   <content type="html">&lt;h2&gt;Permutations&lt;/h2&gt;
&lt;p&gt;Permutation matrices \(P\) execute row exchanges.&lt;/p&gt;
&lt;p&gt;The concept of \(A = LU\), that is, a matrix \(A\) can be factorized into an elimination matrix \(U\) and a set of operations performed during the elimination \(L\). This model supposes no permutations were required during elimination.&lt;/p&gt;
&lt;p&gt;\(PA = LU\) is the description of elimination that takes into account row exchanges, or permutations, occur.&lt;/p&gt;
&lt;h2&gt;Transposes&lt;/h2&gt;
&lt;p&gt;Transposing a matrix:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 3 \\&lt;br /&gt;
  2 &amp;amp; 3 \\&lt;br /&gt;
  4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  ^T&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 4 \\&lt;br /&gt;
  3 &amp;amp; 3 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Generally:&lt;br /&gt;
\[&lt;br /&gt;
  A^T_{i,j} = A_{j,i}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Symmetric matrices are matrices that are the transposes of themselves. That is, \(A^T = A\). Needless to say, a symmetric matrix must be square.&lt;/p&gt;
&lt;p&gt;The product of a matrix and it&amp;#8217;s transpose is a symmetric matrix. \(A^TA\) is always symmetric:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 3 \\&lt;br /&gt;
  2 &amp;amp; 3 \\&lt;br /&gt;
  4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 4 \\&lt;br /&gt;
  3 &amp;amp; 3 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  10 &amp;amp; 11 &amp;amp; 7 \\&lt;br /&gt;
  11 &amp;amp; 13 &amp;amp; 11 \\&lt;br /&gt;
  7 &amp;amp; 11 &amp;amp; 17&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Generally:&lt;br /&gt;
\[&lt;br /&gt;
  (A^TA)^T = A^TA^{TT} = A^TA&lt;br /&gt;
\]&lt;/p&gt;
&lt;h2&gt;Vector spaces &amp;amp; subspaces&lt;/h2&gt;
&lt;p&gt;A vector space is a space, or set of vectors that allow us to take linear combinations of vectors, and multiply vectors by any scalar, and perform vector addition.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Examples:&lt;/b&gt;&lt;br /&gt;
\(R^2\) is a space of all 2-dimension real vectors. Such as \( \begin{bmatrix}3 \\ 2 \end{bmatrix}, \begin{bmatrix}0\\0\end{bmatrix}, \begin{bmatrix}\pi\\e\end{bmatrix}\). This is also known as the x-y plane.&lt;/p&gt;
&lt;p&gt;\(R^3\) is a space of all 3-dimensional real vectors, similar to above, that is, 3 real compents.&lt;/p&gt;
&lt;p&gt;Generally, \(R^n\) is the space of all vectors with \(n\) real numbers.&lt;/p&gt;
&lt;p&gt;Let us imagine the vector space \(R^2\), only lets define it only for positive components. This reduces the vector space to \(\frac{1}{4}\) of it&amp;#8217;s normal size. Consider the task of multiplying a vector by the scalar \(-1\). This would produce a result that is undefined for this restriction. Therefore, this restriction is not a vector space, as it doesn&amp;#8217;t satisfy the rules of a space. That is, it&amp;#8217;s not closed under multiplication of real numbers.&lt;/p&gt;
&lt;p&gt;Imagining the same vector space \(r^2\), and inside this space we have a vector. Lets say we restrict our space to only linear combinations of our vector. That is, we can make our vector as long as as short as we want, and can add and subtract vectors that lie on the same line as the original vector. By that definition, we have defined a vector space inside \(R^2\), called a subspace of \(R^2\). Note, to be a valid subspace, it must contain 0. Therefore the line must pass through the origin in our \(R^2\) space.&lt;br /&gt;
Note, that the subspace of \(R^2\) is not \(R^1\) &amp;#8211; the vectors still contain 2 components.&lt;/p&gt;
&lt;p&gt;Subspaces of \(R^2\):&lt;br /&gt;
1. all of \(R^2\). A space is a subspace of itself.&lt;br /&gt;
2. any line through the point \(\begin{bmatrix}0\\0\end{bmatrix}\).&lt;br /&gt;
3. the zero vector only &amp;#8211; \(Z\)&lt;/p&gt;
&lt;p&gt;Lets apply this concept of subspaces to matrices.&lt;/p&gt;
&lt;p&gt;Consider the matrix A:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 3 \\&lt;br /&gt;
  2 &amp;amp; 3 \\&lt;br /&gt;
  4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The columns of this matrix and all their combinations form a subspace. This is called the column space, \(C(A)\).&lt;br /&gt;
Note this is a subspace of \(R^3\), because each column is \(R^3\), and they form a plane.&lt;/p&gt;
&lt;p&gt;The union of two subspaces does not make a subspace in itself. If you add a vector from one subspace to another vector from a different subspace may result in a vector that lies outside the union of subspaces.&lt;/p&gt;
&lt;p&gt;However, the intersection of two subspaces is a subspace. Consider two subspaces, \(S\) and \(T\), and two vectors in the intersection of those subspaces, \(v\) and \(u\). If \(v\) and \(u\) are both in \(S\), and \(S\) is a subspace, then \(v+u\) will also be in \(S\). Likewise, \(v\) and \(u\) are both in \(T\), and \(T\) is a subspace, therefore \(v+u\) will be in \(T\). This shows that the intersection of \(S\) and \(T\) is a subspace.&lt;/p&gt;
&lt;h2&gt;Column Space&lt;/h2&gt;
&lt;p&gt;Column space of matrix \(A\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 1 &amp;amp; 2 \\&lt;br /&gt;
  2 &amp;amp; 1 &amp;amp; 3 \\&lt;br /&gt;
  3 &amp;amp; 1 &amp;amp; 4\\&lt;br /&gt;
  4 &amp;amp; 1 &amp;amp; 5&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The column space of \(A\) is a subspace of \(R^4\), because \(A\) is a \(4 \times 3\) matrix. It contains:&lt;br /&gt;
- The columns of \(A\)&lt;br /&gt;
- All linear combinations of the columns of \(A\)&lt;br /&gt;
- The zero vector&lt;br /&gt;
The column subspace is itself a subspace of \(R^4\).&lt;/p&gt;
&lt;p&gt;To answer how we know that, we need to reframe our purpose in studying linear algebra.&lt;br /&gt;
The purpose of studying linear algebra is to understand the equation:&lt;br /&gt;
\[&lt;br /&gt;
  Ax = b&lt;br /&gt;
\]&lt;br /&gt;
and to know if, there is a solution to this equation for ever \(b\).&lt;/p&gt;
&lt;p&gt;There is not a solution for every \(b\), because if you look at A, you can see there are 4 equations with only 3 unknowns:&lt;br /&gt;
\[&lt;br /&gt;
  Ax = &lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 1 &amp;amp; 2 \\&lt;br /&gt;
  2 &amp;amp; 1 &amp;amp; 3 \\&lt;br /&gt;
  3 &amp;amp; 1 &amp;amp; 4 \\&lt;br /&gt;
  4 &amp;amp; 1 &amp;amp; 5&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  x_1 \\&lt;br /&gt;
  x_2 \\&lt;br /&gt;
  x_3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  b_1 \\&lt;br /&gt;
  b_2 \\&lt;br /&gt;
  b_3 \\&lt;br /&gt;
  b_4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
This is because the linear combinations of the columns of \(A\) won&amp;#8217;t fill all of \(R^4\).&lt;/p&gt;
&lt;p&gt;However, there are some solutions, and all of these solutions lie in the column space, that is, they are linear combinations of the columns of \(A\).&lt;/p&gt;
&lt;p&gt;Note that all the columns of \(A\) are not linearly independent &amp;#8211; column 3 is linearly dependent on columns 1 &amp;amp; 2, and column 1 is linearly dependent on 2 &amp;amp; 3. We can get rid of either column 1 or column 3 (but not both) and not lose information about the column space.&lt;br /&gt;
Therefore, the column space is actually a subspace in \(R^2\) of \(R^4\).&lt;/p&gt;
&lt;h2&gt;Nullspace&lt;/h2&gt;
&lt;p&gt;Lets consider again the matrix \(A\), above.&lt;/p&gt;
&lt;p&gt;The null space of \(A\) contains all solutions \(x\), as above, to the equation:&lt;br /&gt;
\[&lt;br /&gt;
  Ax = 0&lt;br /&gt;
\]&lt;br /&gt;
That is, all vectors that nulify the matrix \(A\).&lt;/p&gt;
&lt;p&gt;The nullspace is a subspace of \(R^3\), because there are only 3 unknowns, as you can see by looking at \(x\).&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  Ax = &lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 1 &amp;amp; 2 \\&lt;br /&gt;
  2 &amp;amp; 1 &amp;amp; 3 \\&lt;br /&gt;
  3 &amp;amp; 1 &amp;amp; 4 \\&lt;br /&gt;
  4 &amp;amp; 1 &amp;amp; 5&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  x_1 \\&lt;br /&gt;
  x_2 \\&lt;br /&gt;
  x_3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  0 \\&lt;br /&gt;
  0 \\&lt;br /&gt;
  0 \\&lt;br /&gt;
  0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;One solution to the above equation is:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 \\ 1 \\ -1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
and in fact, the definition of the nullspace of \(A\) is any combination of the above vector, or:&lt;br /&gt;
\[&lt;br /&gt;
  c&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 \\ 1 \\ -1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The nullspace of \(A\) is a subspace of \(R^3\) and forms a line.&lt;/p&gt;
&lt;p&gt;We can prove that the solutions to \(Ax = 0\) always give a subspace algebraically:&lt;br /&gt;
if \(Av = 0\) and \(Aw = 0\), then \(A(v + w) = 0\). We can restart \(A(v + w) = 0\) as \(Av + Aw = 0\). \(0 + 0 = 0\) will always hold, therefore the solutions to \(Ax = 0\) will always give a subspace.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Single Variable Calculus - Week 3</title>
   <link href="http://www.timgittos.com/learning/mit-single-variable-calculus/week-3"/>
   <updated>2012-02-17T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-single-variable-calculus/week-3</id>
   <content type="html">&lt;h2&gt;Implicit differentiation&lt;/h2&gt;
&lt;p&gt;Implicit differentiation is a technique that allows you to differentiate functions that you may not have even been able to see.&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \frac{\delta}{\delta x}x^2 = ax^{a-1}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;So far we&amp;#8217;ve covered the case where \(a\) is an integer: \(a = 0, \pm 1, \pm 2, \ldots \). Now we&amp;#8217;re going to consider the case where \(a\) is a rational number: \( a = \frac{m}{n}\), where m &amp;amp; n are integers.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Example 1&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    y &amp;amp;= x^{\frac{m}{n}} \qquad \text{(1)} \\&lt;br /&gt;
    y^n &amp;amp;= x^m \qquad \text{(2)}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Now, we apply \(\frac{\delta}{\delta x}\) to equation (2). We don&amp;#8217;t apply to equation (1) because right now, we don&amp;#8217;t know how to differentiate it. We do know how to differentiate (2).&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x} y^n &amp;amp;= \frac{\delta}{\delta x}x^m \\&lt;br /&gt;
    \left( \frac{\delta}{\delta y}y^n \right) \frac{\delta y}{\delta x} &amp;amp;= mx^{m-1} \qquad \text{(by the chain rule)} \\&lt;br /&gt;
    ny^{n-1}\frac{\delta y}{\delta x} &amp;amp;= mx^{m-1} \\&lt;br /&gt;
    \frac{\delta y}{\delta x} &amp;amp;= \frac{m x^{m &amp;#8211; 1}}{n y^{n &amp;#8211; 1}} \\&lt;br /&gt;
    &amp;amp;= \frac{m}{n} \frac{x^{m-1}}{(x^\frac{m}{n})^{n-1}} \\&lt;br /&gt;
    &amp;amp;= a x^{m-1-(n-1)\frac{m}{n}} \\&lt;br /&gt;
    &amp;amp;= a x^{m-1-m+\frac{m}{n}} \\&lt;br /&gt;
    &amp;amp;= a x^{-1 + \frac{m}{n}} \\&lt;br /&gt;
    &amp;amp;= a x^{a-1} &lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;span class=&quot;caps&quot;&gt;NOTE&lt;/span&gt;: &lt;span class=&quot;caps&quot;&gt;THE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;CHAIN&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;RULE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;WILL&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;CAUSE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;YOU&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;ISSUES&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Example 2&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  x^2 + y^2 = 1&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is defining \(y\) as a function of \(x\) implictily. That means it can be arranged to express \(y\) in terms of \(x\).&lt;/p&gt;
&lt;p&gt;Solving for y:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    y^2 &amp;amp;= 1 &amp;#8211; x^2 \\&lt;br /&gt;
    y &amp;amp;= \pm \sqrt{1 &amp;#8211; x^2} \\&lt;br /&gt;
    y &amp;amp;= (1-x^2)^{\frac{1}{2}} \qquad \text{considering positive branch only} \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= \frac{1}{2}(1 &amp;#8211; x^2)^{-\frac{1}{2}}(-2x) \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= (1 &amp;#8211; x^2)^{-\frac{1}{2}}(-x) \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= \frac{-x}{\sqrt{1 &amp;#8211; x^2}}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The above is the explicit differentiation. &lt;br /&gt;
Following is the implicit method:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x} (x^2 + y^2 &amp;amp;= 1) \\&lt;br /&gt;
    2x + 2yy&amp;#8217; &amp;amp;= 0 \qquad \text{(by the chain rule)} \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= -\frac{2x}{2y} \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= -\frac{x}{y} \\&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The result of the explicit and implicit methods are the same, and the implicit is better than the explicit because it doesn&amp;#8217;t differentiate between positive and negative values for \(y\) and \(x\).&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Example 3&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Consider the equation \(y^4 + xy^2 &amp;#8211; 2 = 0\).&lt;/p&gt;
&lt;p&gt;We can solve it explicitly: (using the &lt;a href=&quot;http://www.purplemath.com/modules/sqrquad2.htm&quot;&gt;quadratic forumula&lt;/a&gt; )&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    y^2 &amp;amp;= \frac{-x \pm \sqrt{x^2 &amp;#8211; 4(-2)}}{2} \\&lt;br /&gt;
    y &amp;amp;= \pm \sqrt{\frac{-x \pm \sqrt{x^2+8}}{2}} \\&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Notice the 4 different roots of the equation (because it&amp;#8217;s to the 4th power).&lt;br /&gt;
It&amp;#8217;s very complex and time consuming.&lt;/p&gt;
&lt;p&gt;Compare this to the implicit method:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x}(y^4 + xy^2 -2 = 0) \\&lt;br /&gt;
    4y^3y&amp;#8217; + y^2 + x(2yy&amp;#8217;) &amp;#8211; 0 &amp;amp;= 0 \\&lt;br /&gt;
    (4y^3 + 2xy)y&amp;#8217; + y^2 &amp;amp;= 0 \\&lt;br /&gt;
    (4y^3 + 2xy)y&amp;#8217; &amp;amp;= -y^2 \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= \frac{-y^2}{4y^3 + 2xy}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;To solve \(y&amp;#8217;\) in terms of x, we&amp;#8217;d need to put the result of the explicit method (so far) into the implicit method. The two go hand in hand.&lt;br /&gt;
Although the implicit method hides the conplexity of solving a quartic equation, it still exists, and at some point, we&amp;#8217;re going to have to deal with it. That means going through all possible 4 roots to find the answer.&lt;/p&gt;
&lt;h2&gt;Inverse functions&lt;/h2&gt;
&lt;p&gt;The inverse of a function is the function that gets us back to our original arguments. For example:&lt;br /&gt;
\[&lt;br /&gt;
  y = \sqrt{x} \text{for x \gt 0}, y^2 = x&lt;br /&gt;
\]&lt;br /&gt;
if we define these in terms of functions:&lt;br /&gt;
\[&lt;br /&gt;
  f(x) = \sqrt{x}, g(y) = x, g(y) = y^2&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;In general:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{array}{2,1}&lt;br /&gt;
  y = f(x), g(y) = x \\&lt;br /&gt;
  g(f(x)) = x, g = f^{-1}, f = g^{-1}&lt;br /&gt;
  \end{array}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Consider the case of graphing a function and it&amp;#8217;s inverse. The inverse can be obtained by swapping the \(x\) and \(y\) values, which in effect is mirroring the function along the line \(x = y\).&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/inverse.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Implicit differentiation allows us to find the derivative of any inverse function, provided we know the derivative of the function.&lt;/p&gt;
&lt;p&gt;Example 1:&lt;/p&gt;
&lt;p&gt;Consider the function:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  y = tan^{-1}x&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which can be rearranged/simplified by taking \(tan\) of each side:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  tan\;y = x&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This can be graphed as follows:&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/inverse-tan.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Recall that&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{\delta}{\delta y} tan\;y &amp;amp;= \frac{\delta}{\delta y} \frac{sin\;y}{cos\;y} \\&lt;br /&gt;
  &amp;amp;= \frac{1}{cos^2y}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x} (tan\;y &amp;amp;= x) \\&lt;br /&gt;
    (\frac{\delta}{\delta y} tan\;y)\frac{\delta y}{\delta x} &amp;amp;= 1 \\&lt;br /&gt;
    \frac{1}{cos^2y} y&amp;#8217; &amp;amp;= 1 \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= cos^2y&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Where we apply \(\frac{\delta}{\delta x}\) to both sides (thats why the x turns into a 1). However, we wanted to find \(\frac{\delta}{\delta x}tan^{-1}x\). We can simplify this by expressing \(cos\;y\) in terms of it&amp;#8217;s defining ratio:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/svcalc/tan-ratio.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;which shows us the hypotenuse is \(\sqrt{1 + x^2}\). This gives us:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  cos\;y &amp;amp;= \frac{1}{\sqrt{1 + x^2}} \\&lt;br /&gt;
  cos^2y &amp;amp;= \frac{1}{1 + x^2}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and then we substitute in the above:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{\delta}{\delta x}tan^{-1}x &amp;amp;= cos^2(tan^{-1}x) \\&lt;br /&gt;
  &amp;amp;= \frac{1}{1 + x^2}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Example 2:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    y &amp;amp;= sin^{-1}x \\&lt;br /&gt;
    sin y &amp;amp;= x \\&lt;br /&gt;
    (cos\;y)y&amp;#8217; &amp;amp;= 1 \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= \frac{1}{cos\;y} \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= \frac{1}{\sqrt{1 &amp;#8211; sin^2y}} \\&lt;br /&gt;
    y&amp;#8217; &amp;amp;= \frac{1}{\sqrt{1 &amp;#8211; x^2}} \\&lt;br /&gt;
    \therefore \frac{\delta}{\delta x}sin^{-1}x &amp;amp;= \frac{1}{\sqrt{1 &amp;#8211; x^2}}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;h2&gt;Exponentials &amp;amp; Logarithms&lt;/h2&gt;
&lt;p&gt;First, lets review exponents.&lt;br /&gt;
Consider some base, \(a\), such that \(a &amp;gt; 0\). We know that \(a^0 = 0\), \(a^1 = a\), \(a^2 = a \times a\). Generally:&lt;br /&gt;
\[&lt;br /&gt;
  a^{x_1 + x_2} = a^{x_1}a^{x_2}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is known as the law of exponents. From this we can derive:&lt;br /&gt;
\[&lt;br /&gt;
  (a^{x_1})^{x_2} = a^{x_1x_2}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Likewise:&lt;br /&gt;
\[&lt;br /&gt;
  a^{\frac{m}{n}} = \sqrt[n]{a^m}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\(a^x\) is defined for all x by continuity. We can calculate things like \(a^\pi\) and \(a^{\sqrt{2}}\) using the rules above.&lt;/p&gt;
&lt;p&gt;Example graph of \(y = 2^x\):&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/exp.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;WThe ultimate goal is to be able to solve&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\delta}{\delta x}a^x&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can begin by going back to first principles:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{\delta}{\delta x}a^x &amp;amp;= \lim_{\Delta x \to 0} \frac{a^{x + \Delta x} &amp;#8211; a^x}{\Delta x} \\ &lt;br /&gt;
  &amp;amp;= \lim_{\Delta x \to 0} \frac{a^x a^{\Delta x} &amp;#8211; a^x}{\Delta x} \\&lt;br /&gt;
  &amp;amp;= \lim_{\Delta x \to 0} a^x \frac{a^{\Delta x} &amp;#8211; 1}{\Delta x} \\&lt;br /&gt;
  &amp;amp;= a^x \lim_{\Delta x \to 0} \frac{a^{\Delta x} &amp;#8211; 1}{\Delta x}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We move the \(a^x\) out of the limit, because as the limit tends to 0, \(a^x\) is constant, and can be moved out of the limit.&lt;br /&gt;
Next, lets define a new variable, and express the above equation in a new way:&lt;br /&gt;
\[&lt;br /&gt;
  M(a) = \lim_{\Delta x \to 0} \frac{a^{\Delta x} &amp;#8211; 1}{\Delta x}&lt;br /&gt;
\]&lt;br /&gt;
so that&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\delta}{\delta x}a^x = M(a)a^x&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;If we recall back to the start of the course, we can recognise that as the equation of a line, the tangent line. From here, we can work out the slope of \(a^x\). First, plug in \(a = 0\) to the above:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \left. \frac{\delta}{\delta x}a^x \right|_{x = 0} &amp;amp;= M(a)a^0 \\&lt;br /&gt;
  &amp;amp;= M(a)&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;So we can see that the slope of \(a^x\) at \(x = 0\) is \(M(a)\). What is \(M(a)\)? &lt;br /&gt;
Solving \(M(a)\) is difficult. Lets beg the question, and instead, define \(e\) as the number such that \(M(e) = 1\).&lt;br /&gt;
The consequences of having a number such as \(e\) are as follows:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{\delta}{\delta x}e^x &amp;amp;= M(e)e^x \\&lt;br /&gt;
  &amp;amp;= e^x&lt;br /&gt;
  \end{align}&lt;br /&gt;
\] &lt;br /&gt;
which is based on the above derivation. &lt;br /&gt;
Also note that \(M(e)\) at \(x = 0\) is 1. That is, the slope of the tangent line at \(x = 0\) is 1.&lt;/p&gt;
&lt;p&gt;How do we know that a number such as \(e\) exists?&lt;/p&gt;
&lt;p&gt;Without defining \(e\), we can show graphically that it must exist.&lt;/p&gt;
&lt;p&gt;Consider the graph of the function \(y = 2^x\), and compare the tangent line at \(x = 0\) (\(M(2)\)) to the secant line through the points \((0,1), (1,2)\):&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/m2.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
Notice the slope of the line \(M(2)\) is less than the secant.&lt;/p&gt;
&lt;p&gt;Now compare the graph of the function \(y = 4^x\) and compare \(M(4)\) against the same secant:&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/m4.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
Notice the slope of the line is greater than the secant.&lt;/p&gt;
&lt;p&gt;This shows that somewhere between the bases of 2 and 4, there is a number where \(M(a) = 1\).&lt;/p&gt;
&lt;p&gt;To fit this concept together with where we left the derivation off, we need to use the natural log.&lt;br /&gt;
If \(y = e^x\), then \(ln\;y = x\). That is, the natural log is the inverse of \(e^x\).&lt;/p&gt;
&lt;p&gt;A refresher on logarithms:&lt;br /&gt;
- \(ln(x_1x_2) = ln\;x_1 + ln\;x_2\)&lt;br /&gt;
- \(ln\;1 = 0\)&lt;br /&gt;
- \(ln\;e = 1\)&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/svcalc/ln.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Next, we need to cover computing the derivative of a logarithm. Remember from implicit differentiation, we can compute the derivative of a function if we know the derivative of it&amp;#8217;s inverse. That&amp;#8217;s the rational behind finding the derivative.&lt;/p&gt;
&lt;p&gt;First, lets define \(w = ln\;x\). Using the above rules of \(ln\) and \(e\) we can show that:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  e^w &amp;amp;= x \\&lt;br /&gt;
  \frac{\delta}{\delta x}e^w &amp;amp;= \frac{\delta}{\delta x} x \\&lt;br /&gt;
  &amp;amp;= 1 \\&lt;br /&gt;
  (\frac{\delta}{\delta w}e^w)(\frac{\delta w}{\delta x}) &amp;amp;= 1 \\&lt;br /&gt;
  e^w \frac{\delta w}{\delta x} &amp;amp;= 1 \\&lt;br /&gt;
  \frac{\delta w}{\delta x} &amp;amp;= \frac{1}{e^w} \\&lt;br /&gt;
  &amp;amp;= \frac{1}{x}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;See that \(\frac{\delta}{\delta w}e^w = e^w\) based on the assumption that \(M(e) = 1\).&lt;br /&gt;
&lt;a href=&quot;http://ocw.mit.edu/courses/mathematics/18-01-single-variable-calculus-fall-2006/lecture-notes/lec6.pdf&quot;&gt;For further info, check the lecture notes for this lecture.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Therefore we get:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\delta}{\delta x}ln\;x = \frac{1}{x}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;To summarize, we have these two rates of change:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\delta}{\delta x} e^x = e^x&lt;br /&gt;
\]&lt;br /&gt;
and&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\delta}{\delta x} ln\;x = \frac{1}{x}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;With these two derivatives in hand, we can return to the task of solving \(M(a)\), and so differentiate \(a^x\). There are two methods we can use to solve any exponential.&lt;/p&gt;
&lt;p&gt;Method 1:&lt;/p&gt;
&lt;p&gt;Convert the exponential to base \(e\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    a^x &amp;amp;= (e^{ln\;a})^x \\&lt;br /&gt;
    &amp;amp;= e^{x\;ln\;a}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
and then differentiate:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{\delta}{\delta x}a^x &amp;amp;= \frac{\delta}{\delta x}e^{x\;ln\;a} \\&lt;br /&gt;
  &amp;amp;= (ln\;a)e^{x\;ln\;a}&lt;br /&gt;
  &amp;amp;= (ln\;a)a^x&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
and we can see therefore that \(M(a) = ln\;a\).&lt;/p&gt;
&lt;p&gt;The above works because of 2 things, and can be illustrated as follows:&lt;br /&gt;
\[&lt;br /&gt;
  \frac{\delta}{\delta x}e^{3x} = 3e^{3x}&lt;br /&gt;
\]&lt;br /&gt;
The 3 is the derivative of \(3x\), and is multiplied by the derivative of \(e^{3x}\), which is \(e^{3x}\).&lt;br /&gt;
The same is occuring above. \(ln\;a\) is a constant, and so we differentiate out the \(x\) and multiply it by the derivative of \(e\), which is itself.&lt;/p&gt;
&lt;p&gt;Method 2:&lt;/p&gt;
&lt;p&gt;The second method involves logarithmic differentiation.&lt;/p&gt;
&lt;p&gt;Sometimes it&amp;#8217;s easier to differentiate the logarithm of a function instead of the function itself.&lt;br /&gt;
Lets assume some function \(u\), and solve:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta u} ln\;u &amp;amp;= \left(\frac{\delta ln\;u}{\delta u}\right)\left(\frac{\delta u}{\delta x}\right) \\&lt;br /&gt;
    &amp;amp;= \frac{1}{u} \frac{\delta u}{\delta x}&lt;br /&gt;
    &amp;amp;= \frac{u&amp;#8217;}{u}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
where we switch notation in the last step.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s easy to see where to go now from here to solve for \(a^x\):&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x} a^x \bigg| u = a^x \\&lt;br /&gt;
    ln\;u &amp;amp;= x\;ln\;a \\&lt;br /&gt;
    \frac{\delta}{\delta x} x\;ln\;a &amp;amp;= ln\;a \\&lt;br /&gt;
    (a^x)&amp;#8217; &amp;amp;= (ln\;a)a^x&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Example 2 of method 2&lt;/b&gt;&lt;br /&gt;
An example of having moving exponents and a moving base.&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s consider the function:&lt;br /&gt;
\[&lt;br /&gt;
  v = x^x&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Solve \(\frac{\delta}{\delta x} v\) using logarithmic differentiation:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    ln\;v &amp;amp;= x\;ln\;x \\&lt;br /&gt;
    (ln\;v)&amp;#8217; &amp;amp;= ln\;x(x)&amp;#8217; + x(ln\;x)&amp;#8217; \\&lt;br /&gt;
    &amp;amp;= ln\;x + x . \frac{1}{x} \\&lt;br /&gt;
    &amp;amp;= ln\;x + 1 \\&lt;br /&gt;
    \frac{v&amp;#8217;}{v} &amp;amp;= ln\;x + 1 \\&lt;br /&gt;
    v&amp;#8217; &amp;amp;= v(ln\;x + 1) \\&lt;br /&gt;
    &amp;amp;= x^x(1 + ln\;x)&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
Where on the second line, we apply the product rule.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Example 3&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#8217;re going to evaluate:&lt;br /&gt;
\[&lt;br /&gt;
  \lim_{n \to \infty}\left(1 + \frac{1}{n}\right)^n  &lt;br /&gt;
\]&lt;br /&gt;
\[&lt;br /&gt;
  ln \left( \left(1 + \frac{1}{n} \right)^n \right) = n\;ln\left(1 + \frac{1}{n}\right)&lt;br /&gt;
\]&lt;br /&gt;
here, we&amp;#8217;re going to assign \(\Delta x = \frac{1}{n}\), which makes \(n = \frac{1}{\Delta x}\):&lt;br /&gt;
\[&lt;br /&gt;
  n\;ln \left( 1 + \frac{1}{n} \right) = \frac{1}{\Delta x} (ln(1 + \Delta x) &amp;#8211; ln\;1)&lt;br /&gt;
\]&lt;br /&gt;
here, we&amp;#8217;re adding 0, in the form of \(ln\;1\).&lt;br /&gt;
This results in an equation that matches the form of another equation we know:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{ln(1 + \Delta x) &amp;#8211; ln\;1}{\Delta x} &amp;amp;= \frac{\delta}{\delta x}ln\;x \quad \text{at x = 1} \\&lt;br /&gt;
  &amp;amp;= \frac{1}{x} \quad \text{at x = 1} \\&lt;br /&gt;
  &amp;amp;= 1&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;br /&gt;
Now we can just work back:&lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \lim_{n \to \infty}\left( 1 + \frac{1}{n} \right)^n &amp;amp;= e^{\left[ ln \left[ lim_{n \to \infty} \left( 1 + \frac{1}{n} \right)^n \right] \right]} \\&lt;br /&gt;
  &amp;amp;= e^1 \\&lt;br /&gt;
  &amp;amp;= e&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Linear Algebra - Week 2</title>
   <link href="http://www.timgittos.com/learning/mit-linear-algebra/week-2"/>
   <updated>2012-02-03T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-linear-algebra/week-2</id>
   <content type="html">&lt;h2&gt;Matrix Multiplication&lt;/h2&gt;
&lt;p&gt;Consider the problem of multiplying two matrices:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  A \times B = C&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can view this problem in 4 different ways.&lt;/p&gt;
&lt;p&gt;The first way is as a row x columns problem.&lt;br /&gt;
Consider the element \(C_{i,j}\). It is given by:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  C_{i,j} &amp;amp;= A_{i,1} B_{1,j} + A_{i,2} B_{2,j} + \ldots \\&lt;br /&gt;
  &amp;amp;= \sum_{k=1}^n A_{i,k} B_{k,j}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This illustrates the matrix multiplication rule that:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  m \times n \;. n \times p = m \times p&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Namely, you can only multiply matrices if the first matrix has the same number of columns as the second does rows. The result of the multiplication is a matrix with the same amount of rows as the first matrix and the same amount of columns as the second matrix.&lt;/p&gt;
&lt;p&gt;We can also think of multiplying matrices in terms of multiplying columns, or vectors. In the case of \(AB = C\), we can think of \(B\) as a group of column vectors: \(A \times [\vec{b_1}, \vec{b_2}, \vec{b_3}] = [A \vec{b_1}, A \vec{b_2}, A \vec{b_3}] \). Each column of C is a combination of the columns of A.&lt;/p&gt;
&lt;p&gt;Another way we can think of multiplying matrices is in terms of multiplying rows. In the case of \(AB = C\), we can think of \(A\) as a group of row vectors: \( \begin{bmatrix} \vec{a_1} \\ \vec{a_2} \\ \vec{a_3} \end{bmatrix} \times B = \begin{bmatrix} \vec{a_1}B \\ \vec{a_2}B \\ \vec{a_3}B \end{bmatrix} \). That is, each row of C is a combination of the rows of B.&lt;/p&gt;
&lt;p&gt;Next, we can think of multiplying matrices in terms of columns x rows.&lt;br /&gt;
Remember a column is a m x 1 matrix, and a row is a 1 x n matrix. Multiplying these together gives:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  m \times 1 \;. 1 \times p = m \times p&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Consider \(AB = C \) generally:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    \vec{a_1} &amp;amp; \vec{a_2} &amp;amp; \vec{a_3}&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \times&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    \vec{b_1} \\&lt;br /&gt;
    \vec{b_2} \\&lt;br /&gt;
    \vec{b_3}&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \vec{a_1} \vec{b_1} + \vec{a_2} \vec{b_2} + \vec{a_3} \vec{b_3}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where \(\vec{a}\) are column vectors of dimension \(m \times 1\) and \(\vec{b}\) are row vectors of dimension \(1 \times n\), and \(\vec{a}\vec{b}\) is a matrix of dimension \(m \times n\).&lt;/p&gt;
&lt;p&gt;Lastly, it should be noted that you can segment matrices and multiply the segments and still obtain the correct answer, so long as the segments are compatible.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    a_1 &amp;amp; a_2 \\&lt;br /&gt;
    a_3 &amp;amp; a_4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \times&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    b_1 &amp;amp; b_2 \\&lt;br /&gt;
    b_3 &amp;amp; b_4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    a_1 b_1 + a_2 b_3 &amp;amp; a_1 b_2 + a_2 b_4 \\&lt;br /&gt;
    a_3 b_1 + a_4 b_3 &amp;amp; a_3 b_2 + a_b b_4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where \(a\) and \(b\) are matrices, segments of a larger matrix.&lt;/p&gt;
&lt;h2&gt;Inverses&lt;/h2&gt;
&lt;p&gt;Inverses don&amp;#8217;t always exist. Not every matrix is invertable. There are two kinds of inverses. Left inverse (\(A^{-1}A = I\)) and right inverse (\(AA^{-1} = I\)).&lt;/p&gt;
&lt;p&gt;For a square matrix, \(A^{-1}A = I = AA^{-1}\) is true, if A has an inverse.&lt;/p&gt;
&lt;p&gt;A matrix that has an inverse is called invertible or nonsingular.&lt;/p&gt;
&lt;h3&gt;Singular Matrices&lt;/h3&gt;
&lt;p&gt;The following matrix is singular, and thus has no inverse:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 2 \\&lt;br /&gt;
  3 &amp;amp; 6&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The above matrix is singular because it&amp;#8217;s determinate is 0. Determinates are covered later. It is also singular because each column is a multiple of the other, that is, they lie on the same line. When this matrix is multiplied with another matrix, the resultant matrix&amp;#8217;s columns will be a combination of the above matrix&amp;#8217;s columns &amp;#8211; and they too will lie on the same line. There is no way to achieve \(\begin{bmatrix}1 &amp;amp; 0 \\ 0 &amp;amp; 1 \end{bmatrix}\) because neither column of \(I\) lies on that line.&lt;/p&gt;
&lt;p&gt;Another reason a square matrix won&amp;#8217;t have an inverse is that it is possible to find a non-zero vector \(x\) such that \(Ax = 0\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 3 \\&lt;br /&gt;
  2 &amp;amp; 6&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  3 \\ -1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  = 0&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;A matrix can&amp;#8217;t have an inverse if some combination of it&amp;#8217;s columns gives nothing.&lt;br /&gt;
If we assume A does have an inverse, then:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  (Ax)A^{-1} &amp;amp;= 0A^{-1} \\&lt;br /&gt;
  x &amp;amp;=0&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which we can see is clearly not true (\(x = \begin{bmatrix} 3 \\ -1 \end{bmatrix} \)), therefore this matrix does not have an inverse.&lt;/p&gt;
&lt;h3&gt;Non-singular matrices&lt;/h3&gt;
&lt;p&gt;Consider the following matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 3 \\&lt;br /&gt;
  2 &amp;amp; 7&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This matrix is invertible and non-singular.&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 3 \\&lt;br /&gt;
  2 &amp;amp; 7&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  a &amp;amp; c \\&lt;br /&gt;
  b &amp;amp; d&lt;br /&gt;
  \end{bmatrix} = &lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We need to find out the value of \(A^{-1}\), \(\begin{bmatrix} a &amp;amp; c \\ b &amp;amp; d \end{bmatrix}\).&lt;br /&gt;
Going back to matrix multiplication, we can see that we can decompose this into two problems:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 3 \\&lt;br /&gt;
    2 &amp;amp; 7&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    a \\ b&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 \\ 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 3 \\&lt;br /&gt;
    2 &amp;amp; 7&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    c \\ d&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    0 \\ 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;These two equations can be solved at once using Gauss-Jordan. First, create an augmented matrix, with the left hand side as \(A\) and the right hand side as \(I\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \left[&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
    1 &amp;amp; 3 \\&lt;br /&gt;
    2 &amp;amp; 7&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \quad&lt;br /&gt;
  \left|&lt;br /&gt;
  \quad&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
    1 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 1&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \right.&lt;br /&gt;
  \right]&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can now perform Gaussian elimination on this augmented matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \left[&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
    1 &amp;amp; 3 \\&lt;br /&gt;
    0 &amp;amp; 1&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \quad&lt;br /&gt;
  \left|&lt;br /&gt;
  \quad&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
    1 &amp;amp; 0 \\&lt;br /&gt;
    -2 &amp;amp; 1&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \right.&lt;br /&gt;
  \right]&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The left hand side is now in upper triangular form, and under normal Gaussian substitution, we&amp;#8217;d finish. However in Gauss-Jordan, we then do a upwards elimination to achieve \(I\) on the left side:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \left[&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
    1 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 1&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \quad&lt;br /&gt;
  \left|&lt;br /&gt;
  \quad&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
    7 &amp;amp; -3 \\&lt;br /&gt;
    -2 &amp;amp; 1&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \right.&lt;br /&gt;
  \right]&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The right hand side is now \(A^{-1}\).&lt;/p&gt;
&lt;p&gt;We can show how Gauss-Jordan works by the following sum:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  E[A \quad I] &amp;amp;= [EA \quad EI] \\&lt;br /&gt;
  &amp;amp;= [I \quad E]&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where E is the elimination matrix that performs the above calculation (augmented matrices). You can see that if \(E \times A = I\), then \(E\) must be \(A^{-1}\), and therefore \(E \times I = E\), which gives the result we observed above.&lt;br /&gt;
\(E \times A = I\) was true because we &lt;i&gt;made&lt;/i&gt; it true, by eliminating to \(I\).&lt;/p&gt;
&lt;h3&gt;Inverse of a product&lt;/h3&gt;
&lt;p&gt;We know \(AA^{-1} = I = A^{-1}A\).&lt;/p&gt;
&lt;p&gt;For products, \(AB B^{-1}A^{-1} = I\) This is due to the associative nature of matrix multiplication.&lt;br /&gt;
Performing the calculation:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  AB ( B^{-1}A^{-1} ) &amp;amp;= I \\&lt;br /&gt;
  A ( B B^{-1} ) A &amp;amp;= I \\&lt;br /&gt;
  AI A^{-1} &amp;amp;= I \\&lt;br /&gt;
  A A^{-1} &amp;amp;= I \\&lt;br /&gt;
  I &amp;amp;= I&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;The same holds for \(B^{-1}A^{-1}AB = I\), which is placing the inverse group on the left of the equation.&lt;/p&gt;
&lt;p&gt;A note about transposing. Two things about transposing a matrix:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;When you transpose a matrix, you have to swap arguments:&lt;br /&gt;
  \[&lt;br /&gt;
    A A^{-1} = I = (A^{-1})^T A^T&lt;br /&gt;
  \]&lt;/li&gt;
	&lt;li&gt;The inverse of a transposed matrix is the inverse of the matrix transposed:&lt;br /&gt;
  \[&lt;br /&gt;
    (A^{-1})^T = (A^T)^{-1}&lt;br /&gt;
  \]&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Factorization into A = LU&lt;/h2&gt;
&lt;p&gt;Elimination with no row matrices&lt;/p&gt;
&lt;p&gt;Consider the following:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  E_{2,1}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    2 &amp;amp; 1 \\&lt;br /&gt;
    8 &amp;amp; 7&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  2 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is the first step in Gaussian elimination, where the first matrix is matrix \(A\), and the last matrix is matrix \(U\). The \(E_{2,1}\) matrix elminates \(A_{2,1}\) to make \(U\) an upper-triangular matrix.&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 \\&lt;br /&gt;
    -4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    2 &amp;amp; 1 \\&lt;br /&gt;
    8 &amp;amp; 7&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  2 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;is the solution for \(E_{2,1}\).&lt;/p&gt;
&lt;p&gt;To put this in the form of \(A = LU\), we need to recognise that \(L = E_{2,1}^{-1}\), and multiply both sides:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{array}{rcl}&lt;br /&gt;
  ( E_{2,1} E_{2,1}^{-1} )&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    2 &amp;amp; 1 \\&lt;br /&gt;
    8 &amp;amp; 7&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&amp;amp;&lt;br /&gt;
  E_{2,1}^{-1}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  2 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \\&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    2 &amp;amp; 1 \\&lt;br /&gt;
    8 &amp;amp; 7&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&amp;amp;&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 \\&lt;br /&gt;
    4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  2 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \end{array}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Notice that \(U\) is an upper-triangle and \(L\) is a lower-triangle. \(U\) has the pivots in the matrix, and these can be pulled out:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    2 &amp;amp; 1 \\&lt;br /&gt;
    0 &amp;amp; 3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    2 &amp;amp; 0 \\&lt;br /&gt;
    0 &amp;amp; 3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; \frac{1}{2} \\&lt;br /&gt;
    0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where the first matrix on the right hand side is the matrix \(P\) for pivot, and is a diagonal matrix, and the second matrix is \(U\), the upper triangular matrix.&lt;/p&gt;
&lt;p&gt;Now lets consider the same operations a larger matrix, assuming again we don&amp;#8217;t perform a row exchange:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  E_{3,2}E_{3,1}E_{2,1}A = U&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Where we eliminate \(A_{2,1}\) first, then from the resultant matrix we elminate \(A_{3,1}\) and then from that matrix we eliminate \(A_{3,2}\). To put this into the form of \(A = LU\), we need to invert the matrices and move them to the other side of the equation:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  A &amp;amp;= E_{2,1}^{-1}E_{3,1}^{-1}E_{3,2}^{-1}U \\&lt;br /&gt;
  &amp;amp;= LU&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We perform \(E_{2,1}^{-1}E_{3,1}^{-1}E_{3,2}^{-1}\) instead of \((E_{3,2}E_{3,1}E_{2,1})^{-1}\) because it&amp;#8217;s easier to compute.&lt;/p&gt;
&lt;p&gt;If we perform no row exchanges, the multipliers in \(E\) used to eliminate elements of A go directly into \(L\). For example:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{array}{rl}&lt;br /&gt;
  E_{2,1}^{-1}E_{3,1}^{-1}E_{3,2}^{-1}U =&amp;amp;&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 \\ &lt;br /&gt;
    0 &amp;amp; 1 &amp;amp; 0 \\ &lt;br /&gt;
    0 &amp;amp; 5 &amp;amp; 1 &lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  I&lt;br /&gt;
  \begin{bmatrix} &lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 \\ &lt;br /&gt;
    2 &amp;amp; 1 &amp;amp; 0 \\ &lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 1 &lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  U \\&lt;br /&gt;
  =&amp;amp;&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 \\ &lt;br /&gt;
    0 &amp;amp; 1 &amp;amp; 0 \\ &lt;br /&gt;
    0 &amp;amp; 5 &amp;amp; 1 &lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix} &lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 \\ &lt;br /&gt;
    2 &amp;amp; 1 &amp;amp; 0 \\ &lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 1 &lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  U \\&lt;br /&gt;
  =&amp;amp;&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
    2 &amp;amp; 1 &amp;amp; 1 \\&lt;br /&gt;
    0 &amp;amp; 5 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  U \\&lt;br /&gt;
  =&amp;amp;&lt;br /&gt;
  LU&lt;br /&gt;
  \end{array}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;In terms of computation, performing elimination on an \(n \times n\) matrix is \(O(\frac{1}{3}n^3)\) in the worst case. It&amp;#8217;s no coincidence that this looks like the integral of \(x^2\), as it represents a small change in \(x^2\) over time.&lt;/p&gt;
&lt;p&gt;There are 6 permutation matricies for \(3 \times 3\) matricies:&lt;br /&gt;
&lt;img src=&quot;/images/la/3x3perms.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
For permutations matrices, \(P^{-1} = P^T\). In general, there are \(n!\) for an \(n \times n\) matrix.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Single Variable Calculus - Week 2</title>
   <link href="http://www.timgittos.com/learning/mit-single-variable-calculus/week-2"/>
   <updated>2012-01-25T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-single-variable-calculus/week-2</id>
   <content type="html">&lt;h2&gt;Week 2&lt;/h2&gt;
&lt;h3&gt;Derivative Formulas&lt;/h3&gt;
&lt;p&gt;To work towards the goal of &amp;#8220;differentiating everything&amp;#8221;, need to talk about derivative formulas.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Specfic &amp;#8211; \(f&amp;#8217;(x)\), where \(f(x) = x^n, \frac{1}{x}\) as a few examples.&lt;/li&gt;
	&lt;li&gt;General &amp;#8211; \((u + v)&amp;#8217; = u&amp;#8217; + v&amp;#8217;\) and \((cu)&amp;#8217; = cu&amp;#8217;\) where c is constant, as a few examples.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Start with specific trigonometric derivative formulas.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;\(\frac{\delta}{\delta x} sin \; x\)&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \frac{\delta}{\delta x} sin \; x = \lim_{x \to 0} \frac{sin(x + \Delta) \; &amp;#8211; sin(x)}{\Delta x}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;To solve this, we need to revist the trigonometric sum and difference formulas, namely:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  sin(A + B) = sin A \; cos B + cos A \; sin B&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://oakroadsystems.com/twt/sumdiff.htm&quot;&gt;This is a proof of the identity, using Eulers formula&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Going back to the derivative:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{\delta}{\delta x} sin \; x &amp;amp;= \lim_{x \to 0} \frac{sin(x + \Delta) \; &amp;#8211; sin(x)}{\Delta x} \\&lt;br /&gt;
  &amp;amp;= \lim_{x \to 0} \frac{sin\:x \; cos\:\Delta x + cos\;x \; sin\:\Delta x &amp;#8211; sin\:x}{\Delta x} \\&lt;br /&gt;
  &amp;amp;= \lim_{x \to 0} \quad sin\:x(\frac{cos\:\Delta x &amp;#8211; 1}{\Delta x}) + cos\:x(\frac{sin\:\Delta x}{\Delta x}) \\&lt;br /&gt;
  &amp;amp;= cos\:x&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;due to the fact that \(\frac{cos\:\Delta x &amp;#8211; 1}{\Delta x}\) tends to 0 as \(\Delta x\) tends to 0, and \(\frac{sin\:\Delta x}{\Delta x}\) tends to 1 as \(\Delta x\) tends to 0. Label these as A and B respectively, as we will prove them later.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;\(\frac{\delta}{\delta x} cos x\)&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Same as above, only this time using the identity:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  cos(A + B) = cos A \; cos B &amp;#8211; sin A \; sin B&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x} cos \; x &amp;amp;= \lim_{x \to 0} \frac{cos(x + \Delta) \; &amp;#8211; cos(x)}{\Delta x} \\&lt;br /&gt;
    &amp;amp;= \lim_{x \to 0} \frac{cos\;x \: cos\;\Delta x &amp;#8211; sin\;x \: sin\;\Delta x &amp;#8211; cos\;x}{\Delta x} \\&lt;br /&gt;
    &amp;amp;= \lim_{x \to 0} \quad cos\;x(\frac{cos\;\Delta x &amp;#8211; 1}{\Delta x}) &amp;#8211; sin\;x(\frac{\sin\;\Delta x}{\Delta x}) \\&lt;br /&gt;
    &amp;amp;= \quad &amp;#8211; sin\;x&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;again, by A and B as stated above.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Proofs of A and B&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;First, some remarks:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \frac{\delta}{\delta x} cos\;x \quad \Bigg|^{x=0}&lt;br /&gt;
  \quad \lim_{\Delta x \to 0} \frac{cos(\Delta x) &amp;#8211; 1}{\Delta x} &lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This shows that the rate of change of \(cos x\) at \(x = 0\) is a limit as \(\Delta x\) tends to 0, which has been simplified:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    &amp;amp;\frac{cos(0 + \Delta x) &amp;#8211; cos(0)}{\Delta x} \\&lt;br /&gt;
    = &amp;amp;\frac{cos(\Delta x) &amp;#8211; 1}{\Delta x}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and likewise&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \frac{\delta}{\delta x} sin\;x \quad \Bigg|^{x=0}&lt;br /&gt;
  \quad \lim_{\Delta x \to 0} \frac{sin(\Delta x)}{\Delta x} &lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;because of the simplification:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    &amp;amp;\frac{sin(0 + \Delta x) &amp;#8211; sin(0)}{\Delta x} \\&lt;br /&gt;
    = &amp;amp;\frac{sin(\Delta x)}{\Delta x}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We should note that the derivatives of sine and cosine at \(x = 0\) give all values of \(\frac{\delta}{\delta x} sin x\), \(\frac{\delta}{\delta x} cos x\)&lt;/p&gt;
&lt;p&gt;Back to the proofs:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Property B&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Geometric proof:&lt;/p&gt;
&lt;p&gt;Lets rename \(\Delta x\) as \(\theta\).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/svcalc/b-proof.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Consider the ratio of the arc length to the line \(sin \theta\). Then double it for the two \(\theta\) that were drawn:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  &amp;amp;\frac{2 sin \theta}{2 \theta} \\&lt;br /&gt;
  = &amp;amp;\frac{sin \theta}{\theta}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Now, as \(\theta\) approaches 0, the lines \(sin \theta\) and \(arclength \theta\) get close and close to the same line, so the result of the ratio is 1, intuitively because short pieces of curves are nearly straight.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Property A&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The basis for the proof for cosine is the same as the proof for sine &amp;#8211; that of short pieces of curves being nearly straight.&lt;/p&gt;
&lt;p&gt;First, \(cos \theta\) is going to be negative, so we need to invert the statement:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \frac{1 &amp;#8211; cos \theta}{\theta}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/svcalc/a-proof.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This is a similar image as before, only magnified.&lt;br /&gt;
The distance from the centre of the circle to the circumference is 1 (because this is a unit circle, and the gap between the \(sin \theta\) line and the circumference is \(1 &amp;#8211; cos \theta\). As \(\theta\) tends to 0, this gap gets smaller and smaller, and as such, \(\frac{1 &amp;#8211; cos \theta}{\theta}\) tends to 0.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;&lt;span class=&quot;caps&quot;&gt;NOTE&lt;/span&gt; TO &lt;span class=&quot;caps&quot;&gt;SELF&lt;/span&gt; &amp;#8211; &lt;span class=&quot;caps&quot;&gt;RECORD&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;GEOMETRIC&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;PROOF&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;General Derivative Rules&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Product Rule&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  (uv)&amp;#8217; = u&amp;#8217;v + uv&amp;#8217;&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;can be remembered as changing one variable at a time. Will be proven as such.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \frac{\delta}{\delta x} (x^n sin\;x) = nx^{n-1}sin\;x + x^n cos\;x&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Proof:&lt;/p&gt;
&lt;p&gt;Going back to first principles of calculus, we can rewrite the sum in terms of the rate of change:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  \frac{\delta}{\delta x} uv &amp;amp;= \lim_{\Delta x \to 0} \frac{u(x + \Delta x)v(x + \Delta x) &amp;#8211; u(x)v(x)}{\Delta x} \\&lt;br /&gt;
  &amp;amp;= \lim_{\Delta x \to 0} \frac{u(x + \Delta x)(v(x + \Delta x) &amp;#8211; v(x)) + v(x)(u(x + \Delta x) &amp;#8211; u(x))}{\Delta x} \qquad \text{(1)} \\ &lt;br /&gt;
  &amp;amp;= \lim_{\Delta x \to 0} u(x + \Delta x)\frac{\delta v}{\delta x} + v(x)\frac{\delta u}{\delta x} \\ &lt;br /&gt;
  &amp;amp;= uv&amp;#8217; + vu&amp;#8217;&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We converted the sum in (1) to a new form to aid in the proof. You can multiply out (1) to show that it is indeed equal:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  u(x + \Delta x)(v(x + \Delta x) &amp;#8211; v(x)) + v(x)(u(x + \Delta x) &amp;#8211; u(x)) &amp;amp;= u(x + \Delta x)v(x + \Delta x) &amp;#8211; v(x)u(x + \Delta x) + v(x)u(x + \Delta x) &amp;#8211; v(x)u(x) \\&lt;br /&gt;
  &amp;amp;= u(x + \Delta x)v(x + \Delta x) &amp;#8211; v(x)u(x)&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;As \(\Delta x\) tends to 0, then \(u(x + \Delta x)\) approaches \(u(x)\), which will complete the proof.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Quotient Rule&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \left(\frac{u}{v}\right)&amp;#8217; = \frac{u&amp;#8217;v &amp;#8211; uv&amp;#8217;}{v^2}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;only works when \(v \ne 0\).&lt;/p&gt;
&lt;p&gt;Proof:&lt;/p&gt;
&lt;p&gt;First, recall that \(\frac{\delta}{\delta x}\) is equal to \(\frac{\Delta y}{\Delta x}\) and we can compute \(\Delta y\) in a separate step, and then just divide by \(\Delta x\).&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \Delta \left( \frac{u}{v} \right) &amp;amp;= \frac{u + \Delta u}{v + \Delta v} &amp;#8211; \frac{u}{v} \\&lt;br /&gt;
    &amp;amp;= \frac{uv + v(\Delta u) &amp;#8211; uv &amp;#8211; u(\Delta v)}{(v + \Delta v)v} \\&lt;br /&gt;
    &amp;amp;= \frac{v(\Delta u) &amp;#8211; u(\Delta v)}{(v + \Delta v)v} \\&lt;br /&gt;
    \frac{\Delta \left( \frac{u}{v} \right) }{\Delta x} &amp;amp;= \frac{ \frac{\Delta u}{\Delta x}v &amp;#8211; u\frac{\Delta v}{\Delta x} }{(v + \Delta v)v} \\&lt;br /&gt;
    \frac{\delta}{\delta x} \left( \frac{u}{v} \right) &amp;amp;= \lim_{\Delta x \to 0} \frac{ \frac{\delta u}{\delta x}v &amp;#8211; u\frac{\delta v}{\delta x} }{v^2} \\&lt;br /&gt;
    &amp;amp;= \frac{u&amp;#8217;v &amp;#8211; uv&amp;#8217;}{v^2}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Let us reconsider the above, setting \(u = 1\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x} \left( \frac{1}{v} \right) &amp;amp;= \frac{-1v&amp;#8217;}{v^2} \\&lt;br /&gt;
    &amp;amp;= -v^{-2}v&amp;#8217;&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and now, lets consider the above example generally, with \(\frac{1}{x^n}\) represented as \(x^{-n}\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta x} x^{-n} &amp;amp;= \frac{\delta}{\delta x} \left( \frac{1}{x^n} \right) \\&lt;br /&gt;
    &amp;amp;= -x^{-2n}nx^{n-1} \\&lt;br /&gt;
    &amp;amp;= -nx^{-n-1}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;You&amp;#8217;ll notice that this follows the same pattern that applies to \(x^n\).&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Chain rule&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We&amp;#8217;ll start by derriving the rule, then writing it down.&lt;/p&gt;
&lt;p&gt;Proof:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\Delta y}{\Delta t} &amp;amp;= \frac{\Delta y}{\Delta x} \frac{\Delta x}{\Delta t} \\&lt;br /&gt;
    \frac{\delta y}{\delta t} &amp;amp;= \frac{\delta y}{\delta x} \frac{\delta x}{\delta t}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;TODO&lt;/span&gt;: &lt;span class=&quot;caps&quot;&gt;FIND&lt;/span&gt; A &lt;span class=&quot;caps&quot;&gt;BETTER&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;PROOF&lt;/span&gt; OF &lt;span class=&quot;caps&quot;&gt;THIS&lt;/span&gt;, OR &lt;span class=&quot;caps&quot;&gt;SHOW&lt;/span&gt; A &lt;span class=&quot;caps&quot;&gt;MORE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;EXPLICIT&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;EXAMPLE&lt;/span&gt; *&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta t} (sin\;t)^{10} &amp;amp;= x^{10} &amp;amp; \text{Substituting x = sin t} \\&lt;br /&gt;
    &amp;amp;= 10x^9 cos\;t \\&lt;br /&gt;
    &amp;amp;= 10(sin\;t)^9 cos\;t &amp;amp; \text{Substituting the value of x back in}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Example 2:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    \frac{\delta}{\delta t} sin(10t) &amp;amp;= sin(x) &amp;amp; \text{Substituting x = 10t} \\&lt;br /&gt;
    &amp;amp;= cos(x) \times 10 \\&lt;br /&gt;
    &amp;amp;= cos(10t) \times 10 &amp;amp; \text{Substituting 10t = x back in}&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Higher derrivatives *&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Refers to multiple steps of differentiation.&lt;/p&gt;
&lt;p&gt;Consider the function \(u = u(x)\), then \(u&amp;#8217;\) is a new function in and of itself. We can differentiate this function: \(u&amp;#8217;&amp;#8217;\). This is the second derivative, and it too is a new function, and can be differentiated.&lt;/p&gt;
&lt;p&gt;You can continue this to any number of higher derrivatives, second, third, fourth, etc.&lt;/p&gt;
&lt;p&gt;Notation: &lt;br /&gt;
\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
  u&amp;#8217; &amp;amp;= \frac{\delta u}{\delta x} = \frac{\delta}{\delta x} u \\&lt;br /&gt;
  u&amp;#8217;&amp;#8217; &amp;amp;= \frac{\delta}{\delta x}\frac{\delta u}{\delta x} = \frac{\delta}{\delta x}\frac{\delta}{\delta x} u \\&lt;br /&gt;
  &amp;amp;= \left(\frac{\delta}{\delta x}\right)^2 u \\&lt;br /&gt;
  &amp;amp;= \frac{\delta^2}{(\delta x)^2} u \\&lt;br /&gt;
  &amp;amp;= \frac{\delta^2}{\delta x^2} u&lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{align}&lt;br /&gt;
    D^nx^n &amp;amp;= ? \\&lt;br /&gt;
    Dx^n &amp;amp;= nx^{n-1} \\&lt;br /&gt;
    D^2x^n &amp;amp;= n(n-1)x^{n-2} \\&lt;br /&gt;
    D^3x^n &amp;amp;= n(n-1)(n-2)x^{n-3} \\&lt;br /&gt;
    D^{n-1}x^n &amp;amp;= (n(n-1)(n-2) \ldots 2)x^1 \\&lt;br /&gt;
    D^nx^n &amp;amp;= (n(n-1)(n-2) \ldots 2 \times 1) \times 1 \\&lt;br /&gt;
    &amp;amp;= n! &lt;br /&gt;
  \end{align}&lt;br /&gt;
\]&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Single Variable Calculus - Week 1</title>
   <link href="http://www.timgittos.com/learning/mit-single-variable-calculus/week-1"/>
   <updated>2012-01-18T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-single-variable-calculus/week-1</id>
   <content type="html">&lt;h3&gt;Differentiation&lt;/h3&gt;
&lt;h4&gt;What is a derivative?&lt;/h4&gt;
&lt;p&gt;&lt;b&gt;Geometric interpretation&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Consider the problem of finding the tangent line to some function \(y=f(x)\) at \(P=(x_0,y_0)\):&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/tangent.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The tangent line has an equation of the form \(y &amp;#8211; y_0 = m(x &amp;#8211; x_0)\), where m is the slope or gradient of the line.&lt;br /&gt;
Finding \(y_0\) is easy &amp;#8211; \(y_0 = f(x_0)\).&lt;br /&gt;
Finding m involves calculus &amp;#8211; \(m = f&amp;#8217;(x_0)\). &lt;br /&gt;
That is, \(f&amp;#8217;(x_0)\), the derivative of \(f\) at \(x_0\) is the slope of the tangent line to \(y = f(x)\) at P.&lt;/p&gt;
&lt;p&gt;Consider the following graph:&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/secant.gif&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
How do we know which of these two lines is the tangent, given that both pass through the same point?&lt;br /&gt;
Lets define the point where the secant and the tangent intersect as P, and the other point on the secant as Q.&lt;br /&gt;
As the point Q gets closer to the point P, the slope of the secant line starts to match the slope of the tangent line.&lt;br /&gt;
Therefore:&lt;br /&gt;
The tangent is the limit of the secant line \(PQ\) as the point \(Q \rightarrow P\), assuming P is fixed.&lt;/p&gt;
&lt;p&gt;Again consider the secant line \(PQ\).&lt;br /&gt;
Calculating the gradient of \(PQ\):&lt;br /&gt;
The difference between Q&amp;#8217;s x value and P&amp;#8217;s x value is known as \(\Delta x\) (delta x), or the change in x.&lt;br /&gt;
The change in y is called \(\Delta f\) (in this case?).&lt;br /&gt;
The gradient between \(P\) and \(Q\) is the ratio of \(\frac{\Delta f}{\Delta x}\).&lt;br /&gt;
As the point Q gets closer to P, \(\Delta x\) gets smaller.&lt;br /&gt;
Thus \(m = \lim_{\Delta x \to 0} \frac{\Delta f}{\Delta x}\)&lt;/p&gt;
&lt;p&gt;If P is the point \((x_0, f(x_0))\), then we can represent Q as \((x_0 + \Delta x, f(x_0 + \Delta x))\).&lt;br /&gt;
&lt;b&gt;Therefore \(m = \lim_{\Delta x \to 0} \frac{f(x_0 + \Delta x) &amp;#8211; f(x_0)}{\Delta x}\).&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;This is the heart of the derivative.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;br /&gt;
Consider the graph for \(\frac{1}{x}\)&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/1dividedbyx.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
Find the tanget at point \(x_0\):&lt;br /&gt;
$$m = \lim_{\Delta x \to 0} \frac{ \frac{1}{x_0 + \Delta x} &amp;#8211; \frac{1}{x_0} }{\Delta x}$$&lt;br /&gt;
$$m = \lim_{\Delta x \to 0} \frac{1}{\Delta x}\left( \frac{ x_0 &amp;#8211; (x_0 + \Delta x) }{ (x_0 + \Delta x)x_0 } \right)$$&lt;br /&gt;
$$m = \lim_{\Delta x \to 0} \frac{1}{\Delta x}\left( \frac{ -\Delta x }{ (x_0 + \Delta x)x_0 } \right)$$&lt;br /&gt;
$$m = \lim_{\Delta x \to 0} -\frac{1}{ (x_0 + \Delta x)x_0 }$$&lt;br /&gt;
$$m \rightarrow -\frac{1}{ x_0^2 }$$&lt;/p&gt;
&lt;p&gt;Example 2:&lt;br /&gt;
Find the area of the triangle formed by the axes and the curve described by \(y = \frac{1}{x}\).&lt;br /&gt;
This is a word problem with only one part of calculus &amp;#8211; the rest is regular math.&lt;br /&gt;
Graph the problem:&lt;br /&gt;
&lt;img src=&quot;/images/svcalc/triangle-area.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
The only part of the problem that involves calculus is finding the tangent. We found the gradient \(m\) above, so lets use that.&lt;br /&gt;
\(y &amp;#8211; y_0 = -\frac{1}{x_0^2}(x &amp;#8211; x_0)\)&lt;br /&gt;
To calculate the area of the triangle, we need the base length (along the \(x\) axis) and the base height (along the \(y\) axis).&lt;br /&gt;
We can find those by calculating the \(x\) intercept and \(y\) intercepts.&lt;br /&gt;
\(x\) intercept is at \(y = 0\), and we can express \(y_0\) in terms of \(f(x)\):&lt;br /&gt;
$$ &amp;#8211; \frac{1}{x_0} = -\frac{1}{x_0^2}(x &amp;#8211; x_0) $$&lt;br /&gt;
$$ &amp;#8211; \frac{1}{x_0} = -\frac{x}{x_0^2} + \frac{1}{x_0} $$&lt;br /&gt;
$$ \implies \frac{x}{x_0^2} = \frac{2}{x_0} $$ &lt;br /&gt;
$$ \implies x = 2x_0 $$&lt;br /&gt;
Using symmetry, we can find the \(y\) intercept quickly.&lt;br /&gt;
Firsly, a note about symmetry:&lt;br /&gt;
$$ y = \frac{1}{x} \implies xy = 1 \implies x = \frac{1}{y} $$&lt;br /&gt;
$$ \therefore y = 2y_0 $$&lt;br /&gt;
The area of a triangle is \(\frac{1}{2}\) base x perpendicular height.&lt;br /&gt;
\(\therefore area = \frac{1}{2}(2_x0)(2y_0) = 2x_0y_0\) = 2&lt;br /&gt;
The area is 2 because \(y = \frac{1}{x}\), and \(xy\) will always equal 1.&lt;/p&gt;
&lt;p&gt;Notation:&lt;br /&gt;
\(y = f(x), \Delta y = \Delta f\)&lt;br /&gt;
\(f&amp;#8217; = \frac{\delta f}{\delta x} = \frac{\delta y}{\delta x} = \frac{\delta}{\delta x}f = \frac{\delta}{\delta x}y\)&lt;/p&gt;
&lt;p&gt;Example 3:&lt;br /&gt;
\(y = \frac{\delta}{\delta x}x^n\)&lt;br /&gt;
$$ \frac{\Delta f}{\Delta x} = \lim_{\Delta x \to 0} \frac{(x + \Delta x)^n &amp;#8211; x^n}{\Delta x} $$&lt;br /&gt;
In order to solve this, we need to revist the binomial theorem (algebra).&lt;br /&gt;
Binomial theorem states that:&lt;br /&gt;
\( (x + \Delta x)^n = (x + \Delta x) &amp;#8230; (x + \Delta x) \)&lt;br /&gt;
\( = x^n + nx^{n-1} + O((\Delta x)^n)\)&lt;br /&gt;
continuing:&lt;br /&gt;
$$ \frac{\Delta f}{\Delta x} = \frac{1}{\Delta x}\big((x + \Delta x)^n &amp;#8211; x^n \big) $$&lt;br /&gt;
$$ \frac{\Delta f}{\Delta x} = \frac{1}{\Delta x}\big(x^n + nx^{n-1}\Delta x + O((\Delta x)^n) &amp;#8211; x^n \big) $$&lt;br /&gt;
$$ \frac{\Delta f}{\Delta x} = \frac{1}{\Delta x}\big(nx^{n-1}\Delta x + O((\Delta x)^n) \big) $$&lt;br /&gt;
$$ \frac{\Delta f}{\Delta x} = nx^{n-1} + O((\Delta x)^n) $$&lt;br /&gt;
$$ \frac{\Delta f}{\Delta x} = \lim_{\Delta x \to 0} nx^{n-1} + O((\Delta x)^n) = nx^{n-1} $$&lt;br /&gt;
$$ \therefore \frac{\delta}{\delta x}x^n = nx^{n-1} $$&lt;/p&gt;
&lt;h3&gt;Rate of Change&lt;/h3&gt;
&lt;p&gt;Geometrically, a derivative can be thought of as the slope of a tangent line for a curve.&lt;br /&gt;
It can also be considered from the point of view of relative rate of change. That is, the change in variables \(x\) and \(y\) for a given function \(f(x)\).&lt;br /&gt;
\(\frac{\Delta x}{\Delta y}\) is the &lt;b&gt;average&lt;/b&gt; rate of change &amp;#8211; that is, the entire change over the entire interval.&lt;br /&gt;
\(\frac{\delta x}{\delta y}\) is the average rate of change limited, and is the &lt;b&gt;instantaneous&lt;/b&gt; rate of change.&lt;/p&gt;
&lt;p&gt;Examples:&lt;br /&gt;
1. q = charge, \(\frac{\delta q}{\delta t}\) = current. The rate of change in charge over time is current.&lt;br /&gt;
2. s = distance, \(\frac{\delta s}{\delta t}\) = speed. The rate of change in distance over time is speed.&lt;/p&gt;
&lt;p&gt;Consider the &lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt; pumpkin drop:&lt;br /&gt;
From the top of one of the buildings in &lt;span class=&quot;caps&quot;&gt;MIT&lt;/span&gt;, on Halloween, students drop pumpkins from the top of building to the ground.&lt;br /&gt;
Assume the building is 80m high, and assume the rate of acceleration due to gravity is 5m&lt;sup&gt;2&lt;/sup&gt; (not 9.8m&lt;sup&gt;2&lt;/sup&gt;).&lt;br /&gt;
\( h = 80 &amp;#8211; 5t^2 \)&lt;br /&gt;
at t = 0, h = 80&lt;br /&gt;
at t = 4, h = 0&lt;/p&gt;
&lt;p&gt;The &lt;b&gt;average&lt;/b&gt; speed is:&lt;br /&gt;
\(\frac{\Delta h}{\Delta t} = \frac{0 &amp;#8211; 80}{4 &amp;#8211; 0} = -20m/s \)&lt;/p&gt;
&lt;p&gt;The &lt;b&gt;instantaneous&lt;/b&gt; speed as it hits the ground is: &lt;br /&gt;
\(\frac{\delta}{\delta t}h = 0 &amp;#8211; 10t\) (differentiated the function for height)&lt;br /&gt;
at t = 4, &lt;b&gt;instantaneous&lt;/b&gt; speed is -40m/s.&lt;/p&gt;
&lt;p&gt;Examples that don&amp;#8217;t involve time:&lt;br /&gt;
3. T = temperature, \(\frac{\delta T}{\delta x}\) = temperature gradient (used in weather forecasting &amp;amp; airflow)&lt;br /&gt;
4. Sensitivity of measurements&lt;/p&gt;
&lt;h2&gt;Limits &amp;amp; Continuity&lt;/h2&gt;
&lt;p&gt;Left &amp;amp; right hand limits.&lt;br /&gt;
\(\lim_{x \to x_0^+}\) &amp;#8211; right hand limit. Says that x is bigger than \(x_0\) and we&amp;#8217;re approaching \(x_0\) with a negative \(\Delta\)&lt;br /&gt;
\(\lim_{x \to x_0^-}\) &amp;#8211; left hand limit. Says that x is smaller than \(x_0\) and we&amp;#8217;re approaching \(x_0\) with a positive \(\Delta\)&lt;/p&gt;
&lt;p&gt;Example:&lt;br /&gt;
$$&lt;br /&gt;
  f(x) = \left\{ &lt;br /&gt;
    \begin{array}{l l}&lt;br /&gt;
      x + 1 &amp;amp; \quad x &amp;gt; 0\\&lt;br /&gt;
      -x + 2 &amp;amp; \quad x &amp;lt; 0\\&lt;br /&gt;
    \end{array} \right.&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;$$\lim_{x \to x_0^+} f(x) = \lim_{x \to x_0} x + 1 = 1$$&lt;/p&gt;
&lt;p&gt;$$\lim_{x \to x_0^-} f(x) = \lim_{x \to x_0^-} -x + 2 = 2$$&lt;/p&gt;
&lt;p&gt;Note: we didn&amp;#8217;t need x = 0 value.&lt;/p&gt;
&lt;p&gt;Continuity:&lt;br /&gt;
\(f(x)\) is continuous at \(x_0\) when \(\lim_{x \to x_0} = f(x_0\)&lt;br /&gt;
Requirements:&lt;br /&gt;
- \(\lim_{x \to x_0} f(x)\) exists (from left &amp;amp; right, and left &amp;amp; right must be the same)&lt;br /&gt;
- \(f(x_0)\) is defined&lt;br /&gt;
- Both of the above are equal to each other&lt;/p&gt;
&lt;p&gt;Continuous functions are easier to calculate limits for because you can just insert the \(x_0\) term into the function and determine the limit.&lt;/p&gt;
&lt;p&gt;Discontinuity:&lt;br /&gt;
If \(f(x)\) is not continuous, then it is discontinuous.&lt;br /&gt;
&lt;b&gt;Jump discontinuity&lt;/b&gt; &amp;#8211; Limit from left and right exist but are not equal&lt;br /&gt;
&lt;b&gt;Removable discontinuity&lt;/b&gt; &amp;#8211; Limit from left and right are equal. Discontinuity can be removed by redefining the function for the point of discontinuity.&lt;br /&gt;
Example:&lt;br /&gt;
$$&lt;br /&gt;
  \begin{array}{1 1}&lt;br /&gt;
  g(x) = \frac{sin x}{x} \\&lt;br /&gt;
  h(x) = \frac{1 &amp;#8211; cosx}{x}&lt;br /&gt;
  \end{array}&lt;br /&gt;
$$&lt;br /&gt;
g(0) is undefined, but:&lt;br /&gt;
$$&lt;br /&gt;
  \begin{array}{1 1}&lt;br /&gt;
  \lim_{x \to 0} \frac{sin x}{x} = 1 \\&lt;br /&gt;
  \lim_{x \to 0} \frac{1 &amp;#8211; cos x}{x} = 0&lt;br /&gt;
  \end{array}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;These functions have a removable discontinuity at x = 0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Infinite discontinuity&lt;/b&gt;&lt;br /&gt;
Consider \(\frac{1}{x}\):&lt;br /&gt;
$$&lt;br /&gt;
  \begin{array}{1 1}&lt;br /&gt;
    \lim_{x \to x_0^+} \frac{1}{x} = \infty \\&lt;br /&gt;
    \lim_{x \to x_0^-} \frac{1}{x} = -\infty&lt;br /&gt;
  \end{array}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Other (ugly) discontinuities&lt;/b&gt;&lt;br /&gt;
\(y = sin \frac{1}{x} \text{as} \; x \to 0\)&lt;br /&gt;
No left or right limit&lt;/p&gt;
&lt;h3&gt;Differential implies continuous theorem&lt;/h3&gt;
&lt;p&gt;If f is differentiable at \(x_0\), then x is continuous at \(x_0\)&lt;br /&gt;
&lt;b&gt;Proof:&lt;/b&gt;&lt;br /&gt;
$$&lt;br /&gt;
  \lim_{x \to x_0} f(x) &amp;#8211; f(x_0) = 0&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  \lim_{x \to x_0} \frac{f(x) &amp;#8211; f(x_0)}{x &amp;#8211; x_0} (x &amp;#8211; x_0) = f&amp;#8217;(x_0) . 0 = 0&lt;br /&gt;
$$&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Single Variable Calculus</title>
   <link href="http://www.timgittos.com/learning/mit-single-variable-calculus"/>
   <updated>2012-01-18T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-single-variable-calculus</id>
   <content type="html">&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;THIS&lt;/span&gt; IS A &lt;span class=&quot;caps&quot;&gt;PLACEHOLDER&lt;/span&gt; SO &lt;span class=&quot;caps&quot;&gt;THAT&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;THE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;APPEARS&lt;/span&gt; IN &lt;span class=&quot;caps&quot;&gt;THE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;PROJECT&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;LIST&lt;/span&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>D&amp;D Monster Tokens</title>
   <link href="http://www.timgittos.com/projects/dungeons-and-dragons-monster-tokens"/>
   <updated>2012-01-09T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/dungeons-and-dragons-monster-tokens</id>
   <content type="html">&lt;h2&gt;Announcing Adventurin &amp;#8211; August 8&lt;sup&gt;th&lt;/sup&gt;, 2013&lt;/h2&gt;
&lt;p&gt;I wrote this post a year and a half ago because I was frustrated by the mini market, how expensive it is, and how bad the art was on the minis.&lt;/p&gt;
&lt;p&gt;Some friends and I decided to work on the problem togther, and we&amp;#8217;re launching &lt;a href=&quot;http://ad.ventur.in/?utm_source=timgittos.com&amp;utm_medium=blog&amp;utm_campaign=tokens&quot;&gt;Adventurin&lt;/a&gt;, a service where you can use your browser to design and get delivered to your house a custom miniature for your D&amp;amp;D games. No plugins, no special software needed.&lt;/p&gt;
&lt;p&gt;You can print your characters minis, or even build &lt;span class=&quot;caps&quot;&gt;NPC&lt;/span&gt; and eventually monsters to print out.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m probably not going to update the tokens below, as the game I was creating them for fell apart a long time ago. However, I highly recommend joining the mailing list for Adventurin and checking it out when we&amp;#8217;re done.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Everyone knowns how much easier combat is to understand when you have some spatial aids. Wizards of the Coast and other gaming companies are pushing hard on minis, but they&amp;#8217;re fairly expensive and take up a lot of storage room. Did I also mention they happen to be expensive to collect a lot?&lt;/p&gt;
&lt;p&gt;As an alternative, you can use tokens, and make them at home. I used to think home-made tokens looked cheap, because the tokens I saw people use had hodge-podge artwork on them, in different styles and mediums, and there was no sense of cohesion.&lt;/p&gt;
&lt;p&gt;Which is why I decided to make my own tokens. I like to think I&amp;#8217;ve come up with a pretty streamline way to make tokens fast, and I&amp;#8217;m quickly expanding my repetoire.&lt;/p&gt;
&lt;p&gt;Here are the things you need:&lt;/p&gt;
&lt;p&gt;- One of these bad boys:&lt;br /&gt;
&lt;iframe src=&quot;http://rcm-na.amazon-adsystem.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=gebloftigi-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=B002BTSEM4&quot; style=&quot;width:120px;height:240px;&quot; scrolling=&quot;no&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
which is used in scrapbooking. This will do for most medium sized creatures, but if you need to go larger, you can use one of these:&lt;br /&gt;
&lt;iframe src=&quot;http://rcm-na.amazon-adsystem.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=gebloftigi-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=B00C90WLE2&quot; style=&quot;width:120px;height:240px;&quot; scrolling=&quot;no&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
which is a circle cutter, and should do 1&amp;quot; &amp;#8211; 5&amp;quot; circles, which should be good for any monster you can come up with.&lt;br /&gt;
- Some contact paper, available at any stationary store.&lt;br /&gt;
- Some card stock&lt;br /&gt;
- A computer and a printer.&lt;/p&gt;
&lt;p&gt;Using these supplies, you can make your own tokens fairly quickly and easily. Now, I like to draw, and I&amp;#8217;m fairly good at it, so I draw my own tokens. For those of you who either don&amp;#8217;t have the time, inclination or skill to draw your own, I&amp;#8217;m making mine available for free.&lt;/p&gt;
&lt;p&gt;As you can see, the art is consistent, and the templates are pretty easy to use. Simply print the template onto card stock, contact both sides so you can write on them with dry erase markers, line up the circle punch and punch them out. Instant tokens.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m slowly adding more monsters as my adventuring party encounter them, so periodically check back for updated monsters.&lt;br /&gt;
Here are the monsters that I have currently:&lt;br /&gt;
- &lt;a href=&quot;http://www.timgittos.com/files/tokens/zombie.jpg&quot;&gt;Zombie&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://www.timgittos.com/files/tokens/skeleton.jpg&quot;&gt;Skeleton&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://www.timgittos.com/files/tokens/hobgoblin.jpg&quot;&gt;Hobgoblin&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://www.timgittos.com/files/tokens/spider.jpg&quot;&gt;Spider&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://www.timgittos.com/files/tokens/ghoul.jpg&quot;&gt;Ghoul&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://www.timgittos.com/files/tokens/homunculus.jpg&quot;&gt;Homunculus&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://www.timgittos.com/files/tokens/evilcleric.jpg&quot;&gt;Evil cleric&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://www.timgittos.com/files/tokens/humanberzerker.jpg&quot;&gt;Human berzerker&lt;/a&gt;&lt;br /&gt;
- Gelatinous cube (coming soon)&lt;br /&gt;
- Goblin (coming soon)&lt;br /&gt;
- Kobold (coming soon)&lt;/p&gt;
&lt;p&gt;(current as of 01-09-2012, and we play once a week, with new monsters twice a month or so)&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Linear Algebra - Week 1</title>
   <link href="http://www.timgittos.com/learning/mit-linear-algebra/week-1"/>
   <updated>2012-01-06T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-linear-algebra/week-1</id>
   <content type="html">&lt;h3&gt;Linear equations&lt;/h3&gt;
&lt;p&gt;n equations, n unknowns &amp;#8211; easy to solve.&lt;/p&gt;
&lt;p&gt;Example:&lt;br /&gt;
$$&lt;br /&gt;
  \begin{array}{1 1}&lt;br /&gt;
  2x &amp;#8211; y = 0 \\&lt;br /&gt;
  -x + 2y = 3&lt;br /&gt;
  \end{array}&lt;br /&gt;
$$&lt;br /&gt;
can be solved with matrices as follows:&lt;br /&gt;
$$&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  2 &amp;amp; -1 \\&lt;br /&gt;
  -1 &amp;amp; 2&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  x \\&lt;br /&gt;
  y&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  0 \\&lt;br /&gt;
  3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;The matrix of co-efficients will be called \(A\), the vector of unknowns will be called \(X\) and the resultant matrix will be called \(b\).&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Row picture&lt;/b&gt;&lt;br /&gt;
&lt;img src=&quot;/images/la/graph01.gif&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The point of intersection is the solution to this pair of linear equations.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Column picture&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We can reinterpret these two equations into a single matrix equation:&lt;br /&gt;
$$&lt;br /&gt;
  x \begin{bmatrix}&lt;br /&gt;
    2 \\&lt;br /&gt;
    -1&lt;br /&gt;
  \end{bmatrix} + y \begin{bmatrix}&lt;br /&gt;
    -1 \\&lt;br /&gt;
    2&lt;br /&gt;
  \end{bmatrix} = \begin{bmatrix}&lt;br /&gt;
    0 \\&lt;br /&gt;
    3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;Now the equation is asking us to find the correct linear combination of the columns, or vectors, that solves the equation.&lt;br /&gt;
The linear combination is the proportion of each vector that solves the equation.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/la/graph02.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Lets plug in the correct results from above, and take 1 of \(\begin{bmatrix}2\\-1\end{bmatrix}\) and 2 of \(\begin{bmatrix}-1\\2\end{bmatrix}\):&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/la/graph03.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;As you can see, we get the answer \(b\), which is \(\begin{bmatrix}0\\3\end{bmatrix}\)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Example 2&lt;/b&gt;&lt;br /&gt;
Now lets consider 3 equations with 3 unknowns:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  \begin{array}{1 1}&lt;br /&gt;
    2x &amp;#8211; y = 0 \\&lt;br /&gt;
    -x + 2y &amp;#8211; z = -1 \\&lt;br /&gt;
    -3y + 4z = 4&lt;br /&gt;
  \end{array}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;Matrix form:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  A =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    2 &amp;amp; -1 &amp;amp; 0 \\&lt;br /&gt;
    -1 &amp;amp; 2 &amp;amp; -1 \\&lt;br /&gt;
    0 &amp;amp; -3 &amp;amp; 4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \quad&lt;br /&gt;
  b =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    0 \\&lt;br /&gt;
    -1 \\&lt;br /&gt;
    4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;Row picture:&lt;/p&gt;
&lt;p&gt;A 3D cartesian axis with 3 planes that meet in a point. Omitting the plot due to the complexity of the problem.&lt;br /&gt;
This points to a weakness in this interpretation of the problem in higher dimensions.&lt;/p&gt;
&lt;p&gt;Column picture:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  x&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  2 \\&lt;br /&gt;
  -1 \\&lt;br /&gt;
  0&lt;br /&gt;
  \end{bmatrix} + y&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  -1 \\&lt;br /&gt;
  2 \\&lt;br /&gt;
  -3&lt;br /&gt;
  \end{bmatrix} + z&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  0 \\&lt;br /&gt;
  -1 \\&lt;br /&gt;
  4&lt;br /&gt;
  \end{bmatrix} = &lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  0 \\&lt;br /&gt;
  -1 \\&lt;br /&gt;
  4&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;The solution is \(x = 0, y = 0, z = 1\), which is clearly seen from the matrices.&lt;/p&gt;
&lt;p&gt;Consider the case where we have a different &lt;span class=&quot;caps&quot;&gt;RHS&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  x&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  2 \\&lt;br /&gt;
  -1 \\&lt;br /&gt;
  0&lt;br /&gt;
  \end{bmatrix} + y&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  -1 \\&lt;br /&gt;
  2 \\&lt;br /&gt;
  -3&lt;br /&gt;
  \end{bmatrix} + z&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  0 \\&lt;br /&gt;
  -1 \\&lt;br /&gt;
  4&lt;br /&gt;
  \end{bmatrix} = &lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 \\&lt;br /&gt;
  1 \\&lt;br /&gt;
  -3&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;You can see the solution is \(x = 1, y = 1, z = 0\).&lt;/p&gt;
&lt;p&gt;Consider all &lt;span class=&quot;caps&quot;&gt;RHS&lt;/span&gt; sides? Can we solve \(Ax = b\) for every b? To restate, do the linear combinations of the columns fill 3D space?&lt;br /&gt;
The answer for the above matrix A, the answer is yes. This means the matrix is non-singular and invertable.&lt;br /&gt;
If the answer is no, then the matrix is singular and non-invertable.&lt;/p&gt;
&lt;p&gt;For example, if the three vectors lie in the same plane, then the combinations will lie in the same plane &amp;#8211; but not all of 3D space.&lt;/p&gt;
&lt;p&gt;A matrix is singular and non-invertable if the columns are linearly independent from each other.&lt;/p&gt;
&lt;p&gt;Multiplying a matrix by a vector:&lt;br /&gt;
Column way, as opposed to the row way:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  \begin{bmatrix} 2 &amp;amp; 5 \\ 1 &amp;amp; 3 \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix} 1 \\ 2 \end{bmatrix} &lt;br /&gt;
$$&lt;br /&gt;
$$&lt;br /&gt;
  = 1 \begin{bmatrix} 2 \\ 1 \end{bmatrix} + 2 \begin{bmatrix} 5 \\ 3 \end{bmatrix}&lt;br /&gt;
$$&lt;br /&gt;
$$&lt;br /&gt;
  = \begin{bmatrix} 12 \\ 7 \end{bmatrix}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;So you can see that \(Ax\) is a combination of the columns of \(A\)&lt;/p&gt;
&lt;h3&gt;Matrix Elimination&lt;/h3&gt;
&lt;p&gt;Discovered by Gauss.&lt;/p&gt;
&lt;p&gt;We will be working from the following example equations:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  \begin{array}{1 3}&lt;br /&gt;
    x + 2y + z = 2 \\&lt;br /&gt;
    3x + 8y + z = 12 \\&lt;br /&gt;
    4y + z = 2&lt;br /&gt;
  \end{array}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;the coefficients of which can be represented by the following matrix:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  A = \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
    3 &amp;amp; 8 &amp;amp; 1 \\&lt;br /&gt;
    0 &amp;amp; 4 &amp;amp; 1&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;the answer with:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  b = \begin{bmatrix}&lt;br /&gt;
    2 \\&lt;br /&gt;
    12 \\&lt;br /&gt;
    2&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;and the full equation represented by:&lt;/p&gt;
&lt;p&gt;$$&lt;br /&gt;
  Ax = b&lt;br /&gt;
$$&lt;/p&gt;
&lt;p&gt;To begin, the purpose of elimination is to get rid of as many unknowns as we can and then solve for the remaining unknown.&lt;br /&gt;
The first step in this case would be to subtract \(x + 2y + z = 2\) from \(3x + 8y + z\) with the goal of eliminating the \(x\) variable.&lt;/p&gt;
&lt;p&gt;Firstly, declare the \(x\) coefficient in the first row of matrix \(A\) to be the pivot. Then find the multiple of the pivot required to eliminate it. In this case, it&amp;#8217;s 3. Then subtract the first row multiplied by the multiple from the second row. This will result in:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 2 &amp;amp; -2 \\&lt;br /&gt;
  0 &amp;amp; 4 &amp;amp; 1&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This has eliminated \(x\) from the second row, the [2, 1] position. The next step would be to eliminate \(x\) from the [3, 1] position, however there is no need to do this, as it is already 0.&lt;/p&gt;
&lt;p&gt;Next, eliminate \(y\) from the third row. Set the pivot to be the \(y\) coefficient in \(A\) and find the multiple required to eliminate it. The multiple is 2. Then subtract the second row multiplied by the multiple from the third row:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 2 &amp;amp; -2 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 5&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This results in a type of matrix called an upper-triangular matrix. This is the form of matrix we need to complete this form of elimination. We can call this matrix \(u\).&lt;/p&gt;
&lt;p&gt;Note: pivots can&amp;#8217;t be 0.&lt;/p&gt;
&lt;p&gt;This process will fail if there&amp;#8217;s a 0 in a pivot position. This will require reorganizing the matrix if possible, so that there is a non-zero number in the pivot position. If you can&amp;#8217;t find 3 pivots, the matrix is non-invertable and the solution cannot be found.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Back substitution&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;After finding the multiples, we can apply the same algorithm to the right hand side of the equation:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  b = &lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
  2 \\ 12 \\ 2&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \quad&lt;br /&gt;
  \rightarrow&lt;br /&gt;
  \quad&lt;br /&gt;
  b = &lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
  2 \\ 6 \\ 2&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \quad&lt;br /&gt;
  \rightarrow&lt;br /&gt;
  \quad&lt;br /&gt;
  b =&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
  2 \\ 6 \\ -10&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This leaves us with the augmented matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 2 &amp;amp; -2 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 5&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \left|&lt;br /&gt;
  \begin{matrix}&lt;br /&gt;
  2 \\ 6 \\ -10&lt;br /&gt;
  \end{matrix}&lt;br /&gt;
  \right.&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and we can see that we have the equation \(5z = -10\) and that \(z = -2\).&lt;/p&gt;
&lt;p&gt;We can then substitute that back in to the above equation for \(2y &amp;#8211; 2(-2) = 6\) to get \(y = 1\), and then substitute that back into the first equation for \(x + 2(1) + 1(-2) = 2\) and get \(x = 2\).&lt;/p&gt;
&lt;p&gt;Thus using elimination and substitution we have solved the equation with \(x = 2\), \(y = 1\) and  \(z = -2\)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Matrices&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Now we&amp;#8217;re going to represent the above calculation in matrix form. We want to perform elimination on the following matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
  3 &amp;amp; 8 &amp;amp; 1 \\&lt;br /&gt;
  0 &amp;amp; 4 &amp;amp; 1 \\&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;First, we want to find the matrix that will subtract 3 times row 1 from row 2, and leaves the other rows. So we want to find the matrix \(X\) that solves the following:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  X \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
    3 &amp;amp; 8 &amp;amp; 1 \\&lt;br /&gt;
    0 &amp;amp; 4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \quad = \quad&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
    0 &amp;amp; 2 &amp;amp; -2 \\&lt;br /&gt;
    0 &amp;amp; 4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Lets go back to the concept of multiplying matrices first, in order to solve this intuitively.&lt;/p&gt;
&lt;p&gt;Consider this problem:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  x_{1,1} &amp;amp; y_{1,2} &amp;amp; z_{1,3} \\&lt;br /&gt;
  x_{2,1} &amp;amp; y_{2,2} &amp;amp; z_{2,3} \\&lt;br /&gt;
  x_{3,1} &amp;amp; y_{3,2} &amp;amp; z_{3,3}&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  4 \\ 5 \\ 6&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;This is saying take 4 of the first column, 5 of the second column and 6 of the third column:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    4 (x_{1,1} + x_{2,1} + x_{3,1}) \\&lt;br /&gt;
    5 (y_{1,2} + y_{2,2} + y_{3,2}) \\&lt;br /&gt;
    6 (z_{1,3} + z_{2,3} + z_{3,3})&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  = \begin{bmatrix}&lt;br /&gt;
  12x \\&lt;br /&gt;
  15y \\&lt;br /&gt;
  18z&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which is a combination of the columns of the matrix. This will result in a column vector.&lt;/p&gt;
&lt;p&gt;Where as this problem:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  4 &amp;amp; 5 &amp;amp; 6&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  x_{1,1} &amp;amp; y_{1,2} &amp;amp; z_{1,3} \\&lt;br /&gt;
  x_{2,1} &amp;amp; y_{2,2} &amp;amp; z_{2,3} \\&lt;br /&gt;
  x_{3,1} &amp;amp; y_{3,2} &amp;amp; z_{3,3}&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;is saying &amp;quot;take 4 of the first row, 5 of the second row and 6 of the third row:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \left[&lt;br /&gt;
  \begin{array}{3 1}&lt;br /&gt;
  4 (x_{1,1} + y_{1,2} + z_{1,3}) + \\&lt;br /&gt;
  5 (x_{2,1} + y_{2,2} + z_{2,3}) + \\&lt;br /&gt;
  6 (x_{3,1} + y_{3,2} + z_{3,3})&lt;br /&gt;
  \end{array}&lt;br /&gt;
  \right]&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  = \begin{bmatrix}&lt;br /&gt;
  15x &amp;amp; 15y &amp;amp; 15z&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which is a combination of the rows of the matrix. This will result in a row vector.&lt;/p&gt;
&lt;p&gt;Now going back to the problem at hand:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  X \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
    3 &amp;amp; 8 &amp;amp; 1 \\&lt;br /&gt;
    0 &amp;amp; 4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \quad = \quad&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
    0 &amp;amp; 2 &amp;amp; -2 \\&lt;br /&gt;
    0 &amp;amp; 4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;You can see that we need 1 of the first row, and 1 of the last row to solve this equation. Thus, we can see that:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  X =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
  x_{2,1} &amp;amp; x_{2,2} &amp;amp; x_{2,3} \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;because if you consider \(\begin{bmatrix} 1 &amp;amp; 0 &amp;amp; 0 \end{bmatrix}\) as a row vector, that will take 1 of the first row of the matrix and none of the second and third rows of the matrix, which is what the first row of the answer is. Likewise for the last row.&lt;/p&gt;
&lt;p&gt;Now we need the row that will subtract 3 of the first row from the second row. We can see the answer is:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  X = &lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
  -3 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can also call this matrix \(E_{2,1}\), the elimination matrix to eliminate the 2,1 position of the co-efficient matrix.&lt;/p&gt;
&lt;p&gt;Now we need to represent step 2, which will eliminate the position 3,2, matrix \(E_{3,2}\):&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  E_{3,2}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
    0 &amp;amp; 2 &amp;amp; -2 \\&lt;br /&gt;
    0 &amp;amp; 4 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \quad = \quad&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
    1 &amp;amp; 2 &amp;amp; 1 \\&lt;br /&gt;
    0 &amp;amp; 2 &amp;amp; -2 \\&lt;br /&gt;
    0 &amp;amp; 0 &amp;amp; 5&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Using the above steps, we know that:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  E_{3,2} =&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; -2 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;We can now roll both steps into a single step, a single matrix \(E\) that does all the steps at once.&lt;br /&gt;
Firstly, lets represet what we did in an equation:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  E_{3,2}(E_{2,1}A) = u&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;where u is the final result of the elimination, before we started the back substitution.&lt;/p&gt;
&lt;p&gt;Given that matrix multiplication is associative, we can represent that as:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  (E_{3,2}E_{2,1})A = u&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;which will give E:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; -2 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
  -3 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
  0 &amp;amp; 0 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \quad = \quad&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  1 &amp;amp; 0 &amp;amp; 0 \\&lt;br /&gt;
  -3 &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
  6 &amp;amp; -2 &amp;amp; 1&lt;br /&gt;
  \end{bmatrix} &lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;However, that&amp;#8217;s not the optimal way. Lets consider the equation again:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  (E_{3,2}E_{2,1})A = u&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;Lets consider, instead of how we&amp;#8217;d get from A to u, but from u to A, using &lt;b&gt;inverses&lt;/b&gt;. That&amp;#8217;s a topic for next time.&lt;/p&gt;
&lt;p&gt;Note: If we needed to exchange rows, we would have done so using a permutation matrix. This is easy to derrive by thinking about it in terms of functions of rows in terms of row exchanges, and columns in terms of column exchanges, as per the above examples.&lt;br /&gt;
For example, exchanging rows in a 2&amp;#215;2 matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  0 &amp;amp; 1 \\&lt;br /&gt;
  1 &amp;amp; 0 \\&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  a &amp;amp; b \\&lt;br /&gt;
  c &amp;amp; d&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \quad = \quad&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  c &amp;amp; d \\&lt;br /&gt;
  a &amp;amp; b&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;
&lt;p&gt;and exchanging columns in a 2&amp;#215;2 matrix:&lt;/p&gt;
&lt;p&gt;\[&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  a &amp;amp; b \\&lt;br /&gt;
  c &amp;amp; d&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  0 &amp;amp; 1 \\&lt;br /&gt;
  1 &amp;amp; 0&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
  \quad = \quad&lt;br /&gt;
  \begin{bmatrix}&lt;br /&gt;
  b &amp;amp; a \\&lt;br /&gt;
  d &amp;amp; c&lt;br /&gt;
  \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MIT OCW Linear Algebra</title>
   <link href="http://www.timgittos.com/learning/mit-linear-algebra"/>
   <updated>2012-01-06T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/mit-linear-algebra</id>
   <content type="html">&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;THIS&lt;/span&gt; IS A &lt;span class=&quot;caps&quot;&gt;PLACEHOLDER&lt;/span&gt; SO &lt;span class=&quot;caps&quot;&gt;THAT&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;THE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;APPEARS&lt;/span&gt; IN &lt;span class=&quot;caps&quot;&gt;THE&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;PROJECT&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;LIST&lt;/span&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>2011 In Review, And a Look Forward to 2012</title>
   <link href="http://www.timgittos.com/blog/2011-in-review-and-a-look-forward-to-2012"/>
   <updated>2012-01-02T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/2011-in-review-and-a-look-forward-to-2012</id>
   <content type="html">&lt;p&gt;Although I didn&amp;#8217;t start out with a plan for 2011, I&amp;#8217;m going to perform a brief review of the last year and outline some of the remarkable things that happened to me. This will hopefully help me feel like I&amp;#8217;ve achieved something significant.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Got married&lt;/li&gt;
	&lt;li&gt;Moved to the US permanently&lt;/li&gt;
	&lt;li&gt;Started a new job at an Austin based startup&lt;/li&gt;
	&lt;li&gt;Made some new friends, and started playing D&amp;amp;D again (this is something I didn&amp;#8217;t think I could ever do again, so it&amp;#8217;s a good thing for me)&lt;/li&gt;
	&lt;li&gt;Visited India for the first time&lt;/li&gt;
	&lt;li&gt;Completed 2 courses in Stanfords experimental online university courses &amp;#8211; Introduction to Artificial Intelligence, and Machine Learning. This lead me to watch some lectures and learn material I&amp;#8217;ve been meaning to get around to for a few years&lt;/li&gt;
	&lt;li&gt;Realized the importance of working on only one thing at a time.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The last one, I think, is the most important to my future growth.&lt;/p&gt;
&lt;p&gt;Up until now, I&amp;#8217;ve been trying to do too many things at once, and thus got nothing done. I&amp;#8217;ve always been saying I&amp;#8217;ll concentrate on one thing at a time, but I never follow through.&lt;/p&gt;
&lt;p&gt;The Stanford online classes helped me finally follow through with that goal, and for 2 months, I focused only on completing those classes. It opened my eyes to just how important it is to work on only one thing at a time.&lt;/p&gt;
&lt;p&gt;Due to this, I am devoting the entirety of 2012 to my artwork, and I&amp;#8217;m setting some specific goals to measure my progress. After all, if you&amp;#8217;re not measuring it, you can&amp;#8217;t learn from it.&lt;/p&gt;
&lt;p&gt;These goals are as follows:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Finish the 4&amp;#8242;&amp;#215;5&amp;#8242; airbrush portrait of myself and my wife for my mother-in-law.&lt;/li&gt;
	&lt;li&gt;Sell a piece of artwork&lt;/li&gt;
	&lt;li&gt;Earn enough money through art on the side to buy a Cintiq&lt;/li&gt;
	&lt;li&gt;Submit art for Spectrum 20 (being accepted would be fantastic, but submitting is good enough)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This isn&amp;#8217;t the full list of goals, but it is a list of landmarks to mark my progress. I&amp;#8217;m hoping that I&amp;#8217;ll get the first 2 done before June.&lt;br /&gt;
At the end of 2012, I&amp;#8217;ll review how I did with these goals.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Things that Suck</title>
   <link href="http://www.timgittos.com/blog/things-that-suck"/>
   <updated>2011-12-16T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/things-that-suck</id>
   <content type="html">&lt;p&gt;I do a lot of reading about startups and entrepreneurship. A common theme on the subject of getting started is finding problems to solve. &amp;#8220;Easier said than done&amp;#8221;, I&amp;#8217;ve always thought. People in the tech startup world love to claim that ideas are cheap and easy, execution is where it counts. Ideas weren&amp;#8217;t cheap and easy to me, until I learned a trick.&lt;/p&gt;
&lt;p&gt;Startup literature writes that you should find meaningful problems to solve in order to start your startup. That seems kind of abstract to me. If I had a meaningful problem, usually I&amp;#8217;ve already solved it myself.&lt;br /&gt;
Getting more specific, people bring up &amp;#8220;pain points.&amp;#8221; Find something in your life that is a &amp;#8220;pain point&amp;#8221; and fix that, and chances are, other people have the same &amp;#8220;pain point&amp;#8221; and you can help them solve it. Again, that&amp;#8217;s a little abstract. What causes me pain in my life? Not much.&lt;/p&gt;
&lt;p&gt;While dwelling on the meaning of &amp;#8220;pain point&amp;#8221;, I came up with a rephrasing and a quick acid test. A pain point is something that makes you say &amp;#8220;Man, this sucks.&amp;#8221;&lt;/p&gt;
&lt;p&gt;&amp;#8220;Driving home in traffic sucks&amp;#8221;&lt;br /&gt;
&amp;#8220;Planning a wedding sucks&amp;#8221;&lt;br /&gt;
&amp;#8220;Changing travel plans sucks&amp;#8221;&lt;br /&gt;
&amp;#8220;Lost luggage sucks&amp;#8221;&lt;/p&gt;
&lt;p&gt;Something is a &amp;#8220;pain point&amp;#8221; if doing it, or experiencing it, or fixing it makes you think &amp;#8220;Man, this sucks.&amp;#8221;&lt;/p&gt;
&lt;p&gt;If something sucks, and you can fix it, then you start to put the idea through the whole &amp;#8220;will people pay for this&amp;#8221; wringer.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Stanford Online Artificial Intelligence Class</title>
   <link href="http://www.timgittos.com/learning/stanford-artificial-intelligence"/>
   <updated>2011-12-15T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/stanford-artificial-intelligence</id>
   <content type="html">&lt;h2&gt;What is this?&lt;/h2&gt;
&lt;p&gt;Stanford is running &lt;a href=&quot;http://ai-class.com&quot;&gt;an artificial intelligence class&lt;/a&gt; during the summer of 2011. I am participating in this class, and this page will track my progress. I will be posting things like lecture notes and additional reading/research.&lt;/p&gt;
&lt;p&gt;I hope to both provide help to other people who are running the class, information to people who may have missed the class, and accountability for myself to follow this class through to completion.&lt;/p&gt;
&lt;h3&gt;Update: December 15, 2011&lt;/h3&gt;
&lt;p&gt;With the class come to a close, I can publish all of my individual lecture notes in a single document:&lt;br /&gt;
&lt;a href=&quot;http://timgittos.com/files/ai-class/notes.pdf&quot;&gt;Entire course notes&lt;/a&gt;&lt;br /&gt;
and the solution to the last week&amp;#8217;s programming exercise:&lt;br /&gt;
&lt;a href=&quot;http://timgittos.com/files/ai-class/aiclassnlp1.rb&quot;&gt;aiclassnlp1.rb&lt;/a&gt; &amp;#8211; solution for the first question&lt;br /&gt;
&lt;a href=&quot;http://timgittos.com/files/ai-class/aiclassnlp2.rb&quot;&gt;aiclassnlp2.rb&lt;/a&gt; &amp;#8211; solution for the second question&lt;br /&gt;
&lt;a href=&quot;http://timgittos.com/files/ai-class/corpus.txt&quot;&gt;corpus.txt&lt;/a&gt; &amp;#8211; training corpus for the second question (Flatland by Edwin A. Abbot, from &lt;a href=&quot;http://gutenberg.org&quot;&gt;Project Gutenberg&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://timgittos.com/files/ai-class/input.txt&quot;&gt;input.txt&lt;/a&gt; &amp;#8211; input for the second question (from the notes on the video)&lt;/p&gt;
&lt;h2&gt;Week 1&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-01.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the first week&amp;#8217;s lessons.&lt;/p&gt;
&lt;h2&gt;Week 2&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-02.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the second week&amp;#8217;s lessons.&lt;br /&gt;
Also, the homework for Week 2 really kicked my butt. I had some issues getting my head around some of the probability, so here are some resources I&amp;#8217;m finding useful:&lt;br /&gt;
- &lt;a href=&quot;http://www.reddit.com/r/aiclass/comments/lrojo/understanding_bayes_rule_intuitively_without/&quot;&gt;http://www.reddit.com/r/aiclass/comments/lrojo/understanding_bayes_rule_intuitively_without/&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://www.reddit.com/r/aiclass/comments/lm7g7/dseparation_and_the_bayes_ball_algorithm/&quot;&gt;http://www.reddit.com/r/aiclass/comments/lm7g7/dseparation_and_the_bayes_ball_algorithm/&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&quot;http://postimage.org/image/udh7nv217/&quot;&gt;http://postimage.org/image/udh7nv217/&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Week 3&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-03.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the third week&amp;#8217;s lessons.&lt;/p&gt;
&lt;h2&gt;Week 4&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-04.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the fourth week&amp;#8217;s lessons.&lt;/p&gt;
&lt;h2&gt;Week 5&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-05.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the fifth week&amp;#8217;s lessons.&lt;/p&gt;
&lt;h2&gt;Week 6&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-06.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the sixth week&amp;#8217;s lessons.&lt;/p&gt;
&lt;h2&gt;Week 7&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-07.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the seventh&amp;#8217;s week&amp;#8217;s lessons.&lt;/p&gt;
&lt;h2&gt;Week 8&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-08.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the eighth week&amp;#8217;s lessons.&lt;/p&gt;
&lt;p&gt;This week, we also (kind of) learn how the Kinect does it&amp;#8217;s thing. Kind of awesome.&lt;/p&gt;
&lt;h2&gt;Week 9&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-09.txt&quot;&gt;Lecture notes&lt;/a&gt; for the ninth week&amp;#8217;s lessons.&lt;/p&gt;
&lt;p&gt;These notes are in txt format because I had to take the notes on a laptop and not my iPad as I normally do.&lt;/p&gt;
&lt;h2&gt;Week 10&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://timgittos.com/files/ai-class/notes-week-10.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the tenth week&amp;#8217;s lessons.&lt;/p&gt;
&lt;p&gt;This week we also got to do optional programming assignments. Here are my solutions in Ruby (1.91):&lt;br /&gt;
&lt;a href=&quot;http://timgittos.com/files/ai-class/aiclassnlp1.rb&quot;&gt;aiclassnlp1.rb&lt;/a&gt; &amp;#8211; solution for the first question&lt;br /&gt;
&lt;a href=&quot;http://timgittos.com/files/ai-class/aiclassnlp2.rb&quot;&gt;aiclassnlp2.rb&lt;/a&gt; &amp;#8211; solution for the second question&lt;br /&gt;
&lt;a href=&quot;http://timgittos.com/files/ai-class/corpus.txt&quot;&gt;corpus.txt&lt;/a&gt; &amp;#8211; training corpus for the second question (Flatland by Edwin A. Abbot, from &lt;a href=&quot;http://gutenberg.org&quot;&gt;Project Gutenberg&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://timgittos.com/files/ai-class/input.txt&quot;&gt;input.txt&lt;/a&gt; &amp;#8211; input for the second question (from the notes on the video)&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Stanford Online Machine Learning Class</title>
   <link href="http://www.timgittos.com/learning/stanford-machine-learning"/>
   <updated>2011-12-11T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/learning/stanford-machine-learning</id>
   <content type="html">&lt;h2&gt;What is this?&lt;/h2&gt;
&lt;p&gt;Stanford is running &lt;a href=&quot;http://ml-class.com&quot;&gt;a machine learning class&lt;/a&gt; during the summer of 2011. I am participating in this class, and this page will track my progress. I will be posting things like lecture notes and additional reading/research.&lt;/p&gt;
&lt;p&gt;I hope to both provide help to other people who are running the class, information to people who may have missed the class, and accountability for myself to follow this class through to completion.&lt;/p&gt;
&lt;h2&gt;Week 1&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;/files/ml-class/notes-week-01.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the first week&amp;#8217;s lessons.&lt;/p&gt;
&lt;h2&gt;Week 2&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;/files/ml-class/notes-week-02.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the second week&amp;#8217;s lessons.&lt;br /&gt;
&lt;a href=&quot;/&quot;&gt;Programming exercise&lt;/a&gt; posted in the second week. (I&amp;#8217;ll put these up at the end of the course, considering you can submit late)&lt;/p&gt;
&lt;h3&gt;Week 3&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;/files/ml-class/notes-week-03.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the third week&amp;#8217;s lessons.&lt;br /&gt;
&lt;a href=&quot;/&quot;&gt;Programming exercise&lt;/a&gt; posted in the third week. (I&amp;#8217;ll put these up at the end of the course, considering you can submit late)&lt;br /&gt;
&lt;a href=&quot;http://david-hu.com/2011/11/02/how-khan-academy-is-using-machine-learning-to-assess-student-mastery.html&quot;&gt;Practical classifying with logistic regression&lt;/a&gt; &amp;#8211; an interesting write up about how &lt;a href=&quot;http://www.khanacademy.org&quot;&gt;Khan Academy&lt;/a&gt; uses logistic regression to assess student mastery through a course.&lt;/p&gt;
&lt;h3&gt;Week 4 &amp;amp; 5&lt;/h3&gt;
&lt;p&gt;Both weeks 4 &amp;amp; 5 are about Neural Networks, and due to a change in the structure of week 4 a little into week 5, I&amp;#8217;ve rolled these two weeks into one.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/files/ml-class/notes-week-04-05.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the fourth and fifth week&amp;#8217;s lessons.&lt;br /&gt;
&lt;a href=&quot;/&quot;&gt;Programming exercise&lt;/a&gt; posted in the fourth week and the &lt;a href=&quot;/&quot;&gt;programming exercise&lt;/a&gt; for the fifth week. (I&amp;#8217;ll put these up at the end of the course, considering you can submit late)&lt;/p&gt;
&lt;p&gt;Also, I want to say that these two weeks&amp;#8217; programming exercises were to me the most interesting. Not only did we achieve a real, practical goal (recognizing hand written digits), but we got some insight about how to represent data in machine vision problems.&lt;br /&gt;
Week 4 was to implement forward propagation, and week 5 was backward propagation. In the end you end up with a neural network that can classify hand written digets that you built and trained from scratch yourself. Very cool.&lt;/p&gt;
&lt;h3&gt;Week 6&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;/files/ml-class/notes-week-06.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the sixth week&amp;#8217;s lessons.&lt;br /&gt;
&lt;a href=&quot;/&quot;&gt;Programming exercise&lt;/a&gt; posted in the sixth week. (I&amp;#8217;ll put these up at the end of the course, considering you can submit late)&lt;/p&gt;
&lt;h3&gt;Week 7&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;/files/ml-class/notes-week-07.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the seventh week&amp;#8217;s lessons.&lt;br /&gt;
&lt;a href=&quot;/&quot;&gt;Programming exercise&lt;/a&gt; posted in the seventh week. (I&amp;#8217;ll put these up at the end of the course, considering you can submit late)&lt;/p&gt;
&lt;h3&gt;Week 8&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;/files/ml-class/notes-week-08.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the eighth week&amp;#8217;s lessons.&lt;br /&gt;
&lt;a href=&quot;/&quot;&gt;Programming exercise&lt;/a&gt; posted in the eighth week. (I&amp;#8217;ll put these up at the end of the course, considering you can submit late)&lt;/p&gt;
&lt;h3&gt;Week 9&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;/files/ml-class/notes-week-09.pdf&quot;&gt;Lecture notes&lt;/a&gt; for the nineth week&amp;#8217;s lessons.&lt;br /&gt;
&lt;a href=&quot;/&quot;&gt;Programming exercise&lt;/a&gt; posted in the nineth week. (I&amp;#8217;ll put these up at the end of the course, considering you can submit late)&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Time</title>
   <link href="http://www.timgittos.com/blog/time"/>
   <updated>2011-11-08T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/blog/time</id>
   <content type="html">&lt;p&gt;&lt;iframe src=&quot;http://player.vimeo.com/video/31455885?title=0&amp;amp;byline=0&amp;amp;portrait=0&amp;amp;color=f1f1ef&quot; width=&quot;720&quot; height=&quot;405&quot; frameborder=&quot;0&quot; webkitAllowFullScreen mozallowfullscreen allowFullScreen&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;a href=&quot;http://thisismadebyhand.com/film/the_knife_maker&quot;&gt;The Knife Maker&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Firstly, this film resonates with me strongly. It&amp;#8217;s how I feel about my work, and the hobbies I choose to invest my time in.&lt;/p&gt;
&lt;p&gt;One of my favorite insights from the HN thread I found this in: &amp;#8220;Time must be used up. You don&amp;#8217;t get to just stop using your time until you have something in particular you want to use it for. If making something by hand is rewarding to you, and someone else will pay you for it then it&amp;#8217;s probably a good use of your time.&amp;#8221;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Rails 3.1 Model Property Name Gotcha</title>
   <link href="http://www.timgittos.com/blog/rails-model-property-name-gotcha"/>
   <updated>2011-10-28T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/rails-model-property-name-gotcha</id>
   <content type="html">&lt;p&gt;If you&amp;#8217;re trying to instantiate a Rails model and you keep getting &lt;em&gt;nil&lt;/em&gt; back instead of an instance of that model, chances are you have done something dumb like try to create a property on that model called &amp;#8220;class&amp;#8221;, or something equally ill-advised.&lt;/p&gt;
&lt;p&gt;I haven&amp;#8217;t tested this for all Ruby keywords, but chances are good that if the build in Object class has an instance property by the same name as one of your model properties, you&amp;#8217;re going to run into trouble.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s obvious when you&amp;#8217;re not dealing with the consequences, but when you&amp;#8217;re sitting there in a console and your .new instantiation is returning &lt;em&gt;nil&lt;/em&gt;, this get pretty confusing.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Games as Platforms</title>
   <link href="http://www.timgittos.com/blog/games-as-platforms"/>
   <updated>2011-10-18T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/games-as-platforms</id>
   <content type="html">&lt;p&gt;I just read &lt;a href=&quot;http://www.thatsaterribleidea.com/2011/10/mojang-up-minecraft-down.html&quot;&gt;an article about Minecraft&amp;#8217;s direction away from a platform towards a computer game&lt;/a&gt; , and couldn&amp;#8217;t help thinking of one of my recent posts &lt;a href=&quot;http://www.timgittos.com/blog/platforms-and-sandboxes/&quot;&gt;about businesses doing the opposite&lt;/a&gt; . If anything, it reinforces the concept of a platform for inverting the responsibility of creating value.&lt;/p&gt;
&lt;p&gt;I know I&amp;#8217;d much rather sell a game that makes money by itself, and enable others to create value for it by modding it. Hell, you could even let content creators earn money and take a commission. &lt;br /&gt;
I guess the only thing you need to be aware of is becoming a lame middleware vendor instead of a consumer product vendor.&lt;/p&gt;
&lt;p&gt;Platform as product first, then extendable by the community.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Platforms and Sandboxes</title>
   <link href="http://www.timgittos.com/blog/platforms-and-sandboxes"/>
   <updated>2011-10-12T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/platforms-and-sandboxes</id>
   <content type="html">&lt;p&gt;I&amp;#8217;m in the middle of reading &lt;a href=&quot;http://news.ycombinator.com/item?id=3101876&quot;&gt;this HackerNews posting&lt;/a&gt; and I&amp;#8217;m starting to see some parallels between building a tech business on a platform, and creating a sandbox &lt;span class=&quot;caps&quot;&gt;RPG&lt;/span&gt; game&lt;sup&gt;1&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;Both are based on inverting the work load. Provide a means for other people to do your work for you and they will. The tech business (&lt;span class=&quot;caps&quot;&gt;RPG&lt;/span&gt;) will move in a direction your customers (players) want, and you can focus on more important parts of your business (game).&lt;/p&gt;
&lt;p&gt;Interesting.&lt;/p&gt;
&lt;p&gt;&lt;sub&gt;&lt;br /&gt;
1. For those unfamiliar with sandbox &lt;span class=&quot;caps&quot;&gt;RPG&lt;/span&gt; games, the person running the game basically presents a complete world with an overall plot, and lets the characters choose their own actions and interact how they will with this world, as opposed to creating individual, fixed story adventures for their players to run through. &lt;br /&gt;
&lt;/sub&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>A Case for Brevity</title>
   <link href="http://www.timgittos.com/blog/a-case-for-brevity"/>
   <updated>2011-10-10T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/a-case-for-brevity</id>
   <content type="html">&lt;p&gt;I have a somewhat keen interest in speed reading, because the world is fascinating and I only have so many years to learn it&amp;#8217;s secrets. One speed reading technique involves reading only the first few sentences of a paragraph, because that&amp;#8217;s where the author makes their point. The rest is just to convince you of it&amp;#8217;s validity. I have seen this true in most places, especially on the internet in blog posts.&lt;/p&gt;
&lt;p&gt;Which is why I find myself wondering why I even write posts, every time I write a post. What am I trying to say? If I have something to say, is it worth an entire post? Do I need to convince people it&amp;#8217;s true?&lt;/p&gt;
&lt;p&gt;I just read a post about perseverence being the key to success, and it was quite long. At least 600 words. I read the first few sentences, then the first sentence of each paragraph and gained no new insights. The author spent their entire post trying to convince me that perseverence is essential for success in anything. Is that something that people need to be convinced of? Are there really people who don&amp;#8217;t already know this? If so, would they likely be reading this article? I don&amp;#8217;t think so.&lt;br /&gt;
The entire article could have been replaced with &amp;#8220;Natural talent is mistakenly assumed to be largely responsible for success; perseverence has more effect on success&amp;#8221;.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s what&amp;#8217;s been holding me back from blogging a lot. I find it difficult to justify padding a simple point out to a &amp;#8220;respectable&amp;#8221; sized post. I think it&amp;#8217;s time I embraced brevity.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Literati - Ruby based literate programming library</title>
   <link href="http://www.timgittos.com/projects/literati"/>
   <updated>2011-08-15T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/literati</id>
   <content type="html">&lt;h2&gt;Description&lt;/h2&gt;
&lt;p&gt;One of the big issues with development is how fast code&lt;br /&gt;
documentation becomes out of date, when it is written at all.&lt;/p&gt;
&lt;p&gt;While programs are executed by computers, we write them mostly&lt;br /&gt;
for the benefit of other programmers, hence the proliferation of&lt;br /&gt;
high level languages such as Ruby and Python.&lt;/p&gt;
&lt;p&gt;Literate programming is an attempt to solve this problem by &lt;br /&gt;
tightly coupling the code to the documentation, and to help&lt;br /&gt;
programmers write clearer programs for each other first, and for&lt;br /&gt;
computers second.&lt;/p&gt;
&lt;p&gt;Literate programming was pioneered by Donald Knuth, and while there&lt;br /&gt;
are a lot of software packages to tangle/weave literate programming&lt;br /&gt;
files, there&amp;#8217;s a wide variety of syntaxes for writing documents.&lt;/p&gt;
&lt;p&gt;Literati attempts to keep the literate programming syntax as&lt;br /&gt;
close to regular text as possible, so you don&amp;#8217;t have to think&lt;br /&gt;
about how to format your programs and documentation.&lt;/p&gt;
&lt;p&gt;Literati keeps out of your way so you can do what you do best: code.&lt;/p&gt;
&lt;h2&gt;Status&lt;/h2&gt;
&lt;p&gt;This is still very much a rough proof of concept.&lt;/p&gt;
&lt;p&gt;At the moment, the library is contained in one file: literati.rb.&lt;br /&gt;
There are 2 sample programs that you can run through Literati and it&lt;br /&gt;
will produce a Ruby and a Python based calculator.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m in the middle of a rewrite of Literati, in Literati format.&lt;br /&gt;
This can be found in the lib directory, however it&amp;#8217;s not functional.&lt;/p&gt;
&lt;h2&gt;Source&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://github.com/tgittos/literati&quot;&gt;http://github.com/tgittos/literati&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Syntax&lt;/h2&gt;
&lt;p&gt;I&amp;#8217;ve tried to keep the literati syntax as simple as possible. You should be able&lt;br /&gt;
to pick it up by just reading through the two sample programs, however there&lt;br /&gt;
may be some finer points that aren&amp;#8217;t obvious.&lt;/p&gt;
&lt;p&gt;Each code block must have a header, in the form of&lt;br /&gt;
== Identifier ==&lt;br /&gt;
The identifier will uniquely identify that code block, and allow you to reference&lt;br /&gt;
it later in the document.&lt;/p&gt;
&lt;p&gt;You can optionally put more documentation after the header. This documentation&lt;br /&gt;
can be any format you wish.&lt;br /&gt;
After your documentation, you can close the documentation section with&lt;br /&gt;
@api, doc&lt;br /&gt;
This tag tells literati which documentation types this documentation block belongs to.&lt;/p&gt;
&lt;p&gt;Then your source code comes next. You can terminate your source code by starting a new block.&lt;/p&gt;
&lt;p&gt;At the end, you need a program description block, which looks like&lt;br /&gt;
== @filename.rb ==&lt;br /&gt;
The @ in the header marks the name of the file, and below the header block are code section &lt;br /&gt;
references, as defined in the unique identifiers above.&lt;/p&gt;
&lt;p&gt;I know none of this documentation makes any sense, but considering this is still in dev,&lt;br /&gt;
that&amp;#8217;s to be expected.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll rewrite the documentation when I finish refactoring the code.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Modeler - 3D modeling in the browser</title>
   <link href="http://www.timgittos.com/projects/modeler"/>
   <updated>2011-06-08T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/projects/modeler</id>
   <content type="html">&lt;h2&gt;Goals&lt;/h2&gt;
&lt;p&gt;3D modeling in the browser. No plugins, no programs to install. Just fire up a browser and off you go.&lt;/p&gt;
&lt;h2&gt;Status&lt;/h2&gt;
&lt;p&gt;[07-24-2011] Added in a directional and ambient light to the shader. Next up is point lighting.&lt;/p&gt;
&lt;p&gt;[06-15-2011] Optimizations have been finished and merged into the master branch.&lt;br /&gt;
Next up is implementing a simple lighting model, and then work on setting up the interface to allow geometry to be&lt;br /&gt;
put into a scene.&lt;/p&gt;
&lt;p&gt;[06-08-2011] I&amp;#8217;m putting this demo page up because somebody on Github has asked to see a demo. This project is far&lt;br /&gt;
from nearing a state where you can call it a 3D modeling application. Right now, I have a basic renderer that can take&lt;br /&gt;
a scene made of some primitives and render it to screen. I&amp;#8217;m working on optimizations because there&amp;#8217;s currently a large&lt;br /&gt;
amount of overhead associated with getting objects to the &lt;span class=&quot;caps&quot;&gt;GPU&lt;/span&gt; right now.&lt;br /&gt;
My goal is that once I&amp;#8217;ve finished optimizing the core of the renderer, I can start designing a basic interface and&lt;br /&gt;
method of inputing geometry. Then I will perhaps release a stable version of the source.&lt;/p&gt;
&lt;h2&gt;Demo&lt;/h2&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/projects/demos/modeler/app/modeler.min.js&quot;&gt;&lt;/script&gt;&lt;script ty=e&quot;text/javascript&quot;&gt;
  MODELER.BASE = '/projects/demos/modeler/src/'; // reassign the base URL
  function repositionCanvas() {
    var canvas = document.getElementsByTagName('canvas')[0];
    document.getElementById('demo').appendChild(canvas);
  };
&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;
var scene, camera, renderer;
var cube;
var lastTime = 0;
function pageLoaded() {  
    scene = REDBACK.Core.WebGLSceneGraph();
    camera = MODELER.Camera();
    renderer = REDBACK.Core.WebGLRenderer( { scene: scene, camera: camera} );
  
    // first load shaders
  	MODELER.Event.listen(MODELER.EVENTS.FILEMANAGER.LOAD_SUCCESS, fileManagerPreloaded);
  	MODELER.IO.FileManager.preload([
  		MODELER.BASE + 'shaders/webgltexture.vshader',
  		MODELER.BASE + 'shaders/webgltexture.fshader',
  		'/projects/demos/modeler/assets/textures/glass.gif'
  	]);
	
  	function fileManagerPreloaded(){
  		var cube_mat, cube_tex, lighting;
  		cube_tex = REDBACK.Textures.WebGLTexture({
        image: MODELER.IO.FileManager.get('/projects/demos/modeler/assets/textures/glass.gif')
      });
      cube_mat = REDBACK.Materials.WebGLTextureMaterial({
        texture: cube_tex.getTexture()
        ,alpha: 0.5
      });
      cube = MODELER.Primitive.Cube({
        material: cube_mat
  			,z: -10
  			,rotVector: [1, 1, 0]
  			,rotDegrees: 45
      });
      scene.addObject(cube);

      lighting = REDBACK.Lighting.WebGLDirectionalLight({
        direction: [-1.0, 1.0, 1.0],
        colour: [1.0, 1.0, 1.0],
        ambientColour: [0.2, 0.2, 0.2]
      });
      scene.addLight(lighting);

      resizeViewport();
      repositionCanvas();
      render();
  	}  
  };
  function render() {
    var timeNow = new Date().getTime();
    if (lastTime != 0) {
      var elapsed = timeNow - lastTime;
    
      //Do rendering magicks
      cube.rotDegrees += (90 * elapsed) / 1000.0;
    }
    lastTime = timeNow;

    renderer.render();
    requestAnimationFrame(render);
  };
  function resizeViewport(e) {
    renderer.setSize(600, 480);
  };
  window.onload = pageLoaded;
  window.onresize = resizeViewport;
&lt;/script&gt;&lt;div id=&quot;demo&quot;&gt;&lt;/div&gt;
&lt;h2&gt;Code&lt;/h2&gt;
&lt;p&gt;For the latest, bleeding edge code, you can go to &lt;a href=&quot;http://github.com/tgittos/modeler&quot;&gt;Github&lt;/a&gt; and clone it locally. &lt;br /&gt;
There&amp;#8217;s a terse readme that will describe how to get it up and running on your local computer.&lt;/p&gt;
&lt;p&gt;There are no stable releases right now, as the project is very far from where it needs to be to live up to it&amp;#8217;s goal.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Now On Jekyll</title>
   <link href="http://www.timgittos.com/blog/now-on-jekyll"/>
   <updated>2011-05-27T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/blog/now-on-jekyll</id>
   <content type="html">&lt;p&gt;I first started my blog in order to help myself learn. I figured that I would be motivated to write, and in order to fully explain things, I would force myself to do research and increase my knowledge on a given topic. So I set up a Wordpress blog, created a very simple theme and got started with it.&lt;/p&gt;
&lt;p&gt;This was all good in theory, but in practice it didn&amp;#8217;t quite work. This really bugged me, because I didn&amp;#8217;t know &lt;em&gt;why&lt;/em&gt; it didn&amp;#8217;t work. I thought about it for a long time, and I think I&amp;#8217;ve figured it out.&lt;/p&gt;
&lt;p&gt;The reason it wasn&amp;#8217;t working is because the way I think and do things is very different from the workflow of Wordpress. Wordpress is a very linear blogging system. Posts are displayed in the order they&amp;#8217;re created, and if you want to do a series of detailed posts in multiple posts, you either need to do them one after the other, or you need to keep them as drafts until they&amp;#8217;re all done.&lt;/p&gt;
&lt;p&gt;I tend to work a little different. I like to do a lot of things at once, and nibble away at posts. I&amp;#8217;ll write a little here and a little there, and generally take my time to produce content. This wasn&amp;#8217;t working for me in Wordpress, and it was actually starting to make me feel bad.&lt;/p&gt;
&lt;p&gt;So, I decided to change to a platform that&amp;#8217;s a little more freestyle. I chose &lt;a href=&quot;http://github.com/mojombo/jekyll&quot;&gt;Jekyll&lt;/a&gt; because I decided to integrate my site with Github. Now I don&amp;#8217;t have to worry about logging in to a web based control panel, because everything is handled with public/private key encryptions on Github, and it&amp;#8217;s very easy to deploy to my sever with a post-commit hook that tells my server to do a git pull.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m also writing in textile now, which means that should I produce any content that&amp;#8217;s worth publishing, converting it to TeX then to a &lt;span class=&quot;caps&quot;&gt;PDF&lt;/span&gt; or something similar should be equally easy.&lt;/p&gt;
&lt;p&gt;This is probably time for the obligatory &amp;#8220;this is a work in progress&amp;#8221; comment, and to say that things will be in flux for a while, at least until I get settled on a format/workflow that really works for me. I&amp;#8217;ve been working with this for a while now offline, and it seems to be doing the trick, but there are still a few bugs to iron out.&lt;/p&gt;
&lt;p&gt;You can also find all of my old posts still on the website, in my &lt;a href=&quot;/archives&quot;&gt;archives&lt;/a&gt; , however I couldn&amp;#8217;t bring across all the comments, so to those of you who commented on my writing, thank you and I&amp;#8217;m sorry.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Pivoting</title>
   <link href="http://www.timgittos.com/archives/pivoting"/>
   <updated>2011-04-20T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/pivoting</id>
   <content type="html">&lt;p&gt;In start-up parlance, to pivot is to change the direction of your attack. Which makes it the perfect description for what I&amp;#8217;m doing.&lt;/p&gt;
&lt;p&gt;When I started this blog, I just wanted to build a name for myself out on the internet. I was aware that potential employers would probably be searching for my name, and I wanted to control the content that they found. I had no overall goals for the blog itself, other than what it would do for me.&lt;/p&gt;
&lt;p&gt;Over time, it evolved into a place for me to share snippets of code and techniques that I&amp;#8217;d found along the way. Each time I did something kind of cool, I&amp;#8217;d write it up and post it online. While I hope that these snippets have helped people, and I know some of them have, I&amp;#8217;ve decided that&amp;#8217;s not really what I want to do with my blog anymore.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve long held the belief that information channels in the human mind are serial. You&amp;#8217;re either consuming information or you&amp;#8217;re producing, but it&amp;#8217;s very hard to do both at the same time. I&amp;#8217;m a consumer, I always have been and I always will be. I&amp;#8217;m fascinated by a whole bunch of different but loosely related things. I don&amp;#8217;t have the time to write regularly while I&amp;#8217;m trying to do all this cool stuff.&lt;/p&gt;
&lt;p&gt;But there&amp;#8217;s the rub: I like to write about what I learn. It helps order my thoughts and creates a reference document for me to refresh my memory from. It&amp;#8217;s secondary to doing cool stuff, and a blog demands to be first choice when it comes to building audiences and producing quality content regularly.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not well suited to the blog format of writing. I&amp;#8217;d prefer to do something awesome, write it up and publish it, and disappear for another 6 months while I do something else awesome. And that&amp;#8217;s exactly what I&amp;#8217;m going to do.&lt;/p&gt;
&lt;p&gt;Lately I&amp;#8217;ve been working deep inside computer graphics, reading and learning and tinkering around in WebGL. I will be doing that for a while, and won&amp;#8217;t be posting here much. But when I do, I&amp;#8217;ll post all about the things I learn.&lt;/p&gt;
&lt;p&gt;Between here and there, I will be migrating off Wordpress and onto Jekyll. These days I carry around a computing device of some kind that I can store files on, so web based access to content is no longer important to me. Jekyll will make the site faster, more secure and easier for me to change and deal with. I have no timeframe for this, and will publish none.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>The Social Media Revolution</title>
   <link href="http://www.timgittos.com/archives/the-social-media-revolution"/>
   <updated>2011-02-15T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/the-social-media-revolution</id>
   <content type="html">&lt;p&gt;I can&amp;#8217;t remember exactly when I first started hearing about the so-called &amp;#8220;Social Media revolution.&amp;#8221; It was right when I was starting to really get into web development. It was easily at least 3 years ago, before Twitter had hit the mainstream like it has now. All I remember is that I didn&amp;#8217;t buy into it.&lt;/p&gt;
&lt;p&gt;I had been a member of a social network called &lt;a href=&quot;http://www.deviantart.com&quot;&gt;deviantArt&lt;/a&gt; since 2001, and joined Facebook quickly after it opened it&amp;#8217;s doors to people who weren&amp;#8217;t in school. I had graduated when it reached Australia, and wasn&amp;#8217;t able to create an account. I had interacted with people through an online media for a long time before I heard the phrases &amp;#8220;social network&amp;#8221; and &amp;#8220;social media.&amp;#8221; To me, all this talk from marketers and web designers about leveraging social media, claiming that social media was the way forward, was just that &amp;#8211; talk, nothing but hot air.&lt;/p&gt;
&lt;p&gt;I think today I can say that I understand the social media revolution. All it took was to get involved in creating a social network.&lt;/p&gt;
&lt;p&gt;I have recently changed jobs to an Austin company that is busy building it&amp;#8217;s business social network. Working as close as I am with their social network and learning about how they plan to leverage the community, I can see that I took the wrong end of the stick with regards to social media.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve read a lot of criticism lately about Facebook, with critics saying that Facebook is a hollow way to interact with your friends. They say that it cheapens relationships, and waters down the meaning of &amp;#8216;friend.&amp;#8217; This is the view I&amp;#8217;d had of all social media in the past, and while it may or may not be a valid criticism of Facebook, it&amp;#8217;s certainly not a valid criticism of social media.&lt;/p&gt;
&lt;p&gt;I had a discussion today with a friend about the future of publishing. She&amp;#8217;s in the publishing business, and is violently opposed to e-books and the effects they&amp;#8217;re having on brick and mortar book stores. It was while I was explaining to her my vision of the future that I realised the value of social media. We were musing on the role of publishers in a primarily e-book formatted world where there was almost no hand selling done. She was worried about the authors that weren&amp;#8217;t super stars, and how they would get eyes on their books in a world where you didn&amp;#8217;t have covers to browse, and browsing had a greater friction.&lt;/p&gt;
&lt;p&gt;I explained that it would be social media and social networks that would step in. Websites like &lt;a href=&quot;http://www.goodreads.com&quot;&gt;Goodreads&lt;/a&gt; are a good start, where people share their opinions on books and list books they&amp;#8217;ve read and want to read. You&amp;#8217;d build a network of readers that you know, and know the tastes of, and that would provide the data you&amp;#8217;d need to make decisions about new books.&lt;/p&gt;
&lt;p&gt;It was then that I realised the true value of social networks. It&amp;#8217;s a new way for applications to gather real, meaningful data in the most efficient way. By crowd sourcing data, you build a knowledge base in a relevant domain in a very hands off way. By leveraging this data, you can provide very personalised and useful functionality in applications. Rather than make assumptions about your visitors and users, you can obtain hard data and act upon it.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Safari and Firing Keypress Events with Backspace</title>
   <link href="http://www.timgittos.com/archives/safari-and-firing-keypress-events-with-backspace"/>
   <updated>2010-10-05T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/safari-and-firing-keypress-events-with-backspace</id>
   <content type="html">&lt;p&gt;Whilst working on a project for a client that uses a lot of jQuery and &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;AJAX&lt;/span&gt;, I found that the &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; AjaxControlToolkit control MaskedEditExtender doesn&amp;#8217;t quite work in Safari. The symptoms of the problem are the backspace and delete keys not working to clear the text in the mask.&lt;/p&gt;
&lt;p&gt;A little too late for my project, there was a fix posted on the &lt;a href=&quot;http://ajaxcontroltoolkit.codeplex.com/workitem/17166&quot;&gt;project&amp;#8217;s Codeplex issue tracker&lt;/a&gt; (which I haven&amp;#8217;t verified personally). It involves patching AjaxControlToolkit javascript in source to sniff specifically for Webkit browsers and compiling a new AjaxControlToolkit.dll.&lt;/p&gt;
&lt;p&gt;Instead, I took the extenders out and replaced them with a custom jQuery date mask. I researched a few of the more popular jQuery plugins that do that, but found they didn&amp;#8217;t quite work the way we wanted them to, so I had to roll my own.&lt;/p&gt;
&lt;p&gt;Stupidly, I tested mostly in Firefox, and after a while got it working pretty well. I went to test it in Safari, and it didn&amp;#8217;t work. I feared all the work I had done was for naught. I took a quick look in Safari&amp;#8217;s javascript console and found that Safari wasn&amp;#8217;t firing keypress events for the backspace key, which is what my plugin was listening for.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://unixpapa.com/js/key.html&quot;&gt;As it turns out, this was a known issue with Webkit browsers&lt;/a&gt;. I tested around and figured out that it was &lt;em&gt;just&lt;/em&gt; the keypress event that wasn&amp;#8217;t being fired. The keydown event was being fired fine. So I switched my plugin to listen to the keydown event instead of the keypress event, and that resolved the issue.&lt;/p&gt;
&lt;p&gt;So if you want to support Webkit browsers and you&amp;#8217;re doing key press detection for &amp;#8216;special&amp;#8217; keys, use the keydown event instead of the keypress event. It will save you some frustration.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Evaluating JSON in Safari</title>
   <link href="http://www.timgittos.com/archives/evaluating-json-in-safari"/>
   <updated>2010-08-13T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/evaluating-json-in-safari</id>
   <content type="html">&lt;p&gt;Just a quickie on parsing &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; strings in Safari.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m in the middle of a project developing a timesheet/rostering application, which uses a lot of Javascript. I have a series of web services that interact with jQuery. For reasons beyond the scope of this post, the web service returns a &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; string, which needs to be parsed into a &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; object, and then further processing is done on the object.&lt;/p&gt;
&lt;p&gt;I had a bug where Safari was choking on the &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; string returned by my webservice, yet Firefox and IE were happy parsing it. As it turns out, my &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; string had a Javascript keyword in it; &amp;#8216;break&amp;#8217;.&lt;/p&gt;
&lt;p&gt;Here is my &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; string (well, an example):&lt;/p&gt;
&lt;/notextile&gt;

Safari was choking on the &lt;code&gt;break&lt;/code&gt; in the above JSON string.

When I wrapped the attribute in single quotes, like so:

&lt;notextile&gt;&lt;p&gt;it was happy.&lt;/p&gt;
&lt;p&gt;You can replicate this by using the below code snippet to parse out your &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; string quickly in Safari&amp;#8217;s debug window:&lt;/p&gt;
&lt;/notextile&gt;

which should fail. If you add the single quotes around &lt;code&gt;break&lt;/code&gt; though, it should work just fine.

This also fails for other Javascript keywords:

&lt;notextile&gt;&lt;p&gt;fails. If you wrap &lt;code&gt;if&lt;/code&gt; in single quotes, it works.&lt;/p&gt;
&lt;p&gt;I think the take away lesson is to always wrap your object attributes in a &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; string in single quotes, otherwise Safari will choke on it.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Autostart a VPN in Windows XP/Vista</title>
   <link href="http://www.timgittos.com/archives/autostart-vpn-in-windows-vista"/>
   <updated>2010-03-10T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/autostart-vpn-in-windows-vista</id>
   <content type="html">&lt;h1&gt;Autostart a &lt;span class=&quot;caps&quot;&gt;VPN&lt;/span&gt; in Windows XP/Vista&lt;/h1&gt;
&lt;p&gt;Just a quick one today, and it&amp;#8217;s exactly what it says on the box.&lt;/p&gt;
&lt;p&gt;I was unreasonably inconvenienced by the need to manually dial into my works &lt;span class=&quot;caps&quot;&gt;VPN&lt;/span&gt; everytime I start my computer up. For some reason it really rubbed me the wrong way.&lt;/p&gt;
&lt;p&gt;A few days ago, I finally decided to solve this niggling problem once and for all. Here are the steps you&amp;#8217;ll need, assuming you already have the Windows &lt;span class=&quot;caps&quot;&gt;VPN&lt;/span&gt; client configured for a &lt;span class=&quot;caps&quot;&gt;VPN&lt;/span&gt;:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Save your authentication details in the connection&lt;/li&gt;
	&lt;li&gt;Set the &lt;span class=&quot;caps&quot;&gt;VPN&lt;/span&gt; connection to &lt;em&gt;not&lt;/em&gt; prompt for user details (Start &amp;#8594; Connect To &amp;#8594; right click on your &lt;span class=&quot;caps&quot;&gt;VPN&lt;/span&gt; &amp;#8594; Properties &amp;#8594; Options &amp;#8594; uncheck &amp;#8220;Prompt for name and password&amp;#8221;)&lt;/li&gt;
	&lt;li&gt;Create a .bat file somewhere safe, and put in it the following: &lt;code&gt;rasdial &quot;Name of your VPN Connection&quot;&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Create a shortcut to this .bar file&lt;/li&gt;
	&lt;li&gt;Put this shortcut into your startup folder&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now, the next time reboot, your &lt;span class=&quot;caps&quot;&gt;VPN&lt;/span&gt; should start as soon as you get an internet connection.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>ProxyBotLib</title>
   <link href="http://www.timgittos.com/projects/starcraft-ai"/>
   <updated>2010-02-19T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/projects/starcraft-ai</id>
   <content type="html">&lt;p&gt;A library for connecting a .&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; based bot to the Starcraft Brood War &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; &lt;a href=&quot;http://code.google.com/p/bwapi/&quot;&gt;http://code.google.com/p/bwapi/&lt;/a&gt;. Contains source for the &lt;span class=&quot;caps&quot;&gt;BWAPI&lt;/span&gt; socket communication dll and the .&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; proxy bot.&lt;/p&gt;
&lt;p&gt;Available from &lt;a href=&quot;http://github.com/tgittos/ProxyBotLib&quot;&gt;Github&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Created for use with the &lt;span class=&quot;caps&quot;&gt;EIS&lt;/span&gt; Starcraft AI competition &lt;a href=&quot;http://eis.ucsc.edu/StarCraftAICompetition&quot;&gt;http://eis.ucsc.edu/StarCraftAICompetition&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Based on &lt;a href=&quot;http://breakablec.redirectme.net/svn/repos/trunk/StarProxyBot_net/&quot;&gt;http://breakablec.redirectme.net/svn/repos/trunk/StarProxyBot_net/&lt;/a&gt; which is based on &lt;a href=&quot;http://eis.ucsc.edu/StarCraftRemote&quot;&gt;http://eis.ucsc.edu/StarCraftRemote&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Getting Started&lt;/h1&gt;
&lt;p&gt;This library is intended to aid an external, .&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; based AI bot to connect to the &lt;span class=&quot;caps&quot;&gt;BWAPI&lt;/span&gt; socket. To get started, create a new console application which will be the base for your AI agent. Add the ProxyBotLib project to the solution, and add to the console application a reference to ProxyBotLib. There is a sample agent in ProxyBotLib.Tests that you should move to the console application. Create an instance of the agent, and create an instance of the ProxyBot, passing the agent to the constructor of the ProxyBot.&lt;/p&gt;
&lt;h1&gt;Example&lt;/h1&gt;
&lt;pre&gt;
&lt;code&gt;
[STAThread]
public static void Main(System.String[] args)
{
    StarCraftAgent agent = new StarCraftAgent();
    ProxyBot proxyBot = new ProxyBot(agent);

    try
    {
        proxyBot.start();
    }
    catch (SocketException e)
    {
        Console.Error.WriteLine(e.StackTrace);
        System.Environment.Exit(0);
    }
    catch (System.Exception e)
    {
        Console.Error.WriteLine(e.StackTrace)
    }
}
&lt;/code&gt;
&lt;/pre&gt;</content>
 </entry>
 
 <entry>
   <title>ASP.NET GridView with an ObjectDataSource</title>
   <link href="http://www.timgittos.com/archives/asp-net-gridview-with-an-objectdatasource"/>
   <updated>2009-10-26T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/asp-net-gridview-with-an-objectdatasource</id>
   <content type="html">&lt;p&gt;Just a quick tip:&lt;/p&gt;
&lt;p&gt;I got the following exception today:&lt;/p&gt;
&lt;pre&gt;If a data source does not return ICollection and cannot return the total row count, 
it cannot be used by the GridView to implement server-side paging.&lt;/pre&gt;
&lt;p&gt;If you&amp;#8217;re trying to return an IEnumerable from your select method, try changing it to a List or an array. That should clear the problem right up.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Going Dark</title>
   <link href="http://www.timgittos.com/archives/going-dark"/>
   <updated>2009-10-13T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/going-dark</id>
   <content type="html">&lt;p&gt;Nearly 12 months on from the start of my blog (the first post went up at the end of November 2008), I&amp;#8217;m finding less and less time to do the quality kind of writing I have set out to do. I feel that, as I change, so too does my website need to change.&lt;/p&gt;
&lt;p&gt;As much as this site is currently a programming blog, it&amp;#8217;s also my electronic representation. The website shares my name, and is representative of me. There&amp;#8217;s more to me than just programming. For a while I&amp;#8217;ve tried blogging or writing about non-programming related topics on another domain, however I don&amp;#8217;t feel this is fair to myself.&lt;/p&gt;
&lt;p&gt;I guess the best way to describe myself is an &lt;a href=&quot;http://en.wikipedia.org/wiki/Polymath&quot;&gt;aspiring polymath&lt;/a&gt;. I have an interest in a broad range of topics, notably programming/computer science, mathematics and art. This website doesn&amp;#8217;t really represent that. I can&amp;#8217;t maintain multiple websites to separate various areas of my life &amp;#8211; I&amp;#8217;m a single person with multiple facets, and I should have a single website, with multiple facets.&lt;/p&gt;
&lt;p&gt;Additionally, I find myself with less and less time to devote to this kind of writing, as it slowly makes it&amp;#8217;s way down to the bottom of my priority list. Currently I&amp;#8217;m trying to rekindle my math education by going back to basics, learn Punjabi so I can impress the fiance&amp;#8217;s parents, do several programming projects at once and get back into doing art regularly, and writing is a very far last.&lt;/p&gt;
&lt;p&gt;So, all that lead up to say that I&amp;#8217;m going dark, and will be overhauling the site sometime in the future. I&amp;#8217;m going to change the format of the site so that it more accurately represents me as a whole, is better organised and has a nice format that allows me to post quick, smaller posts that can be filtered out when subscribing to &lt;span class=&quot;caps&quot;&gt;RSS&lt;/span&gt; feed. I may or may not stick with Wordpress &amp;#8211; I think I&amp;#8217;ll probably start hacking away at &lt;a href=&quot;http://www.enkiblog.com/&quot;&gt;Enki&lt;/a&gt; and do some funky stuff with wildcard subdomains or something.&lt;/p&gt;
&lt;p&gt;All older posts will remain, as a few of my posts are rather popular (by more than 50% compared to the rest of the site) and I suspect they&amp;#8217;re really helping people out.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Mario AI Competition 2009 - Getting Started</title>
   <link href="http://www.timgittos.com/archives/mario-ai-competition-2009-getting-started"/>
   <updated>2009-08-25T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/mario-ai-competition-2009-getting-started</id>
   <content type="html">&lt;p&gt;Programming is fun. That&amp;#8217;s why I decided it would be a good career for me. I love solving puzzles, and I love the concept of making computers, these mysterious boxes of my childhood, do things. However, when you finally get to working as a professional programmer, the types of projects you get to work on are often not as interesting as you&amp;#8217;d like. This is why I am interested in AI. AI presents new and unique challenges, and techniques of approaching these challenges. I said in a previous post that AI was more commonplace than you&amp;#8217;d think, but didn&amp;#8217;t really follow it up with suggestions of where you can work on AI related programs.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve recently stumbled on an interesting AI competition (before it got big with the video &amp;#8211; I&amp;#8217;ve been writing this post for about a month), based off of an open source Java project called Inifine Mario, called &lt;a href=&quot;http://julian.togelius.com/mariocompetition2009/&quot;&gt;Mario AI Competition 2009&lt;/a&gt;. The competition is to create an AI agent that can navigate randomly generated Mario levels, pitting each agent against each other. The first round of this competition has already closed, however there is another round that closes September 3.&lt;/p&gt;
&lt;p&gt;I won&amp;#8217;t be attending the conferences nor will I be submitting agents to the competition. I will however work on a few agents, as this is probably the most fun application of AI that I&amp;#8217;ve seen in a while, and it&amp;#8217;s a small enough environment to enable me to get very familiar with it very quickly, and hence get into making solutions very quickly.&lt;/p&gt;
&lt;p&gt;On the surface, this seems a trivial, niche problem. An agent that can navigate a video game level doesn&amp;#8217;t really have a lot of diverse applications. However, it&amp;#8217;s a great way to begin practicing some fundamental concepts of AI. The parameters of the competition don&amp;#8217;t limit the techniques you can use to create the agent. In the video below, &lt;a href=&quot;http://www.doc.ic.ac.uk/~rb1006/projects:marioai&quot;&gt;Robin Baumgarten&lt;/a&gt; is using A* path finding techniques.&lt;/p&gt;
&lt;p&gt;&lt;object width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/DlkMs4ZHHr8&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_embedded&amp;fs=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/DlkMs4ZHHr8&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_embedded&amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowScriptAccess=&quot;always&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;However, A* is just the start, and is a fairly basic approach (though it works pretty well by the demos), and there are many more options, including machine learning and neural networks. Unfortunately, I won&amp;#8217;t be covering any of that yet. The goal of this post is to get myself, and anyone else interested, up to speed on the environment, and the basics of creating an agent. I will be creating a very simple reactive agent that has no planning, and is quite flawed. However, you should be able to walk away with a firm grasp of how the environment works and what tools you have at your disposal.&lt;/p&gt;
&lt;p&gt;Before I go on, a disclaimer is necessary: I haven&amp;#8217;t worked with Java since my university days, so about 6 years or so. I will post some code, and that code will probably suck. You have been warned.&lt;/p&gt;
&lt;h3&gt;The Game Environment&lt;/h3&gt;
&lt;p&gt;The details on the code available from the competition website are fairly vague, so I&amp;#8217;m posting this to perhaps help some people who are interested in getting into it, and also for my reference to help while working on it. Firstly, obviously, you&amp;#8217;re going to have to download the code available on the competition website. The code is relatively stable at this point, however it was constantly being updated with fixes for bugs posted on the &lt;a href=&quot;http://groups.google.com/group/mariocompetition&quot;&gt;Google Group&lt;/a&gt; for the competition. These changes would be posted on the group, so I&amp;#8217;d check it regularly, or grab it from &lt;a href=&quot;http://code.google.com/p/marioai/&quot;&gt;Google Code&lt;/a&gt; with svn, and just update your repo regularly. Once you&amp;#8217;ve downloaded it, open it in your &lt;span class=&quot;caps&quot;&gt;IDE&lt;/span&gt;/editor of choice, and roll up your sleeves.&lt;/p&gt;
&lt;p&gt;Firstly, I&amp;#8217;m going to reference classes by their fully qualified class names; ie: ch.idsia.scenarios.Play, which references Play.java located in the src/ch/idsia/scenarios folder. This way you can play along at home.&lt;/p&gt;
&lt;p&gt;According to the online documentation, you can fire up a run by typing&lt;br /&gt;
&lt;code&gt;
java ch.idsia.scenarios.Play
&lt;/code&gt;&lt;br /&gt;
from within the &amp;#8220;classes&amp;#8221; directory. This will start a copy of the Infinite Mario game with a human player. To start with a pre written agent, type&lt;br /&gt;
&lt;code&gt;
java ch.idsia.scenarios.Play ch.idsia.ai.agents.ai.ForwardJumpingAgent
&lt;/code&gt;&lt;br /&gt;
to start with an agent that will run forward and jump as soon as it can.&lt;/p&gt;
&lt;p&gt;The ch.idsia.scenarios.Play class is a simple class that sets up the agent, whether it&amp;#8217;s human controlled or automated, and then it sets some play environment variables and runs the application. If an argument is supplied, it will attempt to instantiate an instance of the class and pass it through to the play environment.&lt;/p&gt;
&lt;p&gt;I won&amp;#8217;t be covering the the details of the simulation code, as it&amp;#8217;s all pretty logically separated and you don&amp;#8217;t really need to know how to do that. Information is passed through to the agent through an implementation of the interface ch.idsia.mario.environments.Environment. This argument to the &lt;code&gt;getAction&lt;/code&gt; function provides the agent with a serialised view of the terrain and the location of enemies, along with information about Mario. Basically, any information you can get by looking at the scene.&lt;/p&gt;
&lt;p&gt;This information is provided in the form of a byte matrix, through several functions. &lt;code&gt;observation.getLevelSceneObservation()&lt;/code&gt; will return a matrix with details of the terrain. It will also tell you what the type of the terrain is, such as a pipe or a one way platform. This detail is found in &lt;code&gt;ch.idsia.mario.engine.LevelScene&lt;/code&gt;. You can see the number codes for the different types of terrain. It&amp;#8217;s broken down into gaps, hard borders, half borders and flower pots.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;observation.getEnemiesObservation()&lt;/code&gt; is very similar to &lt;code&gt;observation.getLevelSceneObservation()&lt;/code&gt;, except it addresses enemy locations. Again, you&amp;#8217;ll also get the type of the enemy from the matrix in the form of an integer code, which you can find in &lt;code&gt;ch.idsia.mario.engine.sprites.Sprite&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve written a debugging function that will output both the enemy and terrain matricies to give you a code view of what&amp;#8217;s going on. It&amp;#8217;s interesting and enlightening to watch the code view of the simulation next to the simulation itself, and it will help us write code to fit our design. The function is as follows:&lt;/p&gt;
&lt;/notextile&gt;

I put the above code into a function in the agent itself, and called the function from the &lt;code&gt;getAction&lt;/code&gt; function of the agent, purely because I know this is going to get called once per tick. You can put it wherever you want to put it.

&lt;h3&gt;Creating a Dumb Agent&lt;/h3&gt;
As I mentioned at the start of this post, I'm just going to start with creating a very simple, dumb agent that will attempt to traverse the level, and even then not get it right all the time for reasons I will cover. On the surface, Mario's tasks for navigating a stage without enemies is pretty straightforward. All he needs to do is to get himself around the level and jump over pits. 

However, sometimes Mario can find himself falling into a gap, or over-jumping his mark and jumping into a hole. So basically, we need to check if there's something in Mario's path that needs to be jumped over, or if there's a gap that we need to jump over. But, we can't just jump - we also need to check if jumping is going to put is into a gap and kill Mario, and if Mario runs off of where ever he is, he might fall into a hole.

This would be fairly straight forward if we had a robust method of predicting where Mario's jumps will take him, but unfortunately we don't officially get this information. 
There is a movement algorithm in &lt;code&gt;ch.idsia.mario.engine.sprites.Mario&lt;/code&gt;, which starts at the &lt;code&gt;move&lt;/code&gt; method, however, not only is this not in the spirit of the competition, but more importantly, it's very hard to figure out, for me at least. I've not been able to reliably modify the movement code to act as a predictor of Mario's path if you plug-in how long to hold each key for.

Hence, at this stage, we'll just be making Mario go right and try and jump over obstacles. Seems fairly simple.

You'll see in the provided agents that the function &lt;code&gt;getAction&lt;/code&gt; is the heart of the agent, and an instance of the Environment interface discussed before. This function is the work horse of your agent, as it will tell the simulation what the agent is going to do.

Although the &lt;code&gt;observation.getLevelSceneObservation()&lt;/code&gt; and &lt;code&gt;observation.getEnemiesObservation()&lt;/code&gt; methods return the full view of the level, all the features are jumbled together. Later on, we'll need to know what's a cannon and what's a pipe, and what's raised ground, and maybe even what's a block we can punch. We'll need to know this because cannons shoot Bullet Bills and enemy flowers live in pipes, and these can appear at any time, and if Mario is near by, he's going to get hurt.

I've created the following function to categorize the environment into pipes, cannons and pits:

&lt;notextile&gt;&lt;p&gt;The three variables are defined as private members of the agent, and calling this function will populate them with tile locations in the case of pipes and cannons, and tile columns in the case of pits. You don&amp;#8217;t have to do this with such a simple agent &amp;#8211; you can simply use similar techniques to parse over the whole level state.&lt;/p&gt;
&lt;p&gt;I use this information to determine how far away obstacles are. At first I was going to make the distance between obstacles affect the jumping distance and height, however without an accurate way to determine where jumps are going to land, this can actually cause more harm than good. So I ignore it, and just use a fairly blunt approach.&lt;/p&gt;
&lt;p&gt;Firstly, another helper function:&lt;/p&gt;
&lt;/notextile&gt;

This function takes a Vector and will return the closes tile to Mario, depending on his direction. It's a very coarse way to determine the closes obstacle to Mario. Bear in mind that it doesn't recognise when obstacles are put close together, thus doesn't optimise Mario's jumping.

The goal of the agent is to jump over the closest obstacle. That's it. Considering our obstacles are now in three different datastructures (cannons in one, pipes in another, and pits and raised terrain in the original byte array), we need to store the delta (distance between Mario and the closes obstacle) and update it only when we've found a smaller delta. Also, I want to keep the delta of any pits separate, as I'm going to have different rules for pits than other obstacles (because pits are the only thing that can kill Mario at this stage).

To this end, I create two integer variables at the top of the &lt;code&gt;getAction&lt;/code&gt; method. They are intitialized to 11 because this is where Mario is:

&lt;notextile&gt;&lt;p&gt;Here is the code to extract the delta of the nearest obstacle, and the delta of the nearest pit. Note that &lt;code&gt;levelState&lt;/code&gt; is the results from a call to &lt;code&gt;observation.getLevelSceneObservation&lt;/code&gt;:&lt;/p&gt;
&lt;/notextile&gt;

Once we have the deltas, we can use this information to decide what to do. I mentioned above treating obstacle deltas different from jump deltas. This is an attempt to make Mario take smaller jumps when he can see a pit is after an obstacle. This is controlled by two instance members that keep track of jump height and jump length, called &lt;code&gt;jumpHeight&lt;/code&gt; and &lt;code&gt;jumpLength&lt;/code&gt; respectively. This is very hit and miss. Notice that Mario does not respond to anything more than 4 tiles away, and tiles that are behind him. This is to prevent him from going jump crazy:

&lt;notextile&gt;&lt;p&gt;Finally, the &lt;code&gt;maintainJump&lt;/code&gt; method is to ensure we&amp;#8217;re holding down the jump key for the optimal amount of time. It is also coded to provide rudimentary control over jump height and length, however this isn&amp;#8217;t being taken advantage of.&lt;/p&gt;
&lt;p&gt;&lt;/notextile&gt;&lt;/p&gt;
&lt;p&gt;The complete agent is at the bottom of this post for you to download and include in your project. Simply put it in the path &lt;code&gt;src/timgittos&lt;/code&gt;, configure the &lt;code&gt;ch.idsia.scenarios.Play&lt;/code&gt; class to have no enemies, with &lt;code&gt;options.setPauseWorld(true)&lt;/code&gt;, and run any level you want (passable result with difficulty 3). Then build the project and run it with &lt;code&gt;java ch.idsia.scenarios.Play timgittos.BlogAgent&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;As you will observe, the agent will make Mario go towards the right as fast as possible, jumping over obstacles as it meets them.  For the most part, it works well enough. However, there are quite a few fatal flaws, and I will explain why it fails in this way.&lt;/p&gt;
&lt;p&gt;Most obviously, the agent frequently falls down gaps. It doesn&amp;#8217;t fall down all gaps &amp;#8211; which would indicate that it&amp;#8217;s not a failure in the gap detection, but rather something else. In fact, what&amp;#8217;s going on is that the gaps that Mario tends to fall down are those that enter his field of consideration (4 tiles ahead of him) while he&amp;#8217;s in the air. The agent makes no effort to check whether it&amp;#8217;s jump will land Mario in a pit (since it can&amp;#8217;t predict where Mario will land), and my previous efforts at trying to make the agent force Mario to the left when it detects he&amp;#8217;s going to go down a pit have failed.&lt;/p&gt;
&lt;p&gt;Mario will also fall down pits if there are multiple pits in a row. Again, this is because the agent doesn&amp;#8217;t exert much control over the size and length of Mario&amp;#8217;s jumps ,and so can&amp;#8217;t pin point that it wants to land in the middle of the two pits, so it tends to overshoot the jump and fall down the second pit.&lt;/p&gt;
&lt;p&gt;Most annoyingly, the agent will sometimes get stuck. If it reaches an obstacle, such as a cannon or a bit of wall or a pipe and jumps at the wrong angle, it will enter a weird wall jump loop, where it jumps, gets stuck on the obstacle, jumps off, jumps again, and gets stuck again. This will loop until there is no time. This is a side effect of the environment allowing wall jumps, which is cool when you can get the agent to make Mario jump out of a pit he&amp;#8217;s falling into, but annoying when he gets stuck.&lt;/p&gt;
&lt;p&gt;In any case, this agent is far from complete, and just serves to demonstrate how the simulation environment works, and how to interact with it. Once you&amp;#8217;re clear how to work with the simulation, you can concentrate on building a useful agent, either by starting from scratch (like you would if you were going to use a machine learning approach), or by building on top of this base (for a determinate approach like A*).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download: &lt;a href='/files/archives/BlogAgent.java'&gt;Mario AI Blog agent (.java)&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Configuring webHttpBinding When Using WCF with JQuery</title>
   <link href="http://www.timgittos.com/archives/configuring-webhttpbinding-when-using-wcf-with-jquery"/>
   <updated>2009-06-24T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/configuring-webhttpbinding-when-using-wcf-with-jquery</id>
   <content type="html">&lt;p&gt;Firstly, a disclaimer: I don&amp;#8217;t have a lot of experience working with &lt;span class=&quot;caps&quot;&gt;AJAX&lt;/span&gt; enabled &lt;span class=&quot;caps&quot;&gt;WCF&lt;/span&gt; services, and from reading some of &lt;a href=&quot;http://www.west-wind.com/presentations/jQuery/default.aspx&quot;&gt;Rick Strahl&amp;#8217;s posts on using JQuery with &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt;&lt;/a&gt;, I&amp;#8217;m doing things in a really hackish and terrible manner. Hopefully my mistakes won&amp;#8217;t impact the usefulness of this short tip.&lt;/p&gt;
&lt;p&gt;When working with JQuery and &lt;span class=&quot;caps&quot;&gt;AJAX&lt;/span&gt; enabled &lt;span class=&quot;caps&quot;&gt;WCF&lt;/span&gt; services, I recently encountered the following error, through Firebug and Fiddler:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
The maximum string content length quota (8192) has been exceeded while reading &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; data. &lt;br /&gt;
This quota may be increased by changing the &lt;br /&gt;
MaxStringContentLength property on the XmlDictionaryReaderQuotas &lt;br /&gt;
object used when creating the &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; reader.&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is caused by &lt;span class=&quot;caps&quot;&gt;WCF&lt;/span&gt; webHttpBinding default having fairly draconion limitations on &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; message length and depth. &lt;a href=&quot;http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/6ad1bf1c-e340-44ae-8ba5-91428d6e78a7&quot;&gt;This thread on &lt;span class=&quot;caps&quot;&gt;MSDN&lt;/span&gt;&lt;/a&gt; helped diagnose the problem, however it didn&amp;#8217;t do much to help me solve my particular problem. Ultimately, I stumbled upon the solution quite accidentally.&lt;/p&gt;
&lt;p&gt;Firstly, as per the &lt;span class=&quot;caps&quot;&gt;MSDN&lt;/span&gt; thread, you need to add the custom binding configuration underneath the &lt;system.serviceModel&gt; configuration section:&lt;br /&gt;
[xml]&lt;br /&gt;
&lt;system.serviceModel&gt;&lt;br /&gt;
  &lt;bindings&gt;&lt;br /&gt;
    &lt;webHttpBinding&gt;&lt;br /&gt;
      &lt;binding name=&quot;bindingConfiguration&quot;&gt;&lt;br /&gt;
        &lt;readerQuotas maxDepth=&quot;32&quot; maxStringContentLength=&quot;2048000&quot; maxArrayLength=&quot;16384&quot; maxBytesPerRead=&quot;4096&quot; maxNameTableCharCount=&quot;16384&quot; /&gt;&lt;/p&gt;
&lt;/binding&gt;
&lt;/webHttpBinding&gt;
&lt;/bindings&gt;
..
&lt;/system.serviceModel&gt;
&lt;p&gt;[/xml]&lt;/p&gt;
&lt;p&gt;At first I thought this was a custom binding, and tried to replace the service endpoint binding to the custom binding defined above, however this was causing an &amp;#8220;System.ServiceModel.ServiceActivationException&amp;#8221; exception.&lt;/p&gt;
&lt;p&gt;The above binding declaration is actually a configuration for the webHttpBinding. As such, you need to add the BindingConfiguration property onto your service endpoint, along side your binding declaration. This is as follows:&lt;br /&gt;
[xml]&lt;br /&gt;
&lt;service behaviorConfiguration=&quot;Your.Service.Behavior&quot;
      name=&quot;Your.Service.Name&quot;&gt;&lt;br /&gt;
    &lt;endpoint address=&quot;&quot; behaviorConfiguration=&quot;Your.Behavior.Configuration&quot;
     binding=&quot;webHttpBinding&quot; bindingConfiguration=&quot;bindingConfiguration&quot; contract=&quot;Your.Service.Contract&quot; /&gt;&lt;/p&gt;
&lt;/service&gt;
&lt;p&gt;[/xml]&lt;/p&gt;
&lt;p&gt;This will allow you to send larger messages to your &lt;span class=&quot;caps&quot;&gt;WCF&lt;/span&gt; services via &lt;span class=&quot;caps&quot;&gt;AJAX&lt;/span&gt;, and get on with creating applications.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Going Camping with CouchDB On OS X Tiger</title>
   <link href="http://www.timgittos.com/archives/going-camping-with-couchdb-on-os-x-tiger"/>
   <updated>2009-06-12T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/going-camping-with-couchdb-on-os-x-tiger</id>
   <content type="html">&lt;p&gt;With &lt;a href=&quot;http://www.engadget.com/2009/06/08/apple-shipping-snow-leopard-in-september-29-upgrade/&quot;&gt;Snow Leopard being released at the end of September this year&lt;/a&gt;, Tiger is definitely starting to show it&amp;#8217;s age. I&amp;#8217;ve been putting off upgrading to Leopard for quite some time, not being able to justify the down time associated with upgrading an OS. This has had an unpleasant side effect of not being able to do things quite as easily as I want, and finding information is hard.&lt;/p&gt;
&lt;p&gt;Due to the &lt;a href=&quot;http://www.timgittos.com/a-cms-in-ruby-and-why-i-stopped&quot;&gt;recommendations in the comments of my Ruby &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; article&lt;/a&gt;, I have decided to start playing with the &lt;a href=&quot;http://camping.rubyforge.org/files/README.html&quot;&gt;Camping Ruby microframework&lt;/a&gt; backed by &lt;a href=&quot;http://couchdb.apache.org/&quot;&gt;CouchDB&lt;/a&gt;. Getting Camping up and running was easy enough, and I managed to get some trivial functionality going. Camping uses SQLite for it&amp;#8217;s database, which is fine if I wanted to massage my data into a relational form. However, I have models with optional attributes, and rather than making nullable database types, I want to leverage CouchDB&amp;#8217;s schema-less, RESTful document storage. Each persisted object in my application will be available on a unique url, so CouchDB is a nice fit for what I want to do.&lt;/p&gt;
&lt;h3&gt;The Great Installation&lt;/h3&gt;
&lt;p&gt;I found this &lt;a href=&quot;http://knuthellan.wordpress.com/2009/03/08/camping-with-couchdb/&quot;&gt;great article&lt;/a&gt; about getting Camping talking to CouchDB, and it seemed easy enough, so I decided to try it. Since I already had Camping working, all I needed was to get CouchDB installed on my Macbook. As much as I&amp;#8217;m not scared of compiling applications from source, I&amp;#8217;ve had issues in the past with OS X and compiling, so I decide to find a simple package or disk image to install. I found &lt;a href=&quot;http://janl.github.com/couchdbx/&quot;&gt;CouchDBX&lt;/a&gt;, however checking the requirements showed that it supports Leopard only.&lt;/p&gt;
&lt;p&gt;With a little more research, I found out I had to use &lt;a href=&quot;http://www.macports.org/&quot;&gt;Macports&lt;/a&gt; to install CouchDB. Macports relies on XCode Tools which come available on the DVDs that came with OS X. If you haven&amp;#8217;t previously installed XCode Tools, then you should install them before you install Macports. Something that is buried in a &lt;a href=&quot;http://trac.macports.org/ticket/18282&quot;&gt;support ticket&lt;/a&gt;, however, is that Macports targets XCode tools 2.5. My XCode tools was something like 2.4.8. While I did manage to get Macports installed, the installation for CouchDB fails when it tries to build tk. If you, like me, have an older XCode Tools than 2.5, you&amp;#8217;ll need to download 2.5, which you can find &lt;a href=&quot;http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=19907&quot;&gt;deep inside the Apple website&lt;/a&gt;. This does require an Apple Developer Connection account to get, so if you don&amp;#8217;t have one, you&amp;#8217;ll need to create one.&lt;/p&gt;
&lt;p&gt;Installing CouchDB is as simple as issuing&lt;br /&gt;
[bash]&lt;br /&gt;
sudo port install couchdb&lt;br /&gt;
[/bash]&lt;br /&gt;
and Macports will take care of the rest. CouchDB lists it&amp;#8217;s dependencies as Spidermonkey, Erlang and a few others, however each of those has dependencies, and each of those dependencies has dependencies, and it ends up taking quite a long time and downloading a fair few packages. The upside is that if you didn&amp;#8217;t have Erlang previously installed, you do now. Erlang is something I&amp;#8217;ve been wanting to take a look at.&lt;/p&gt;
&lt;h3&gt;Start The Server Before You Leap&lt;/h3&gt;
&lt;p&gt;While the article I linked to above about getting Camping and CouchDB talking is good, it&amp;#8217;s not exactly the most verbose explanation especially if you haven&amp;#8217;t read the documentation for CouchDB and prefer to just dive in. For those who are still a little unsure like I was about how exactly to do this, I&amp;#8217;ll outline my approach below.&lt;/p&gt;
&lt;p&gt;Before you get started writing any code at all, you need to start your CouchDB server. This is something that escaped me for the longest time, and when I finally twigged, it gave me a bit of grief. To start CouchDB, issue the following command:&lt;br /&gt;
[bash]&lt;br /&gt;
sudo couchdb&lt;br /&gt;
[/bash]&lt;br /&gt;
If you try this without escalating privilege, it will return an error &amp;quot;{&amp;quot;init terminating in do_boot&amp;quot;,,[{couch_server_sup,start_server,1},{erl_eval,do_apply,5},{erl_eval,exprs,5}, {init,start_it,1},{init,start_em,1}]}}&amp;quot;, which searching for will bring you to the &lt;a href=&quot;http://wiki.apache.org/couchdb/Error_messages&quot;&gt;CouchDB&lt;/a&gt; wiki page for error messages. This page will tell you the problem is an unavailable port. For me, at least, this is not true. CouchDB runs on port 5984 which as far as I know is not used for any system services or other software. The reason I was getting this error was that I wasn&amp;#8217;t running it with enough privilege.&lt;/p&gt;
&lt;p&gt;Once you get CouchDB started, you&amp;#8217;ll notice it blocks the terminal. I don&amp;#8217;t like to have too many windows open at once, so I&amp;#8217;d prefer to have it run as a background process. Fortunately CouchDB will let you do that with a command line switch option, along with changing the location of the pid file. I&amp;#8217;ll leave figuring out how you want to start it up to you.&lt;/p&gt;
&lt;p&gt;Once you have CouchDB started, you&amp;#8217;ll have access to a web-based administration panel called Futon. Futon is available to you at &lt;code&gt;http://localhost:5984/_utils/&lt;/code&gt;, assuming you&amp;#8217;re running CouchDB on your local host. The Futon utility will allow you to create databases and insert documents in preparation to test your connectivity with Camping.&lt;/p&gt;
&lt;h3&gt;Camping Time&lt;/h3&gt;
&lt;p&gt;There were two Ruby gems I had considered when deciding how to connect Ruby to CouchDB. I should point out that due to the RESTful nature of CouchDB, you strictly don&amp;#8217;t need any Ruby gems and could roll your own fairly easily, if you wanted to. I didn&amp;#8217;t want that level of control, personally. The two gems I considered were &lt;a href=&quot;http://github.com/jchris/couchrest/tree/master&quot;&gt;CouchRest&lt;/a&gt; and &lt;a href=&quot;http://github.com/paulcarey/relaxdb/tree/master&quot;&gt;RelaxDB&lt;/a&gt;. CouchRest is a simple Ruby wrapper around the CouchDB &lt;span class=&quot;caps&quot;&gt;REST&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;, whereas RelaxDB is more abstracted, bringing ActiveRecord-like functionality to CouchDB. While before I would have chosen RelaxDB, I&amp;#8217;m intentionally trying to work a little closer to the raw APIs here, so I chose CouchRest.&lt;/p&gt;
&lt;p&gt;You can install CouchRest through RubyGems:&lt;br /&gt;
[bash]&lt;br /&gt;
sudo gem install couchrest&lt;br /&gt;
[/bash]&lt;br /&gt;
however I found that the gem version wouldn&amp;#8217;t work and kept throwing errors when I started my Camping application. To overcome this, I just cloned it from the GitHun repository and placed it in my Camping app directory and referenced it that way.&lt;/p&gt;
&lt;p&gt;The first thing to do would be to create a normal Camping sample application, if you haven&amp;#8217;t done already. For the purposes of this post, I&amp;#8217;m going to use the &amp;#8220;&amp;#8221;http://camping.rubyforge.org/files/&lt;span class=&quot;caps&quot;&gt;README&lt;/span&gt;.html&amp;quot;&amp;gt;skeletal Camping blog&lt;/a&gt;&amp;quot; application used in the documentation, and edit that to work with CouchDB. I figure this will give everyone a relatively common base from which to start. Import CouchRest just below where the application imports Camping:&lt;br /&gt;
[ruby]&lt;br /&gt;
require &amp;#8216;camping&amp;#8217;&lt;br /&gt;
require &amp;#8216;couchrest&amp;#8217; # or &amp;#8216;couchrest/couchrest&amp;#8217; or similar if you&amp;#8217;ve cloned from Github&lt;br /&gt;
[/ruby]&lt;/p&gt;
&lt;p&gt;Given that the purpose of this article is to demonstrate connecting to CouchDB, and not the design of a framework around it, we can safely ignore defining a model for now, and rely on CouchDB as our model. So if you&amp;#8217;re following along from the example application, you can safely delete the classes from Blog::Models module. We&amp;#8217;re not going to delete the whole module, because of the &lt;code&gt;create&lt;/code&gt; method.&lt;/p&gt;
&lt;p&gt;The Camping &lt;a href=&quot;http://camping.rubyforge.org/classes/Camping.html&quot;&gt;create&lt;/a&gt; method that is run when the server starts up your Camping app. From the documentation, &amp;#8220;This is a good place to check for database tables and create those tables to save users of your application from needing to manually set them up.&amp;#8221; Instead, we&amp;#8217;re going to use this method to set up CouchRest in our application:&lt;br /&gt;
[ruby]&lt;br /&gt;
module Blog::Models&lt;br /&gt;
  def Blog.create&lt;br /&gt;
    db_url = &amp;#8216;http://localhost:5984/&amp;#8217;&lt;br /&gt;
    storage = CouchRest.database(&amp;#8220;#{db_url}blog&amp;#8221;)&lt;br /&gt;
    Blog::Controllers::Index.set_storage(storage)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
[/ruby]&lt;/p&gt;
&lt;p&gt;Next, because we&amp;#8217;re now calling a new method on the controller class, we need to modify that. Change the Blog::Controllers::Index class to the following:&lt;br /&gt;
[ruby]&lt;br /&gt;
module Blog::Controllers&lt;br /&gt;
  class Index &amp;lt; R &amp;#8216;/(\w+)&amp;#8217;&lt;br /&gt;
    def Index.set_storage(storage)&lt;br /&gt;
      &lt;code&gt;@storage = storage
    end
    def get(id)
      @post = @&lt;/code&gt;storage.get(&amp;#8216;posts/&amp;#8217; + id)&lt;br /&gt;
      render :index&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
[/ruby]&lt;br /&gt;
What I&amp;#8217;ve done here is given the controller class a static reference to my CouchDB database (from the &lt;code&gt;create&lt;/code&gt; method). Then the controller was changed to respond to a regex, which is passed into the get method. We use the id passed in to retrieve a document from CouchDB, which we assign as an instance variable.&lt;/p&gt;
&lt;p&gt;Lastly, we need to modify the Index function view to pull data from the CouchDB database:&lt;br /&gt;
[ruby]&lt;br /&gt;
def index&lt;br /&gt;
  h1 @post[:title]&lt;br /&gt;
end&lt;br /&gt;
[/ruby]&lt;br /&gt;
This will output the title of the test document created at the start of the article.&lt;/p&gt;
&lt;p&gt;If you haven&amp;#8217;t already, start up Futon and create a database for the purposes of this demo. Call the database &amp;#8220;blog&amp;#8221;, and fill it with a test document with the id of &amp;#8220;posts/test&amp;#8221;, and at least a &amp;#8220;title&amp;#8221; property with the value &amp;#8220;Test Post&amp;#8221;, and any other properties you wish.&lt;/p&gt;
&lt;p&gt;Start the Camping application with &lt;code&gt;camping blog.rb&lt;/code&gt;, and point a browser to &lt;code&gt;http://localhost:3301/test&lt;/code&gt;, and you should see &amp;#8220;Test Post&amp;#8221; in a header tag, rendered out to the browser, which means that Camping has successfully communicated with CouchDB.&lt;/p&gt;
&lt;p&gt;I didn&amp;#8217;t cover putting data into CouchDB, however you would do it in a similar vein, writing a &lt;code&gt;post&lt;/code&gt; method inside your routes to create data and save it to CouchDB. From here, personally, I&amp;#8217;m going to create some wrapper classes for requests and models and build up something which is a little DRYer, however as far as a demo, this is good enough.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>My Best Guesses About Wolfram Alpha</title>
   <link href="http://www.timgittos.com/archives/my-best-guesses-about-wolfram-alpha"/>
   <updated>2009-05-19T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/my-best-guesses-about-wolfram-alpha</id>
   <content type="html">&lt;p&gt;Following the &amp;#8220;soft launch&amp;#8221; of Wolfram Alpha a few days ago, I&amp;#8217;ve been wondering exactly how Wolfram Alpha works. From the description of all the hype leading up to it, it seemed like a question answering application that is specialized in answering questions, as opposed to say Google, which is more into finding and presenting data, leaving the interpretation to humans. Now that it&amp;#8217;s here, we can have a play around and see what it can do.&lt;/p&gt;
&lt;p&gt;Firstly, I tried to &lt;a href=&quot;http://www.wolframalpha.com/input/?i=how+does+wolfram+alpha+work&quot; title=&quot;How does Wolfram Alpha work - Wolfram Alpha&quot;&gt;ask Wolfram Alpha how it worked&lt;/a&gt;, and it just gave me a puzzled look. So I can only guess, and guess I shall.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;http://www.wolframalpha.com/about.html&quot;&gt;Wolfram Alpha website lays it all out on the table&lt;/a&gt;, with regards to what it&amp;#8217;s all about. Wolfram Alpha&amp;#8217;s goal &amp;#8220;is to accept completely free-form input, and to serve as a knowledge engine&amp;#8221; to answer search queries entered. From the very limited playing I&amp;#8217;ve done, it seems pretty cool.&lt;/p&gt;
&lt;p&gt;Following my move from Perth to Texas, I typed in &amp;#8220;&amp;#8221;http://www.wolframalpha.com/input/?i=austin+to+perth&amp;quot;&amp;gt;Austin to Perth&lt;/a&gt;&amp;quot; into Wolfram Alpha just to see what it told me. I got back map, with a line drawn between the cities. I got the distance in miles between the two and the flight time. I got a side by side comparison of the local times, populations and approximate elevations.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.google.com/search?q=austin+to+perth&quot;&gt;Google however, delivered me what I was actually looking for, sort of.&lt;/a&gt; Maybe that&amp;#8217;s just a difference in expectations and thinking.&lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s clear that Wolfram Alpha is pretty cool, and will do some awesome things with the data before it returns it back to you, but it doesn&amp;#8217;t really help me figure out how it works. My thoughts are that Wolfram Alpha combines a large database of indexed knowledge in the form of a knowledge base and a powerful logical language, the language being Stephen Wolfram&amp;#8217;s own &lt;a href=&quot;http://en.wikipedia.org/wiki/Mathematica&quot; title=&quot;Mathematica on Wikipedia&quot;&gt;Mathematica&lt;/a&gt;, naturally. As he describes it, Wolfram Alpha is the &amp;#8220;killer-app&amp;#8221; for Mathematica.&lt;/p&gt;
&lt;p&gt;First, lets discuss the vast store of data available to Wolfram Alpha, most likely in the form of a knowledge base. A knowledge base is an information representation scheme designed to allow information to be operated on using logic. Information is stored in &amp;#8220;sentences&amp;#8221; in a knowledge representation language. The knowledge base allows logical agents, in this case the Wolfram Alpha application, to receive queries, and then search and analyse the knowledge base, performing logical inferences and information compounding, then collating it and returning the results. The logical agent does all the heavy lifting, but the very structure of the knowledge base helps the agent.&lt;/p&gt;
&lt;p&gt;The heart of the logical agent is it&amp;#8217;s knowledge representation language. It allows the agent to &amp;#8220;reason&amp;#8221; through sentences and make inferences in order to derive new facts. Proposition logic and First-order logic are both knowledge representation languages. Knowledge representation languages use syntax and semantics to define knowledge, where syntax outlines the structure of a language, and the semantics are the meaning.&lt;/p&gt;
&lt;p&gt;Logic is a very mathematical concept, and mathematics can be seen as a kind of logic that operates on numbers. Mathematics has a syntax, that defines the infix notation of logical operators on operands, and the semantics are what those operators do. 1 + 1 = 2 is an example of a complex logical language, where the syntax defines that the + operator acts on each 1, and the = operator defines the result of the previous operation. The semantics define that the value of 1 + 1 is 2.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.wolframalpha.com/2009/05/01/the-secret-behind-the-computational-engine-in-wolframalpha/&quot; title=&quot;The Secret Behind the Computational Engine in Wolfram Alpha&quot;&gt;Mathematica, the heart of Wolfram Alpha&lt;/a&gt;, is a computational language, according to it&amp;#8217;s Wikipedia page. It&amp;#8217;s built on top of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Symbolic_Manipulation_Program&quot; title=&quot;Symbolic Manipulation Program - Wikipedia&quot;&gt;Symbolic Manipulation Program&lt;/a&gt;, designed by both Chris A. Cole and Stephen Wolfram. The Symbolic Manipulation Program is a &amp;#8220;computer algebra system&amp;#8221;, which facilitates symbolic computation,  allowing computers to operate on symbols and manipulate expressions instead of operating on their values, which sounds a heck of a lot like something that could be used to create a logic that can operate on a knowledge base.&lt;/p&gt;
&lt;p&gt;Going back to logical agents and knowledge bases, there are a number of ways logical agents can extract and infer information from knowledge bases. The topic of knowledge based logical agents is a pretty vast one, and I couldn&amp;#8217;t possibly explain it completely in a single post, even if I knew more than just a fraction of it, which I don&amp;#8217;t. But I can summarize what I do understand, and how it applies to Wolfram Alpha.&lt;/p&gt;
&lt;p&gt;As referred to often in the post so far, inference or &lt;em&gt;entailment&lt;/em&gt; plays a large part of how a logical agent can extract &amp;#8220;new&amp;#8221; information from a knowledge base. &lt;a href=&quot;http://en.wikipedia.org/wiki/Inference&quot; title=&quot;Inference - Wikipedia&quot;&gt;Inference&lt;/a&gt; is deeply rooted in formal logic, and techniques have been developed to allow automated software processes to apply it to a knowledge base.&lt;/p&gt;
&lt;p&gt;Logical entailment is the idea that a sentence &amp;#8220;logically follows&amp;#8221; another sentence. If a given sentence &lt;strong&gt;a&lt;/strong&gt; is true, and the truth of sentence &lt;strong&gt;b&lt;/strong&gt; depends on the truth of &lt;strong&gt;a&lt;/strong&gt;, then &lt;strong&gt;b&lt;/strong&gt; must be true, and also that if &lt;strong&gt;b&lt;/strong&gt; is true, then logically &lt;strong&gt;a&lt;/strong&gt; must also be true. This is useful if the knowledge base doesn&amp;#8217;t contain the fact that one of &lt;strong&gt;a&lt;/strong&gt; or &lt;strong&gt;b&lt;/strong&gt; is true, but it does contain definition that the truth of &lt;strong&gt;b&lt;/strong&gt; depends on the truth of &lt;strong&gt;a&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The knowledge base is designed to be a model of reality, and holds sentences about the world intended to describe it to a level of detail. Sentences can be as atomic as facts, such as &amp;#8220;the sky is blue&amp;#8221;, or can be logical sentences such as &amp;#8220;if the sun is in the sky, it is not night&amp;#8221;, which of course has exceptions (such as in certain seasons in the polar regions), which also need to be modeled in the knowledge base.&lt;/p&gt;
&lt;p&gt;This is relevant because, with a finite model represented by the knowledge base, there are a finite number of entailment and inferences that can be made on the model, which means that a logical agent such as Wolfram Alpha can reduce the world to a finite search space, and can run a search over this space looking for information that follows on from the set of facts in the knowledge base.&lt;/p&gt;
&lt;p&gt;Search techniques for searching the knowledge base are similar as search techniques in other AI based problems, such as constraint satisfaction problems and touring problems. These searching algorithms include backtracking and local search methods, such as hill climbing.&lt;/p&gt;
&lt;p&gt;When searching this knowledge base, the logical agent needs to abide by a series of rules, known as inference rules, in order to guarantee the the knowledge it entails and infers is valid.&lt;/p&gt;
&lt;p&gt;Firstly, the logical agent needs to be aware of the equivalence of two logical sentences. If two sentences are both true under the same model, such as the Wolfram Alpha knowledge base, then they are logically equivalent, and can be used to format facts in a different way to aid inference.&lt;/p&gt;
&lt;p&gt;Secondly, the logical agent needs to be aware of the concept of validity. A sentence is valid if it is true in every model, which essentially means it&amp;#8217;s a tautology and is always true. These tautologies are useful because they aid in validating inferences, where &lt;strong&gt;a&lt;/strong&gt; infers &lt;strong&gt;b&lt;/strong&gt; if a implies &lt;strong&gt;b&lt;/strong&gt; is a tautology, where implication is such that &lt;strong&gt;b&lt;/strong&gt; is true if and only if &lt;strong&gt;a&lt;/strong&gt; is true. This can get a little confusing, and if you can, I&amp;#8217;d suggest you read Chapter 7 in &lt;a href=&quot;http://www.amazon.com/gp/product/0137903952?ie=UTF8&amp;tag=gebloftigi-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0137903952&quot;&gt;AI:&lt;span class=&quot;caps&quot;&gt;AMA&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
.&lt;/p&gt;
&lt;p&gt;Thirdly, it needs to ensure the sentence is satisfiable, which means it&amp;#8217;s true in at least one model, which is basically just searching for inferences and determining that, for a given search space state, the inference being suggested is true.&lt;/p&gt;
&lt;p&gt;The logical agent and inference/entailment from a knowledge base can be observed in Wolfram Alpha with a fairly simple query: &amp;#8220;&amp;#8221;http://www.wolframalpha.com/input/?i=red+%2B+yellow&amp;quot;&amp;gt;red + yellow&lt;/a&gt;&amp;quot;. In this query, the logical agent would probably hit the knowledge base and tell it that both red and yellow are true, meaning that we want to find information about those. It would then search for all sentences that are entailed or logical structures that mention the fact red or yellow, such as a sentence &amp;#8220;orange is a mix of red and yellow&amp;#8221;. It would then tell the knowledge base that this fact had been entailed, and tell it that orange is true. Then, when it finds the sentence &amp;#8220;blue is complementary to orange&amp;#8221;, it can add that to the record set. Obviously there will be other sentences in the knowledge base, and the agent will have to use a filtering algorithm to determine which sentences and facts are relevant to the query, otherwise it might return results that the user is not interested in.&lt;/p&gt;
&lt;p&gt;To successfully parse the search query, it would also need a measure of natural language processing, so that it can convert a human-readable query into a machine readable query. This, combined with a large, extensive knowledge base, a fast logical language such as Mathematica and AI techniques for inference and entailment of knowledge mean that Wolfram Alpha can answer a wide range of questions that a simple indexed and categorised search engine couldn&amp;#8217;t.&lt;/p&gt;
&lt;p&gt;However that&amp;#8217;s just my best guess. And keep in mind who I am: I&amp;#8217;m just a young web developer with an interest in AI. I don&amp;#8217;t actively participate in AI research, and I have no formal training. My guesses and musings are probably widely off the mark, and if anyone has any other ideas or corrections, clarifications or discussions, I&amp;#8217;d love to hear them in the comments.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;sub&gt;&lt;br /&gt;
&lt;ol&gt;&lt;br /&gt;
&lt;li&gt;If you mistype a search query into Wolfram Alpha, curiously it won&amp;#8217;t suggest a correction. Considering how relatively easy this task is (&lt;a href=&quot;http://en.wikipedia.org/wiki/Levenshtein_distance&quot;&gt;just use it&amp;#8217;s Levenshtein Distance&lt;/a&gt;), I find it odd that it doesn&amp;#8217;t support this.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;/sub&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Now Appearing In Austin, Texas</title>
   <link href="http://www.timgittos.com/archives/now-appearing-in-austin-texas"/>
   <updated>2009-04-26T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/now-appearing-in-austin-texas</id>
   <content type="html">&lt;p&gt;This blog has gone dark over the last two or so weeks, but for a very good reason. On the 21&lt;sup&gt;st&lt;/sup&gt; of April, I flew from Perth, Western Australia to Austin, Texas, where I will be staying for the next 6 months. For those not acquainted with the trip, it&amp;#8217;s half a world away at over 13,000km, for a total flying time of 29 hours not including layovers (for my trip, anyway).&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been spending the last week settling down here in Austin, and the week before that preparing for the trip. I&amp;#8217;m still suffering from some jet lag, and catching up on the last 8 months with my girlfriend, who I hadn&amp;#8217;t seen since August 2008. I haven&amp;#8217;t had the time nor the concentration required to write a blog post, and I haven&amp;#8217;t touched my Google Reader account, which I can see has over 1,600 unread articles.&lt;/p&gt;
&lt;p&gt;However, I do have some interesting posts coming up. I&amp;#8217;m planning a response to an AI article that was linked to me in a comment, a more in depth look at the importance of searching by solving the 8-Queens problems in Python using some different search techniques, and a look at creating some graceful degradation control adapters for &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; server controls that don&amp;#8217;t work without Javascript.&lt;/p&gt;
&lt;p&gt;So, don&amp;#8217;t unsubscribe from my feed in your readers, the blog isn&amp;#8217;t abandoned, life has just taken priority over it. When things settle down, I&amp;#8217;ll start writing articles again.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Where Do We Draw The Line On Complexity?</title>
   <link href="http://www.timgittos.com/archives/where-do-we-draw-the-line-on-complexity"/>
   <updated>2009-04-15T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/where-do-we-draw-the-line-on-complexity</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve got a few posts planned about AI and &lt;span class=&quot;caps&quot;&gt;HCI&lt;/span&gt;, however these require a lot of time to research and write code for, time that I don&amp;#8217;t have given I&amp;#8217;m flying to the US on the 21&lt;sup&gt;st&lt;/sup&gt; of April. So I apologise to people who saw my last AI article on Hacker News and Reddit and subscribed to my feed expecting more of the same. There will be more, I promise. I just need more time. For now, just some musings.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been thinking a lot lately about solving problems. I read a number of programming aggregators and startup blogs, and the term &amp;#8220;solve a problem&amp;#8221; keeps nagging at me. To be successful, at programming and business, you need to solve a problem. I&amp;#8217;d love to eventually run a development company, but I don&amp;#8217;t know what problem to solve. So, I consider the problem my current employer is solving.&lt;/p&gt;
&lt;p&gt;I currently work for a web development company that is doing fairly well. We have a suite of products that we sell to our clients, and sell services related to those products. They&amp;#8217;re doing well, so obviously, they must be solving a problem. So, from &amp;#8220;client&amp;#8221; point of view, the problem we solve is that of letting people who don&amp;#8217;t know anything about websites build and run complex websites.&lt;/p&gt;
&lt;p&gt;We have a &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; product that allows non web geeks manage websites. This includes writing new pages and editing content on existing pages, publishing news items, distributing these to an email list, managing uploaded files and inserting modules of dynamic content to their hearts desire. The modules we offer include contact forms, random image rotators, resume upload controls, auto-generating bread crumbs and menus, and so on. These modules aim to reduce the complexity of managing dynamic sites, so that ordinary people can do it.&lt;/p&gt;
&lt;p&gt;On top of that, we do custom applications built on top of that &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; site. Clients have a site they run themselves with the &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;, but some also have dedicated applications with a separate interface. These are separate because they&amp;#8217;re custom jobs. They provide functionality that is not available in the &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; (yet), or functionality that would be too complex to maintain using the &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;. So again, we&amp;#8217;re reducing the complexity of running a custom application.&lt;/p&gt;
&lt;p&gt;So, on first looks, we build websites and applications that non-geeks can use. But looking further, we manage complexity. We reduce the complexity for the client, so that the client can do difficult things with ease, and don&amp;#8217;t have to know &lt;em&gt;how&lt;/em&gt; it&amp;#8217;s done, only that they can do it.&lt;/p&gt;
&lt;p&gt;On the other hand, good programming is about managing complexity. That is, trying to keep your code as free from complexity as you can get away with while still doing the job. Complex code is buggy and unmaintainable.&lt;/p&gt;
&lt;p&gt;Complexity exists, and it is immutable. Once you&amp;#8217;ve simplified a task to the point that the only steps involved are those that accomplish that task, and that task cannot be accomplished without those steps, you have your complexity, and it isn&amp;#8217;t going anywhere. The task cannot be made more simple, because to do that we&amp;#8217;d have to leave out steps, which would not accomplish the task.&lt;/p&gt;
&lt;p&gt;What we do from then on is delegate complexity, shift it around and make it other people&amp;#8217;s problem. Take for example, the task of creating and publishing a blog post. Our software has tagging, categories, post titles and post content. Creating a post involves writing a post, giving it a title, adding tags, selecting categories and publishing it.&lt;/p&gt;
&lt;p&gt;Breaking it down, we need to create a body, create a title, create all categories, create all tags, link the tags to the post, link the post to the categories and publish it. Each link has a display name and a &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; slug, and each category has a display name and a &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; slug. &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; slugs cannot contain certain characters, however their display names can.&lt;/p&gt;
&lt;p&gt;Now, we can delegate this complexity to the user, which will result in simple code. The user will be responsible for creating tags and categories, and giving them &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; slugs that fit our rules, while the application will just take the data and store it, and retrieve it when asked. The user will be responsible for assigning tags to the post and the categories, and the application just stores it. This is obviously an unacceptable level of complexity for the user.&lt;/p&gt;
&lt;p&gt;We could also delegate all the complexity to the application, making the user experience simple. The user just types in the tags they want, picks the categories, and the application will link the tags if they exist, create them if they don&amp;#8217;t, automatically strip unwanted characters from &lt;span class=&quot;caps&quot;&gt;URL&lt;/span&gt; slugs and hide a lot of the complexity. In more complicated cases, this will result in very complex code that will be bug prone.&lt;/p&gt;
&lt;p&gt;So the question is, where do we draw the line? What balance of code complexity and user interface complexity is successful? I guess you could say &amp;#8220;make it 50/50&amp;#8221; and think that&amp;#8217;s good enough, but I don&amp;#8217;t agree. I think the balance is very contextual, and often leans in favour of code complexity. In simple examples like above, taking on all the complexity of the task in the code is a trivial thing and easily done. For nuclear reactor control software, things might not be straight forward.&lt;/p&gt;
&lt;p&gt;This is the key to a successful software product/business, I think. Finding the right balance between complexity. If you put too much complexity on the user, user&amp;#8217;s won&amp;#8217;t be able to use it, and your software won&amp;#8217;t sell, and the whole thing will bomb. If you put too much complexity on the software, it will be buggy and difficult to maintain, and will eat up development time and money, and possibly even end up costing more than it earns, and then it will bomb. That&amp;#8217;s not even including the more personal aspects of programmer job satisfaction and sanity.&lt;/p&gt;
&lt;p&gt;Success is finding the sweet spot when balancing complexity.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>jQuery Context Menu Unbind Click Fix</title>
   <link href="http://www.timgittos.com/archives/jquery-context-menu-unbind-click-fix"/>
   <updated>2009-04-09T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/jquery-context-menu-unbind-click-fix</id>
   <content type="html">&lt;p&gt;Updated on May 28, 2009, due to partial fix. The fix should now be a complete fix.&lt;br /&gt;
&amp;#8212;&lt;br /&gt;
Apologies for the somewhat confusing title.&lt;br /&gt;
I&amp;#8217;ve been doing a lot of jQuery work, replacing all the &lt;span class=&quot;caps&quot;&gt;AJAX&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; crap in my project at work to speed the interface up. I&amp;#8217;ve started using the awesome &lt;a href=&quot;http://abeautifulsite.net/notebook/80&quot;&gt;jQuery Context Menu&lt;/a&gt; plugin. However, I found it was also messing around with &lt;a href=&quot;http://www.jstree.com&quot;&gt;jsTree&lt;/a&gt; which I am using on the same page.&lt;/p&gt;  &lt;p&gt;The problem is that the jQuery Context menu overzealously unbinds all click events from the document. This means that it&amp;#8217;s going to break all your other Javascript that relies on clicking. Checking the &lt;a href=&quot;http://docs.jquery.com/Events/unbind&quot;&gt;documentation for jQuery&amp;#8217;s &lt;em&gt;unbind&lt;/em&gt; function&lt;/a&gt;, you can see that it accepts a function as a second parameter. This is the function that will be unbound if you pass that in as a parameter.&lt;br /&gt;
So, I fixed the jQuery Context Menu by changing the following:&lt;br /&gt;
&lt;ol&gt;   &lt;br /&gt;
&lt;li&gt;In the main &lt;em&gt;contextMenu&lt;/em&gt; function, near the end, just above the &lt;em&gt;return&lt;/em&gt; statement, I added the following:&lt;br /&gt;
[javascript]&lt;br /&gt;
// External click event for document &lt;br /&gt;
function onDocumentClick(e) {&lt;br /&gt;
      var menu = $(&amp;#8216;#&amp;#8217; + o.menu);&lt;br /&gt;
      $(document).unbind(&amp;#8216;click&amp;#8217;, onDocumentClick).unbind(&amp;#8216;keypress&amp;#8217;);&lt;br /&gt;
      $(menu).fadeOut(o.outSpeed);&lt;br /&gt;
      return false;&lt;br /&gt;
}     &lt;br /&gt;
[/javascript]&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;Next, I change the function that assigns the &lt;em&gt;click&lt;/em&gt; listener to the document to assign the defined function, instead of an anonymous function. So, change:      &lt;br /&gt;
[javascript]      &lt;br /&gt;
// Hide bindings&lt;br /&gt;
setTimeout( function() { // Delay for Mozilla&lt;br /&gt;
      $(document).click( function() {&lt;br /&gt;
            $(document).unbind(&amp;#8216;click&amp;#8217;).unbind(&amp;#8216;keypress&amp;#8217;);&lt;br /&gt;
            $(menu).fadeOut(o.outSpeed);&lt;br /&gt;
            return false;&lt;br /&gt;
      });&lt;br /&gt;
}, 0);&lt;br /&gt;
[/javascript]&lt;br /&gt;
to&lt;br /&gt;
[javascript] &lt;br /&gt;
// Hide bindings&lt;br /&gt;
setTimeout(function() { // Delay for Mozilla&lt;br /&gt;
      $(document).click(onDocumentClick);&lt;br /&gt;
}, 0);&lt;br /&gt;
[/javascript]&lt;/li&gt;    
&lt;li&gt;Lastly, I remove all instances of:     &lt;br /&gt;
[javascript]      &lt;br /&gt;
$(document).unbind(&amp;#8216;click&amp;#8217;);&lt;br /&gt;
[/javascript]&lt;/li&gt; 
&lt;/ol&gt;
&lt;p&gt;That&amp;#8217;s it. That fixed the problem for me. You&amp;#8217;ll notice I don&amp;#8217;t bother with the &lt;em&gt;keypress&lt;/em&gt; bindings. That&amp;#8217;s because I&amp;#8217;m not using them, so I&amp;#8217;m not bothered. I&amp;#8217;m assuming the fix for that will be a similar strategy, for those who are bothered.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve uploaded my version for those who can&amp;#8217;t get it working using the tips in this post, but remember the copyright remains with Cory S.N. LaViska over at &lt;a href=&quot;http://abeautifulsite.net/notebook/80&quot;&gt;A Beautiful Site&lt;/a&gt;.&lt;br /&gt;
&lt;a href=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/04/jquerycontextmenu.js&quot;&gt;jquery.contextMenu.js&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Correcting 5 Misconceptions About AI</title>
   <link href="http://www.timgittos.com/archives/correcting-5-misconceptions-about-ai"/>
   <updated>2009-04-07T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/correcting-5-misconceptions-about-ai</id>
   <content type="html">&lt;p&gt;For the longest time, I have been interested in artificial intelligence. The idea of computers that could make decisions and think independently fascinated me. Of course, I knew that AI wasn&amp;#8217;t quite that advanced, but the idea still captivated me. However, the barrier to learning AI was too high. It was too complex and too academic. Just looking at the mathematical notation involved made my head spin.&lt;/p&gt;
&lt;p&gt;I eventually took the plunge and convinced my family to buy me &lt;a href=&quot;http://www.amazon.com/gp/product/0137903952?ie=UTF8&amp;tag=gebloftigi-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0137903952&quot;&gt;Artificial Intelligence: A Modern Approach&lt;/a&gt;&lt;img src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;l=as2&amp;o=1&amp;a=0137903952&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; alt=&quot;&quot; style=&quot;border:none !important; margin:0px !important;&quot; /&gt; for Christmas, and 12 months later, I actually started reading it. I&amp;#8217;m &lt;em&gt;still&lt;/em&gt; reading it, and will be the first to admit I don&amp;#8217;t understand everything that is discussed, however there are a few things that I&amp;#8217;m realising about AI.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;It&amp;#8217;s All About Searching&lt;/strong&gt;&lt;br /&gt;
Searching is a constant in AI techniques. Problems are defined and solution spaces are created. Problems can be represented in a number of ways (graphs, trees, logic knowledge bases), however in the end, it always comes back to searching.&lt;/p&gt;
&lt;p&gt;This is important because searching is easy. Searching is something that a lot of programmers already know, even if it&amp;#8217;s only at a most basic, brute force level. We do searching all the time. We loop through arrays searching for values, we use regular expressions to match string patterns, we retrieve records from databases. We search.&lt;/p&gt;
&lt;p&gt;At it&amp;#8217;s simplest, you can search using brute force searching, iterating over all combinations and permutations of solutions looking for one that satisfies the problem, but beyond that, you can involve tricky heuristics to make optimal decisions about how to search. You can have local searches, which will pick a solution space and search it for local maximums, such as hill climbing, and searches that will find global minimums, such as simulated annealing.  But it&amp;#8217;s still search. It&amp;#8217;s still something you can do.&lt;/p&gt;
&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;It&amp;#8217;s More Common Than You Think&lt;/strong&gt;&lt;br /&gt;
AI is a hell of a lot more prevalent than most people realise. I didn&amp;#8217;t think AI had much commercial application before I started learning about it, but luckily that didn&amp;#8217;t dim my interest. For those who are interested, but holding back because they don&amp;#8217;t see how it would benefit them, here&amp;#8217;s some good news. AI techniques are used everywhere. &lt;br /&gt;
&lt;br /&gt;
That international 4 city flight you booked used AI techniques. A constraint satisfaction problem solver took all the constraints about needing to be at this city by that time, flying on this airline for that much, and creating a plan for you. When Amazon recommends products you might be interested in, it calculates this with Bayesian networks and classifiers, a method of probabilistically linking a set of variables. Circuit design, product manufacturing, supply chain optimisation, all of these things use techniques that AI use. They&amp;#8217;re not the sole domain of AI, but learning AI will cause you to learn these too.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;You Can Use It Today&lt;/strong&gt;&lt;br /&gt;
Whatever you&amp;#8217;re working on, you can probably use AI techniques in it. Even some of the more exotic sounding techniques like neural networks can be of use to you. Self healing databases? &lt;a href=&quot;http://blip.tv/file/1947373/&quot; title=&quot;Easy AI in Python&quot;&gt;Hell yeah.&lt;/a&gt; Even Bayesian classifiers to catalog and categorise products, heuristic searches to mine data in databases, hierarchical task planners to plan that holiday or manage that Gantt chart.&lt;br /&gt;
&lt;br /&gt;
Can you use it anywhere? No. Your simple &lt;span class=&quot;caps&quot;&gt;CRUD&lt;/span&gt; app probably won&amp;#8217;t benefit from a wizz-bang heuristic search. But if you&amp;#8217;re doing anything that involves large amounts of data, interacting with people, predicting trends and recognising patterns, you can use it.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;It&amp;#8217;s In Demand&lt;/strong&gt;&lt;br /&gt;
You may have heard of the &lt;a href=&quot;http://www.netflixprize.com/&quot; title=&quot;Netflix Prize&quot;&gt;Netflix Prize&lt;/a&gt;. Guess what? That&amp;#8217;s AI. Google is the biggest search engine around, and index billions upon billions of pages on the internet, and can get you relevant results to a question in a matter of seconds. That&amp;#8217;s one hell of a big knowledge base, and one smart search algorithm. Amazon sell products all over the world, and aggressively upsell and cross sell. I get emails about related products I might like based on my wishlist and purchase history, and they&amp;#8217;re actually pretty accurate.&lt;br /&gt;
&lt;br /&gt;
Also, computer games. Enough said.&lt;br /&gt;
&lt;br /&gt;
AI skills are in demand. Not huge demand, but probably more that you would have guessed. These skills are hugely profitable in the right hands, and big companies want to extract every single little morsel of useful information about your browsing, shopping, eating, travelling, viewing and reading habits in order to market to you more effectively. Now that sounds a little creepy to me, but if that doesn&amp;#8217;t bug you, more power.&lt;/li&gt;
	&lt;li&gt;&lt;strong&gt;There&amp;#8217;s a Lot of Information Out There&lt;/strong&gt;&lt;br /&gt;
AI isn&amp;#8217;t some weirdo niche science topic. There&amp;#8217;s actually quite a lot of information out there, once you start going down the rabbit hole. &amp;#8220;AI: A Modern Approach&amp;#8221; cites hundreds of papers and books. There&amp;#8217;s thousands of websites out there on the subject. There are many academic papers that are made available for free online. There are communities, like &lt;a href=&quot;http://aigamedev.com&quot; title=&quot;AI Game Dev&quot;&gt;AIGameDev&lt;/a&gt;, dedicated to spreading that delicious knowledge.&lt;br /&gt;
&lt;br /&gt;
I think the hardest part about finding information is getting the terminology. It&amp;#8217;s pretty dense when you first get into it, especially when talking about acyclic directed graphs, and your idea of a graph was like mine was about a year ago, namely a few bars on a 2D Cartesian axis. But once you&amp;#8217;ve got a foot in the door of the lingo, it can become pretty accessible, and information starts becoming more bountiful. That foot in the door can be either a good, basic website, or in my case, a university level textbook &lt;em&gt;designed&lt;/em&gt; to introduce people to AI.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;AI is a big field, full of fascinating and interesting concepts and techniques, and it&amp;#8217;s a young field that&amp;#8217;s still full of potential. It&amp;#8217;s not as complex or confusing as film and television would have you think. That&amp;#8217;s not to say it&amp;#8217;s a walk in the park, as I stated earlier, I&amp;#8217;m probably running a 70% rate of understanding what I&amp;#8217;m reading, but I&amp;#8217;m managing. And if I can manage, so can you. So if you&amp;#8217;re interested, there&amp;#8217;s no better time to start than now.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>A CMS in Ruby on Rails, and Why I Stopped</title>
   <link href="http://www.timgittos.com/archives/a-cms-in-ruby-and-why-i-stopped"/>
   <updated>2009-04-06T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/a-cms-in-ruby-and-why-i-stopped</id>
   <content type="html">&lt;p&gt;For the last couple of months I have been writing a series of posts describing a personal Ruby on Rails based &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;. I have been writing tutorial style posts outlining what I was doing, and why I was doing it. Don&amp;#8217;t bother trying to look for those posts, because I&amp;#8217;ve archived them.&lt;/p&gt;
&lt;p&gt;This decision was pretty easy after I slowed down and reviewed the situation objectively for a few minutes. That clarity, coupled with a few truths that hit home while reading the source of a few other Rails applications pretty much sealed the deal.&lt;/p&gt;
&lt;p&gt;The next post in the series was going to be an overview of another Ruby &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; project, &lt;a href=&quot;&quot;&gt;BrowserCMS&lt;/a&gt;. I saw a video from RailsConf about this project, and recognised a lot of their goals as coinciding with mine. So I was going to poke through their code, see how they&amp;#8217;ve done things, compare it to how I did the  same things, or was planning to do them.&lt;/p&gt;
&lt;p&gt;While I was reading through their source, it occurred to me just how much I don&amp;#8217;t get Rails. I have a bit of a poke around with scaffolding and get familiar enough with the generators and I decide that I&amp;#8217;m ready to tell people how do create a &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; in Ruby, because I&amp;#8217;ve nearly finished creating a &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; in &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s clear to me, now, how silly that was.&lt;/p&gt;
&lt;p&gt;Rails isn&amp;#8217;t just a framework for Ruby, it&amp;#8217;s a whole change in paradigm. Intellectually, I know Rails is &amp;#8220;opinionated software&amp;#8221;, however I don&amp;#8217;t think I understood what that really means. I tried to make my code as flexible and configurable as possible, and I was struggling with all but the most basic &lt;span class=&quot;caps&quot;&gt;CRUD&lt;/span&gt; tasks.&lt;/p&gt;
&lt;p&gt;So, first I realised I wasn&amp;#8217;t ready to tell anyone how to do anything in Rails.&lt;/p&gt;
&lt;p&gt;But I have a series of about 5 posts doing just that. What do I do with those? Do I continue on, plugging away at learning while trying to instruct? I decided the answer to that depended on what I had achieved with my posts. What was the value of them?&lt;/p&gt;
&lt;p&gt;Then I realised that I had covered very little other than simple &lt;span class=&quot;caps&quot;&gt;CRUD&lt;/span&gt;. Sure, I had some unusual object relations, like trees and self referential comments, and I implemented some business logic like compiling pages into templates, however the total sum of the non-&lt;span class=&quot;caps&quot;&gt;CRUD&lt;/span&gt; related content could have fit into 1 post. So I spent 4 posts blathering away at how to achieve the same task as running &lt;em&gt;script/scaffold&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;What&amp;#8217;s worse is that I realised I was &lt;a href=&quot;http://www.timgittos.com/wordpress-or-roll-your-own&quot;&gt;back in the rut of creating a &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;&lt;/a&gt;. How on earth did I do that again, after stating loudly and proudly that &lt;strong&gt;I don’t even like programming websites.&lt;/strong&gt;? Well, I told myself, you are planning on using this on your own sites, your many, many online business ideas. Sometimes you have to do the same old thing to earn money. Which is true, if I had done anything of worth, but I hadn&amp;#8217;t, I was a long winded scaffold script. I got carried away in the joy of learning a new language/framework (which isn&amp;#8217;t a bad thing), and fell into the familiar territory of doing what I always do (which &lt;strong&gt;is&lt;/strong&gt; a bad thing).&lt;/p&gt;
&lt;p&gt;So, now I realise that I&amp;#8217;m not only trying to teach people something I don&amp;#8217;t understand, I&amp;#8217;m trying to teach them how to do something I don&amp;#8217;t even like doing.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s stupid.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve archived the posts. I may revisit, as I still have grand ideas of what a &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; should be, but for now I&amp;#8217;m shelving the whole thing. Luckily I have such a small readership (read: none) at this stage, nobody will be affected. For that I&amp;#8217;m grateful.&lt;/p&gt;
&lt;p&gt;And yet, through all this stupidity, I have learnt a few things of value.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve learnt that Ruby on Rails is more complex than I thought, and will hit the books again to pick up some more advanced techniques.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve learnt that I&amp;#8217;m scared to push myself in programming. This revelation is a pointy one. I love programming, it&amp;#8217;s my job, it&amp;#8217;s my hobby and it&amp;#8217;s my passion. The fact that I&amp;#8217;m scared to push myself to innovate, hiding behind the excuse that I&amp;#8217;m not smart enough or I&amp;#8217;m not creative enough is double edged. On one hand, it&amp;#8217;s sad that I&amp;#8217;m not as ambitious as I thought. On the other, it&amp;#8217;s great that I know now, so that I can get stuck into remedying that.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve also learnt a lot about blogging. Those posts of mine weren&amp;#8217;t really providing much value. I don&amp;#8217;t have many readers because I&amp;#8217;m not saying anything new, and I&amp;#8217;m not showing anybody cool things they can&amp;#8217;t find in a hundred other blogs. I also didn&amp;#8217;t have much of a personal voice, and was writing them like I would a textbook, which is missing the point of a blog. It&amp;#8217;s supposed to be informal, and I&amp;#8217;m supposed to show my personality. So, I&amp;#8217;ve found my voice, while realising that I&amp;#8217;m not providing value. Another pointy idea, but ultimately good, because that too is something I can work on.&lt;/p&gt;
&lt;p&gt;So, inevitably, I have to question the value of &lt;strong&gt;this&lt;/strong&gt; post. What could this post provide to someone who stumbles across this website? Well, a few things.&lt;/p&gt;
&lt;p&gt;Firstly, self awareness is a great thing to possess as a programmer. If you know where your weaknesses are, you can train in them, and get better. But that&amp;#8217;s not enough, you also need to know what you&amp;#8217;re afraid of, so you can recognise that you don&amp;#8217;t even &lt;em&gt;know&lt;/em&gt; that it&amp;#8217;s a weakness. That fear hides the existence of the things you&amp;#8217;re not good of, and that&amp;#8217;s a major roadblock to improving.&lt;/p&gt;
&lt;p&gt;And lastly, if you don&amp;#8217;t have anything to add to the conversation, don&amp;#8217;t say anything. The whole internet is a conversation, and I&amp;#8217;ve just been babbling to myself in a corner the whole time. If you want to contribute, add your own thoughts, your own interpretation on subjects that are well known. Go into new levels of detail on old ideas and technologies. Introduce new ideas or technology, or modify existing ones. Contribute, don&amp;#8217;t just talk for the sake of talking.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Visual Studio 2008 Deletes LINQ DBML Designer File</title>
   <link href="http://www.timgittos.com/archives/visual-studio-2008-deletes-lin-dbml-designer-file"/>
   <updated>2009-04-01T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/visual-studio-2008-deletes-lin-dbml-designer-file</id>
   <content type="html">&lt;p&gt;Do you spend hours wrangling with your &amp;#8220;Interactive&amp;#8221; Development Environment, trying to prevent it from deleting your boiler plate .designer file for your &lt;span class=&quot;caps&quot;&gt;LINQ&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;DBML&lt;/span&gt;? Do you get baffled watching Visual Studio delete said file from your software version control system, and then struggle to get the two back into sync?&lt;/p&gt;
&lt;p&gt;Then you might be encountering &lt;a href=&quot;https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=361577&quot;&gt;this bug&lt;/a&gt; right here. The reason for this post is because this bug seems very hard to find information on in Google. So hopefully I can raise some awareness, and at least have it pop up on a Google search.&lt;/p&gt;
&lt;p&gt;Typical symptoms are the designer file for the &lt;span class=&quot;caps&quot;&gt;DBML&lt;/span&gt; being deleted when the &lt;span class=&quot;caps&quot;&gt;DBML&lt;/span&gt; is updated. If you&amp;#8217;re also using source control, Visual Studio will attempt to delete it from your source control at the same time. Renaming the &lt;span class=&quot;caps&quot;&gt;DBML&lt;/span&gt; file will cause it to regenerate, however it can cause major headaches when combined with source control, removing it, adding it, pending delete actions hidden in a project you thought you had unchecked out.&lt;/p&gt;
&lt;p&gt;The solution is the suitably moronic action of moving all your using statements inside your namespace declaration. A co-worker found this solution in &lt;a href=&quot;http://social.msdn.microsoft.com/Forums/en-US/vs2008sp1beta/thread/40539acd-0216-4357-ac63-d507bf259c3d/&quot;&gt;this &lt;span class=&quot;caps&quot;&gt;MSDN&lt;/span&gt; forum thread&lt;/a&gt;. Once you move your usings, Visual Studio happily stops deleting your designer file, and you can finally get back to work programming instead of fighting your tools.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>In Defense of the Jerk</title>
   <link href="http://www.timgittos.com/archives/in-defense-of-the-jerk"/>
   <updated>2009-03-29T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/in-defense-of-the-jerk</id>
   <content type="html">&lt;p&gt;Not just any jerk, but &lt;a href=&quot;http://sethgodin.typepad.com/seths_blog/2009/03/yeah-but-he-really-knows-his-stuff.html&quot; title=&quot;Seth Godin's Blog - Yeah But He Really Knows His Stuff&quot;&gt;the jerk who knows his stuff&lt;/a&gt;. The technically strong, socially weak programmer who does not play well with others.&lt;/p&gt;
&lt;p&gt;During a recent employee review, I was told that I need to work on a few areas, namely the way I communicate with my co-workers, and my tendencies to shoot down ideas without supplying alternatives. I was also told that my technical proficiency was more than sufficient.&lt;/p&gt;
&lt;p&gt;The technically capable but socially awkward programmer is a cliche in every day society, and the rogue programmer is a cliche in development teams. Seth Godin&amp;#8217;s post, and another one that cropped up in Hacker News reminded me of this, and made me think. I realised that, to some extend, I am that jerk.&lt;/p&gt;
&lt;p&gt;The point of this isn&amp;#8217;t to toot my own horn, rather to try to offer an explanation on behalf of all well-meaning jerks in software development teams. Now, I&amp;#8217;m not talking about those jerk jerks, who code maze-like code to secure themselves a job, those who are needlessly rude and abrasive, and those that ignore the other members of the team to the detriment of the whole project.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m talking about the jerks who are otherwise good employees. We&amp;#8217;re not trying to sabotage the project, to exert our will over the project, to make anyone feel bad or insufficient.&lt;/p&gt;
&lt;p&gt;We just care about the code.&lt;/p&gt;
&lt;p&gt;At least, I do. I care about what I&amp;#8217;m doing. I care about the project. I want my code to be the best code I&amp;#8217;ve ever written, I want this project to be the most successful project the company has.  I own my code, and take pride in it.&lt;/p&gt;
&lt;p&gt;When somebody suggests something that I know won&amp;#8217;t work, that will negatively affect the quality of the code, I freak out, somewhat. The first thing on my mind is to shoot down this idea, because I don&amp;#8217;t want it reducing the quality of the project.&lt;/p&gt;
&lt;p&gt;If my manager is planning on putting another programmer on the project with me, and I don&amp;#8217;t believe they&amp;#8217;re quite up to standard, I&amp;#8217;m going to try to limit the damage they do to the application. I&amp;#8217;m going to try and push them to work in a relatively isolated corner of the application. Unfortunately, I know this is a bad team work based attitude, however I can&amp;#8217;t help it.&lt;/p&gt;
&lt;p&gt;Now, I&amp;#8217;m not defending jerks. Being a jerk is a bad thing, I know this. I agree with what my boss said, and agree that I need to work on these areas. However, instantly firing the jerk, if they&amp;#8217;re a well meaning jerk, is not a good idea, because you&amp;#8217;ll lose someone who is passionate about what they do, and constantly striving to improve them.&lt;/p&gt;
&lt;p&gt;Instead, just try to work things through, and soften the edges of the jerk.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Parsing ASP.NET pages with SGMLParser</title>
   <link href="http://www.timgittos.com/archives/parsing-aspnet-pages-with-sgmlparser"/>
   <updated>2009-03-09T00:00:00-07:00</updated>
   <id>http://www.timgittos.com/archives/parsing-aspnet-pages-with-sgmlparser</id>
   <content type="html">&lt;p&gt;I&amp;#8217;m going to take a short break in my Ruby &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; series to post something I encountered at work.&lt;/p&gt;
&lt;p&gt;During my development of the &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; at work, I&amp;#8217;ve had to deal with parsing &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; content in order to compile page content into tags. This involves being able to replace certain elements of a page with other elements. At first I tried to do this with regular expressions, however this didn&amp;#8217;t turn out too well when it came to dealing with the inconsistencies in legacy sites running on the current, older &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;. Next, I tried parsing the pages as XDocuments, which worked ok as long as I was parsing well formed pages. As soon as it hit a malformed page, however, it died in a fiery burst of exceptions.&lt;/p&gt;
&lt;p&gt;Then I looked at SGMLParser, and it seemed like it was my savior. It parsed &lt;span class=&quot;caps&quot;&gt;SGML&lt;/span&gt;, of which &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; is a subset, and it auto corrected malformed content, and would handle all the inconsistencies of life, in use &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;, and it would allow me to parse it into an XDocument so I can manipulate nodes. However, even SGMLParser had it&amp;#8217;s own problems: it wouldn&amp;#8217;t handle &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; server tags very well, which was a problem.&lt;/p&gt;
&lt;p&gt;We provide &amp;#8220;plug in&amp;#8221; functionality to &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; sites by the way of &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; server controls. You build your functionality, stick the server control files into your site, drop the binary into the bin folder and insert the server control tags into your page. Fire it up, and it will appear and function. However, when running pages with server control tags through the SGMLParser, it wouldn&amp;#8217;t recognise the namespaces, and would strip them, completely breaking them.&lt;/p&gt;
&lt;p&gt;This was unsatisfactory, as we were planning on using a similar sort of set up to perform the same thing in the new &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;. So, I hit Google, looking for ways to get around this. There&amp;#8217;s not a lot of information out there about it, other than &amp;#8220;&lt;span class=&quot;caps&quot;&gt;SGML&lt;/span&gt; parses &lt;span class=&quot;caps&quot;&gt;SGML&lt;/span&gt;, not &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt;, which isn&amp;#8217;t valid &lt;span class=&quot;caps&quot;&gt;SGML&lt;/span&gt;&amp;#8221; which was exceedingly unhelpful, because I already know.&lt;/p&gt;
&lt;p&gt;I peeked into the source of SGMLReader to see if maybe I could remove the functionality that stripped out unknown namespaces. Sure, this would probably defeat the purpose of using SGMLParser, but it would help me out in this specific project. Unfortunately, the codebase is rather complicated and I really didn&amp;#8217;t want to dig in and spend hours on something I wasn&amp;#8217;t sure was even going to work.&lt;/p&gt;
&lt;p&gt;I saw that the project has a custom &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; dtd, so I considered briefly writing a dtd for &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt;. However, while I was thinking of all the different permutations of server tags, especially when you can specify your own namespaces and tag names and attributes, I quickly decided that wasn&amp;#8217;t suitable either.&lt;/p&gt;
&lt;p&gt;In the end, and I believe this is honestly the only way to do it, I ended up pre-processing my content, wrapping &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; server tags within &amp;lt;![&lt;span class=&quot;caps&quot;&gt;CDATA&lt;/span&gt;[ ]]&amp;gt; tags. I noticed that SGMLParser was wrapping my older &amp;lt;% %&amp;gt; &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt; style tags in this fashion, and leaving them unmolested. After I parse it into the XDocument, do my manipulations and pull it back out as the desired content, I run a post-process through it, removing the &amp;lt;![&lt;span class=&quot;caps&quot;&gt;CDATA&lt;/span&gt;[ ]]&amp;gt; tags that were added in the pre-process. After, I&amp;#8217;m left with my content as it went in, with the modifications done through the compiling process.&lt;/p&gt;
&lt;p&gt;Of course, I do the pre-processing and post-processing with a regular expression:&lt;br /&gt;
[code language=&amp;#8220;html&amp;#8221;]&lt;br /&gt;
&amp;lt;/?[\w]+:[^&amp;gt;]*/?&amp;gt;&lt;br /&gt;
[/code] &lt;br /&gt;
which I think is kind of funny, in a way. I can never seem to escape regular expressions.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>ASP.NET Ajax, FCKEditor and Firebug</title>
   <link href="http://www.timgittos.com/archives/aspnet-ajax-fckeditor-and-firebug"/>
   <updated>2009-02-12T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/aspnet-ajax-fckeditor-and-firebug</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/images/archives/firebugs.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Today at work I had the pleasure of dealing with a functionality bug in our new &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; that is written in &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt;. Our &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; uses FCKEditor for the rich text editor, and we&amp;#8217;re using a whole gang of &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; Ajax stuff for the interface. Specifically, we&amp;#8217;re using a TabContainer with user controls inside each tab.&lt;/p&gt;
&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; is designed in the way that most CMS&amp;#8217;s are &amp;#8211; we have 2 major components. Page objects contain the content data of a page, so text, &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; meta data, etc. Template objects contain templates &amp;#8211; that is, &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; files with areas where you insert the page content, similar to how Dreamweaver does it&amp;#8217;s templates for you.&lt;/p&gt;
&lt;p&gt;When you publish a page/site, the &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; compiles the content into the template, then saves that as a file. When you&amp;#8217;re editing or creating a page in the admin interface, the application reads the content areas available in the current template you have selected for that page, and creates an FCKEditor dialog for it.&lt;/p&gt;
&lt;p&gt;Because you might not know how the content you&amp;#8217;re writing fits into the template you&amp;#8217;re going to use, we provide a preview function. This preview function will read in the content of the FCKEditor dialogs, create a temporary page object, set the src of an iframe to our preview page, which takes the page objects and feed it to a preview function which will compile the page and return the string, which we dump to the output stream of the preview page. We then fire up the iframe inside an &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; popup extender, for a nice modal preview.&lt;/p&gt;
&lt;p&gt;This all worked fine, until we got the tab container involved.&lt;/p&gt;
&lt;p&gt;In order to streamline the work flow and reduce the page refreshes on postbacks, we decided to put the content in a tab container, with different parts of the page in different tabs. When we did this, we noticed that when the preview button did a partial postback, it reloaded the FCKEditor dialogs from the database, obliterating the changes we made to the page (if any), or just displaying nothing for the content if it was a new page.&lt;/p&gt;
&lt;p&gt;This was just on my computer.&lt;/p&gt;
&lt;p&gt;On a co-workers computer, it worked perfectly as intended, despite the fact we were both working from the same source, in the same &lt;span class=&quot;caps&quot;&gt;IDE&lt;/span&gt;, running it in the same browser. What gives?&lt;/p&gt;
&lt;p&gt;After poking around on both computers and trying the application in different browsers, we concluded that it doesn&amp;#8217;t work &lt;em&gt;only&lt;/em&gt; in my Firefox &amp;#8211; IE was fine on my computer, and all browsers were fine on his. Acting on a hunch, I disabled Firebug for my Firefox, because I noticed my co-worker didn&amp;#8217;t have Firebug installed.&lt;/p&gt;
&lt;p&gt;The application started working again.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t know why this happens, and why Firebug should be interfering with the Javascript in an obtrusive way, or even which Javascript it&amp;#8217;s interfering with. I don&amp;#8217;t know if Firebug was screwing with FCKEditor or &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; Ajax. So, this post is partially to put this info out there, in the hopes that someone else can answer for me.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s also partially to say, if you&amp;#8217;re seeing odd behavior that seems to be cropping up inconsistently across machines running Firefox, try disabling Firebug. Since being done by Firebug, I&amp;#8217;ve decided to leave it off during all development, and thinking back, I wonder how many other Javascript bugs I&amp;#8217;ve fought with that were caused by Firebug, and not the code.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Consistent Designs Across Browsers</title>
   <link href="http://www.timgittos.com/archives/consistent-designs-across-browsers"/>
   <updated>2009-02-08T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/consistent-designs-across-browsers</id>
   <content type="html">&lt;p&gt;Firstly, a caveat: I am not a designer. I am a server side programmer who dabbles in web design and development. I do not know &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; as well as someone who designs websites for a living would. So take this advice with a grain of salt.&lt;/p&gt;
&lt;p&gt;Today @RealtorPaul asked why his site wasn&amp;#8217;t displaying right in Firefox, when it was displaying fine in IE. This is a common enough occurrence in web design, and it&amp;#8217;s due to the fact that different browser vendors use different render engines, and each render engine has it&amp;#8217;s own share of bugs.&lt;/p&gt;
&lt;p&gt;Bugs are qualified by measuring against a set of standards laid down by the W3C as a target for render engines. Among the various browsers, IE typically has the longest history of the worst standards support around, with IE 6 being the #1 criminal, and admittedly IE 7 is much better, but still flawed.&lt;/p&gt;
&lt;p&gt;When users develop a &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; interface that they check primarily against IE, testing how it looks in IE, etc, they&amp;#8217;ll often get a nasty shock when they check in a Gecko (Firefox, etc) browser, as their designs fall apart and generally look horrible.&lt;/p&gt;
&lt;p&gt;While the ideal way to trouble shoot these problems is to go over your &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; code with a fine tooth comb and understand how all the various rules are working, and understand how all the browsers render those rules, that&amp;#8217;s not very practical. Luckily, the 80/20 rule tends to come into play here, meaning the largest problems between browsers are caused by a small selection of things. Here is a list of things you can check against:&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
	&lt;li&gt;&lt;strong&gt;Do you have a valid doctype in your &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; code?&lt;/strong&gt; A valid doctype will look like this: &lt;br /&gt;
&lt;pre class=&quot;html&quot;&gt;&amp;lt;!&lt;span class=&quot;caps&quot;&gt;DOCTYPE&lt;/span&gt; html &lt;span class=&quot;caps&quot;&gt;PUBLIC&lt;/span&gt; &amp;#8220;-//W3C//&lt;span class=&quot;caps&quot;&gt;DTD&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; 4.01//EN&amp;#8221; &lt;/pre&gt;&lt;br /&gt;
&lt;pre class=&quot;html&quot;&gt;&amp;#8220;http://www.w3.org/TR/html4/strict.dtd&amp;#8221;&amp;gt;&lt;/pre&gt;&lt;br /&gt;
You can find a &lt;a title=&quot;Available doctypes for HTML pages.&quot; href=&quot;http://www.w3.org/QA/2002/04/valid-dtd-list.html&quot;&gt;list of available doctypes at the W3C website&lt;/a&gt;. I personally recommend the &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; 4.01 doctype over the &lt;span class=&quot;caps&quot;&gt;XHTML&lt;/span&gt; doctypes, for reasons that deserve a topic of their own. To use a doctype, put it as the first thing in every &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; page in your website.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;&lt;strong&gt;Are you using a lot of padding and margins?&lt;/strong&gt; One of the differences between Firefox and IE (just to name two) that most people hit is the difference in the box model.&lt;a title=&quot;Box model explanation - RedMelon.net&quot; href=&quot;http://redmelon.net/tstme/box_model/&quot;&gt; IE renders it&amp;#8217;s box model incorrectly&lt;/a&gt;, and as a result, can cause a lot of grief when using a lot of padding and margins. &lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;&lt;strong&gt;Are you using properties that do not have 100% support in all browsers?&lt;/strong&gt; Some &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; features are not implemented completely in all browsers, and their support is patchy at best. You can find a &lt;a title=&quot;CSS compatibility chart - Quirksmode.org&quot; href=&quot;http://www.quirksmode.org/css/contents.html&quot;&gt;list of these &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; features at quirksmode.org&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;&lt;strong&gt;Are you floating a lot of elements?&lt;/strong&gt; Floating elements removes them from the regular flow of the page, and as a result, can have some funky results on your design. Floating elements can be awesome when you know how to use it, but can be confusing as hell when you don&amp;#8217;t. &lt;a title=&quot;Things you should know about CSS floating - Smashing Mag&quot; href=&quot;http://www.smashingmagazine.com/2007/05/01/css-float-theory-things-you-should-know/&quot;&gt;Make sure you know what you&amp;#8217;re doing when you float stuff&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;&lt;strong&gt;Are you changing the flow of elements with the &amp;#8220;display&amp;#8221; property?&lt;/strong&gt; Certain elements are block level elements (they sit on their own line, and push elements beside them down) and some are inline elements (they happily co-exist in the middle of other elements). If you&amp;#8217;re changing how some elements display, be aware that other properties (I&amp;#8217;m looking at you, &amp;#8220;width&amp;#8221; and &amp;#8220;height&amp;#8221;) don&amp;#8217;t work on inline elements. &lt;a title=&quot;CSS: Block and Inline Elements - Web Design From Scratch&quot; href=&quot;http://www.webdesignfromscratch.com/css-block-and-inline.php&quot;&gt;Know what happens when you change how things are displayed&lt;/a&gt;.&lt;/li&gt;&lt;/p&gt;
&lt;/ul&gt;
&lt;p&gt;Those are the &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; concepts that get me the most. Many problems are solved just by adding a valid doctype to your page, however if you&amp;#8217;re still finding you&amp;#8217;re having problems, give the other items on the list a look.&lt;/p&gt;
&lt;p&gt;This list is &lt;em&gt;far &lt;/em&gt;from exhaustive, nor is it even very in depth. However, it&amp;#8217;s a good place to start looking, and it might point you in the right direction. With the state of the browser market as it is, debugging &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; is as much an art as creating the design for a site is.&lt;/p&gt;
&lt;p&gt;When debugging &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt;, you might want to start with just bare bones &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;, and slowly add rules as you go, and isolate that way which rules are the ones that are messing everything up. Also, keep in mind that &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; is cascading &amp;#8211; which means you need to put your more specific rules at the bottom of your stylesheet, general rules at the top, otherwise your general rules will override your specific rules.&lt;/p&gt;
&lt;p&gt;The best way I&amp;#8217;ve found to debug &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; is to incrementally apply styles, and use a tool like &lt;a title=&quot;Firebug!&quot; href=&quot;http://www.getfirebug.com/&quot;&gt;Firebug &lt;/a&gt;to turn rules on and off dynamically, so you can see what happens. The most important thing to remember is that even experienced developers have to deal with browser incompatibility. If you find you&amp;#8217;re struggling, keep at it, and don&amp;#8217;t lose heart. It&amp;#8217;s all part of designing a website.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Apps Hungarian is Just Good Naming</title>
   <link href="http://www.timgittos.com/archives/apps-hungarian-is-just-good-naming"/>
   <updated>2009-02-06T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/apps-hungarian-is-just-good-naming</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/02/hungarian.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-206&quot; title=&quot;Hungarian flag&quot; src=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/02/hungarian.jpg&quot; alt=&quot;Hungarian flag&quot; width=&quot;500&quot; height=&quot;257&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Application Hungarian is just good variable naming convention, but worse, because it&amp;#8217;s needlessly concise, and hard to read at a glance. It also comes from an environment that is growing more and more obsolete. More on that in a bit.&lt;/p&gt;
&lt;p&gt;Firstly, clarification is needed as to the definition of Application Hungarian notation, as opposed to Systems Hungarian. All of this is relatively useless, however, if you are in the same situation I was in a few years back and don&amp;#8217;t know what Hungarian notation even is.&lt;/p&gt;
&lt;p&gt;Hungarian notation is a variable and function naming convention where you add either prefixes or suffixes to names. What these prefixes/suffixes mean depends on what type of Hungarian notation you&amp;#8217;re using. Systems Hungarian is the method of adding information about the type of the value of a variable, or a return from a function. For example, a string that represents a name would be called &amp;#8220;strName&amp;#8221; using Systems Hungarian. Applications Hungarian is where you add information about the semantic meaning of the value of a variable.If this is a little foreign, that&amp;#8217;s because most people think Systems Hungarian when they think about Hungarian notation.&lt;/p&gt;
&lt;p&gt;In &lt;a href=&quot;http://www.joelonsoftware.com/articles/Wrong.html&quot;&gt;Making Wrong Code Look Wrong&lt;/a&gt;, which is what inspired this post, Joel Spoelsky outlined exactly what Applications Hungarian notation is, and why it&amp;#8217;s so useful. He outlines that in Applications Hungarian, you add information about the semantic value of a variable/method return. To illustrate, he demonstrates that you can use Applications Hungarian to differentiate safe and unsafe strings in a web application environment. He uses the prefix &amp;#8216;s&amp;#8217; to define a &amp;#8220;safe&amp;#8221; string, that is safe against &lt;span class=&quot;caps&quot;&gt;XSS&lt;/span&gt; attacks (ie: A html encoded string). He uses the &amp;#8216;us&amp;#8217; prefix to define an &amp;#8220;unsafe&amp;#8221; string, that is a string read directly from user input that may contain potentially dangerous code.&lt;/p&gt;
&lt;p&gt;Spolsky also demonstrates using the notation to make wrong code long wrong. That is, by combining prefixes on methods, based on their return types, you can use the names as a sort of litmus test. So if the return prefix of a function specifies it returns a &amp;#8216;us&amp;#8217; or unsafe string, and you assign it to a &amp;#8216;s&amp;#8217; or supposedly safe function, this is clearly a logic bug, and looks wrong.&lt;/p&gt;
&lt;p&gt;I think this is great, and it&amp;#8217;s something I&amp;#8217;ve never thought of, but my question is, how is it different from properly descriptive variable naming, aside from it&amp;#8217;s somewhat obscure brevity?&lt;/p&gt;
&lt;p&gt;The virtues of clear, descriptive names in programming have been sung again and again. If you make your variables and method names descriptive enough, your code becomes somewhat self documenting. You capture the intention and meaning in your code when you use variables like &amp;#8220;customerFirstName&amp;#8221; and &amp;#8220;formatAddress&amp;#8221;. You look at those names and you can immediately see the intention behind the code.&lt;/p&gt;
&lt;p&gt;I see a huge overlap between the best practice of descriptive variable naming and Spolsky&amp;#8217;s intention behind his use of Apps Hungarian, so much so that I don&amp;#8217;t see a difference between the two, with relation to their purported goals. Apps Hungarian is more terse, and more obscure, and has somewhat of a learning curve if you&amp;#8217;re not familiar with the nomenclature of the system. This, to me, seems like a needless barrier to understanding.&lt;/p&gt;
&lt;p&gt;Am I missing something? Why is Apps Hungarian better than regular, descriptive and intelligent variable naming? I can&amp;#8217;t see any benefit to using Apps Hungarian explicitly, and to my understanding, Apps Hungarian is just a more terse method of good variable naming.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Pixel Perfection is Impossible</title>
   <link href="http://www.timgittos.com/archives/pixel-perfection-is-impossible"/>
   <updated>2009-02-03T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/pixel-perfection-is-impossible</id>
   <content type="html">&lt;p&gt;This post is an elaboration of a comment that I left on a &lt;a title=&quot;Joren Rapini on CSS Frameworks&quot; href=&quot;http://jorenrapini.com/blog/web-development/are-css-frameworks-really-worth-using&quot;&gt;post about &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; frameworks&lt;/a&gt;. I agree wholeheartedly with Joren&amp;#8217;s position on &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; frameworks after having used &lt;a title=&quot;960gs CSS Grid Framework&quot; href=&quot;http://960.gs/&quot;&gt;960gs&lt;/a&gt; for the layout of this site (at the time of posting this).. As I mentioned in my reply to Joren&amp;#8217;s post, I used the framework to try to cut down the stress I feel when I try to make things line up properly and that most certainly didn&amp;#8217;t work as intended.&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;/images/archives/frustration.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Specifically, I have a little widget that shows my most recent tweet on the front page, and I&amp;#8217;m using a &lt;a title=&quot;Twitter bird vector images - Darkmotion.com&quot; href=&quot;http://darkmotion.com/blog/2008/07/24/twitter-treat/&quot;&gt;cute Twitter bird vector from DarkMotion.com&lt;/a&gt; as the background for this element. If you are viewing this post in IE, Chrome on a small resolution, and probably Opera and Safari, the bird is probably sitting obnoxiously below the recent post bar, getting in the way of content.&lt;/p&gt;
&lt;p&gt;This little bird has given me so much grief in the design of this site, that I&amp;#8217;ve thrown my hands up in despair and given up. The reason it&amp;#8217;s plagued me so is the way 960gs automatically floats everything for it&amp;#8217;s grid system. If you want to work outside the grid system, even a little bit, the framework makes you pay with blood.&lt;/p&gt;
&lt;p&gt;I love the bird, I love showing my most recent tweet. I will not remove it. However, I can&amp;#8217;t claim to be a serious developer, whilst still allowing obvious display bugs on the site, and I can&amp;#8217;t bring myself to use a third-party theme to represent my personal blog. It just seems wrong.&lt;/p&gt;
&lt;p&gt;In Joren&amp;#8217;s post, there is an excellent comment defending frameworks, which makes mention that Joren&amp;#8217;s blog has a 3 pixel difference in margins of the content, between the header and the footer. While I acknowledge that this wasn&amp;#8217;t the author&amp;#8217;s main point, it brings up something that I&amp;#8217;ve never understood in web design, and the mentality of many web designers, both new to design and coming from print design.&lt;/p&gt;
&lt;p&gt;A web page is a fluid medium. Web designers advocate abandoning the pixel for the em, citing greater flexibility and fluidity. So, at some level, they recognise this. However, people still insist on making designs that rely on pixel perfect precision positioning across all major browser vendors, which is where the need for &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; frameworks and reset stylesheets come from.&lt;/p&gt;
&lt;p&gt;Web browsers are products competing in a market, and they have different ways of rendering &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt;, and they have their own unique quirks. We know this, as well. Beyond glaring &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; interpretation bugs and discrepancies in box models, they have unique margins and padding on elements, and sometimes these only differ by a few pixels.&lt;/p&gt;
&lt;p&gt;Why is this a problem?&lt;/p&gt;
&lt;p&gt;Why do these people feel the need to contort &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt;, torture it into burying these differences, into displaying  the same across each browser. There are far too many permutations of resolution and browser, not to mention whether or not someone has their browser full screened (I don&amp;#8217;t) to try to enforce this pixel perfect design. &lt;/p&gt;
&lt;p&gt;Embrace the differences. Embrace the fact that your margins may not look identical. Recognise that at the design stage, and design your sites to compensate for this. Don&amp;#8217;t split images into different elements if they&amp;#8217;re intended to fit together seamlessly. Find another way. Don&amp;#8217;t stress if the margin between your content and your header is 3 pixels bigger on IE than it is in Firefox. As long as the general communication goals of your design work across all browsers, and it doesn&amp;#8217;t look like a train wreck, be happy.&lt;/p&gt;
&lt;p&gt;I know all of this is easier said than done. I&amp;#8217;m a server side programmer, not a &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; guru or a designer. However, I think it&amp;#8217;s a worthy to keep in mind while designing. Don&amp;#8217;t fight the diversity, embrace it.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>C# Interface Method Gotcha When Inheriting</title>
   <link href="http://www.timgittos.com/archives/csharp-interface-method-gotcha-when-inheriting"/>
   <updated>2009-02-02T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/csharp-interface-method-gotcha-when-inheriting</id>
   <content type="html">&lt;p&gt;I noticed some interesting behavior from C# yesterday at work. Truth be told, I&amp;#8217;ve noticed this in the past, but I&amp;#8217;ve only figured out what&amp;#8217;s causing it today.&lt;/p&gt;
&lt;p&gt;The behavior is this: &lt;strong&gt;when you inherit from a class that implements an interface, calling a hidden/overriden method from an object of the inheriting class that has been upcast to the interface will result in a call the the inherited function.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Ok, so that probably made no sense at all, which is why I will explain it, but not before a warning. I&amp;#8217;m not sure if this is intended behavior, and I&amp;#8217;m not sure if this is something I&amp;#8217;m doing wrong. If someone can point me in the direction of an explanation or a correction, I would be very grateful.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/archives/bugs.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;On to the explanation.&lt;/p&gt;
&lt;p&gt;Take a sample, trivial application that has widgets. These widgets just print messages out to the console. We have an interface, &lt;strong&gt;IWidget&lt;/strong&gt;, which forms the contract for all widgets:&lt;br /&gt;
&lt;/notextile&gt;
Next, we have a generic widget class, which we use for most widgets. This is called &lt;strong&gt;GenericWidget&lt;/notextile&gt;&lt;br /&gt;
Next, we have a generic widget class, which we use for most widgets. This is called &lt;strong&gt;GenericWidget&lt;/strong&gt;:&lt;/p&gt;
&lt;/notextile&gt;
And finally, we have a specific type of widget that does something different, called &lt;strong&gt;SpecificWidget&lt;/strong&gt;:

&lt;notextile&gt;&lt;p&gt;Now, we want to run some tests on our widgets, to see what&amp;#8217;s going on. First, we&amp;#8217;ll test the widgets themselves. Running:&lt;/p&gt;
&lt;/notextile&gt;
will output:
&lt;blockquote&gt;Doing something in GenericWidget
Doing something else in GenericWidget

Doing something in SpecificWidget
Doing something else in SpecificWidget &lt;/blockquote&gt;
 Which is exactly what we expected to see. Test has passed.

Next, lets say we have a function that we want to pass widgets to, but we don't know what kind of widgets we will be passing, only that they are widgets. So we pass them as widgets, but upcast them to IWidget, and call the methods on them from the interface. For example:
&lt;notextile&gt;&lt;p&gt;which will give the following output:&lt;br /&gt;
&lt;blockquote&gt;Doing something in GenericWidget&lt;br /&gt;
Doing something else in GenericWidget&lt;/p&gt;
&lt;p&gt;Doing something in GenericWidget&lt;br /&gt;
Doing something else in GenericWidget&lt;/blockquote&gt;&lt;br /&gt;
Wait, that&amp;#8217;s not right. The specificUpcast should call the method on SpecificWidget, shouldn&amp;#8217;t it? At least, that&amp;#8217;s &lt;em&gt;my &lt;/em&gt;expected behavior. Just to prove there&amp;#8217;s not something wrong with our specificUpcast:&lt;br /&gt;
&lt;/notextile&gt;
will yield:
&lt;blockquote&gt;Doing something in SpecificWidget
Doing something else in SpecificWidget &lt;/notextile&gt;&lt;br /&gt;
will yield:&lt;br /&gt;
&lt;blockquote&gt;Doing something in SpecificWidget&lt;br /&gt;
Doing something else in SpecificWidget &lt;/blockquote&gt;&lt;br /&gt;
which is our expected output all along.&lt;/p&gt;
&lt;p&gt;If someone can explain this to me, or point me to a better method to upcast, then please do so. I&amp;#8217;m finding a lot of my code needs to check for specific types in order to call the proper method, and it seems clunky and awkward. I&amp;#8217;m sure I&amp;#8217;m doing something wrong, I&amp;#8217;m just not sure what.&lt;/p&gt;
&lt;p&gt;As usual, you can find the source code here: &lt;a href=&quot;/files/archives/gotcha.zip&quot;&gt;Interface Upcasting Inherited Classes Gotcha&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Using Twitter to Gather Information</title>
   <link href="http://www.timgittos.com/archives/using-twitter-to-gather-information"/>
   <updated>2009-01-30T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/using-twitter-to-gather-information</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.timgittos.com/wp-content/uploads/2009/01/birds.jpg&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/01/birds.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-184&quot; title=&quot;Birds&quot; src=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/01/birds.jpg&quot; alt=&quot;Birds&quot; width=&quot;450&quot; height=&quot;253&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve mentioned briefly the virtues I see in Twitter when I discussed &lt;a title=&quot;Implementing an Idea in 3 hours with Ruby - TimGittos.com&quot; href=&quot;http://www.timgittos.com/3-hours-from-concept-to-implementation-with-ruby&quot;&gt;how to implement a project in 3 hours&lt;/a&gt;. Now I want to expand on how to use Twitter to gather information. I mentioned in that the key to utilising Twitter to gather information was to follow the right kinds of people. However, you&amp;#8217;ll find that when you start following more than 100 people, things get a little hectic.&lt;/p&gt;
&lt;p&gt;Every programmer is more effective with a solid selection of tools, and Twitter is no different. &lt;a title=&quot;Tweetdeck&quot; href=&quot;http://www.tweetdeck.com/beta/&quot;&gt;TweetDeck&lt;/a&gt; is the best Twitter desktop client I&amp;#8217;ve used, and it&amp;#8217;s an &lt;span class=&quot;caps&quot;&gt;AIR&lt;/span&gt; app, so it runs on all major operating systems. Most Twitter clients have a single stream that Tweets come in through, and everything gets lumped together. TweetDeck&amp;#8217;s strongest feature, for the purposes of leveraging Twitter to gather information, is the option of splitting your stream into groups.&lt;/p&gt;
&lt;p&gt;TweetDeck allows you to put people you follow into groups, and have their tweets appear in a different window. The notification alert will also show this segregation. In addition to splitting your followers, you can specify windows that will feed you the results of searches, using the Twitter search operators outlined &lt;a href=&quot;http://search.twitter.com/operators&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The search operators and TweetDeck are the engine of our information gathering machine. Using the search operators you can follow the public stream and cherry pick Tweets that contain information you want. You can look for specific phrases, specific hashtags, tweets after a certain date and tweets with links.&lt;/p&gt;
&lt;p&gt;For example, I use use a search for &amp;#8220;artificial intelligence&amp;#8221; with links to find people who tweet interesting links concerning artificial intelligence, which is a subject I&amp;#8217;m highly interested in. I can run several of these filters in different windows at the same time, and grok the whole public stream. No longer am I restricted to listening only to those that I follow. Of course, that&amp;#8217;s not to say I no longer follow people. If someone pops up multiple times in my filters, I&amp;#8217;ll follow them to be sure not to miss a single tweet from them.&lt;/p&gt;
&lt;p&gt;This method, however, isn&amp;#8217;t flawless. If you look too narrowly, you won&amp;#8217;t find any tweets. Also, when you finally do find tweets, even by trying to pick out key phrases/keywords and links, there will be a significant signal to noise ratio. My search for AI topics often lead to students linking university class websites and time tables, which is something I&amp;#8217;m obviously not interested in. Often people who pop up in searches all the time turn out to have a high noise to signal ratio.&lt;/p&gt;
&lt;p&gt;Having said that, while there are drawbacks, the ability to monitor the public stream as well as the people you follow, and sift out tweets that have a higher likelihood of being relevant is a powerful thing, and will often connect you to bits of information you would have never found otherwise. That&amp;#8217;s the power of Twitter, and that&amp;#8217;s why I love Twitter.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>3 Hours from Concept To Implementation With Ruby</title>
   <link href="http://www.timgittos.com/archives/3-hours-from-concept-to-implementation-with-ruby"/>
   <updated>2009-01-27T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/3-hours-from-concept-to-implementation-with-ruby</id>
   <content type="html">&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/01/ruby.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-186&quot; title=&quot;Ruby&quot; src=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/01/ruby.jpg&quot; alt=&quot;Ruby&quot; width=&quot;450&quot; height=&quot;284&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Although I&amp;#8217;m still relatively new to it, I&amp;#8217;m a big fan of Twitter. However, not for the social media aspects of it. I view Twitter as an excellent method of gathering information, as long as you follow the right kinds of people. By the right kinds of people, I mean people who tweet interesting links they find online. Simply follow people who are interested or involved in the same subjects that you&amp;#8217;re interested in, and they will feed you information over time, in a nice steady flow.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m very much interested in AI, and AI as it applies to games. I am a fee paying member of Alex J. Champandard&amp;#8217;s &lt;a title=&quot;AIGameDev&quot; href=&quot;http://www.aigamedev.com&quot;&gt;AIGameDev&lt;/a&gt; and I follow him on &lt;a href=&quot;http://twitter.com/aigamedev&quot;&gt;Twitter&lt;/a&gt;. While this is great, his flow of information isn&amp;#8217;t fast enough for me. So I set to Twitter to search for people who are interested in AI and game development, when I found the @playwitter account, and the &lt;a title=&quot;Playwitter - following game development on Twitter&quot; href=&quot;http://playwitter.com/&quot;&gt;associated website&lt;/a&gt;. As you can see from the @playwitter tweet, they&amp;#8217;re not yet fully functional. I didn&amp;#8217;t really want to wait, and I didn&amp;#8217;t really want to follow all those people on my own. So I decided to come up with an intermediary solution.&lt;/p&gt;
&lt;p&gt;The concept is a Twitter bot that will read in an &lt;span class=&quot;caps&quot;&gt;RSS&lt;/span&gt; feed and tweet the entries. I decided to use Ruby, as I haven&amp;#8217;t done any significant programming in Ruby before. &lt;a title=&quot;My First Impression of Ruby - timgittos.com&quot; href=&quot;http://www.timgittos.com/first-impressions-of-ruby&quot;&gt;All I knew was the basic syntax&lt;/a&gt; that I read from the &lt;a href=&quot;http://www.amazon.com/gp/product/0974514055?ie=UTF8&amp;amp;tag=gebloftigi-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0974514055&quot;&gt;Pickaxe&lt;/a&gt; book.&lt;/p&gt;
&lt;p&gt;First, I hit Google looking for a Ruby &lt;span class=&quot;caps&quot;&gt;RSS&lt;/span&gt; parser library. Oh! It turns out Ruby has one built into the language. So I read a few websites on how to do that, and it seems pretty straight forward. So I grab the feed over at Playwitter and start pulling it down with my Ruby script. The quick script I wrote in 10 minutes worked like a charm.&lt;/p&gt;
&lt;p&gt;The next part was to tweet the entries. I looked for a Twitter library and settled on the &lt;a title=&quot;Ruby Twitter Gem&quot; href=&quot;http://twitter.rubyforge.org/&quot;&gt;Twitter gem&lt;/a&gt;. I installed the gem, and this took me a while to get it working as a library, but get it working I did. I was able to send tweets from an automated script.&lt;/p&gt;
&lt;p&gt;It took me about half an hour to wire these together and before I knew it, I was done. However, it was fairly crude, and I found out when I tried to deploy it to my server that it wouldn&amp;#8217;t make the grade. I set about refactoring and upgrading the code and trying to get it run. 3 hours later, it was complete, and it was working.&lt;/p&gt;
&lt;p&gt;In the end, I implemented the idea in 3 hours, with the following features:&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
	&lt;li&gt;&lt;span class=&quot;caps&quot;&gt;YAML&lt;/span&gt; config file for defining Twitter account details and &lt;span class=&quot;caps&quot;&gt;RSS&lt;/span&gt; feeds to tweet from.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Timestamp based polling of the &lt;span class=&quot;caps&quot;&gt;RSS&lt;/span&gt; feeds, storing only updates new since the last poll.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Tweeting with added hashtag, defined in the &lt;span class=&quot;caps&quot;&gt;YAML&lt;/span&gt; with the feed&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Deployment as a Ruby Gem&lt;/li&gt;&lt;/p&gt;
&lt;/ul&gt;
&lt;p&gt;Details of the project are the subject of another post, and when that project is a little mature, I will create that post.&lt;/p&gt;
&lt;p&gt;From concept to deployment on a live site, with a basic knowledge of Ruby only, in 3 hours. That&amp;#8217;s a fantastic result that I&amp;#8217;ve never experienced in another language, compiled or not. It was fun, it was fast, and I felt the freedom of &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; with the benefit of a well implemented OO system.&lt;/p&gt;
&lt;p&gt;Man, I love Ruby.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Frameworks Make Reading New Code Hard</title>
   <link href="http://www.timgittos.com/archives/frameworks-make-reading-new-code-hard"/>
   <updated>2009-01-24T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/frameworks-make-reading-new-code-hard</id>
   <content type="html">&lt;p&gt;In an effort to increase my knowledge of both Ruby and Rails, I have been keeping my eyes open for interesting Ruby/Rails apps to peek at the source code of. Whilst looking at @j_stirk&amp;#8217;s &lt;a title=&quot;Jason Stirk's Blog&quot; href=&quot;http://griffin.oobleyboo.com/&quot;&gt;website&lt;/a&gt;, I noticed it was running on &lt;a title=&quot;Radiant CMS - Ruby CMS&quot; href=&quot;http://radiantcms.org/&quot;&gt;Radiant &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;&lt;/a&gt;, a Ruby &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;. So, I grabbed a copy of the source code.&lt;/p&gt;
&lt;p&gt;Whilst I was having a peek at the source, I began to think that I was in a little over my head. I managed to muddle my way through the config/routes.rb file and figure out (with judicious use of Google) what requests were being directed to what controllers. The problems started happening when I hit the controller, and started seeing filters and symbols and statements that I didn&amp;#8217;t know where to go next to find out about.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/01/confused1.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-191&quot; title=&quot;Confusion&quot; src=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/01/confused1.jpg&quot; alt=&quot;Confusion&quot; width=&quot;400&quot; height=&quot;288&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;At first I thought it was to do with the fact that I don&amp;#8217;t really know Ruby. I know enough to recognise it, and muddle through basic syntax, but I don&amp;#8217;t know any tricks, any coding conventions and the nuances of Ruby programming. However, upon reflecting on my dilemma, I realised this isn&amp;#8217;t something that was restricted to Ruby, Rails and Radiant &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;I remember last year looking into &lt;a title=&quot;PHP application framework&quot; href=&quot;http://www.symfony-project.org/&quot;&gt;Symfony&lt;/a&gt;, before deciding that &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; was too god-awful ugly to waste my time on. I recall that too had a fairly high learning curve, and looking through an existing Symfony app, it was very hard to figure out what exactly was going on. There was much &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; browsing.&lt;/p&gt;
&lt;p&gt;A few years ago when I first learnt &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt;, I was in a similar situation. Server tags and user controls and page events and assemblies were all very new and very confusing to this ex-&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; &amp;amp; &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt; 3.0 developer. I stormed through a book on &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; and was thrown head first into a contracting gig before catching my stride again.&lt;/p&gt;
&lt;p&gt;I love frameworks. Ever since I heard about this thing called &amp;#8220;Rails&amp;#8221; a few years back, and realised there were a few similar frameworks written in &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;, I&amp;#8217;ve been in love with frameworks. And I&amp;#8217;ve always learnt them from the ground up, creating my own application. Last night was the first time I&amp;#8217;ve ever tried to learn a framework from an application.&lt;/p&gt;
&lt;p&gt;And it&amp;#8217;s hard.&lt;/p&gt;
&lt;p&gt;While frameworks increase programmer productivity and make maintenance easier for programmers who already are in the know, they make things really hard for a new maintainer who is not familiar with the code to dive in and figure out what&amp;#8217;s going on. Not only do they have to learn the individual nuances of the programmer who wrote the application, they also have to figure out how the framework works.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Reconciling YAGNI With Reversibility</title>
   <link href="http://www.timgittos.com/archives/reconciling-yagni-with-reversibility"/>
   <updated>2009-01-21T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/reconciling-yagni-with-reversibility</id>
   <content type="html">&lt;p&gt;Yesterday I started reading Andrew Hunt&amp;#8217;s &lt;a href=&quot;http://www.amazon.com/gp/product/020161622X?ie=UTF8&amp;amp;tag=gebloftigi-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=020161622X&quot;&gt;The Pragmatic Programmer&lt;/a&gt;&lt;img style=&quot;border:none !important; margin:0px !important;&quot; src=&quot;http://www.assoc-amazon.com/e/ir?t=gebloftigi-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=020161622X&quot; border=&quot;0&quot; alt=&quot;&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;, which has been sitting around waiting to be read for at least several months. Every programmer I talk to says that it&amp;#8217;s a book that will really stimulate growth as a programmer, and I certainly need to grow.&lt;/p&gt;
&lt;p&gt;Already several of the things the author has said have rung true, and I can see many of the scenarios he&amp;#8217;s described as having happened, or nearly happened, in a few of the projects I myself has been involved with. Which is exactly what has piqued this post.&lt;/p&gt;
&lt;p&gt;Hunt outlines the need for what he calls &lt;strong&gt;reversibility&lt;/strong&gt;. He states that there are critical decisions to be made in each project, and each of these involves a commitment that often isn&amp;#8217;t easily changed, such as committing to a type of database, or committing to a design pattern.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/01/cat.jpg&quot;&gt;&lt;img class=&quot;aligncenter size-full wp-image-193&quot; title=&quot;Cat in a Box&quot; src=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/01/cat.jpg&quot; alt=&quot;Cat in a Box&quot; width=&quot;375&quot; height=&quot;250&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;He goes on to describe the need for a Schrödinger&amp;#8217;s Cat approach to software design. The basis is the &lt;a title=&quot;Schrödinger's Cat - Wikipedia&quot; href=&quot;http://en.wikipedia.org/wiki/Schrödinger's_cat&quot;&gt;Schrödinger&amp;#8217;s Cat&lt;/a&gt; theory which illustrates quantum superposition &amp;#8211; where at the point of a decision, multiple dimensions spawn off and you don&amp;#8217;t know which dimension you&amp;#8217;re in until the decision is observed.&lt;/p&gt;
&lt;p&gt;Hunt argues that we should design code to be flexible enough to allow as many of the &amp;#8220;possible dimensions&amp;#8221; as possible. What he means by this is to allow for these critical decisions to be changed, with minimal impact on the code, hence the term &lt;strong&gt;reversibility&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;To do this, we should code for possibilities. We should always keep in mind what might happen, and design our software so that we can accommodate the change. This flies directly into the face of another principle of programming, &lt;a title=&quot;You Ain't Gonna Need It - Wikipedia&quot; href=&quot;http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It&quot;&gt;You Ain&amp;#8217;t Gonna Need It (&lt;span class=&quot;caps&quot;&gt;YAGNI&lt;/span&gt;)&lt;/a&gt;, and the general belief that the more code you write, the more opportunity there is to introduce bugs in code (something Hunt himself mentions).&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;YAGNI&lt;/span&gt; outlines that you shouldn&amp;#8217;t write code you don&amp;#8217;t need, and cites several reasons why, and coupled along with the idea of writing less code is better, this is something I believe. However Hunt&amp;#8217;s Reversibility idea is in almost direct opposition &amp;#8211; he advocates writing code &amp;#8220;just in case.&amp;#8221;&lt;/p&gt;
&lt;p&gt;Can these two ideas be reconciled?&lt;/p&gt;
&lt;p&gt;I believe they can, and it&amp;#8217;s an approach I&amp;#8217;ve used in the past. I&amp;#8217;ve found that it&amp;#8217;s possible to quickly and safely recognise that there is the possibility of a change by writing interfaces and method stubs for new functionality, and have them throw not-implemented exceptions.&lt;/p&gt;
&lt;p&gt;This way, you acknowledge that a decision might be changed and have already got the application hooks to hook into it, but you haven&amp;#8217;t wasted time implementing something that may not come to pass. Your software will build, and at the existing functionality won&amp;#8217;t be broken while you wait to implement these new changes.&lt;/p&gt;
&lt;p&gt;This seems like a trivial thing to do, however it can really streamline the process in my experience.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>AI Application Programming - Book Review</title>
   <link href="http://www.timgittos.com/archives/ai-application-programming-book-review"/>
   <updated>2009-01-18T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/ai-application-programming-book-review</id>
   <content type="html">&lt;p&gt;I&amp;#8217;m spending a lot of my time lately reading about AI, both game related, business application related and academia related. Having recently completed &amp;#8220;&lt;em&gt;AI Application Programming&lt;/em&gt;&amp;#8221; by M. Tim Jones (Charles River Media, 2003, First Edition), I have decided to review it in the context of my current situation.&lt;/p&gt;
&lt;p&gt;I am new to the field of AI, and my previous reading has been limited to sporadic Wikipedia research on concepts as I come across them. This book covers a lot of material that I haven&amp;#8217;t read about before, but it also covers some material I have. This allows me to evaluate the book as both someone with prior knowledge, and someone with no knowledge.&lt;/p&gt;
&lt;p&gt;Firstly, the book was a fairly broad overview on integrating aspects of artificial intelligence into application development. Therefore it was no surprise that a majority of the AI concepts discussed were optimization oriented. The book provided an overview of the history of AI, then it covered simulated annealing, adaptive resonance theory, ant algorithms/ant colony optimization, neural networks, genetic algorithms, a chapter on using some of the techniques described to run artificial life simulations, rules based systems, fuzzy logic, bigrams/Markov chains, agent based software and a wrap up the future of AI.&lt;/p&gt;
&lt;p&gt;Each chapter is fairly formulaic. It starts with an overview of the theory of the subject for that chapter, and the presentation of any relevant formula. Then a basic example is covered, without code, in order to show how the theory being covered can be applied. Then a specific example with C source is covered, with a detailed explanation of what&amp;#8217;s going on. I largely glossed over the source, as I don&amp;#8217;t really have much familiarity with C, so cannot comment on the quality of the source.&lt;/p&gt;
&lt;p&gt;Overall I have mixed feelings about the book. A lot of the topics have domain specific language, such as referring to parts of algorithms as genes and candidate algorithms as chromosomes in genetic algorithms, and I feel the author sticks to these to the detriment of comprehension of the topic. For example, the author was discussing &amp;#8220;energy&amp;#8221; and &amp;#8220;temperature&amp;#8221; with relation to simulated annealing, without outlining that it&amp;#8217;s goal was to narrow the search space for a solution to a  given problem.&lt;/p&gt;
&lt;p&gt;Another detracting factor was the numerous errors in diagrams, equations and the text. These errors can be attributed to a variety of sources, from poor copying jobs on some of the diagrams to bad editing. One particularly annoying error was the diagram showing how a &lt;span class=&quot;caps&quot;&gt;NOT&lt;/span&gt; logic gate could be constructed using a single neuron neural network &amp;#8211; the diagram showed an input bias of 1, with a weight of 1 on the input, claiming that the output will always be the inverse of the input, by the equation &lt;em&gt;output = input * input weight + bias&lt;/em&gt;.&lt;br /&gt;
An input of 0 into this equation will indeed output a 1, however an input 1 will yield 2, which is incorrect. The correct diagram should have a input weight of -1, which will yield a correct answer with both the 0 and 1 inputs. These errors hindered the understanding of the topic.&lt;/p&gt;
&lt;p&gt;However, it&amp;#8217;s not all bad news. From my personal reading, I had always struggled with how the back propagation algorithm in neural networks worked, and this book managed to successfully explain it. A lot of the other topics, such as fuzzy logic and the rules based system were also well presented and relatively straight forward.&lt;/p&gt;
&lt;p&gt;From reading this book, I feel I have a solid enough understanding of the basics of the topics covered that I could successfully go out and perform my own, more in depth research and succeed fairly well, as well as integrate a few of the more rudimentary features of these approaches into an application.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>How To Run Your Own Webserver</title>
   <link href="http://www.timgittos.com/archives/how-to-run-your-own-webserver"/>
   <updated>2009-01-14T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/how-to-run-your-own-webserver</id>
   <content type="html">&lt;p&gt;For some time, I&amp;#8217;ve run my own web server from the comfort of my own home. I made this decision due to the fact that I wanted more control over my server, and I wanted to run as many web development languages side by side as I could, and mainly because I wanted to run &lt;span class=&quot;caps&quot;&gt;SVN&lt;/span&gt;. Before I started hosting my own websites, I had a sketchy knowledge of how the &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; works, and how to go about hosting your own websites on a Linux operating system. I also had minimal Linux administration skills.&lt;/p&gt;
&lt;p&gt;There are a few good reasons for hosting your own website:&lt;br /&gt;
&lt;ol&gt;&lt;br /&gt;
	&lt;li&gt;No artificial caps on bandwidth and hard disk usage. You pay for what you use, and if you need more, you buy more.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Total control over your hosting environment. If you want a language installed, install it. If you want to run a certain version of Rails, run it. It&amp;#8217;s your server.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Experience. Hosting your own websites on your own server can give you a lot of experience with systems administration on a server operating system.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Cost. You have complete control over how much everything costs, and you know exactly where your money is going. You can spend as much or as little as you wanted.&lt;/li&gt;&lt;/p&gt;
&lt;/ol&gt;
&lt;h3&gt;How Do You Do It?&lt;/h3&gt;
&lt;p&gt;First, it helps to get an idea of what you really want. Do you want to run a huge corporate intranet with load balancing and proxy servers, or do you just want a small server to host personal sites and tinker? Is your budget limitless, or are you already living on ramen for dinner 5 nights a week? Do you want to host proprietary languages like Cold Fusion or &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt;, or will a Linux/Apache install satisfy you?&lt;/p&gt;
&lt;p&gt;Personally, I was only interested in hosting personal sites, and doing it cheaply was my utmost concern. This is what I will focus on, as this is what I have experience in. So, what I was looking for was a relatively easy solution that was above all cheap.&lt;br /&gt;
&lt;h3&gt;1. Get Your Hardware&lt;/h3&gt;&lt;br /&gt;
Before you can start, you need to have hardware to put your server on, and if you already don&amp;#8217;t have it, appropriate networking gear to support multiple computers accessing the same internet connection (if you want to use a personal computer as well).&lt;/p&gt;
&lt;p&gt;As your end goal is a web server, this server preferably needs to be up 24/7, which means whatever hardware you choose to run it on will essentially cease to exist with regards to usage. Most of the time, hopefully, you&amp;#8217;ll never need to do much work on the server itself, only transferring data to and from it.&lt;/p&gt;
&lt;p&gt;I already had my networking gear, and I commandeered an old desktop computer for my server. It was a Pentium IV 3.0GHz with 2GB of &lt;span class=&quot;caps&quot;&gt;RAM&lt;/span&gt;. I found in the year or so I ran the server that my memory usage didn&amp;#8217;t ever go above ~400mb. I also had a 120GB hard disk in there. This computer used to serve as my old gaming workstation, however I don&amp;#8217;t play games much these days, and I bought a laptop that was more powerful.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cost: &lt;/strong&gt;Free&lt;br /&gt;
&lt;h3&gt;2. Get Your Software&lt;/h3&gt;&lt;br /&gt;
I chose to run CentOS 5 as my Linux distribution. My choice was admittedly relatively arbitrary, however I was relatively happy with the choice. I installed the OS and included only the packages that I knew I needed &amp;#8211; that meant no xserver, and no &lt;span class=&quot;caps&quot;&gt;GUI&lt;/span&gt;. I was going to administrate this server via ssh on my laptop. I then updated the OS and installed all the required software.&lt;/p&gt;
&lt;p&gt;I immediately recognised that it would be hard to individually install and hook up everything that I wanted to run, and decided to run a web-server software package to help. I eventually settled on Webmin after a few false starts, and Webmin proved to be very user friendly and relatively powerful. If I was doing the same thing again, I would be relatively comfortable doing it all individually without Webmin, but it was Webmin that provided me with a safety net while learning.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cost: &lt;/strong&gt;Free&lt;br /&gt;
&lt;h3&gt;3. Get Connected&lt;/h3&gt;&lt;br /&gt;
I was already running the biggest Internet providing plan that my &lt;span class=&quot;caps&quot;&gt;ISP&lt;/span&gt; offered. As I live in Australia, we have to live with usage caps on our Internet plans. Mine was 20GB download during peak traffic, 40GB download during off-peak, and unmetered upload. This was perfect for hosting a server, as most of my traffic was upload, once I got everything installed.&lt;/p&gt;
&lt;p&gt;However, you do need more than just an Internet connection to get a server online, you also need a static IP address. Technically you can do it with a dynamic IP and a dynamic &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; service, however that was a level of complexity I didn&amp;#8217;t have the patience to deal with. So I put a static IP on my account as well.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cost: &lt;/strong&gt;$10/month for the static IP, Internet was free because I was using the connection anyway&lt;br /&gt;
&lt;h3&gt;4. Get Hosted&lt;/h3&gt;&lt;br /&gt;
This is the final step to getting your server ready to host websites. So far, you have a server with the software installed, and you have an Internet connection and a static IP. You can type your static IP in a browser and get your Webmin&amp;#8217;s default landing page (if your router supports &lt;span class=&quot;caps&quot;&gt;NAT&lt;/span&gt;  loopback, which mine didn&amp;#8217;t). To get your web server attached to a domain name, you first must register the domain name, then point it to nameservers that run a &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; server. &lt;/p&gt;
&lt;p&gt;You could run the &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; server on the same machine, or a different machine, but that was all too complicated for me. I instead chose to get a hosted &lt;span class=&quot;caps&quot;&gt;DNS&lt;/span&gt; solution with Nettica, and have Nettica manage my name servers. Then it was simply a matter of pointing my domains to the Nettica nameservers, pointing my Nettica entries to my server IP, and add the virtual servers with Webmin, letting it take care of configuring Apache for named virtual hosting.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cost: &lt;/strong&gt;$50/year&lt;/p&gt;
&lt;p&gt;So that&amp;#8217;s it. For about $170/year, I could host my own server and serve as many websites as I had room for on the Internet. I had complete control over the server, and I could install what I wanted, when I wanted.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t run the server now, as I have recently moved to a location where I cannot justify it, but overall I found the experience very rewarding. Sure, you can get cheaper shared hosting, but there&amp;#8217;s nothing like deciding you want to install, say, &lt;span class=&quot;caps&quot;&gt;SVN&lt;/span&gt; and just installing it, and having it up and ready in 10 minutes for no charge.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>PHP Has An Identity Crisis</title>
   <link href="http://www.timgittos.com/archives/php-has-an-identity-crisis"/>
   <updated>2009-01-11T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/php-has-an-identity-crisis</id>
   <content type="html">&lt;p&gt;I have been using &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; for quie a while. I first learnt &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; 4 when I was 18-19, building a dynamic art gallery type site for my drawing attempts. I thought it was wonderful that I could programmatically display new images without having to update the &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; file. I also used &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; for my final year project in university, and by the time I graduated, I was quite proficient in it.&lt;/p&gt;
&lt;p&gt;However, as I slowly got more and more interested in programming, and the principles of programming, I learn more and more languages, and learnt &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; practices that I never applied to &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;, simply because I was self taught, and at the time &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; wasn&amp;#8217;t pushing itself as an &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; language.&lt;/p&gt;
&lt;p&gt;However, times change, and the &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; community tends to push the fact that &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; is an &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; language. Firstly, this isn&amp;#8217;t entirely accurate. &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; is a language that supports &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt;, however it isn&amp;#8217;t an &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; language. There is no string object &amp;#8211; I cannot take a substring of a string by calling a method on the string variable. Instead I must use a global function substr() to do it. That&amp;#8217;s not &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt;, it&amp;#8217;s procedural wrapped in &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;However, &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; does support &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt;. You can define custom classes, you can create objects and you can call methods on that object. In a hostile world full of more &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; languages like Ruby and Python that are gaining traction in the web development world, &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; must push more and more it&amp;#8217;s &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; support. If you talk with serious developers in the world of &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;, they will insist that although &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; is not inherently an &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; language, it&amp;#8217;s close enough.&lt;/p&gt;
&lt;p&gt;Today I found out that from &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; has &lt;a title=&quot;GOO at PHP.net&quot; href=&quot;http://uk3.php.net/manual/en/control-structures.goto.php&quot;&gt;introduced in &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; 5.3 the &lt;span class=&quot;caps&quot;&gt;GOTO&lt;/span&gt; statement&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For those of you who are unaware of the specifics of the &lt;span class=&quot;caps&quot;&gt;GOTO&lt;/span&gt; function, &lt;a href=&quot;http://phpimpact.wordpress.com/2009/01/08/php-spaghetti-alla-bolognese/&quot;&gt;this post&lt;/a&gt;, also the post that I learnt this fact from, outlines it. While experienced programmers know enough to avoid the &lt;span class=&quot;caps&quot;&gt;GOTO&lt;/span&gt; statement, new programmers may not, and &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; can be abused enough already without the &lt;span class=&quot;caps&quot;&gt;GOTO&lt;/span&gt; statement.&lt;/p&gt;
&lt;p&gt;So, what is it &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;? Are you an &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; language, or are you procedural? The &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; community pushes it&amp;#8217;s support for &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt;, and then it introduces a control statement that characterises the worst of procedural code. &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; needs to clarify it&amp;#8217;s future as a language, and decide whether to push itself as an &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; language or as a procedural language.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Encapsulation in Python</title>
   <link href="http://www.timgittos.com/archives/encapsulation-in-python"/>
   <updated>2009-01-03T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/encapsulation-in-python</id>
   <content type="html">&lt;p&gt;Or, &amp;#8220;I see London, I see France, I see Python&amp;#8217;s underpants&amp;#8221;&lt;/p&gt;
&lt;p&gt;I come from a primarily C# background, where I have fairly tight control over how visible my properties and methods are. I can choose to make them private to the class, protected to the class and its children, internal to the assembly or public for everything.&lt;/p&gt;
&lt;p&gt;In my course of learning Python, I&amp;#8217;ve discovered awesome things like docstrings, multiple inheritance and sequence unpacking. However, I&amp;#8217;ve also been shocked and made more than a little uncomfortable by the realisation that Python doesn&amp;#8217;t implement encapsulation. I don&amp;#8217;t trust other people not to abuse access to methods that I&amp;#8217;ve intended to be private &amp;#8211; I&amp;#8217;ve seen too much bad code for that. While I know &lt;a title=&quot;Encapsulation in Python&quot; href=&quot;http://importantshock.wordpress.com/2006/11/03/adventures-in-pythonic-encapsulation/&quot;&gt;there are ways to get around this&lt;/a&gt;, I don&amp;#8217;t feel I should have to perform code gymnastics to implement what I feel is an essential part of an OO language.&lt;/p&gt;
&lt;p&gt;Another thing that makes me cringe a little about Python is the need to pass in the self parameter for all object methods. I realise that this is required to differentiate between an instance method and a class/static method, however I just can&amp;#8217;t shake the idea that it seems a little clunky, even though I know it&amp;#8217;s no different from writing a static at the start of my function definition.&lt;/p&gt;
&lt;p&gt;However, to wrap up the last two weeks, I feel confident in saying that from what I&amp;#8217;ve seen I like Ruby more than I like Python. That&amp;#8217;s not to say these are bad languages; I first learnt web based programming with &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;, and I&amp;#8217;m sure that I&amp;#8217;m going to leave &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; in the dust for one of these two languages. I will also disclose that I did not learn Python 3.0, and haven&amp;#8217;t really looked into it whatsoever, so if 3.0 changes some of the stuff here, forgive me.&lt;/p&gt;
&lt;p&gt;Having said that, I will investigate both languages more, and definitely work in both more. I&amp;#8217;ve found &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; doesn&amp;#8217;t do it for me anymore, I&amp;#8217;ve seen a better side of programming where I don&amp;#8217;t have to live with ugly warts in my languages, and &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; is ugly. Long live Python and Ruby.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Don't Get the Wrong Degree</title>
   <link href="http://www.timgittos.com/archives/dont-get-the-wrong-degree"/>
   <updated>2009-01-03T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/dont-get-the-wrong-degree</id>
   <content type="html">&lt;p&gt;I recently read an &lt;a title=&quot;Relevance of CS degree - Daniel Pratt&quot; href=&quot;http://www.danielgpratt.com/2009/01/confession-i-dont-have-degree.html&quot;&gt;interesting post&lt;/a&gt; that popped up in my feed reeder on Saturday night, on a subject that strikes &lt;a title=&quot;Learning Mathematics - Tim Gittos&quot; href=&quot;http://www.timgittos.com/learning-mathematics&quot;&gt;very close to home&lt;/a&gt;. Obviously I am not in the exact same situation; I have a degree.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;But I have the wrong degree.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Software Engineering degree I studied was very heavy on the management side of software engineering, and light on the actual implementation side of programming. I don&amp;#8217;t know if this is common to SE degrees, however I found this was the case with mine.&lt;/p&gt;
&lt;p&gt;I share Daniel&amp;#8217;s love and thirst for information, and have a very strong drive to learn as much about everything as I can. So, on the surface, the dilemma of not having the right degree seems fairly harmless. Daniel describes the phenomena of &amp;#8220;perception is reality&amp;#8221; &amp;#8211; people perceive that having a degree is better than not having a degree. So I guess I have a head start in that aspect. I have the piece of paper, I don&amp;#8217;t have to deal with these negative perceptions.&lt;/p&gt;
&lt;p&gt;Instead, I had to deal with the mistaken belief that I was more competent than I was.&lt;/p&gt;
&lt;p&gt;I have never worked in a large company. The company I&amp;#8217;m with now is the largest company I&amp;#8217;ve ever been with, and we only have 4 developers, including myself. I&amp;#8217;ve always worked with smaller companies, that either only dabble in programming, or were start-ups. It wasn&amp;#8217;t until I looked at a job posting at a larger company that I realised that I may have made a huge, 3 year long mistake.&lt;/p&gt;
&lt;p&gt;The job posting was your standard outline of positional requirements and expected experience and education, but it also had a puzzle attached. You had to complete the puzzle, in your language of choice, and submit the code along with your resume for consideration. This was in late 2006. I can say now that it was a simple graph problem, finding the minimal spanning tree of any given graph. Back then, however, I thought it was just an odd puzzle.&lt;/p&gt;
&lt;p&gt;I didn&amp;#8217;t know this was a class of problem. I didn&amp;#8217;t know this was rooted in mathematical theory, I didn&amp;#8217;t know there were algorithms for solving this. I charged head first into solving the puzzle blindly. I ended up with a 90% complete solution that came very close to &lt;a title=&quot;Prim's Algorithm - Wikipedia&quot; href=&quot;http://en.wikipedia.org/wiki/Prim%27s_algorithm&quot;&gt;Prim&amp;#8217;s algorithm&lt;/a&gt;. I submitted my crippled solution, and naturally didn&amp;#8217;t get the position. Later, someone pointed out what class of problem it was, and I was off searching for it.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s when it hit me.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s when I found out how little I knew about my craft.&lt;/p&gt;
&lt;p&gt;Since that day, I&amp;#8217;ve regretted every year in that software engineering degree, every year I learnt things that I wasn&amp;#8217;t interested in (management) that I could have spent doing computer science. If I could afford it, and if I could afford the time off, I would go back, start fresh and do a computer science degree. However, the more I learn, the more this desire fades. But there is not a day that I do not strive to fill the gaps in my knowledge myself.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not bashing Software Engineering. I know it was my fault for not properly researching the course material offered, I know that I could have gotten what I missed from another institution. The only reason I know this, however, is because I learnt enough about the industry to know what I was missing, and subsequently, know what I needed. And that&amp;#8217;s not something every potential high school graduate looking to get into programming will know.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s not enough to get a degree &amp;#8211; you have to make sure you get the right degree, from the right place. Unfortunately, that generally takes more experience to judge than you have right out of high-school.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Passing Parameters in Actionscript</title>
   <link href="http://www.timgittos.com/archives/passing-parameters-in-actionscript"/>
   <updated>2008-12-28T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/passing-parameters-in-actionscript</id>
   <content type="html">&lt;p&gt;While in the process of trying to learn Python, I decided it would be a good idea to attempt to learn some AI and AI related concepts at the same time using the PyGame framework, as advised by &lt;a title=&quot;Getting Started in AI - AIGameDev&quot; href=&quot;http://aigamedev.com/questions/starting-programming&quot;&gt;AIGameDev&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For a while, I&amp;#8217;ve had this really nice &lt;a title=&quot;Steering Behaviors for Autonomous Characters&quot; href=&quot;http://www.red3d.com/cwr/steer/&quot;&gt;steering demo/white paper&lt;/a&gt; in my &lt;a title=&quot;My Delicious bookmarks&quot; href=&quot;http://www.delicious.com/summaro&quot;&gt;Delicious&lt;/a&gt; account, something that I&amp;#8217;ve meant to try implementing myself. Because this was entirely new territory, and I know my physics/math isn&amp;#8217;t up to scratch, I decided to try to implement some of the behaviors outlined in the previous paper in Actionscript 3.0 first, then when I got the hang of it, port it to Python.&lt;/p&gt;
&lt;p&gt;After about 8 hours or so, I had finally puzzled out the seek/flee behavior, and tried to put together a demo as in the above page, when I hit a strange bug. If I put the seek behavior vehicle on the stage on it&amp;#8217;s own, it performed correctly. If I placed the flee behavior vehicle on the stage on it&amp;#8217;s own, it performed correctly. If I had both on the stage at once, they freaked out and opposed one another, and the two vehicles often got caught in a state of equilibrium, their velocities canceling each other out.&lt;/p&gt;
&lt;p&gt;It seemed as if my little vehicle views were sharing the same vehicle model, and the two different behaviors were acting on the same vehicle model. Which didn&amp;#8217;t make any sense, considering they were two separate instances of the same class.&lt;/p&gt;
&lt;p&gt;After a lot of bug testing and fiddling around, I finally realise I had been caught by the way Actionscript passes parameters into functions/constructors: &lt;strong&gt;unless you&amp;#8217;re passing a primitive data type, Actionscript passes by reference&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I was instantiating my vehicles with the same velocity and starting position, and I was using arrays to pass in this information into the constructors, little knowing that the actual array each class &lt;em&gt;was manipulating was the same array&lt;/em&gt;.&lt;br /&gt;
You can easily bypass this by importing&lt;br /&gt;
&lt;pre&gt;mx.utils.ObjectUtil&lt;/pre&gt;&lt;br /&gt;
and using the&lt;br /&gt;
&lt;pre&gt;ObjectUtil.copy&lt;/pre&gt;&lt;br /&gt;
method (remembering to cast it back to your desired data type, in my case an array).&lt;br /&gt;
So, if you find your instances seem to be sharing private variables they shouldn&amp;#8217;t be, check your parameters and make sure you&amp;#8217;re not passing things by reference to multiple instances and manipulating them.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ruby Wrap Up</title>
   <link href="http://www.timgittos.com/archives/ruby-wrap-up"/>
   <updated>2008-12-25T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/ruby-wrap-up</id>
   <content type="html">&lt;p&gt;Today marks the last day of my Ruby portion of my Ruby/Python Bootcamp. Unfortunately with the Christmas and related Christmas stresses, and an impending move, I didn&amp;#8217;t get to spend a lot of time with the language, beyond the fundamentals.&lt;/p&gt;
&lt;p&gt;I did a dumb thing, and started to try to get a website up and going on Rails 2.2. Rails is a great framework, although I&amp;#8217;ve found the learning curve beyond your basic scaffolding and &lt;span class=&quot;caps&quot;&gt;MVC&lt;/span&gt; set up to be fairly high. I made extensive use of&lt;a title=&quot;Rails 2.2 API Dictionary&quot; href=&quot;http://www.railsbrain.com/api/rails-2.2.2/doc/index.html&quot;&gt; this Rails &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; guide&lt;/a&gt; and it certainly helped a lot, as did &lt;a title=&quot;Ruby on Rails Guides portal&quot; href=&quot;http://guides.rubyonrails.org/&quot;&gt;the Ruby on Rails guides portal&lt;/a&gt;. The reason this was as dumb idea had nothing to do with Rails or Ruby, and everything to do with the fact &lt;a title=&quot;Why I don't like making websites - timgittos.com&quot; href=&quot;http://www.timgittos.com/wordpress-or-roll-your-own&quot;&gt;I hate making websites&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Seriously, I&amp;#8217;m on holiday. I should be staying away from websites for a while.&lt;/p&gt;
&lt;p&gt;So, I didn&amp;#8217;t end up doing much on the website I promised I&amp;#8217;d show, and there&amp;#8217;s not really anything to show, yet. I did manage to set up an excellent workflow with &lt;span class=&quot;caps&quot;&gt;SVN&lt;/span&gt; and my web-host, which will eliminate the need for an &lt;span class=&quot;caps&quot;&gt;FTP&lt;/span&gt; client, and Ruby did help me complete my partial understanding of RESTful design.&lt;/p&gt;
&lt;p&gt;So, I walk away after a week of Ruby with a rudimentary knowledge of Ruby syntax, which is enough to let me read Ruby code and fill in the gaps myself, a stronger knowledge of RESTful design and a much smarter development workflow.&lt;/p&gt;
&lt;p&gt;Thanks, Ruby.&lt;/p&gt;
&lt;p&gt;So, tomorrow, or tonight, I&amp;#8217;ll kick off Python, and I&amp;#8217;ll also see if I can&amp;#8217;t use it while investigating a few other programming related interests, like OpenGL programming or some AI stuff, if I can figure it out. Hopefully I&amp;#8217;ll be able to get as much out of Python as I got out of Ruby.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>First Impressions Of Ruby</title>
   <link href="http://www.timgittos.com/archives/first-impressions-of-ruby"/>
   <updated>2008-12-20T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/first-impressions-of-ruby</id>
   <content type="html">&lt;p&gt;I like it.&lt;/p&gt;
&lt;p&gt;A lot.&lt;/p&gt;
&lt;p&gt;But I always knew I would. I&amp;#8217;m so far impressed with how much effort Ruby goes to at making itself understood at a casual glance, and just how easy it is to write self documenting code. Writing code that&amp;#8217;s free of braces and parenthesis is refreshing, and it&amp;#8217;s nice to know the safety blanket is there (with regards to parenthesis for functions, conditional statements, etc) is there if I need it.&lt;/p&gt;
&lt;p&gt;I started last night by flicking through &lt;a title=&quot;Why's (Poingant) Guide to Ruby&quot; href=&quot;http://poignantguide.net/ruby/&quot;&gt;Why&amp;#8217;s (Poignant) Guide&lt;/a&gt;, and found it pretty good for the basics. I quickly picked up the general concepts and basic syntax fast, and Why&amp;#8217;s Guide was pretty whimsical and kept things interesting. However I quickly bored of the absurdity in chapter 5 where the majority of its content is fluff.&lt;/p&gt;
&lt;p&gt;I tried switching to &lt;a title=&quot;The Book of Ruby&quot; href=&quot;http://www.sapphiresteel.com/The-Book-Of-Ruby&quot;&gt;SaphireSteel&amp;#8217;s The Book of Ruby&lt;/a&gt;, however right at the start when the author stated:&lt;br /&gt;
&lt;blockquote&gt;if (subtotal &amp;lt; 0.0) then subtotal = 0.0 end&lt;/p&gt;
&lt;p&gt;Putting everything on one line like this adds nothing to the clarity of the code, which is why I prefer to avoid it&lt;/blockquote&gt;&lt;br /&gt;
I knew that this book would not help me. I already know many languages that require simple statements like that to be spread over multiple lines. I want a language to do this:&lt;/p&gt;
&lt;p&gt;[code language=&amp;#8220;ruby&amp;#8221;]subtotal = 0.0 if subtotal &amp;lt; 0.0[/code]&lt;/p&gt;
&lt;p&gt;Hi, Ruby.&lt;/p&gt;
&lt;p&gt;Then I browsed over to &lt;a title=&quot;Ruby in 20 Minutes&quot; href=&quot;http://www.ruby-lang.org/en/documentation/quickstart/&quot;&gt;Ruby in 20 Minutes&lt;/a&gt; and quickly flicked through the pages, and it concreted my knowledge. I like iterators, I like respond_to?, I like how everything seems to make sense. I also am pleased to see how many concepts map onto similar things in C#. Modules are like namespaces, but better. attr_accessor is like { get; set;}. attr_reader is like {get; private set;}.&lt;/p&gt;
&lt;p&gt;I feel I&amp;#8217;m ready to go find some code in the wild and attempt to read it. I&amp;#8217;ll also see if I can come up with a post that maps Ruby concepts to C# concepts for other C# programmers interested in Ruby (and with IronRuby, there&amp;#8217;s no reason why you shouldn&amp;#8217;t be).&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ruby &amp; Python Bootcamp</title>
   <link href="http://www.timgittos.com/archives/ruby-python-bootcamp"/>
   <updated>2008-12-19T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/ruby-python-bootcamp</id>
   <content type="html">&lt;p&gt;It&amp;#8217;s common advice in the programming industry to learn one new language every year to stay on top of things. It&amp;#8217;s something I honestly believe in as well. Unfortunately I can&amp;#8217;t say I&amp;#8217;ve learnt a new language this year.&lt;/p&gt;
&lt;p&gt;Last year, I learnt Actionscript 3.0, which is different enough from Actionscript 2.0 to be called a new language. I did this because of work, I did it in December and I had to do it &lt;strong&gt;&lt;em&gt;fast&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;.&lt;/em&gt; That worked pretty well for me. I got thrown in the deep end and had to learn or drown.&lt;/p&gt;
&lt;p&gt;This year, with this being my last day at work for 2 weeks, I&amp;#8217;m going to do the same thing, but I&amp;#8217;m going to make it a little more interesting. I consider myself a reasonably competent programmer, and fairly solid in my knowledge of &lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt; paradigms. I think I can learn a language pretty quick. So, during my holidays, I&amp;#8217;m going to:&lt;br /&gt;
&lt;ol&gt;&lt;br /&gt;
	&lt;li&gt;See how fast I really can learn a language at least to the point where I know what to search for online and can find my own way around reasonably confidently.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;See just how easily various concepts from different languages transfer across syntax&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Build some stuff I&amp;#8217;ve been meaning to build for a while but kept putting off&lt;/li&gt;&lt;/p&gt;
&lt;/ol&gt;
&lt;p&gt;With that in mind, this year I&amp;#8217;m going to learn both &lt;strong&gt;Ruby and Python in 2 weeks&lt;/strong&gt;, dedicating a week to both languages. In the process of learning these languages, I will also build a base for 2 websites for 2 of my domains that I have been meaning to build. I won&amp;#8217;t spend any time designing them, just building the code.&lt;/p&gt;
&lt;p&gt;So, over the next 2 weeks, the majority of posts on here will be reflecting my thoughts on Ruby and Python, and linking to resources that I plan to use in my learning, with a final post being the unveiling of the websites I manage to build.&lt;/p&gt;
&lt;p&gt;Wish me luck!&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Wireframe Your Interfaces First</title>
   <link href="http://www.timgittos.com/archives/wireframe-your-interfaces-first"/>
   <updated>2008-12-17T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/wireframe-your-interfaces-first</id>
   <content type="html">&lt;p&gt;As I&amp;#8217;ve mentioned in &lt;a title=&quot;Compile an .ascx as a .dll - timgittos.com&quot; href=&quot;http://www.timgittos.com/compile-a-user-control-as-a-dll&quot;&gt;a past post&lt;/a&gt;, I&amp;#8217;m doing a rebuild of the &lt;acronym title=&quot;Content Management System&quot;&gt;&lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;&lt;/acronym&gt; here at work and I&amp;#8217;ve reached the point where the internals are done, and now I have to create a user interface for the application.&lt;/p&gt;
&lt;p&gt;Now, in the past I have worked a variety of jobs and in those jobs a variety of roles. One of my jobs saw me as a web developer, like now, but with a difference: I was the &lt;strong&gt;only&lt;/strong&gt; web developer.&lt;/p&gt;
&lt;p&gt;I was responsible for quoting, requirements analysis, planning, design, development, testing, debugging, deployment and maintenance. If there&amp;#8217;s only one thing I learned there, it was that web development is more than &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; and Javascript and a server side language, and a freelance web developer needs to know &lt;em&gt;more&lt;/em&gt; than just programming and design.&lt;/p&gt;
&lt;p&gt;What I really found hard was the design part.&lt;/p&gt;
&lt;p&gt;That is, until I read somewhere that design is visual communication. Just like any other form of communication, you need to have a point, something to say. However, that point can very easily get lost in the minutiae of designing, of making sure something looks good.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve found that wireframing is essential. You use the wireframe to establish the &lt;em&gt;point&lt;/em&gt; of the page, the information that a page needs to contain, free of it&amp;#8217;s appearance. You use the wireframe to tweak the structure, to experiment with different work flows. When you&amp;#8217;re done, you go over the top and start designing.&lt;/p&gt;
&lt;p&gt;Wireframing has enabled me to quickly build a general structure for a user interface, concentrating on the information and tasks that interface needs to perform.&lt;/p&gt;
&lt;p&gt;I &lt;a title=&quot;Balsamiq - Wireframe and mockup tool&quot; href=&quot;http://www.balsamiq.com/&quot;&gt;wireframe with Balsamiq&lt;/a&gt;, which I&amp;#8217;ve found to be an excellent tool. You can try it out indefinitely on their site, fully functional, and all it costs is pop-up every 5 minutes asking you to buy it. I&amp;#8217;m recommending we buy at least one copy for work, and I recommend you check it out if you want to make effective applications.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Learning Mathematics</title>
   <link href="http://www.timgittos.com/archives/learning-mathematics"/>
   <updated>2008-12-14T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/learning-mathematics</id>
   <content type="html">&lt;p&gt;Although I&amp;#8217;m proud of my education and work experience thus far, the most important thing I have come to realise is where the vast gaps in my education &lt;em&gt;are.&lt;/em&gt; A little too late did I realise that the degree I really wanted was Computer Science, and instead I studied Software Engineering.&lt;/p&gt;
&lt;p&gt;If you need someone to analyse a complex problem and break it down into it&amp;#8217;s components, I can do that. If you need someone to manage a project and make sure your resources are optimised, I&amp;#8217;m your man. &lt;/p&gt;
&lt;p&gt;However, during my degree, we only breifly touched on mathematics and algorithms. If I recall correctly, we covered some basic boolean logic and very basically touched on sets. We didn&amp;#8217;t really get into the nitty gritty stuff that I&amp;#8217;ve seen CompSci graduates talk about.&lt;/p&gt;
&lt;p&gt;However, I&amp;#8217;m not the kind of person who would shrug &amp;#8220;Oh well&amp;#8221; and go about my business &amp;#8211; I&amp;#8217;m taking it upon myself to learn in my own time.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t know how other people learn. Although I&amp;#8217;ve done a little reading into it, I&amp;#8217;m still trying to come to terms with how I learn. While trying to study mathematics, I&amp;#8217;ve realised I have a tendency to explore various elements of a topic in depth &amp;#8211; I tend to dive into the intricacies of a concept, then go back to the shallow level and move on to a new concept.&lt;/p&gt;
&lt;p&gt;However, I&amp;#8217;ve found that this is very difficult to do with mathematics. All of the higher level concepts rely on lower level concepts, and there is much cross referencing. I might be looking into &lt;a title=&quot;Euler's Totient function - Wikipedia&quot; href=&quot;http://http://en.wikipedia.org/wiki/Euler's_totient_function&quot;&gt;Euler&amp;#8217;s Totient function&lt;/a&gt;, which will lead me to the concept of &lt;a title=&quot;Coprimes - Wikipedia&quot; href=&quot;http://en.wikipedia.org/wiki/Coprime&quot;&gt;coprimes&lt;/a&gt;, which will lead me to &lt;a title=&quot;Algebraic Rings - Wikipedia&quot; href=&quot;http://en.wikipedia.org/wiki/Ring_(algebra)&quot;&gt;rings&lt;/a&gt;, which are contrasted to &lt;a title=&quot;Groups - Wikipedia&quot; href=&quot;http://en.wikipedia.org/wiki/Group_(mathematics)&quot;&gt;groups&lt;/a&gt;, which were referenced back in the totient function! What&amp;#8217;s worse is all of these topics, especially the more abstractable rings and groups, extend past the real number systems, which I haven&amp;#8217;t even considered yet.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve found the best way to learn mathematics is to go broad and shallow, pick up the basic concept of all related concepts, then slowly work your way down. It results in a kind of net of understanding that isn&amp;#8217;t complete, but allows a person to easily recognise holes, and more intuitively link concepts together.&lt;/p&gt;
&lt;p&gt;Learning methods and methods of thinking are both subjects that fascinate me, and I&amp;#8217;ll probably have a deeper look into it when I get some time. I think these topics have a vast impact one what kind of knowledge people can learn easily, and can account for people having a &amp;#8220;knack&amp;#8221; for something.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Compile a User Control as a DLL</title>
   <link href="http://www.timgittos.com/archives/compile-a-user-control-as-a-dll"/>
   <updated>2008-12-07T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/compile-a-user-control-as-a-dll</id>
   <content type="html">&lt;p&gt;At work, I&amp;#8217;m redeveloping the old, &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt; 3.0 &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; application and replacing it with a shiny new .&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; 3.5 implementation. The software is designed to be run as a virtual directory from all websites, and thus shares the same from installation to installation.&lt;/p&gt;
&lt;p&gt;The old &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; is a mutant. It started as an &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt; 3.0 application, and then had extra bits made of .&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; 1.0 &amp;amp; .&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; 2.0 tacked on to it, much in the same manner that Frankenstein&amp;#8217;s monster was created. The core &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt; 3.0 application handled the page/news creation and publishing, and served as the interface.&lt;/p&gt;
&lt;p&gt;The additions were mostly in the form of user controls (.ascx files) that were placed in the content for a page that needed one. These user controls took care of things like random image rotators, contact forms, bread crumb menus, etc. Various sites used a various sub-section of a pool of controls.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;modus operandi&lt;/em&gt; with the current system is that each installation has it&amp;#8217;s own collection of controls which are inserted into pages by us on behalf of the client, because it involves putting &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; markup into the content areas.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve decided this isn&amp;#8217;t such a great idea, and as such, I&amp;#8217;m centralising the user controls as a library, seperate from the &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;, so that each site accesses the single pool of controls, and if a client leaves, it will be relatively simple to recompile a new library with the controls they use.&lt;/p&gt;
&lt;p&gt;Anyway, that&amp;#8217;s the back story. Essentially what I need to do is compile a whole load of .ascx files into a dll, and load them into pages. I&amp;#8217;ve spent all morning looking on Google for &lt;a title=&quot;&amp;quot;.net 3.5 compile ascx dll&amp;quot; - Google Search&quot; href=&quot;http://www.google.com.au/search?q=.net+3.5+compile+ascx+.dll&quot;&gt;tips on how to do this&lt;/a&gt;. And frankly the results were less than helpful, however I have a history of &lt;a title=&quot;Twitter status post&quot; href=&quot;http://twitter.com/tgittos/status/1039617602&quot;&gt;not reading documentation&lt;/a&gt; &lt;a title=&quot;Reply Twitter status&quot; href=&quot;http://twitter.com/tgittos/status/1039622067&quot;&gt;properly&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;What I found out you need to do, is to add a &lt;strong&gt;class library&lt;/strong&gt; project to your solution, and add the .ascx file as per normal. However, you need to do several steps to get this working properly:&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
	&lt;li&gt;Go to the properties of your .ascx file and change the &lt;strong&gt;build action&lt;/strong&gt; to &lt;strong&gt;Embedded Resource.&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;From your control declaration on the .ascx file, delete &lt;strong&gt;AutoEventWireup&lt;/strong&gt;. We need to wire these things up ourselves. Personally I cleared it of everything except the language attribute.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;In the old code behind (now unattached class file) for the .ascx, you need to override the &lt;strong&gt;OnLoad&lt;/strong&gt; event handler, and put the following code:&lt;br /&gt;
[sourcecode language=&amp;#8220;csharp&amp;#8221;]&lt;br /&gt;
string content = String.Empty;&lt;br /&gt;
Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), &amp;#8220;example.ascx&amp;#8221;);&lt;br /&gt;
using (StreamReader reader = new StreamReader(stream))&lt;br /&gt;
{&lt;br /&gt;
content = reader.ReadToEnd();&lt;br /&gt;
}&lt;br /&gt;
Control userControl = Page.ParseControl(content);&lt;br /&gt;
this.Controls.Add(control);&lt;br /&gt;
[/sourcecode]&lt;br /&gt;
This source will use reflection to open the currently executing dll (in this case, our .ascx library) and find the content for the .ascx, parse it as a new control and add it to the currently executing context.&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;For every control on the .ascx, in our now orphaned .ascx.cs you need to declare a private/protected variable of the same time, with the same variable name as the ID on the control (for sanity&amp;#8217;s sake). You need to find this control in our newly loaded .ascx and assign a reference:&lt;br /&gt;
[sourcecode language=&amp;#8220;csharp&amp;#8221;]&lt;br /&gt;
labelInAscx = (Label)control.FindControl(&amp;#8220;labelInAscx&amp;#8221;);&lt;br /&gt;
[/sourcecode]&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;The above two steps is exactly what the &lt;strong&gt;AutoWireUp&lt;/strong&gt; attribute on the control declaration does for you. We do it manually because we have to use reflection to extract the content of the ascx file, which is compiled into our dll.&lt;/li&gt;&lt;/p&gt;
&lt;/ul&gt;
&lt;p&gt;After taking these steps, compile your project, and in another project, on a regular aspx page, register the assembly and use as you would any normal .ascx and hopefully the content will render out fine.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.timgittos.com/wordpress/wp-content/uploads/2009/01/compileascxdll.zip&quot;&gt;Compile .ascx as &lt;span class=&quot;caps&quot;&gt;DLL&lt;/span&gt; solution for Visual Studio 2008&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>0.999... = 1 Is Important</title>
   <link href="http://www.timgittos.com/archives/09-1-is-important"/>
   <updated>2008-12-04T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/09-1-is-important</id>
   <content type="html">&lt;p&gt;Before I get into this, I am not a mathematician. I&amp;#8217;m not even an amateur. I&amp;#8217;m just a guy who barely passed high school math 7 years ago, and who is interested in learning more.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s a generally accepted (though not completely) fact that 0.999&amp;#8230; = 1. I&amp;#8217;m not going to go into proofs, however if you need to see for yourself, you can find some at the &lt;a title=&quot;0.999... - Wikipedia&quot; href=&quot;http://en.wikipedia.org/wiki/0.999...&quot;&gt;Wikipedia article for 0.999&amp;#8230;&lt;/a&gt; And I&amp;#8217;m not going to debate or even acknowledge that people disagree, because that&amp;#8217;s not the point of this post.&lt;/p&gt;
&lt;p&gt;The point is, that 0.999&amp;#8230; = 1 is an important concept that demonstrates the abstraction of the numeral from the number. The people who see 0.999&amp;#8230; = 1 and can&amp;#8217;t believe it, I believe, haven&amp;#8217;t adequately realised there is a difference between a number and a numeral.&lt;/p&gt;
&lt;p&gt;A numeral is a symbol that represents a number &amp;#8211; that&amp;#8217;s all it is. It is, of itself, inherently useless. The numeral doesn&amp;#8217;t mean anything without the number. However, a number itself has meaning, no matter what numeral you use to represent it. This is what&amp;#8217;s going on with 0.999&amp;#8230; = 1.&lt;/p&gt;
&lt;p&gt;The reason this distinction is important is one of advancement in mathematics, specifically in algebra and all other relatively abstract fields. When you realise that 1, the numeral, represents the number 1, and 0.999&amp;#8230; the numeral, can &lt;em&gt;also&lt;/em&gt; represent the number 1, you realise that 4/4 is also a valid numeral for the number 1. Then, it&amp;#8217;s just a very small step to understanding that x can represent the number 1, and that in the equation 2x + y = 5, y also represents a number, and we need to find out that number.&lt;/p&gt;
&lt;p&gt;Although the example I gave is trivial, I believe it&amp;#8217;s an important concept to grasp, and it&amp;#8217;s a concept many people don&amp;#8217;t grasp.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Adobe AIR 1.5 Update Framework</title>
   <link href="http://www.timgittos.com/archives/adobe-air-15-update-framework"/>
   <updated>2008-12-03T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/adobe-air-15-update-framework</id>
   <content type="html">&lt;p&gt;Lately I&amp;#8217;ve been working on a small &lt;a title=&quot;Adobe AIR&quot; href=&quot;http://www.adobe.com/products/air/&quot;&gt;Adobe &lt;span class=&quot;caps&quot;&gt;AIR&lt;/span&gt;&lt;/a&gt; application, and one of the last things I had to do for this application was build in auto-update functionality. So, naturally, I hit the &lt;a title=&quot;Google is wise&quot; href=&quot;http://www.google.com&quot;&gt;all knowing sage&lt;/a&gt; with my question, and found many blog posts referencing the official Adobe &lt;span class=&quot;caps&quot;&gt;AIR&lt;/span&gt; Update Framework, an additional swc library you can download and include in your project.&lt;/p&gt;
&lt;p&gt;Last night I found out that this framework has been rolled into the latest &lt;span class=&quot;caps&quot;&gt;AIR&lt;/span&gt; 1.5 &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt;, so I checked my version and downloaded the update. My experience with the Flex &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt; told me I&amp;#8217;d have to find the &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt; path in Flex Builder and point it to my new &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt; to get the auto-update goodness.&lt;/p&gt;
&lt;p&gt;This, however, was not the case &amp;#8211; there was no variable. So I searched more online for the answers to my question, and finally found &lt;a title=&quot;Adobe AIR - Distributing and Updating Applications&quot; href=&quot;http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff2.html&quot;&gt;some official Adobe documentation&lt;/a&gt;. After a quick browse through, I deemed this useless. I still could not find how to get access to the &lt;code&gt;ApplicationUpdaterUI&lt;/code&gt; class. &lt;/p&gt;
&lt;p&gt;Eventually I re-read that documentation, and a section that I &lt;em&gt;thought&lt;/em&gt; was incorrectly copied from the old update framework download actually held the key.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You still need to copy the swc library to your project&lt;/strong&gt;. &lt;/p&gt;
&lt;p&gt;Only, the &lt;strong&gt;swc is in the &lt;span class=&quot;caps&quot;&gt;AIR&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt; package&lt;/strong&gt;, not available as a separate download. Having copied the library to my project, I then had access to the auto-update goodness, but no thanks to Adobe&amp;#8217;s confusing documentation.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Interconnectivity of Media</title>
   <link href="http://www.timgittos.com/archives/interconnectivity-of-media"/>
   <updated>2008-11-27T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/interconnectivity-of-media</id>
   <content type="html">&lt;p&gt;On the 27th of November, 2008, terrorists attacked Mumbai, India. They hit several places and killed 80 people (at the time of this post), and wounding many more.&lt;/p&gt;
&lt;p&gt;I first heard about this through &lt;span class=&quot;caps&quot;&gt;MSN&lt;/span&gt; via my girlfriend, who sent me a news link. Twitter lit up, several tweets about people&amp;#8217;s reactions to the news, and with one of those tweets, a link to live &lt;span class=&quot;caps&quot;&gt;CNN&lt;/span&gt; footage streaming online direct from Mumbai. A quick look on Google trends showed that the news of the events in India have circled the globe in less than 24 hours.&lt;/p&gt;
&lt;p&gt;I saw this as well during the US Presidential elections, and it was even more intense. Twitter was non-stop tweeting about the various speeches and states, every major international news site had a streaming video and up to date Flash based maps for voting, and Google trends was all about the election and Prop 8. I was watching live footage of Obama&amp;#8217;s and McCain&amp;#8217;s speeches, and footage from Kenya.&lt;/p&gt;
&lt;p&gt;I felt it then, and I feel it now: overwhelming awe.&lt;/p&gt;
&lt;p&gt;The growth of the internet since 1983, away from a purely academic/military network with text only media, to today with streaming video and interactive content, has truly made our world a global community.&lt;/p&gt;
&lt;p&gt;Working day to day on the internet, creating websites to further the individual causes of various people, it&amp;#8217;s easy to lose site of how awesome the internet really is, and how interconnected everything is these days.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s nice to be able to take a step back.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Wordpress Or Roll Your Own</title>
   <link href="http://www.timgittos.com/archives/wordpress-or-roll-your-own"/>
   <updated>2008-11-26T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/wordpress-or-roll-your-own</id>
   <content type="html">&lt;p&gt;Laziness is a good quality for a programmer to have. Code reuse is smart, it&amp;#8217;s fast and efficient, and leads to less bugs (depending on how popular the code you use is).&lt;/p&gt;
&lt;p&gt;I know this.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve known this since university. Do I do it? I&amp;#8217;m starting to, I&amp;#8217;m slowly learning it. This is relevant, because prior to setting up Wordpress on my server, I developed roughly 4 version of my own &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; blogging platform. Two of them were relatively usable though still buggy, and 2 of them never made it past the full execution stack stage.&lt;/p&gt;
&lt;p&gt;Now, when I phrase it like this, it doesn&amp;#8217;t seem so bad, but I was constantly referencing Wordpress admin screen shots and had installs of Wordpress, Joomla and Drupal to pick and choose interface elements and functionality that I liked from these software applications.&lt;/p&gt;
&lt;p&gt;I had planned to start from scratch and slowly build up the featureset of my application to match those of the more popular open source applications. And to get experience I planned to use these applications&amp;#8230; but only in a sandbox, which was not publicly accessible.&lt;/p&gt;
&lt;p&gt;At the same time as trying to develop, in my own time, my own blogging/&lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; solution, I&amp;#8217;m upgrading the &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; we use at work. This upgrade is a complete rewrite, migrating the funcitonality from &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt; Classic to &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt;. This involves designing and developing, on my own, a fully functioning &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; system with support for page editing and a news section.&lt;/p&gt;
&lt;p&gt;So I was spending all time at work during the day creating an &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt;, then coming home at the end of the day to fire up Zend Studio and do &lt;em&gt;the exact same thing&lt;/em&gt; in &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;. I was reluctant to program, and the application was stalling, and I wasn&amp;#8217;t blogging.&lt;/p&gt;
&lt;p&gt;And the worst, I wasn&amp;#8217;t aware of &lt;em&gt;why&lt;/em&gt; I was stalling, and why I didn&amp;#8217;t want to work on it. I would spend my time at home goofing off, watching movies and chatting to friends. At least I had the intelligence to sit down and design a theme for my blog, once the code was finished. But I still wasn&amp;#8217;t developing the blog engine, and the whole process became this big elephant in the room that I was trying to ignore, blocking the doorway to me finally starting to do something I&amp;#8217;ve been wanting to do for a while.&lt;/p&gt;
&lt;p&gt;I didn&amp;#8217;t realise the lunacy of what I was doing until I stepped back and started programming something else entirely unrelated to both &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; and blogs. Once I had done so I realised a shocking truth: &lt;strong&gt;I don&amp;#8217;t even like programming websites.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;At least, not in my own time.&lt;/p&gt;
&lt;p&gt;Programming blog engines and CMSes isn&amp;#8217;t something I want to spend all my time doing. I want to work on other projects, push the boundaries of my own knowledge &amp;#8211; but the blog/&lt;span class=&quot;caps&quot;&gt;CMS&lt;/span&gt; thing is a rut that I&amp;#8217;ve fallen into. Been there, done that, I know the problem well and I know the solution well.&lt;/p&gt;
&lt;p&gt;So, something to take away from my experience is this:&lt;/p&gt;
&lt;p&gt;Unless your business/hobby/passion is writing blog engines, just use an off the shelf one. Your time is better spent &lt;em&gt;actually&lt;/em&gt; blogging than writing a blog engine. You learn more, it&amp;#8217;s generally more interesting, and you&amp;#8217;re creating content sooner.&lt;/p&gt;
&lt;p&gt;And isn&amp;#8217;t content what it&amp;#8217;s all about in the end?&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Why Blog?</title>
   <link href="http://www.timgittos.com/archives/why-blog"/>
   <updated>2008-11-25T00:00:00-08:00</updated>
   <id>http://www.timgittos.com/archives/why-blog</id>
   <content type="html">&lt;p&gt;Or to put it another way, why you should care about this blog.&lt;/p&gt;
&lt;p&gt;Just in setting this blog up, I&amp;#8217;ve learnt many things, many things that I can share with people. Is this why I&amp;#8217;m choosing to blog? Partially. But the really compelling reason is learning.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve often heard it said that if you want to learn more about something, teach it. Through experiences on online forums, helping people with code, I find that this is a true statement. However, teaching in a classroom is beyond me &amp;#8211; both in terms of time and in terms of relative skill levels. So I&amp;#8217;m turning to the internet, a blog, to write about and share my experiences. Not because I think I&amp;#8217;m qualified to teach &lt;em&gt;anyone, &lt;/em&gt;but because I&amp;#8217;m not.&lt;/p&gt;
&lt;p&gt;So, we come back to the question, &amp;#8220;who is this guy, and why should I listen to him?&amp;#8221;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m a 24 year old developer currently living in Perth, Western Australia. I have a Bachelor of Science (Software Engineering) that I obtained from the Edith Cowan University. I have been working in the field of programming since late 2005. I have worked as a debugger/maintenance programmer for a desktop application for a now gone Perth startup, I have worked as a one-stop web development shop for a small company that also doesn&amp;#8217;t exist, and am currently a backend developer for a web development company.&lt;/p&gt;
&lt;p&gt;But none of that is important.&lt;/p&gt;
&lt;p&gt;I have worked in Actionscript 2.0, Director Lingo, &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt; 3.0, &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;, &lt;span class=&quot;caps&quot;&gt;ASP&lt;/span&gt;.&lt;span class=&quot;caps&quot;&gt;NET&lt;/span&gt; (C#) and Actionscript 3.0, all in major projects. I have worked extensively with MySQL, PostgreSQL and &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; Server. I have developed both desktop applications and web applications, as well as web services and desktop Windows services. I am familiar with Windows OSes, OS X and Linux based systems. I can adequately administrate both &lt;span class=&quot;caps&quot;&gt;IIS&lt;/span&gt; and Apache servers.&lt;/p&gt;
&lt;p&gt;None of that is important either.&lt;/p&gt;
&lt;p&gt;What &lt;strong&gt;is&lt;/strong&gt; important is that I have made mistakes. A lot of mistakes. About 10 years worth of mistakes. From those mistakes, I have learnt a lot, and I have clear goals in life.&lt;br /&gt;
I have made lifestyle mistakes, scholastic mistakes, career mistakes and mistakes in programming. I have tanked a couple of large projects, and have sabotaged my own efforts at starting and maintaining a small business.&lt;/p&gt;
&lt;p&gt;From these mistakes comes a passion for correcting what I can &amp;#8211; and to do that, I have to learn. I have to upgrade my skills, I have to grow as a person. I intend to do that by writing about them. Both to sort my own thoughts out, and to recieve feedback and learn from that feedback.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s why you should listen to me. And tell me when I&amp;#8217;m wrong, and tell me when I&amp;#8217;m being stupid and tell me when I am getting it right.&lt;/p&gt;
&lt;p&gt;I want to learn everything I can, and while learning, hopefully give something back.&lt;/p&gt;</content>
 </entry>
 
 
</feed>