<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2817592795075516705</id><updated>2012-02-27T04:39:26.907-08:00</updated><category term='Facebook Connect'/><category term='scheme'/><category term='sicp'/><category term='lisp'/><category term='Ouray'/><category term='python'/><category term='study group'/><category term='LaTeX'/><title type='text'>mebassett programming</title><subtitle type='html'>&lt;a href="http://mebassett.blogspot.com"&gt;maths blog&lt;/a&gt; - programming blog - &lt;a href="http://mebassett.gegn.net"&gt;about me&lt;/a&gt; - &lt;a href="http://www.twitter.com/mebassett"&gt;twitter&lt;/a&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-4770897552734775412</id><published>2012-02-08T16:44:00.000-08:00</published><updated>2012-02-08T17:06:15.842-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='sicp'/><title type='text'>Metaclasses, first class objects, and a lesson from SICP.</title><content type='html'>This week my &lt;a href="http://www.uclmaths.org/index.php/Structure_and_Interpretation_of_Computer_Programs_Winter_2012"&gt; SICP Study Group&lt;/a&gt; is looking at functions as first-class objects.  This means, among other things, that functions can be passed as arguments and returned as values of other functions.  A few members of my group feel that the material covered is too theoretical and has little real-world value.  I'm always a bit bemused by this, because I use ideas from SICP nearly every day, especially when it comes to higher-order functions.  So I thought I'd use an example from my day job to show how this section of SICP is particularly useful.  &lt;br /&gt;&lt;br /&gt;Part of my job includes writing data-entry applications so that other team members can interact with my statistical models.  I write these applications in Python, using a library called &lt;a href="http://webpy.org/"&gt;web.py&lt;/a&gt;.  In this library, we can assign to each web request URI a &lt;em&gt;class&lt;/em&gt; to handle it.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;What's a Class?&lt;/h1&gt;&lt;br /&gt;It's something we haven't seen before in our study group!  I don't want to explain it in detail (you can check &lt;a href="http://en.wikipedia.org/wiki/Class_%28computer_programming%29"&gt;Wikipedia&lt;/a&gt;), but I hope it'll suffice to say this:&lt;br /&gt;&lt;br /&gt;A class can be thought of as a way to capture, isolate, and reuse state between a group of functions.  "State" is another concept we haven't seen in my group!  We've only written stateless, functional programs.  "State" here means data that exists independently of the functions, but is sometimes used or modified by the functions to perform its computation (exempli gratia, the balance of a bank account might be state between a group of functions that affect one's bank account).   For instance, say we have a web server handling requests from the internet.  Each request needs to perform a series of computations related to that request, but the data for each request, id est, the &lt;em&gt;state&lt;/em&gt; of the request, should be kept separate from each other.  This is exactly why web.py uses classes for requests.  We can define what data or state our groups of functions need to share, and we can make copies of those groups (called "instances" of the class) that won't interfere with each other's state.  &lt;br /&gt;&lt;br /&gt;&lt;h1&gt;What's a Class look like?&lt;/h1&gt;&lt;br /&gt;Classes in Python have a name, some data members, and some functions.  Classes to handle web requests with web.py generally look something like this:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt;class RequestHandler:&lt;br /&gt;    request_var1 = "data..."&lt;br /&gt;    request_var2 = "more data..."&lt;br /&gt;    def GET(self):&lt;br /&gt;        i = web.input()&lt;br /&gt;        #code to handle request...&lt;br /&gt;        return html_output&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Web.py will look for a function GET inside the class when the web request comes with GET headers.  Each time the application gets a web request, it creates a new instance of the class, id est, a fresh copy of the data and functions, and calls the new GET method with the new data.&lt;br /&gt;&lt;br /&gt;In this specific example, the class is really just a special "wrapping" around the GET function so web.py can use it.  It won't hurt the reader who is unfamiliar with classes to regard them as functions for the remainder of this post.&lt;br /&gt;&lt;br /&gt;Now, classes to handle web request are often a lot more complex than that.  In my case, I have specific requests that should respond with data that contains the current parameters of my statistical model, and the data should be formatted for easy entry into a web application (exempli gratia, in &lt;a href="http://en.wikipedia.org/wiki/JSON"&gt;JSON&lt;/a&gt;).  I have about two dozen of these requests that ask for different aspects of the same object.  Hence if I had to write them all out, each one would look something like this:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt;class YetAnotherRequestHandler:&lt;br /&gt;    def GET(self):&lt;br /&gt;        # code to process incoming request data and check for errors&lt;br /&gt;        # 5-10 lines ***same for every request***.&lt;br /&gt;        ...&lt;br /&gt;        # code that's specific to this request, 2-3 lines.&lt;br /&gt;        ...&lt;br /&gt;        # code to transform output into JSON-ready format&lt;br /&gt;        # another 5-10 lines that are **the same for every request***&lt;br /&gt;        return json_text&lt;/code&gt;&lt;/pre&gt;        &lt;br /&gt;I don't want to burden the reader with those 20 lines of code that are the same for each request (nor do I want to show my employer's source code or think of my own contrived example!) but I hope I can make the point clear:  each of these two dozen request handlers, they share a significant amount of code.  If I were to write them all out by hand, I'd have over 80% duplicated code.  Boring.  Hard to read.  Messy to change all at once.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Higher-order functions...erm, Classes&lt;/h1&gt;&lt;br /&gt;What if, instead of writing two dozen classes that share the same code, we could somehow abstract the similarities and only write the difference?  Say, we could write a series of functions that do the specific-to-request bit:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt;def processor_for_request1(args...)&lt;br /&gt;    # 2 lines of code here&lt;br /&gt;    return data&lt;br /&gt;    &lt;br /&gt;def processor_for_request2(args...)&lt;br /&gt;    # another 2 lines of code here&lt;br /&gt;    return data&lt;br /&gt;    &lt;br /&gt;# and so on...&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;And pass those functions into some machine that will turn them into classes? Well, we can!  Luckily, in Python, functions &lt;strong&gt;and&lt;/strong&gt; classes are first class citizens, so all the techniques in our section of SICP apply here.  We can write a function that takes these processors as input and returns a class that uses them like so:&lt;br /&gt;&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt;def request_class_creator(processing_function):&lt;br /&gt;    class Abstract_Request:&lt;br /&gt;        # code to process incoming request data and check for errors&lt;br /&gt;        # 5-10 lines ***same for every request***.&lt;br /&gt;        data = processing_function(args...)&lt;br /&gt;        # code to transform output into JSON-ready format&lt;br /&gt;        # another 5-10 lines that are **the same for every request***&lt;br /&gt;        return json_text&lt;br /&gt;   &lt;br /&gt;Request_Handler1 = request_class_creator(processor_for_request1)&lt;br /&gt;Request_Handler2 = request_class_creator(processor_for_request2)&lt;br /&gt;# ...and so on&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this way, we only write once the code that is different, we can reuse the components that work, and we can easily see what the important parts of our program are.  Additionally, we can easily write separate &lt;a href="http://en.wikipedia.org/wiki/Unit_testing"&gt;unit tests&lt;/a&gt; for each processing function and for the Abstract_Request handler.  We obviously aren't covering unit testing in the SICP study group, but it's an important part of writing good software nevertheless.  &lt;br /&gt;&lt;br /&gt;While the language and the example is different, this is the exact same technique described in Sec 1.3 of SICP.  In fact, it's where I learned it from.  Python users call this technique a &lt;a href="http://stackoverflow.com/questions/100003/what-is-a-metaclass-in-python"&gt;metaclass&lt;/a&gt;.  Python includes a few constructs to expand how one might use this method, but I think it's safe to say that the basic ideas of it are well-explained in SICP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-4770897552734775412?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/4770897552734775412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2012/02/metaclasses-first-class-objects-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/4770897552734775412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/4770897552734775412'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2012/02/metaclasses-first-class-objects-and.html' title='Metaclasses, first class objects, and a lesson from SICP.'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-8906878953933017883</id><published>2012-02-05T06:37:00.000-08:00</published><updated>2012-02-05T12:21:49.562-08:00</updated><title type='text'>Perceptrons in Lisp (A simple machine learning exercise)</title><content type='html'>&lt;p&gt;So having missed Stanford's Machine Learning course (mostly out of laziness - I'm sure it was great) I'm trying to learn this stuff on my own.  I'm going through MIT's Machine Learning notes on &lt;a href="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-867-machine-learning-fall-2006/lecture-notes/"&gt;OpenCourseWare&lt;/a&gt;.  They're easy [for me] to digest without being insulting, and they help me avoid searching for "The right book" to learn from (a task that would delay my learning anything but make me feel busy). &lt;/p&gt;&lt;p&gt;After reading the first two lectures I decided I should stop and practice what I've learned:  a simple &lt;a href="http://en.wikipedia.org/wiki/Perceptron"&gt;perceptron&lt;/a&gt; learning algorithm.  &lt;/p&gt;&lt;h2&gt;What's a Perceptron anyway?&lt;/h2&gt; &lt;p&gt;It sounds like a Transformer.  It's actually a method of deciding whether an object belongs to a certain class based on a linear combination of that object's characteristics.  Id est, say we have some data on atmospheric conditions, exempli gratia humidity H, wind speed W, et cetera and we want to classify those methods as to whether the conditions will produce a storm a not.  We would have a linear term:&lt;/p&gt;&lt;p&gt;$a_1 H + a_2 W \ldots $&lt;/p&gt;&lt;p&gt;We want to choose the variables $a_i$ so that the above term is positive when we'll have a storm, and negative otherwise.  &lt;/p&gt;&lt;p&gt;More generally, say we have a vector of characteristics $x$.  We want to choose another vector $\boldsymbol\sigma$ so that the dot product $\textbf{x} \cdot \boldsymbol\sigma$ is positive when $x$ belongs to our class and negative otherwise.  The perceptron is the function &lt;/p&gt;&lt;p&gt;$ f (\textbf{x}) = \text{sign}(\boldsymbol\sigma \cdot \textbf{x}) $&lt;/p&gt;&lt;h2&gt;How do we find $\boldsymbol\sigma$?&lt;/h2&gt;&lt;p&gt;Our learning algorithm will tell us how to choose that $\boldsymbol\sigma$.  To do this, we need some &lt;em&gt;training data&lt;/em&gt;. Id est, some vectors $\textbf{x}_1, \ldots, \textbf{x}_n$ along with labels $y_i$ where $y_i = 1$ if $\textbf{x}_i$ belongs to our class and $y_i = -1$ otherwise.&lt;/p&gt; &lt;p&gt;We're going to start with any ol' $\boldsymbol\sigma$, say just a vector with 1's in all positions.  For $\textbf{x}_1$, we look at $f(\textbf{x}_1)$.  If it equals $y_1$, we do nothing. If not, then we update $\boldsymbol\sigma$ with $\boldsymbol\sigma = \boldsymbol\sigma + y_1  \textbf{x}_1$.  One can prove that this update rule will ensure that $f$ gets better at correctly classifying each $\textbf{x}_i$.  We repeat this for all of our training data, and then we have a perceptron that's ready to classify some samples!&lt;/p&gt;&lt;h2&gt;Let's see it in practice.&lt;/h2&gt;&lt;p&gt;This is a pretty simple algorithm and won't take us long to implement, so let's try it.  For our implementation, we're going to look at 25x25 pixel black and white images.  We'll train a perceptron to identify which images are of the letter A and which aren't.  &lt;/p&gt;&lt;p&gt;I [rather foolishly] created my own training data.  I used GIMP to create 25x25 pixel images, saved them as an html table.  Each cell of the table corresponded to a pixel, and GIMP saved them so that each td tag included a BGCOLOR attribute.  I then used sed to convert each html file into a list of colors for each pixel.  You can see the sed command on the &lt;a href="https://github.com/mebassett/Perceptron/blob/master/images/convert.sh"&gt;github for this post&lt;/a&gt;.  &lt;/p&gt;&lt;p&gt;I saved the resulting files with a ".img" extension, and it was pretty easy to write a racket function that would convert such a file into a vector:&lt;/p&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; (define (img-&amp;gt;vector filename)  &lt;br /&gt;  (define filelist (with-input-from-file (string-&amp;gt;path filename)  &lt;br /&gt;            (λ ()  &lt;br /&gt;             (define (iter file-list line)  &lt;br /&gt;              (if (eof-object? line)  &lt;br /&gt;                file-list  &lt;br /&gt;                (iter (append file-list (list line)) (read-line))))  &lt;br /&gt;             (iter '() (read-line)))))  &lt;br /&gt;  (list-&amp;gt;vector (map hexstr-&amp;gt;number filelist)))  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The perceptron itself is not even interesting.  It's just a function that takes the sign of a vector dot product:&lt;/p&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; (define (linear-classifier img)  &lt;br /&gt;  (sign (dot sigma img)))  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And the dot product function is just an application of the built-in vector map function:&lt;/p&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; (define (dot v1 v2)  &lt;br /&gt;  (apply + (vector-&amp;gt;list (vector-map * v1 v2))))  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Of course, the real "machine learning" bit is in the learning algorithm.  This too is just a straightforward description of the above into lisp:&lt;/p&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; (define (train-perceptron img-name)  &lt;br /&gt;  (define label (filename-&amp;gt;label img-name))  &lt;br /&gt;  (define vec (img-&amp;gt;vector img-name))  &lt;br /&gt;  (cond ((= (linear-classifier vec) label)  &lt;br /&gt;      (display "good!\n"))  &lt;br /&gt;     (else  &lt;br /&gt;      (set! sigma (vector-add sigma (scalar-mult label vec)))  &lt;br /&gt;      (display "bad! updated sigma, though.\n"))))  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Where &lt;em&gt;vector-add&lt;/em&gt; and &lt;em&gt;scalar-mult&lt;/em&gt; are more applications of the &lt;em&gt;vector-map&lt;/em&gt; function in Racket's library:&lt;/p&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; (define (vector-add v1 v2)  &lt;br /&gt;  (vector-map +  &lt;br /&gt;        v1  &lt;br /&gt;        v2))  &lt;br /&gt; (define (scalar-mult s v)  &lt;br /&gt;  (vector-map *  &lt;br /&gt;        v  &lt;br /&gt;        (build-vector (vector-length v) (λ (x) s))))  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;One final detail, I defined &lt;em&gt;sigma&lt;/em&gt; as 625 element vector initialized to 1&lt;/p&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; (define sigma (build-vector 625 (λ (x) 1)))  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I had 25 training images for this perceptron, and it still wrongly identified my unseen images.  I noticed that $\boldsymbol\sigma$ was still changing if I trained it repeatedly on the same data, and it didn't stabilize until around the tenth time.  Maybe it needs more training data, maybe the perceptron is a bad algorithm for this task, I really don't know.  In any case, after repeated training, it improved slightly, but still had a false negative. In any case, we have our first simple supervised machine learning algorithm.  Code for this, including training data, is on &lt;a href="https://github.com/mebassett/Perceptron"&gt;my github&lt;/a&gt;.  &lt;/p&gt;&lt;p&gt;There's to particular reason I used Racket/Lisp for this:  it would have been just as straightforward to write it in Ruby, Python, Javascript, et cetera. I just happen to like writing in Racket.  &lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Edit:&lt;/h2&gt;&lt;br /&gt;An intelligent commenter on &lt;a href="http://news.ycombinator.com/item?id=3554844"&gt;Hacker News&lt;/a&gt; pointed out that there are some theoretical guarantees for the accuracy of your perceptron when it encounters new data.  I probably should have covered this here, but because I'm out of time and eager to do other things, I'll just mention that one can prove that the learning algorithm will always settle on a specific $\boldsymbol\sigma$ after a finite number of training points $k$.  Additionally, one can think of $\boldsymbol\sigma$ as a plane dividing points in space, where on one side of the plane are points in our class, and the other side are all the other points.  Theoretically, there will always be a distance $d$ between the closest point in our class and the plane.  $k$, of course, will depend on $d$; id est, the smaller your $d$, the harder the learning problem, and the more data you'll need to train.  (To the best of my understanding!)  The proof of all these things is pretty straightforward, so long as one is comfortable with basic geometry and vector-based arguments.  No higher maths needed.  In fact, it's covered in the second set of lecture notes!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-8906878953933017883?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/8906878953933017883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2012/02/perceptrons-in-lisp-simple-machine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/8906878953933017883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/8906878953933017883'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2012/02/perceptrons-in-lisp-simple-machine.html' title='Perceptrons in Lisp (A simple machine learning exercise)'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-3675945541637975095</id><published>2012-01-18T14:21:00.000-08:00</published><updated>2012-01-18T14:26:26.544-08:00</updated><title type='text'>Don't Censor the Web.</title><content type='html'>Congress is considering two Orwellian-named laws, SOPA and PIPA, that are threatening free speech, internet security, and innovation.&lt;br /&gt;&lt;br /&gt;This is a reminder to &lt;a href="http://projects.propublica.org/sopa/"&gt;call your representatives in Congress&lt;/a&gt; and/or donate to the &lt;a href="http://www.eff.org"&gt;EFF&lt;/a&gt; today to help stop internet censorship.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-3675945541637975095?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/3675945541637975095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2012/01/dont-censor-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/3675945541637975095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/3675945541637975095'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2012/01/dont-censor-web.html' title='Don&apos;t Censor the Web.'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-4149413799419606975</id><published>2012-01-12T12:50:00.000-08:00</published><updated>2012-01-12T12:54:08.779-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lisp'/><category scheme='http://www.blogger.com/atom/ns#' term='sicp'/><category scheme='http://www.blogger.com/atom/ns#' term='study group'/><category scheme='http://www.blogger.com/atom/ns#' term='scheme'/><title type='text'>Reading group for Structure and Interpretation of Computer Programs.</title><content type='html'>I'm leading a study group in the computer science/software engineering classic: Structure and Interpretation of Computer Programs.  The study group is part of the &lt;a href="http://www.uclmaths.org"&gt;UCL Undergrad Maths Colloquium&lt;/a&gt; but students and professionals of any level are welcome to join.  We start meeting on Thursday, 19 January at 7pm in London.  You can find out more at the &lt;a href="http://www.uclmaths.org/index.php/Structure_and_Interpretation_of_Computer_Programs_Winter_2012"&gt;Study Group Page&lt;/a&gt; at the Colloquium's website.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-4149413799419606975?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/4149413799419606975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2012/01/reading-group-for-structure-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/4149413799419606975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/4149413799419606975'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2012/01/reading-group-for-structure-and.html' title='Reading group for Structure and Interpretation of Computer Programs.'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-5478908588221053445</id><published>2011-08-26T05:48:00.000-07:00</published><updated>2011-08-26T07:09:05.148-07:00</updated><title type='text'>Tales from the wild - isolation, incompetence, and database requirements</title><content type='html'>I worked on my own or a led a team of less-experienced programmers throughout all of my professional experience.  As a result, I am sorely missing guidance and help from other developers.  While I normally have the confidence (arrogance!) to plow ahead with my own solutions, I am increasingly aware of my own incompetence, which goes unchecked without having a more senior - or at least equal - developer to pull me back into reality.  For instance, here's an example of a problem I faced several months ago:&lt;br /&gt;&lt;br /&gt;We needed to manage a list (&gt;500 and growing) of events from a web app.  Each event has a title, other general information, and a list of one or more date/place pairs.   Each date/place pair has a vector of numerical info about the event.  Users need a CRUD to edit all this, and it needs to keep track of each change.  E.g.; a user needs to change a date without loosing the associated place and vectors, and it needs to log the change; or a user needs to change the numerical info associated to a specific event/place, et cetera.  The user needs to do this from an ajaxy grid that displays the most recent version of the information (the user doesn't need to see revision history in this grid.) &lt;br /&gt;&lt;br /&gt;How can we store this data in a way that we can retrieve it quickly?  Ideally, I'd like to request all the data needed for the grid in a single SQL query.  Of course, my language used in describing the problem puts many assumptions on a data storage solution already.  Maybe I shouldn't be using SQL.  Maybe a list of pairs isn't optimal.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;My Original Solution&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;I wrote this solution 6+ months ago and am now embarrassed by it:&lt;br /&gt;I have four MySQL tables: Events - id, titles, et cetera; EventDateBridge - a map between Event_id's and id's for date/time pairs (EventDateBridge_id); EventDates - revision history for date/place pairs with EventDateBridge_id, date, place, and time added;  EventVectors - revision history for vectors associated to date/place pairs with EventDateBridge_id, time added, and the vector.  To update an Event we just add a row to the EventVectors or EvenDates table.  To build the grid:  We need one query to grab all events. For each event we need another query to grab all EventDateBridge_id's on that event/place pair.  Finally, we need two more queries - one to grab date/place and another to grab the vector.&lt;br /&gt;&lt;br /&gt;Obvious problems: lots of "order by date_added desc limit 1" to get most recent revision, lots of sub-queries, several queries needed per Event to build the grid - this results in several thousand queries!  &lt;br /&gt;&lt;br /&gt;&lt;h2&gt;A Better Solution&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;A more sober programmer (myself, months later when returning to it) recommended this:&lt;br /&gt;Three MySQL tables: Events as before; RecentEventDates - date_id, event_id, date/place pair and vector; EventDateHistory - date_id, event_id, date_added, date/place pair and vector.  To update an Event, we update the RecentEventDates and add a row to EventDateHistory.  To build the grid we run one a query on RecentEventDates (using a simple join to grab related event information).  We can use our programming language to reassemble the result into a list of events, each event having a list of date/place pairs (otherwise, the result is a list of vectors including event info, date/place pairs, and the numerical vector.)&lt;br /&gt;&lt;br /&gt;Am I missing some better solution? Am I missing a premade solution?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-5478908588221053445?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/5478908588221053445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2011/08/tales-from-wild-isolation-incompetence.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/5478908588221053445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/5478908588221053445'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2011/08/tales-from-wild-isolation-incompetence.html' title='Tales from the wild - isolation, incompetence, and database requirements'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-484964793617043555</id><published>2011-06-20T03:43:00.000-07:00</published><updated>2011-06-20T15:38:23.973-07:00</updated><title type='text'>A Brief Intro to Writing Macros in Racket</title><content type='html'>I plan to learn, among other things, more about lisp-like macros this Summer.  I had a brief introduction to the Common Lisp macro system years ago, but was frightened away when I couldn't understand my code after taking a few days' break.  I'm revisiting macros using Racket.  While there are a handful of great references on Common Lisp macros (including Paul Graham's &lt;a href="http://www.paulgraham.com/onlisp.html"&gt;On Lisp&lt;/a&gt;, which I've yet to read!), I had trouble finding a basic introduction to Racket's more complicated macro system.  The team at Racket/PLT Scheme have been researching macro systems for a few years now, and they've implemented a pretty sophisticated system: syntax objects are first class citizens, et cetera.  Quite honestly, I don't understand any of it yet.  But I thought it'd help to write down my thoughts and work thus far.  Maybe it'll help someone else learn something, too!&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Step 1: Getting to terms with Syntax Objects and Transformer Bindings&lt;/h1&gt;&lt;br /&gt;Lisp macros allow you to extend the syntax of the lisp language itself.  Racket implements these macros by creating a &lt;span style="font-style:italic;"&gt;syntax type&lt;/span&gt; to model the syntax you wish to implement.  Essentially, a syntax object contains an unevaluated s-expression (lisp expression) along with some data about its scope.  A &lt;span style="font-style:italic;"&gt;syntax object&lt;/span&gt; is a first-class citizen, meaning it can be passed around to and fro functions like any other lisp object.  You can extract data (e.g. particular symbols) from these syntax objects using pattern matching techniques, and then use that data to build a new syntax object.  Id est, you can write a function that takes a syntax object and returns a new, transformed syntax object.  To implement a macro, you describe the syntax and write a function to transform it.  When Racket sees your new syntax, it transforms it as you described and then evaluates the resulting syntax object as an s-expression within its own scope. (At least, I think that's what happens!)&lt;br /&gt;&lt;br /&gt;Pretend for a second that we wish to implement a &lt;span style="font-weight:bold;"&gt;while&lt;/span&gt; clause in Racket.  We want to be able to write something like:&lt;br /&gt;&lt;div class="mycode"&gt;(while (&lt; x 5)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(begin (display x)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! x (+ x 1))))&lt;/div&gt;&lt;br /&gt;And have it display &lt;br /&gt;&lt;div class="mycode"&gt;1234&lt;/div&gt;&lt;br /&gt;What we need is something to take the above s-expression and transform it into the following s-expression:&lt;br /&gt;&lt;div class="mycode"&gt;(define (loop)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(if (&lt; x 5)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(begin&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(display x)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! x (+ 1 x))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(loop)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(display "")))&lt;br /&gt;(loop)&lt;/div&gt;&lt;br /&gt;Let's first think about how to turn the s-expression &lt;span style="font-weight:bold;"&gt;(while test body)&lt;/span&gt; into a syntax object.  This is done with the &lt;span style="font-weight:bold;"&gt;syntax&lt;/span&gt; function, e.g.:&lt;br /&gt;&lt;div class="mycode"&gt;(syntax (while text body))&lt;/div&gt;&lt;br /&gt;Racket provides a shortcut to "quote" syntax, id est, the above is equivalent to:&lt;br /&gt;&lt;div class="mycode"&gt;#`(while text body)&lt;/div&gt;&lt;br /&gt;Let's go ahead and define a syntax object to use later in our examples:&lt;br /&gt;&lt;div class="mycode"&gt;(define stx #`(while (&lt; x 5)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(begin (display x)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! x (+ x 1))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;br /&gt;))&lt;/div&gt;&lt;br /&gt;But how do we transform this syntax object into another?  As stated above, we'll use a sort of &lt;span style="font-style:italic;"&gt;pattern matching&lt;/span&gt; to extract data from the syntax object, and plug this data into a new syntax template.  Racket provides a function to implement this called &lt;span style="font-weight:bold;"&gt;syntax-case&lt;/span&gt;.  syntax-case is a function that takes a syntax object, a list of "keywords", and a list of pairs of patterns and new syntax objects.  It tries to match the syntax object you provided to one of the patterns listed, and returns the new corresponding syntax object.  Those patterns can be tricky, and are best explained with examples, so let's try one:  First note that our keyword is "while", let's try the code:&lt;br /&gt;&lt;div class="mycode"&gt;(syntax-case stx&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(while)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(while test body) #`body])&lt;/div&gt;&lt;br /&gt;The &lt;span style="font-weight:bold;"&gt;(while test body)&lt;/span&gt; says that we're looking for an s-expression that starts with the keyword "while", and follows with two other s-expressions.  It binds the syntax object corresponding to those s-expressions to the symbols "test" and "body", respectively.  The new syntax object &lt;span style="font-weight:bold;"&gt;#`body&lt;/span&gt; is simply the body sample.  Thus the above expression returns a syntax object for only the last s-expression in our while clause.  &lt;br /&gt;&lt;br /&gt;If we didn't list "while" in our keyword list, the expression would have still returned the same result.  But instead of only matching while-clauses, the syntax-case expression would match anything, and simply store the first expression in a symbol named &lt;span style="font-weight:bold;"&gt;while&lt;/span&gt;.  &lt;br /&gt;&lt;br /&gt;Let's implement a proper transformation now.  As we stated above, we want our while expression to transform into a recursive function that calls itself so long as &lt;span style="font-weight:bold;"&gt;test&lt;/span&gt; is true.  Our syntax-case is thus:&lt;br /&gt;&lt;div class="mycode"&gt;(syntax-case stx (while)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(while test body)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#`(begin (define (loop) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(if test&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(begin body&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(loop))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(display "")))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(loop))])&lt;/div&gt;&lt;br /&gt;As you can [hopefully] see if you run this code through a REPL, we get a syntax object containing something similar to our desired s-expression.  Now let's tell Racket to perform this syntax transformation.  To do this, we'll use &lt;span style="font-weight:bold;"&gt;define-syntax&lt;/span&gt;.  This statement works a lot like our normal &lt;span style="font-weight:bold;"&gt;define&lt;/span&gt;, except that it ties an identifier to a syntax transformation.  Here's the code:&lt;br /&gt;&lt;div class="mycode"&gt;(define-syntax (while stx-obj)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(syntax-case stx-obj (while)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(while test body)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#`(begin (define (loop) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(if test&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(begin body&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(loop))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(display "")))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(loop))]))&lt;/div&gt;&lt;br /&gt;Now the code&lt;br /&gt;&lt;div class="mycode"&gt;(let ((x 1))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(while (&lt; x 5) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(begin (display x)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! x (+ 1 x)))))&lt;/div&gt;&lt;br /&gt;Works as expected.  &lt;span style="font-weight:bold;"&gt;stx-obj&lt;/span&gt; captures the total expression, including the &lt;span style="font-style:italic;"&gt;while&lt;/span&gt; clause that we defined.  Since Racket detects this by itself, we actually don't need to define the while keyword.  We can replace it with an empty keyword list and a "_" (underscore) pattern (this matches any syntax symbol, but doesn't bind the symbol to a new expression) like this: &lt;br /&gt;&lt;div class="mycode"&gt;(define-syntax (while stx-obj)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(syntax-case stx-obj ()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(_ test body)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#`(begin (define (loop) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(if test&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(begin body&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(loop))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(display "")))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(loop))]))&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Rolling Our Own Object System&lt;/h1&gt;&lt;br /&gt;Now that we've got the basics of macros down, let's try a slightly more ambitious project:  we're going to use macros to implement a basic message-passing object system.  First, consider the following code:&lt;br /&gt;&lt;div class="mycode"&gt;(define (animal location health speed)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define (move new-loc) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! location new-loc)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! health (- health speed)))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define (dispatch m)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(cond [(eq? m 'move) move]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'location) location]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'health) health]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'speed) speed]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(else (error "unknown message"))))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dispatch)&lt;br /&gt;&lt;br /&gt;(define my-animal (animal 1 100 5))&lt;br /&gt;(my-animal 'health)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &gt;&gt; 100&lt;br /&gt;&lt;br /&gt;((my-animal `move) 2)&lt;br /&gt;(my-animal 'health)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &gt;&gt; 95&lt;/div&gt;&lt;br /&gt;This code implements a message-passing design pattern for my awkward model of an "animal" (perhaps for a game?).  We can create new animal objects with the &lt;span style="font-weight:bold;"&gt;animal&lt;/span&gt; function that we defined, and then pass messages to it, emulating object-oriented programming.  &lt;br /&gt;&lt;br /&gt;Instead of writing this design pattern over and over again, we're going to create a macro to implement it for us.  We want to write&lt;br /&gt;&lt;div class="mycode"&gt;(new-object Animal &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(location health speed)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(move (λ (new-loc)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! location new-loc)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! health (- health speed))))])&lt;/div&gt;&lt;br /&gt;The pattern we wish to match is:&lt;br /&gt;&lt;div class="mycode"&gt;(_ name (value ...) [(func-name lambda-body) ...])&lt;/div&gt;&lt;br /&gt;The ellipses (...) after "value" and "(func-name lambda-body)" denote that we expect a list of symbols, rather than just a single symbol.  When we write the syntax template, we'll have to use the same ellipses to repeat the corresponding expression across the list.  To transform the above code into our implementation, the code is:&lt;br /&gt;&lt;div class="mycode"&gt;#'(define (name value ...)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define func-name lambda-body) ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define (dispatch m)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(cond [(eq? m 'value) value] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'func-name) func-name] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[else (error "unknown message")]))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dispatch)&lt;/div&gt;&lt;br /&gt;Combining all this together, we can write the following syntax transformation:&lt;br /&gt;&lt;div class="mycode"&gt;(define-syntax (new-object stx)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(syntax-case stx ()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(_ name (value ...) [(func-name lambda-body) ...])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#'(define (name value ...)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define func-name lambda-body) ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define (dispatch m)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(cond [(eq? m 'value) value] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'func-name) func-name] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[else (error "unknown message")]))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dispatch)]))&lt;/div&gt;&lt;br /&gt;This macro works fine for the above.  But hold on!  What if we want to implement setters for new objects?  E.g.&lt;br /&gt;&lt;div class="mycode"&gt;((my-animal `set-health!) 500)&lt;/div&gt;&lt;br /&gt;Implementing this bit is tricky...&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Manipulating Syntax&lt;/h1&gt;&lt;br /&gt;...to do this, we'll need to take the syntax object for the symbol "health" and transform it into a new syntax object that contains the symbol "set-health!".  We'll need to do this for the full list of members.  But how can we?  Let's take a break from the macros and play around with syntax objects for a bit.  First, define the following:&lt;br /&gt;&lt;div class="mycode"&gt;(define stx #'(health location speed))&lt;br /&gt;(syntax-&gt;list stx)&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;syntax-&gt;list&lt;/span&gt; does what it sounds like, takes a syntax object of a list and returns a list of syntax objects.  Our idea is to continue transformations on that list until it becomes the following syntax object list:&lt;br /&gt;&lt;div class="mycode"&gt;#'(set-health! set-location! set-speed!)&lt;/div&gt;&lt;br /&gt;Then we'll incorporate it into our macro definition.  Racket provides another useful function, &lt;span style="font-weight:bold;"&gt;syntax-&gt;datum&lt;/span&gt; which will transform each individual syntax object of a symbol into the symbol itself.  So our next step is &lt;br /&gt;&lt;div class="mycode"&gt;(map syntax-&gt;datum (syntax-&gt;list stx))&lt;/div&gt;&lt;br /&gt;Now we have a list of symbols.  We can transform this normally, e.g.&lt;br /&gt;&lt;div class="mycode"&gt;(map (λ (item) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(format "set-~a!" (syntax-&gt;datum item))) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(syntax-&gt;list stx))&lt;/div&gt;&lt;br /&gt;We're getting closer, now we need to transform this list of strings back into a list of syntax objects of symbols.  This is pretty straightforward, we just nest &lt;span style="font-weight:bold;"&gt;datum-&gt;syntax&lt;/span&gt; and &lt;span style="font-weight:bold;"&gt;string-&gt;symbol&lt;/span&gt;.  Note the following about &lt;span style="font-weight:bold;"&gt;datum-&gt;syntax&lt;/span&gt;:  A syntax object includes information about the scope of the s-expression it contains.  We want our new syntax object to be within the same scope as the original syntax object.  Luckily, &lt;span style="font-weight:bold;"&gt;datum-&gt;syntax&lt;/span&gt; will do exactly that.  It takes both a syntax object and a symbol and returns a new syntax object containing that symbol within the scope of the first syntax object.  Hence our code is&lt;br /&gt;&lt;div class="mycode"&gt;(map (λ (item)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(datum-&gt;syntax stx &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(string-&gt;symbol (format "set-~a!" (syntax-&gt;datum item)))))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(syntax-&gt;list stx))&lt;/div&gt;&lt;br /&gt;That does exactly what we want it to.  Now, let's re-visit the syntax template from our macro and see how to implement this idea for the object setters.  Recall the macro:&lt;br /&gt;&lt;div class="mycode"&gt;(define-syntax (new-object stx)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(syntax-case stx ()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(_ name (value ...) [(func-name lambda-body) ...])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#'(define (name value ...)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define func-name lambda-body) ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define (dispatch m)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(cond [(eq? m 'value) value] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'func-name) func-name] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[else (error "unknown message")]))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dispatch)]))&lt;/div&gt;&lt;br /&gt;We need to do an intermediate syntax transformation, to convert the "(values ...)" syntax object to the one we created earlier.  We can do this with &lt;span style="font-weight:bold;"&gt;with-syntax&lt;/span&gt;.  &lt;span style="font-weight:bold;"&gt;with-syntax&lt;/span&gt; takes a list of pairs of patterns and syntax objects and a template syntax object.  It binds the bits of the syntax object to the symbols in the pattern, like&lt;span style="font-weight:bold;"&gt;syntax-case&lt;/span&gt;,  and transforms the template into a new syntax object.  We're going to match our transformed list to a simple syntax pattern like thus&lt;br /&gt;&lt;div class="mycode"&gt;[(set-value ...) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(map (λ (item)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(datum-&gt;syntax stx&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(string-&gt;symbol (format "set-~a!" (syntax-&gt;datum item)))))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(syntax-&gt;list #`(value ...)))]&lt;/div&gt;&lt;br /&gt;Note that &lt;span style="font-weight:bold;"&gt;syntax-&gt;list&lt;/span&gt; is now acting on &lt;span style="font-weight:bold;"&gt;#`(value ...)&lt;/span&gt;, id est, the syntax object of lists of symbols for object member names.  Also note that the syntax object used in &lt;span style="font-weight:bold;"&gt;datum-&gt;syntax&lt;/span&gt; is the &lt;span style="font-weight:bold;"&gt;stx&lt;/span&gt; object from our macro definition.  Our new template, with the new setters, looks like:&lt;br /&gt;&lt;div class="mycode"&gt;#'(define (name value ...)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define (set-value new-val)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! value new-val)) ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define func-name lambda-body) ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define (dispatch m)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(cond [(eq? m 'value) value] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'func-name) func-name] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'set-value) set-value] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[else (error "unknown message")]))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dispatch)&lt;/div&gt;&lt;br /&gt;Now let's wrap it all up in our macro definition:&lt;br /&gt;&lt;div class="mycode"&gt;(define-syntax (new-object stx)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(syntax-case stx ()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(_ name (value ...) [(func-name lambda-body) ...])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(with-syntax ([(set-value ...) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(map (λ (item)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(datum-&gt;syntax stx&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(string-&gt;symbol (format "set-~a!" (syntax-&gt;datum item)))))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(syntax-&gt;list #`(value ...)))])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#'(define (name value ...)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define (set-value new-val)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(set! value new-val)) ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define func-name lambda-body) ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(define (dispatch m)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(cond [(eq? m 'value) value] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'func-name) func-name] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[(eq? m 'set-value) set-value] ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[else (error "unknown message")]))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dispatch))]))&lt;/div&gt;&lt;br /&gt;There you have it, folks.  We've implemented a basic object system in less than 20 lines of code.&lt;br /&gt;&lt;br /&gt;Comments, questions, corrections all welcome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-484964793617043555?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/484964793617043555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2011/06/brief-intro-to-writing-macros-in-racket.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/484964793617043555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/484964793617043555'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2011/06/brief-intro-to-writing-macros-in-racket.html' title='A Brief Intro to Writing Macros in Racket'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-4653251827353088324</id><published>2011-06-04T15:29:00.000-07:00</published><updated>2011-06-04T16:00:08.564-07:00</updated><title type='text'>CSS3 Transition Effects in My New Website</title><content type='html'>Having finished my MSci exams at UCL, I thought I would take this opportunity to "freshen up" the layout on my &lt;a href="http://mebassett.gegn.net"&gt;personal website&lt;/a&gt;.  There was one nasty, looming problem with this idea, however - I suck at design.&lt;br /&gt;&lt;br /&gt;Design work starts off a days-long cycle of me torturing myself.  In stage 1, I accept/realize that I am bad designer with few capabilities and resign myself to "keeping it simple".  Stage 2 sees me drawing half of a dozen paper sketches and mock-ups for this "simple design".  These designs later inundate my hapless friends as I pester them for their opinions.  By stage 3, I've accepted that half of my sketches are terrible, and that the other half require an on-screen mockup to judge.  Thus I launch the Gimp and try to create a vector mockup, leading back to stage 1: realizing that I don't have the technical prowess to complete this design and resolving to do something simpler.  After several days, this process takes its toll on my mental health and produces an unremarkable HTML product.&lt;br /&gt;&lt;br /&gt;I went through this cycle this week (after promising myself that "freshening up" would only take a few hours) and settled on a design similar to my &lt;a href="http://mebassett.info"&gt;Reverse Job App&lt;/a&gt; awhile back.  But when I began writing the actual HTML I decided I could torture myself a little more and complete the layout without any use of javascript or jquery.  Instead, I relied solely on the new CSS3 gradient and transition effects.  I decided to write this blog about the latter effect.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;The CSS Effect&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;The front landing page of my has three boxes that link to the different sections of my website like such:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-FKsjsaPEkpE/TeqyQI6HXVI/AAAAAAAAABw/PxNwzA4BeGA/s1600/screenshot7.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 220px; height: 255px;" src="http://4.bp.blogspot.com/-FKsjsaPEkpE/TeqyQI6HXVI/AAAAAAAAABw/PxNwzA4BeGA/s320/screenshot7.png" alt="" id="BLOGGER_PHOTO_ID_5614495875809631570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Each box has a neat hover effect where the shaded background drops down and changes color.  While this effect is easy to implement in jquery, I was able to implement it in Firefox/Chrome/Safari without using one lick of javascript, and I'll show you how.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The HTML&lt;/h2&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt;        &amp;lt; a href="http://www.blogger.com/maths" &amp;gt;&lt;br /&gt;  &amp;lt; div class="bg" &amp;gt;&lt;br /&gt;   &amp;lt;div class="filter" &amp;gt;&lt;br /&gt;    &amp;lt; p &amp;gt;maths. &amp;lt; /p &amp;gt;&lt;br /&gt;   &amp;lt; /div &amp;gt;&lt;br /&gt;  &amp;lt; /div &amp;gt;&lt;br /&gt; &amp;lt; /a &amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Two divs in an a tag?  That's right.  The top a tag is obviously the link.  The outer div.bg tag gives us the background images and adjusts the size of the a element (this is possible without the div.bg, but I could only get the full background image to show if I used absolute positioning).  The inner div.filter tag and p tag will be the subject of the transition effects.  div.filter is a partially transparent box that gives us the shaded background.  The p tag is the actual text of the link.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;CSS Before Effects&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Let's implement the above description.  &lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt; * {margin:0; padding:0;}&lt;br /&gt; a{&lt;br /&gt;  width:180px;&lt;br /&gt;  text-decoration: none;&lt;br /&gt; }&lt;br /&gt; a &gt; div.bg {&lt;br /&gt;  height:216px;&lt;br /&gt;  width:180px;&lt;br /&gt;  border: 2px solid black;&lt;br /&gt;  background-image: url(maths.png); &lt;br /&gt; }&lt;br /&gt; a &gt; div.bg &gt; div.filter{&lt;br /&gt;  background-color: rgba(33, 33, 33, 0.5);&lt;br /&gt;  height:217px;&lt;br /&gt;  width:180px; &lt;br /&gt; }&lt;br /&gt; a &gt; div.bg &gt; div.filter &gt; p{&lt;br /&gt;  display:block;&lt;br /&gt;  padding-top:90px;&lt;br /&gt;  padding-left:18px;&lt;br /&gt;  font-weight:bold;&lt;br /&gt;  color: #ffffff;&lt;br /&gt; }&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;All pretty straightforward.  Combining the above should yield a pretty simple website:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-Z-MT3ZY_MQk/Teq1Ag6oxdI/AAAAAAAAAB4/7nDd3O4Nsek/s1600/screenshot3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 215px; height: 290px;" src="http://3.bp.blogspot.com/-Z-MT3ZY_MQk/Teq1Ag6oxdI/AAAAAAAAAB4/7nDd3O4Nsek/s320/screenshot3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5614498905911248338" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now let's write down the CSS for the hover stage.  We'll start by adjusting the above CSS to get an a tag with a darker filter that only covers the top of the image.  This means we need to change the css for div.filter and p.&lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt;a &gt; div.bg &gt; div.filter&lt;br /&gt;{&lt;br /&gt; background-color:#000000;&lt;br /&gt; background-color: rgba(0, 0, 0, 0.7);&lt;br /&gt; height:145px;&lt;br /&gt; margin-top:72px;&lt;br /&gt;}&lt;br /&gt;a &gt; div.bg &gt; div.filter &gt; p{&lt;br /&gt; display:block;&lt;br /&gt; padding-top:18px;&lt;br /&gt; padding-left:18px;&lt;br /&gt; font-weight:bold;&lt;br /&gt; color: #ffffff;&lt;br /&gt; text-decoration:underline;&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;How do we get a hover effect?  That's simple, we can combine these two descriptions using the :hover psuedo class.  We'll use the first CSS we wrote, and append the second definitions after changing "a &gt; " to "a:hover &gt;", like so:&lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt; * {margin:0; padding:0;}&lt;br /&gt; a{&lt;br /&gt;  width:180px;&lt;br /&gt;  text-decoration: none;&lt;br /&gt; }&lt;br /&gt; a &gt; div.bg {&lt;br /&gt;  height:216px;&lt;br /&gt;  width:180px;&lt;br /&gt;  border: 2px solid black;&lt;br /&gt;  background-image: url(maths.png); &lt;br /&gt; }&lt;br /&gt; a &gt; div.bg &gt; div.filter{&lt;br /&gt;  background-color: rgba(33, 33, 33, 0.5);&lt;br /&gt;  height:217px;&lt;br /&gt;  width:180px; &lt;br /&gt; }&lt;br /&gt; a &gt; div.bg &gt; div.filter &gt; p{&lt;br /&gt;  display:block;&lt;br /&gt;  padding-top:90px;&lt;br /&gt;  padding-left:18px;&lt;br /&gt;  font-weight:bold;&lt;br /&gt;  color: #ffffff;&lt;br /&gt; }&lt;br /&gt; a:hover &gt; div.bg &gt; div.filter&lt;br /&gt; {&lt;br /&gt;  background-color:#000000;&lt;br /&gt;  background-color: rgba(0, 0, 0, 0.7);&lt;br /&gt;  height:145px;&lt;br /&gt;  margin-top:72px;&lt;br /&gt; }&lt;br /&gt; a:hover &gt; div.bg &gt; div.filter &gt; p{&lt;br /&gt;  display:block;&lt;br /&gt;  padding-top:18px;&lt;br /&gt;  padding-left:18px;&lt;br /&gt;  font-weight:bold;&lt;br /&gt;  color: #ffffff;&lt;br /&gt;  text-decoration:underline;&lt;br /&gt; } &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-BarG7vwwl5g/Teq4esF118I/AAAAAAAAACA/n9goKTgGhm8/s1600/screenshot4.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 192px; height: 261px;" src="http://4.bp.blogspot.com/-BarG7vwwl5g/Teq4esF118I/AAAAAAAAACA/n9goKTgGhm8/s320/screenshot4.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5614502722841991106" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;CSS Transition Effects&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;We're nearly there!  How do we get those cool transitions?  The working draft for CSS3 provides two new attributes:&lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt; transition-property: [list of properties]&lt;br /&gt; transition-duration: [number of seconds]&lt;br /&gt;&lt;/div&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;transition-property&lt;/span&gt; instructs the browser to do a default (read: linear) transition from the previous properties to the new properties in this definition.  &lt;span style="font-weight:bold;"&gt;transition-duration&lt;/span&gt; is just the number of seconds the effect should last.  You can read more about them at the &lt;a href="https://developer.mozilla.org/en/css/css_transitions"&gt;Mozilla Development Network&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For div.filter, we're changing the background color, the height, and the margin-top, so we change the hover div.filter definition to:&lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt; a:hover &gt; div.bg &gt; div.filter&lt;br /&gt; {&lt;br /&gt;  background-color:#000000;&lt;br /&gt;  background-color: rgba(0, 0, 0, 0.7);&lt;br /&gt;  height:145px;&lt;br /&gt;  margin-top:72px;&lt;br /&gt;    transition-property: background-color, height,margin-top;&lt;br /&gt;    transition-duration: 0.3s;  &lt;br /&gt; }&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;We'll want to add the same thing to the default div.filter definition as well, so we have a smooth transition from hover to non-hover states:&lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt; a &gt; div.bg &gt; div.filter{&lt;br /&gt;  background-color: rgba(33, 33, 33, 0.5);&lt;br /&gt;  height:217px;&lt;br /&gt;  width:180px;   &lt;br /&gt;    transition-property: background-color, height,margin-top;&lt;br /&gt;    transition-duration: 0.3s;  &lt;br /&gt; }&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Similarly, we need to change the padding-top property of the p tag, this is done with:&lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt;  a:hover &gt; div.bg &gt; div.filter &gt; p{&lt;br /&gt; display:block;&lt;br /&gt; transition-property:padding-top;&lt;br /&gt; transition-duration: 0.3s;&lt;br /&gt; padding-top:18px;&lt;br /&gt; padding-left:18px;&lt;br /&gt; font-weight:bold;&lt;br /&gt; color: #ffffff;&lt;br /&gt; text-decoration:underline;&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;But hold on!  Since transition-property, et al, is still experimental, it requires a vender-prefix.  E.g. for Firefox, it needs -moz-transition-property, et cetera, for webkit-based browsers, -webkit-, for opera, -o-.  So our complete CSS is:&lt;br /&gt;&lt;br /&gt;&lt;div class="mycode"&gt;&lt;br /&gt; * {margin:0; padding:0;}&lt;br /&gt; a{&lt;br /&gt;  width:180px;&lt;br /&gt;  text-decoration: none;&lt;br /&gt; }&lt;br /&gt; a &gt; div.bg {&lt;br /&gt;  height:216px;&lt;br /&gt;  width:180px;&lt;br /&gt;  border: 2px solid black;&lt;br /&gt;  background-image: url(maths.png); &lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;  a &gt; div.bg &gt; div.filter&lt;br /&gt; {&lt;br /&gt;  float: left;&lt;br /&gt;  background-color: transparent;&lt;br /&gt;  background-color: rgba(33, 33, 33, 0.5);&lt;br /&gt;  height:217px;&lt;br /&gt;  width:180px;&lt;br /&gt;  -moz-transition-property: background-color, height,margin-top;&lt;br /&gt;  -moz-transition-duration: 0.3s;&lt;br /&gt;  -webkit-transition-property: background-color, height,margin-top;&lt;br /&gt;  -webkit-transition-duration: 0.3s; &lt;br /&gt;  -o-transition-property: background-color, height,margin-top;&lt;br /&gt;  -o-transition-duration: 0.3s; &lt;br /&gt; &lt;br /&gt; }&lt;br /&gt;   a &gt; div.bg &gt; div.filter &gt; p{&lt;br /&gt;  display:block;&lt;br /&gt;  padding-top:90px;&lt;br /&gt;  padding-left:18px;&lt;br /&gt;  font-weight:bold;&lt;br /&gt;  color: #ffffff;&lt;br /&gt; }&lt;br /&gt;   a:hover &gt; div.bg &gt; div.filter&lt;br /&gt; {&lt;br /&gt;  background-color:#000000;&lt;br /&gt;  background-color: rgba(0, 0, 0, 0.7); &lt;br /&gt;  height:145px;&lt;br /&gt;  margin-top:72px;&lt;br /&gt;  -moz-transition-property: background-color, height,margin-top;&lt;br /&gt;  -moz-transition-duration: 0.3s;&lt;br /&gt;  -webkit-transition-property: background-color, height,margin-top;&lt;br /&gt;  -webkit-transition-duration: 0.3s;&lt;br /&gt;  -o-transition-property: background-color, height,margin-top;&lt;br /&gt;  -o-transition-duration: 0.3s;&lt;br /&gt; }&lt;br /&gt;   a:hover &gt; div.bg &gt; div.filter &gt; p{&lt;br /&gt;  padding-top:18px;&lt;br /&gt;  padding-left:18px;&lt;br /&gt;  font-weight:bold;&lt;br /&gt;  color: #ffffff;&lt;br /&gt;  text-decoration:underline;&lt;br /&gt;  -moz-transition-property:padding-top;&lt;br /&gt;  -moz-transition-duration: 0.3s;&lt;br /&gt;  -webkit-transition-property: padding-top;&lt;br /&gt;  -webkit-transition-duration: 0.3s; &lt;br /&gt;  -o-transition-property: padding-top;&lt;br /&gt;  -o-transition-duration: 0.3s; &lt;br /&gt; }&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;There you have it, folks! CSS3 transitions for everyone! (except, possibly, IE users.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-4653251827353088324?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/4653251827353088324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2011/06/css3-transition-effects-in-my-new.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/4653251827353088324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/4653251827353088324'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2011/06/css3-transition-effects-in-my-new.html' title='CSS3 Transition Effects in My New Website'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-FKsjsaPEkpE/TeqyQI6HXVI/AAAAAAAAABw/PxNwzA4BeGA/s72-c/screenshot7.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-5683870430143465750</id><published>2011-03-06T06:35:00.000-08:00</published><updated>2011-03-06T07:03:47.050-08:00</updated><title type='text'>Open Sourcing Sneffel</title><content type='html'>I've decided to open source Sneffel and other projects.&lt;br /&gt;&lt;br /&gt;I started web development in 2001 with an open source browser based strategy game called Solar Empire.  The player community was generally excited by my work, as I brought some energy into a long-stalled development process.  Except I didn't.  I kept all my contributions to myself on my own server.  I was 11 years old and was too embarrassed to have these "real" software developers look at and criticize my code.&lt;br /&gt;&lt;br /&gt;What a shame.  I missed a great opportunity to learn from others.  Since then I've worked within various teams, but still largely stick to the habit of programming alone in a box.  (This isn't 100% bad.  Even at Universal, I spend time doing "exploratory" programming in Scheme.) So in an attempt to rectify years' worth of bad habits, I've decided to start open-sourcing my projects.  All of them.&lt;br /&gt;&lt;br /&gt;I create a github account (github rocks! I can't believe its taken me this long to sign up!) and am open sourcing my major personal projects.  I expect to open source any future personal projects.&lt;br /&gt;&lt;br /&gt;I know for the most part no one will care and no one will look at my code anyway.  But there's always the chance someone will take a peek and want to contribute.  And I'm sure I could learn a lot from said person.  At the very least, the thought that someone else may be combing through my code will force me to write better.&lt;br /&gt;&lt;br /&gt;You can follow my work at &lt;a href="https://github.com/mebassett/"&gt;https://github.com/mebassett/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-5683870430143465750?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/5683870430143465750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2011/03/open-sourcing-sneffel.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/5683870430143465750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/5683870430143465750'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2011/03/open-sourcing-sneffel.html' title='Open Sourcing Sneffel'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-31944239272634439</id><published>2011-01-12T16:20:00.000-08:00</published><updated>2011-01-12T16:20:02.305-08:00</updated><title type='text'>An idea for a new web app...</title><content type='html'>I often have ideas for new web apps (though I'm thinking more about the iPad every day, I think I want one...) and I like to jot them down.&amp;nbsp; But I remembered I haven't updated this blog in awhile, so I thought I could store them here.&lt;br /&gt;&lt;br /&gt;I've been pretty busy lately with Python programming in data management/financial models for Universal, Scheme/Racket programming for myself, and a whole bunch of maths.&amp;nbsp; I got this idea during a brief pause in my mathematical studies:&lt;br /&gt;&lt;br /&gt;Essentially, its another Reddit/Hacker News app.&amp;nbsp; The key difference is that you pick the community to vote on things.&amp;nbsp; The problem I'm trying to solve is identification of key content from blogs and other alternative news sources. (The problem appeared to me in a comment on Hacker News, actually) RSS and other feeds don't do a good job if signalling important content the way the front page of a newspaper does.&amp;nbsp; Social bookmarking communities rely on the "wisdom of the crowd" which doesn't necessarily pick out the best content (E.g. the top item is some link-bait spam-post about 10 things smart people should work on, while an important article about changing political and economic climates goes unnoticed.)&amp;nbsp; This would solve that problem by giving "upvote" rights to people you select, e.g. friends you respect online and off.&amp;nbsp; It could pull links from Twitter feeds you choose, for instance, as well as RSS, or simply whatever your "editors" pull in.&amp;nbsp; Make sense?&lt;br /&gt;&lt;br /&gt;Right, back to the maths...&amp;nbsp; Hopefully I'll get a chance to write about my adventures in Racket, Python, HTML5, and iPad apps soon!&lt;br /&gt;&lt;br /&gt;Matthew&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-31944239272634439?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/31944239272634439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2011/01/idea-for-new-web-app.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/31944239272634439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/31944239272634439'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2011/01/idea-for-new-web-app.html' title='An idea for a new web app...'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-3101392022302600094</id><published>2010-09-22T08:01:00.001-07:00</published><updated>2010-09-22T08:01:49.187-07:00</updated><title type='text'>Classes and prototypes in a new PHP OOP system.</title><content type='html'>I found this post on Hacker News and thought I'd re-blog a link to it.&amp;nbsp; Just because I thought it was so cool.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://draft.blogger.com/goog_1998977665"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://draft.blogger.com/goog_1998977665"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dhotson.tumblr.com/post/1167021666/php-object-oriented-programming-reinvented"&gt;http://dhotson.tumblr.com/post/1167021666/php-object-oriented-programming-reinvented&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-3101392022302600094?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/3101392022302600094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2010/09/classes-and-prototypes-in-new-php-oop.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/3101392022302600094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/3101392022302600094'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2010/09/classes-and-prototypes-in-new-php-oop.html' title='Classes and prototypes in a new PHP OOP system.'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-8485169294017335935</id><published>2010-08-25T13:20:00.000-07:00</published><updated>2010-08-25T13:20:51.280-07:00</updated><title type='text'>Learning to build great software</title><content type='html'>Whenever I build a new piece of software, I'm nearly always torn in two.  One half of me, the  side that got me to start work in the first place, says things like "this is great! this app will change the world! everyone will want to use it, you just need to get the word out!".  The other side, which doesn't appear appear until after I can see a working prototype, is much less optimistic.  He says things like "wow, this sucks.  No one is ever going to use it.  It's essentially useless.  You shouldn't waste any more time on it".  &lt;br /&gt;&lt;br /&gt;As one might imagine, I have a difficult time deciding which half is right, and whether or not pursue a project further.  But today I discovered a great tactic to determine; I've learned exactly how to figure out if my software is great or not:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Pick up the phone and call your ideal users.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Yes. &amp;nbsp;It's that simple. &amp;nbsp;I don't know how I missed it for so long. &amp;nbsp;It seems so obvious now. &amp;nbsp; But until my finances got dire and I was pursuing Sneffel as a business (Rather than just a programming project) full time without other options, I had never thought about it before &amp;nbsp;I spent today finding distance learning schools who might be interested, calling them up, and trying to sell Sneffel to them. &lt;br /&gt;&lt;br /&gt;I must say: it was really depressing work.&lt;br /&gt;&lt;br /&gt;But I think I've been able to decide if Sneffel is worth pursuing further or not. &amp;nbsp;And as much as it saddens me to say, I think it's time to move on to better projects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-8485169294017335935?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/8485169294017335935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2010/08/learning-to-build-great-software.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/8485169294017335935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/8485169294017335935'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2010/08/learning-to-build-great-software.html' title='Learning to build great software'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-1827931828652598356</id><published>2010-06-12T16:29:00.000-07:00</published><updated>2010-06-12T16:52:12.167-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ouray'/><category scheme='http://www.blogger.com/atom/ns#' term='Facebook Connect'/><category scheme='http://www.blogger.com/atom/ns#' term='LaTeX'/><title type='text'>Ouray – The Facebook Connect LaTeX editor Chat Room.</title><content type='html'>I have two main personal projects running right now: Sneffel and Ouray (both named after places in Colorado.)  The latter started as my 24-hour attempt at making a better “virtual learning environment” than Blackboard, Moodle, or other software I've seen educational institutions use.  Inspired by Twitter and Yammer, I thought a micro-blogging format would do the job, and I put together a quick system that used Facebook Connect to allow a single-click sign on.&lt;br /&gt;&lt;br /&gt;Of course, this was all before Open Graph and the other changes to Facebook's API.  So naturally, when I went back into the code this week to make some changes, I had to see what was up.  All I wanted to do was ask for facebook user's email address (I had not done so when they first signed up) so that I could send them notifications for the Ouray courses they've signed up for.  Easy, right?  Just set the “perms” field in the FBML, like so:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;fb:login-button perms="email" v="2" size="medium"&amp;gt;Connect&amp;lt;/fb:login-button&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Well, this is where the trouble starts.  First, I was using the old PHP API library, and I wanted to ensure I was using the latest code.  Second, as a result, I needed to look up documentation for the new API, and it was a bit fragmented.&lt;br /&gt;&lt;br /&gt;The first thing I realized is that I needed to use a new authentication cookie, and to get this cookie, I needed to ensure I was using the latest javascript API.  So I replaced the old facebook &amp;lt;script&amp;gt; tags and added the new:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt; &amp;lt;script src="http://connect.facebook.net/en_US/all.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;   &amp;lt;script&amp;gt;&lt;br /&gt;      FB.init({appId: 'MYAPPID', status: true, cookie: true, xfbml: true});&lt;br /&gt;  FB.Event.subscribe('auth.sessionChange', function(response) {&lt;br /&gt;    if (response.session) {&lt;br /&gt;     //login&lt;br /&gt;    } else {&lt;br /&gt;     //logout&lt;br /&gt;    }&lt;br /&gt;  }); &amp;lt;/script&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;At the bottom of my pages as instructed.  Now the FB.Event code is key to getting your app to respond to logins. It tells javascript to listen for a facebook event and act upon it with the function passed to it.  I found two different events used for logins, “auth.login” and "auth.sessionChange", for seemingly no reason.  Now the uses of each seem pretty clear from the names, but it would be nice to see the different responses; e.g., can I use sessionChange to detect a login? Yes I can.  Did I find that out from Facebook? No I didn't. (see &lt;a href="http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe"&gt;http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe&lt;/a&gt; for a list of FB events.)&lt;br /&gt;&lt;br /&gt;The next step came in trying to access this new Facebook Cookie.  Facebook's &lt;a href="http://developers.facebook.com/docs/authentication/"&gt;http://developers.facebook.com/docs/authentication/&lt;/a&gt; provides the PHP function&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;function get_facebook_cookie($app_id, $application_secret)&lt;br /&gt;{&lt;br /&gt;  $args = array();&lt;br /&gt;  parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);&lt;br /&gt;  ksort($args); $payload = '';&lt;br /&gt;  foreach ($args as $key =&amp;gt; $value)&lt;br /&gt;      if ($key != 'sig')&lt;br /&gt;          $payload .= $key . '=' . $value;&lt;br /&gt;  if (md5($payload . $application_secret) != $args['sig'])&lt;br /&gt;      return null;&lt;br /&gt;  return $args;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Which worked quite well, assuming the first part was done right.  From here you could grab the cookie data in an array (say $cookie = get_facebook_cookie...) and get going.  The key bit about this cookie is that it carries an “access token” which you needed to pass to the Graph API in order to get the data you requested in the fbLogin perms field.  Now the examples you see at &lt;a href="http://developers.facebook.com/docs/guides/web#personalization"&gt;http://developers.facebook.com/docs/guides/web#personalization&lt;/a&gt; would have you think the key is “oauth_access_token”.  But the example at the bottom of &lt;a href="http://developers.facebook.com/docs/authentication/"&gt;http://developers.facebook.com/docs/authentication/&lt;/a&gt; says its “access_token”.  I was unfortunate enough to not immediately notice the difference, and was left wondering why my cookie didn't have the “oauth_access_token”.  After an hour or so of fighting, I finally realized my var_dump contained an “access_token” and was able to catch the problem.  Thus I was finally able to use code like:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;$user = json_decode(file_get_contents( 'https://graph.facebook.com/me?access_token=' . $cookie['access_token']));&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;To get my facebook data.  Just one final tip – in case anyone else is trying the same thing – don't use file_get_contents.  Use curl.  Like this:&lt;br /&gt;    &lt;blockquote&gt;  $ch = curl_init('https://graph.facebook.com/me?access_token=' .    $cookie['access_token']);&lt;br /&gt;       curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);&lt;br /&gt;      $fbResponse = curl_exec($ch);&lt;br /&gt;      curl_close($ch);&lt;br /&gt;      $userDetails = json_decode($fbResponse);&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I was also able to finish the LaTeX editor for Ouray (even transparent png outputs!) Thanks to ImageMagick and a great tutorial from &lt;a href="http://www.linuxjournal.com/article/7870"&gt;http://www.linuxjournal.com/article/7870&lt;/a&gt;.  Essentially, I just wrote a PHP class to do the batch scripting.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-1827931828652598356?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/1827931828652598356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2010/06/ouray-facebook-connect-latex-editor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/1827931828652598356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/1827931828652598356'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2010/06/ouray-facebook-connect-latex-editor.html' title='Ouray – The Facebook Connect LaTeX editor Chat Room.'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2817592795075516705.post-7848290083221815488</id><published>2010-06-07T04:53:00.001-07:00</published><updated>2010-06-07T04:53:21.282-07:00</updated><title type='text'>more coming soon...</title><content type='html'>watch this space.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2817592795075516705-7848290083221815488?l=mebdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mebdev.blogspot.com/feeds/7848290083221815488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mebdev.blogspot.com/2010/06/more-coming-soon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/7848290083221815488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2817592795075516705/posts/default/7848290083221815488'/><link rel='alternate' type='text/html' href='http://mebdev.blogspot.com/2010/06/more-coming-soon.html' title='more coming soon...'/><author><name>Matthew Eric Bassett</name><uri>http://www.blogger.com/profile/10576806213820001905</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_48nnRy6f0lA/S2QkkaOwFcI/AAAAAAAAAAM/W8lGkyRcOik/s1600-R/6240_521602951720_37903974_30890041_372769_n.jpg'/></author><thr:total>0</thr:total></entry></feed>
