msc-projects-14.html
changeset 333 846966afdad1
parent 331 70142c708a91
child 334 3238418b70ca
equal deleted inserted replaced
332:37b2df329532 333:846966afdad1
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
       
     3 <HEAD>
       
     4 <TITLE>2014/15 MSc Projects</TITLE>
       
     5 <BASE HREF="http://www.inf.kcl.ac.uk/staff/urbanc/">
       
     6 <script type="text/javascript" src="striper.js"></script>
       
     7 <link rel="stylesheet" href="nominal.css">
       
     8 <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
       
     9 </script>
       
    10 </HEAD>
       
    11 <BODY TEXT="#000000" 
       
    12       BGCOLOR="#4169E1" 
       
    13       LINK="#0000EF" 
       
    14       VLINK="#51188E" 
       
    15       ALINK="#FF0000"
       
    16       ONLOAD="striper('ul','striped','li','first,second')">
       
    17 
       
    18 
       
    19 
       
    20 <TABLE WIDTH="100%" 
       
    21        BGCOLOR="#4169E1" 
       
    22        BORDER="0"   
       
    23        FRAME="border"  
       
    24        CELLPADDING="10"     
       
    25        CELLSPACING="2"
       
    26        RULES="all">
       
    27 
       
    28 <TR>
       
    29 <TD BGCOLOR="#FFFFFF" 
       
    30     WIDTH="75%" 
       
    31     VALIGN="TOP">
       
    32 
       
    33 <H2>2014/15 MSc Projects</H2>
       
    34 <H4>Supervisor: Christian Urban</H4> 
       
    35 <H4>Email: christian dot urban at kcl dot ac dot uk,  Office: Strand Building S1.27</H4>
       
    36 <H4>If you are interested in a project, please send me an email and we can discuss details. Please include
       
    37 a short description about your programming skills and Computer Science background in your first email. 
       
    38 I will also need your King's username in order to book the project for you. Thanks.</H4> 
       
    39 
       
    40 <H4>Note that besides being a lecturer at the theoretical end of Computer Science, I am also a passionate
       
    41     <A HREF="http://en.wikipedia.org/wiki/Hacker_(programmer_subculture)">hacker</A> &hellip;
       
    42     defined as &ldquo;a person who enjoys exploring the details of programmable systems and 
       
    43     stretching their capabilities, as opposed to most users, who prefer to learn only the minimum 
       
    44     necessary.&rdquo; I am always happy to supervise like-minded students.</H4>  
       
    45 
       
    46 <ul class="striped">
       
    47 <li> <H4>[CU1] Regular Expression Matching and Derivatives</H4>
       
    48 
       
    49   <p>
       
    50   <B>Description:</b>  
       
    51   <A HREF="http://en.wikipedia.org/wiki/Regular_expression">Regular expressions</A> 
       
    52   are extremely useful for many text-processing tasks such as finding patterns in texts,
       
    53   lexing programs, syntax highlighting and so on. Given that regular expressions were
       
    54   introduced in 1950 by <A HREF="http://en.wikipedia.org/wiki/Stephen_Cole_Kleene">Stephen Kleene</A>,
       
    55   you might think regular expressions have since been studied and implemented to death. But you would definitely be
       
    56   mistaken: in fact they are still an active research area. For example
       
    57   <A HREF="http://www.home.hs-karlsruhe.de/~suma0002/publications/regex-parsing-derivatives.pdf">this paper</A> 
       
    58   about regular expression matching and derivatives was presented just last summer at the international 
       
    59   FLOPS'14 conference. The task in this project is to implement their results.</p>
       
    60 
       
    61   <p>The background for this project is that some regular expressions are 
       
    62   &ldquo;<A HREF="http://en.wikipedia.org/wiki/ReDoS#Examples">evil</A>&rdquo;
       
    63   and can &ldquo;stab you in the back&rdquo; according to
       
    64   this <A HREF="http://peterscott.github.io/2013/01/17/regular-expressions-will-stab-you-in-the-back/">blog post</A>.
       
    65   For example, if you use in <A HREF="http://www.python.org">Python</A> or 
       
    66   in <A HREF="http://www.ruby-lang.org/en/">Ruby</A> (or also in a number of other mainstream programming languages according to this
       
    67   <A HREF="http://www.computerbytesman.com/redos/">blog</A>) the 
       
    68   innocently looking regular expression <code>a?{28}a{28}</code> and match it, say, against the string 
       
    69   <code>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</code> (that is 28 <code>a</code>s), you will soon notice that your CPU usage goes to 100%. In fact,
       
    70   Python and Ruby need approximately 30 seconds of hard work for matching this string. You can try it for yourself:
       
    71   <A HREF="http://www.dcs.kcl.ac.uk/staff/urbanc/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/re.py">re.py</A> (Python version) and 
       
    72   <A HREF="http://www.dcs.kcl.ac.uk/staff/urbanc/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/re.rb">re.rb</A> 
       
    73   (Ruby version). You can imagine an attacker
       
    74   mounting a nice <A HREF="http://en.wikipedia.org/wiki/Denial-of-service_attack">DoS attack</A> against 
       
    75   your program if it contains such an &ldquo;evil&rdquo; regular expression. Actually 
       
    76   <A HREF="http://www.scala-lang.org/">Scala</A> (and also Java) are almost immune from such
       
    77   attacks as they can deal with strings of up to 4,300 <code>a</code>s in less than a second. But if you scale
       
    78   the regular expression and string further to, say, 4,600 <code>a</code>s, then you get a <code>StackOverflowError</code> 
       
    79   potentially crashing your program. Moreover (beside the "minor" problem of being painfully slow) according to this
       
    80   <A HREF="http://www.haskell.org/haskellwiki/Regex_Posix">report</A>
       
    81   nearly all POSIX regular expression matchers are actually buggy.
       
    82   </p>
       
    83 
       
    84   <p>
       
    85   On a rainy afternoon, I implemented 
       
    86   <A HREF="http://www.dcs.kcl.ac.uk/staff/urbanc/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/re3.scala">this</A> 
       
    87   regular expression matcher in Scala. It is not as fast as the official one in Scala, but
       
    88   it can match up to 11,000 <code>a</code>s in less than 5 seconds  without raising any exception
       
    89   (remember Python and Ruby both need nearly 30 seconds to process 28(!) <code>a</code>s, and Scala's
       
    90   official matcher maxes out at 4,600 <code>a</code>s). My matcher is approximately
       
    91   85 lines of code and based on the concept of 
       
    92   <A HREF="http://lambda-the-ultimate.org/node/2293">derivatives of regular expressions</A>.
       
    93   These derivatives were introduced in 1964 by <A HREF="http://en.wikipedia.org/wiki/Janusz_Brzozowski_(computer_scientist)">
       
    94   Janusz Brzozowski</A>, but according to this 
       
    95   <A HREF="http://www.cl.cam.ac.uk/~so294/documents/jfp09.pdf">paper</A> had been lost in the &ldquo;sands of time&rdquo;.
       
    96   The advantage of derivatives is that they side-step completely the usual 
       
    97   <A HREF="http://hackingoff.com/compilers/regular-expression-to-nfa-dfa">translations</A> of regular expressions
       
    98   into NFAs or DFAs, which can introduce the exponential behaviour exhibited by the regular
       
    99   expression matchers in Python and Ruby.
       
   100   </p>
       
   101 
       
   102   <p>
       
   103   Now the authors from the 
       
   104   <A HREF="http://www.home.hs-karlsruhe.de/~suma0002/publications/regex-parsing-derivatives.pdf">FLOPS'14-paper</A> mentioned 
       
   105   above claim they are even faster than me and can deal with even more features of regular expressions
       
   106   (for example subexpression matching, which my rainy-afternoon matcher cannot). I am sure they thought
       
   107   about the problem much longer than a single afternoon. The task 
       
   108   in this project is to find out how good they actually are by implementing the results from their paper. 
       
   109   Their approach is based on the concept of derivatives.
       
   110   I used them once myself in a <A HREF="http://www.inf.kcl.ac.uk/staff/urbanc/Publications/rexp.pdf">paper</A> 
       
   111   in order to prove the <A HREF="http://en.wikipedia.org/wiki/Myhill–Nerode_theorem">Myhill-Nerode theorem</A>.
       
   112   So I know they are worth their money. Still, it would be interesting to actually compare their results
       
   113   with my simple rainy-afternoon matcher and potentially &ldquo;blow away&rdquo; the regular expression matchers 
       
   114   in Python and Ruby (and possibly in Scala too). The application would be to implement a fast lexer for
       
   115   programming languages. 
       
   116   </p>
       
   117 
       
   118   <p>
       
   119   <B>Literature:</B> 
       
   120   The place to start with this project is obviously this
       
   121   <A HREF="http://www.home.hs-karlsruhe.de/~suma0002/publications/ppdp12-part-deriv-sub-match.pdf">paper</A>.
       
   122   Traditional methods for regular expression matching are explained
       
   123   in the Wikipedia articles 
       
   124   <A HREF="http://en.wikipedia.org/wiki/DFA_minimization">here</A> and 
       
   125   <A HREF="http://en.wikipedia.org/wiki/Powerset_construction">here</A>.
       
   126   The authoritative <A HREF="http://infolab.stanford.edu/~ullman/ialc.html">book</A>
       
   127   on automata and regular expressions is by John Hopcroft and Jeffrey Ullmann (available in the library). 
       
   128   There is also an online course about this topic by Ullman at 
       
   129   <A HREF="https://www.coursera.org/course/automata">Coursera</A>, though IMHO not 
       
   130   done with love. 
       
   131   Finally, there are millions of other pointers about regular expression
       
   132   matching on the Web. I found the chapter on Lexing in this
       
   133   <A HREF="http://www.diku.dk/~torbenm/Basics/">online book</A> very helpful.
       
   134   Test cases for &ldquo;<A HREF="http://en.wikipedia.org/wiki/ReDoS#Examples">evil</A>&rdquo;
       
   135   regular expressions can be obtained from <A HREF="http://www.haskell.org/haskellwiki/Regex_Posix">here</A>.
       
   136   
       
   137   </p>
       
   138 
       
   139   <p>
       
   140   <B>Skills:</B> 
       
   141   This is a project for a student with an interest in theory and some
       
   142   reasonable programming skills. The project can be easily implemented
       
   143   in functional languages like
       
   144   <A HREF="http://www.scala-lang.org/">Scala</A>,
       
   145   F#, 
       
   146   <A HREF="http://en.wikipedia.org/wiki/Standard_ML">ML</A>,  
       
   147   <A HREF="http://haskell.org/haskellwiki/Haskell">Haskell</A>, etc. Python and other non-functional languages
       
   148   can be also used, but seem much less convenient.
       
   149   </p>
       
   150   
       
   151 <li> <H4>[CU2] A Compiler for a small Programming Language</H4>
       
   152 
       
   153   <p>
       
   154   <b>Description:</b> 
       
   155   Compilers translate high-level programs that humans can read and write into
       
   156   efficient machine code that can be run on a CPU or virtual machine.
       
   157   A compiler for a simple functional language generating X86 code is described
       
   158   <A HREF="https://github.com/chameco/Shade">here</A>.
       
   159   I recently implemented a very simple compiler for an even simpler functional
       
   160   programming language following this 
       
   161   <A HREF="http://www.cs.princeton.edu/~dpw/papers/tal-toplas.pdf">paper</A> 
       
   162   (also described <A HREF="http://www.cs.princeton.edu/~dpw/papers/tal-tr.pdf">here</A>).
       
   163   My code, written in <A HREF="http://www.scala-lang.org/">Scala</A>, of this compiler is 
       
   164   <A HREF="http://www.dcs.kcl.ac.uk/staff/urbanc/compiler.scala">here</A>.
       
   165   The compiler can deal with simple programs involving natural numbers, such
       
   166   as Fibonacci numbers or factorial (but it can be easily extended - that is not the point).
       
   167   </p>
       
   168 
       
   169   <p>
       
   170   While the hard work has been done (understanding the two papers above),
       
   171   my compiler only produces some idealised machine code. For example I
       
   172   assume there are infinitely many registers. The goal of this
       
   173   project is to generate machine code that is more realistic and can
       
   174   run on a CPU, like X86, or run on a virtual machine, say the JVM. 
       
   175   This gives probably a speedup of thousand times in comparison to
       
   176   my naive machine code and virtual machine. The project
       
   177   requires to dig into the literature about real CPUs and generating 
       
   178   real machine code. 
       
   179   </p>
       
   180   <p>
       
   181   An alternative is to not generate machine code, but build a compiler that compiles to
       
   182   <A HREF="http://www.w3schools.com/js/">JavaScript</A>. This is the language that is supported by most
       
   183   browsers and therefore is a favourite
       
   184   vehicle for Web-programming. Some call it <B>the</B> scripting language of the Web.
       
   185   Unfortunately, JavaScript is also probably one of the worst
       
   186   languages to program in (being designed and released in a hurry). <B>But</B> it can be used as a convenient target
       
   187   for translating programs from other languages. In particular there are two
       
   188   very optimised subsets of JavaScript that can be used for this purpose:
       
   189   one is <A HREF="http://asmjs.org">asm.js</A> and the other is
       
   190   <A HREF="https://github.com/kripken/emscripten/wiki">emscripten</A>.
       
   191   There is a <A HREF="http://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html">tutorial</A> for emscripten
       
   192   and an impressive <A HREF="http://www.unrealengine.com/html5/">demo</A> which runs the
       
   193   <A HREF="http://en.wikipedia.org/wiki/Unreal_Engine">Unreal Engine 3</A>
       
   194   in a browser with spectacular speed. This was achieved by compiling the
       
   195   C-code of the Unreal Engine to the LLVM intermediate language and then translating the LLVM
       
   196   code to JavaScript.
       
   197   </p>
       
   198 
       
   199   <p>
       
   200   <B>Literature:</B>
       
   201   There is a lot of literature about compilers 
       
   202   (for example <A HREF="http://www.cs.princeton.edu/~appel/papers/cwc.html">this book</A> -
       
   203   I can lend you my copy for the duration of the project, or this
       
   204   <A HREF="http://www.diku.dk/~torbenm/Basics/">online book</A>). A very good overview article
       
   205   about implementing compilers by 
       
   206   <A HREF="http://tratt.net/laurie/">Laurie Tratt</A> is 
       
   207   <A HREF="http://tratt.net/laurie/tech_articles/articles/how_difficult_is_it_to_write_a_compiler">here</A>.
       
   208   An online book about the Art of Assembly Language is
       
   209   <A HREF="http://flint.cs.yale.edu/cs422/doc/art-of-asm/pdf/">here</A>.
       
   210   An introduction into x86 machine code is <A HREF="http://ianseyler.github.com/easy_x86-64/">here</A>.
       
   211   Intel's official manual for the x86 instruction is 
       
   212   <A HREF="http://download.intel.com/design/intarch/manuals/24319101.pdf">here</A>. 
       
   213   A simple assembler for the JVM is described <A HREF="http://jasmin.sourceforge.net">here</A>.
       
   214   An interesting twist of this project is to not generate code for a CPU, but
       
   215   for the intermediate language of the <A HREF="http://llvm.org">LLVM</A> compiler
       
   216   (also described <A HREF="http://llvm.org/docs/LangRef.html">here</A>). If you want to see
       
   217   what machine code looks like you can compile your C-program using gcc -S.
       
   218   </p>
       
   219   <p>
       
   220   If JavaScript is chosen as a target instead, then there are plenty of <A HREF="http://www.w3schools.com/js/">tutorials</A> on the Web.
       
   221   <A HREF="http://jsbooks.revolunet.com">Here</A> is a list of free books on JavaScript.
       
   222   A project from which you can draw inspiration is this
       
   223   <A HREF="http://jlongster.com/2012/01/04/outlet-my-lisp-to-javascript-experiment.html">List-to-JavaScript</A>
       
   224   translator. <A HREF="https://bitbucket.org/ktg/parenjs/overview">Here</A> is another such project.
       
   225   And <A HREF="https://github.com/viclib/liscript">another</A> in less than 100 lines of code.
       
   226   <A HREF="http://en.wikipedia.org/wiki/CoffeeScript">Coffeescript</A> is a similar project
       
   227   except that it is already quite <A HREF="http://coffeescript.org">mature</A>. And finally not to
       
   228   forget <A HREF="http://www.typescriptlang.org">TypeScript</A> developed by Microsoft. The main
       
   229   difference between these projects and this one is that they translate into relatively high-level
       
   230   JavaScript code; none of them use the much lower levels <A HREF="http://asmjs.org">asm.js</A> and 
       
   231   <A HREF="https://github.com/kripken/emscripten/wiki">emscripten</A>.
       
   232   </p>
       
   233   <p>
       
   234   <B>Skills:</B> 
       
   235   This is a project for a student with a deep interest in programming languages and
       
   236   compilers. Since my compiler is implemented in <A HREF="http://www.scala-lang.org/">Scala</A>,
       
   237   it would make sense to continue this project in this language. I can be
       
   238   of help with questions and books about <A HREF="http://www.scala-lang.org/">Scala</A>.
       
   239   But if Scala is a problem, my code can also be translated quickly into any other functional
       
   240   language. 
       
   241   </p>
       
   242 
       
   243   <p>
       
   244   <B>PS:</B> Compiler projects, like this one or [CU8], consistently received high marks in the past.
       
   245   I suprvised four so far and none of them received a mark below 70% - one even was awarded a prize.
       
   246   </p>
       
   247 
       
   248 <li> <H4>[CU3] Slide-Making in the Web-Age</H4>
       
   249 
       
   250   <p>
       
   251   The standard technology for writing scientific papers in Computer Science  is to use
       
   252   <A HREF="http://en.wikipedia.org/wiki/LaTeX">LaTeX</A>, a document preparation
       
   253   system originally implemented by <A HREF="http://en.wikipedia.org/wiki/Donald_Knuth">Donald Knuth</A>
       
   254   and <A HREF="http://en.wikipedia.org/wiki/Leslie_Lamport">Leslie Lamport</A>.
       
   255   LaTeX produces very pleasantly looking documents, can deal nicely with mathematical
       
   256   formulas and is very flexible. If you are interested, <A HREF="http://openwetware.org/wiki/Word_vs._LaTeX">here</A>
       
   257   is a side-by-side comparison between Word and LaTeX (which LaTeX &ldquo;wins&rdquo; with 18 out of 21 points).
       
   258   Computer scientists not only use LaTeX for documents,
       
   259   but also for slides (really, nobody who wants to be cool uses Keynote or Powerpoint).
       
   260   </p>
       
   261 
       
   262   <p>
       
   263   Although used widely, LaTeX seems nowadays a bit dated for producing
       
   264   slides. Unlike documents, which are typically &ldquo;static&rdquo; and published in a book or journal,
       
   265   slides often contain changing contents that might first only be partially visible and
       
   266   only later be revealed as the &ldquo;story&rdquo; of a talk or lecture demands.
       
   267   Also slides often contain animated algorithms where each state in the
       
   268   calculation is best explained by highlighting the changing data.
       
   269   </p>
       
   270 
       
   271   <p>
       
   272   It seems HTML and JavaScript are much better suited for generating
       
   273   such animated slides. This <A HREF="http://www.impressivewebs.com/html-slidedeck-toolkits/">page</A>
       
   274   links to 22 slide-generating programs using this combination of technologies. 
       
   275   However, the problem with all of these project is that they depend heavily on the users being
       
   276   able to write JavaScript, CCS or HTML...not something one would like to depend on given that
       
   277   &ldquo;normal&rdquo; users likely only have a LaTeX background. The aim of this project is to invent a
       
   278   very simple language that is inspired by LaTeX and then generate from code written in this language
       
   279   slides that can be displayed in a web-browser.
       
   280   </p>
       
   281 
       
   282  <p>
       
   283  This sounds complicated, but there is already some help available:
       
   284  <A HREF="http://www.mathjax.org">Mathjax</A> is a JavaScript library that can
       
   285  be used to display mathematical text, for example
       
   286 
       
   287  <blockquote>
       
   288  <p>When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
       
   289  \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\).</p>
       
   290  </blockquote>
       
   291 
       
   292  by writing code in the familiar LaTeX-way. This can be reused.
       
   293  Another such library is <A HREF="http://khan.github.io/KaTeX/">KaTeX</A>.
       
   294  There are also plenty of JavaScript
       
   295  libraries for graphical animations (for example
       
   296  <A HREF="http://raphaeljs.com">Raphael</A>,
       
   297  <A HREF="http://svgjs.com">SVG.JS</A>,
       
   298  <A HREF="http://bonsaijs.org">Bonsaijs</A>,
       
   299  <A HREF="http://jsxgraph.uni-bayreuth.de/wp/">JSXGraph</A>). The inspiration for how the user should be able to write
       
   300  slides could come from the LaTeX packages <A HREF="http://en.wikipedia.org/wiki/Beamer_(LaTeX)">Beamer</A>
       
   301  and <A HREF="http://en.wikipedia.org/wiki/PGF/TikZ">PGF/TikZ</A>.
       
   302  </p>
       
   303 
       
   304   <p>
       
   305   <B>Skills:</B> 
       
   306   This is a project requires good knowledge of JavaScript. You need to be able to
       
   307   parse a language and translate it to a suitable part of JavaScript using
       
   308   appropriate libraries. Tutorials for JavaScript are <A HREF="http://www.w3schools.com/js/">here</A>.
       
   309   A parser generator for JavaScript is <A HREF="http://pegjs.majda.cz">here</A>. There are probably also
       
   310   others. If you want to avoid JavaScript there are a number of alternatives: for example the
       
   311   <A HREF="http://elm-lang.org">Elm</A>
       
   312   language has been especially designed for implementing easily interactive animations, which would be
       
   313   very convenient for this project.
       
   314   </p>
       
   315 
       
   316 <li> <H4>[CU4] An Online Student Voting System</H4>
       
   317 
       
   318   <p>
       
   319   <B>Description:</B>
       
   320   One of the more annoying aspects of giving a lecture is to ask a question
       
   321   to the students and no matter how easy the question is to not 
       
   322   receive any answer. The online course system 
       
   323   <A HREF="http://www.udacity.com">Udacity</A>, in contrast, made an art out of
       
   324   asking questions during lectures (see for example the
       
   325   <A HREF="http://www.udacity.com/overview/Course/cs253/CourseRev/apr2012">Web Application Engineering</A> 
       
   326   course CS253).
       
   327   The lecturer there gives multiple-choice questions as part of the lecture and the students need to 
       
   328   click on the appropriate answer. This works very well in the online world. 
       
   329   For  &ldquo;real-world&rdquo; lectures, the department has some 
       
   330   <A HREF="http://en.wikipedia.org/wiki/Audience_response">clickers</A>
       
   331   (these are little devices which form a part of an audience response systems). However, 
       
   332   they are a logistic nightmare for the lecturer: they need to be distributed 
       
   333   during the lecture and collected at the end. Nowadays, where students
       
   334   come with their own laptop or smartphone to lectures, this can
       
   335   be improved.
       
   336   </p>
       
   337 
       
   338   <p>
       
   339   The task of this project is to implement an online student
       
   340   polling system. The lecturer should be able to prepare 
       
   341   questions beforehand (encoded as some web-form) and be able to 
       
   342   show them during the lecture. The students
       
   343   can give their answers by clicking on the corresponding webpage.
       
   344   The lecturer can then collect the responses online and evaluate them 
       
   345   immediately. Such a system is sometimes called
       
   346   <A HREF="http://en.wikipedia.org/wiki/Audience_response#Smartphone_.2F_HTTP_voting">HTML voting</A>. 
       
   347   There are a number of commercial
       
   348   solutions for this problem, but they are not easy to use (in addition
       
   349   to being ridiculously expensive). A good student can easily improve upon
       
   350   what they provide. 
       
   351   </p>
       
   352 
       
   353   <p>
       
   354   The problem of student polling is not as hard as 
       
   355   <A HREF="http://en.wikipedia.org/wiki/Electronic_voting">electronic voting</A>, 
       
   356   which essentially is still an unsolved problem in Computer Science. The
       
   357   students only need to be prevented from answering question more than once thus skewing
       
   358   any statistics. Unlike electronic voting, no audit trail needs to be kept
       
   359   for student polling. Restricting the number of answers can probably be solved 
       
   360   by setting appropriate cookies on the students
       
   361   computers or smart phones.
       
   362   </p>
       
   363 
       
   364   <p>
       
   365   <B>Literature:</B> 
       
   366   The project requires fluency in a web-programming language (for example 
       
   367   <A HREF="http://en.wikipedia.org/wiki/JavaScript">JavaScript</A>,
       
   368   <A HREF="http://en.wikipedia.org/wiki/Go_(programming_language)">Go</A>, 
       
   369   <A HREF="http://www.scala-lang.org/">Scala</A>). However JavaScript with
       
   370   the <A HREF="http://nodejs.org">Node.js</A> extension seems to be best suited for the job.
       
   371   <A HREF="http://www.nodebeginner.org">Here</A> is a tutorial on Node.js for beginners.
       
   372   For web-programming the 
       
   373   <A HREF="http://www.udacity.com/overview/Course/cs253/CourseRev/apr2012">Web Application Engineering</A>
       
   374   course at <A HREF="http://www.udacity.com">Udacity</A> is a good starting point 
       
   375   to be aware of the issues involved. This course uses <A HREF="http://www.python.org">Python</A>.
       
   376   To evaluate the answers from the students, Google's 
       
   377   <A HREF="https://developers.google.com/chart/image/docs/making_charts">Chart Tools</A>
       
   378   might be useful, which is also described in this 
       
   379   <A HREF="http://www.youtube.com/watch?v=NZtgT4jgnE8">youtube</A> video.
       
   380   </p>
       
   381 
       
   382   <p>
       
   383   <B>Skills:</B> 
       
   384   In order to provide convenience for the lecturer, this project needs very good web-programming skills. A  
       
   385   <A HREF="http://en.wikipedia.org/wiki/Hacker_(programmer_subculture)">hacker mentality</A>
       
   386   (see above) is probably also very beneficial: web-programming is an area that only emerged recently and
       
   387   many tools still lack maturity. You probably have to experiment a lot with several different
       
   388   languages and tools.
       
   389   </p>
       
   390 
       
   391 <li> <H4>[CU5] Raspberry Pi's and Arduinos</H4>
       
   392 
       
   393   <p>
       
   394   <B>Description:</B>
       
   395   This project is for true hackers! <A HREF="http://en.wikipedia.org/wiki/Raspberry_Pi">Raspberry Pi's</A>
       
   396   are small Linux computers the size of a credit-card and only cost &pound;34 (see picture on the left below). They were introduced
       
   397   in 2012 and people went crazy...well some of them. There is a
       
   398   <A HREF="https://plus.google.com/communities/113390432655174294208?hl=en">Google+</A> community about Raspberry Pi's that has more
       
   399   than 172k of followers. It is hard to keep up with what people do with these small computers. The possibilities
       
   400   seem to be limitless. The main resource for Raspberry Pi's is <A HREF="http://www.raspberrypi.org">here</A>.
       
   401   There are <A HREF="http://www.themagpi.com">magazines</A> dedicated to them and tons of
       
   402   <A HREF="http://www.raspberrypi.org/phpBB3/viewforum.php?f=39">books</A> (not to mention
       
   403   floods of <A HREF="https://www.google.co.uk/search?q=raspberry+pi">online</A> material).
       
   404   Google just released a
       
   405   <A HREF="http://googlecreativelab.github.io/coder/">framework</A>
       
   406   for web-programming on Raspberry Pi's truning them into webservers.
       
   407   </p>
       
   408 
       
   409   <p>
       
   410   <A HREF="http://en.wikipedia.org/wiki/Arduino">Arduinos</A> are slightly older (from 2005) but still very cool (see picture on the right below). They
       
   411   are small single-board micro-controllers that can talk to various external gadgets (sensors, motors, etc). Since Arduinos
       
   412   are open-software and open-hardware there are many clones and add-on boards. Like for the Raspberry Pi, there
       
   413   is a lot of material <A HREF="https://www.google.co.uk/search?q=arduino">available</A> about Arduinos.
       
   414   The main reference is <A HREF="http://www.arduino.cc">here</A>. Like the Raspberry Pi's, the good thing about
       
   415   Arduinos is that they can be powered with simple AA-batteries.
       
   416   </p>
       
   417 
       
   418   <p>
       
   419   I have two such Raspberry Pi's including wifi-connectors and two <A HREF="http://www.raspberrypi.org/camera">cameras<A>.
       
   420   I also have two <A HREF="http://www.freaklabs.org/index.php/Blog/Store/Introducing-the-Freakduino-Chibi-An-Arduino-based-Board-For-Wireless-Sensor-Networking.html">Freakduino Boards</A> that are Arduinos extended with wireless communication. I can lend them to responsible
       
   421   students for one or two projects. However, the aim is to first come up with an idea for a project. Popular projects are
       
   422   automated temperature sensors, network servers, robots, web-cams (<A HREF="http://www.secretbatcave.co.uk/electronics/shard-rain-cam/">here</A>
       
   423   is a <A HREF="http://www.raspberrypi.org/archives/3547">web-cam</A> directed at the Shard that can
       
   424   <A HREF="http://www.secretbatcave.co.uk/software/shard-rain-cam-quantifying-cloudy/">tell</A>
       
   425   you whether it is raining or cloudy). There are plenty more ideas listed
       
   426   <A HREF="http://www.raspberrypi.org/phpBB3/viewforum.php?f=15">here</A> for Raspberry Pi's and
       
   427   <A HREF="http://playground.arduino.cc/projects/ideas">here</A> for Arduinos.
       
   428   </p>
       
   429 
       
   430   <p>
       
   431   There are essentially two kinds of projects: One is purely software-based. Software projects for Raspberry Pi's are often
       
   432   written in <A HREF="http://www.python.org">Python</A>, but since these are Linux-capable computers any other
       
   433   language would do as well. You can also write your own operating system as done
       
   434   <A HREF="http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/">here</A>. For example the students
       
   435   <A HREF="http://www.recantha.co.uk/blog/?p=4918">here</A> developed their own bare-metal OS and then implemented
       
   436   a chess-program on top of it (have a look at their very impressive
       
   437   <A HREF="http://www.youtube.com/watch?v=-03bouPsfEQ&feature=player_embedded">youtube</A> video).
       
   438   The other kind of project is a combination of hardware and software; usually attaching some sensors
       
   439   or motors to the Raspberry Pi or Arduino. This might require some soldering or what is called
       
   440   a <A HREF="http://en.wikipedia.org/wiki/Breadboard">bread-board</A>. But be careful before choosing a project
       
   441   involving new hardware: these devices
       
   442   can be destroyed (if &ldquo;Vin connected to GND&rdquo; or &ldquo;drawing more than 30mA from a GPIO&rdquo;
       
   443   does not make sense to you, you should probably stay away from such a project). 
       
   444   </p>
       
   445 
       
   446   <p>
       
   447   <center>
       
   448   <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;
       
   449   "src="http://upload.wikimedia.org/wikipedia/commons/3/3d/RaspberryPi.jpg" width="313" height="209">
       
   450 
       
   451   <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;
       
   452   "src="http://upload.wikimedia.org/wikipedia/commons/3/38/Arduino_Uno_-_R3.jpg" width="240" height="209">
       
   453   </center>
       
   454   </p>
       
   455 
       
   456   <p>
       
   457   <B>Skills:</B> 
       
   458   Well, you must be a hacker; happy to make things. Your desk might look like on the photo on the left.
       
   459   The right photo shows an earlier student project which connects wirelessly a wearable Arduino (packaged
       
   460   in a "self-3d-printed" watch) to a Raspberry Pi seen in the background. The Arduino takes meaurements of 
       
   461   heart rate and body temperature; the Raspberry Pi collects this data and makes it accessible via a simple
       
   462   web-service.
       
   463   <center>
       
   464   <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;
       
   465   "src="http://www.inf.kcl.ac.uk/staff/urbanc/rpi-photo.jpg" width="209" height="313">
       
   466 
       
   467   <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;
       
   468   "src="http://www.inf.kcl.ac.uk/staff/urbanc/rpi-watch.jpg" width="450" height="254">
       
   469   </center>
       
   470   </p>
       
   471 
       
   472 <li> <H4>[CU6] Generating Testcases from a Specification</H4>
       
   473 
       
   474 <li> <H4>[CU7] GPRS + GPS for Arduinos</H4>
       
   475 
       
   476 <li> <H4>[CU8] Language Translator into JavaScript</H4>
       
   477 
       
   478   <p>
       
   479   <b>Description:</b> 
       
   480   <A HREF="http://www.w3schools.com/js/">JavaScript</A> is a language that is supported by most
       
   481   browsers and therefore is a favourite
       
   482   vehicle for Web-programming. Some call it <B>the</B> scripting language of the Web.
       
   483   Unfortunately, JavaScript is probably one of the worst
       
   484   languages to program in (being designed and released in a hurry). <B>But</B> it can be used as a convenient target
       
   485   for translating programs from other languages. In particular there are two
       
   486   very optimised subsets of JavaScript that can be used for this purpose:
       
   487   one is <A HREF="http://asmjs.org">asm.js</A> and the other is
       
   488   <A HREF="https://github.com/kripken/emscripten/wiki">emscripten</A>.
       
   489   There is a <A HREF="https://github.com/kripken/emscripten/wiki/Tutorial">tutorial</A> for emscripten
       
   490   and an impressive <A HREF="http://www.unrealengine.com/html5/">demo</A> which runs the
       
   491   <A HREF="http://en.wikipedia.org/wiki/Unreal_Engine">Unreal Engine 3</A>
       
   492   in a browser with spectacular speed. This was achieved by compiling the
       
   493   C-code of the Unreal Engine to the LLVM intermediate language and then translating the LLVM
       
   494   code to JavaScript.
       
   495   </p>
       
   496 
       
   497   <p>
       
   498   <B>Skills:</B> 
       
   499   This project is about exploring these two subsets of JavaScript and implement a translator
       
   500   of a small language into them.  This is similar to the project [CU2] above and requires
       
   501   similar skills. In addition it would be good to have already some familiarity with JavaScript.
       
   502   There are plenty of <A HREF="http://www.w3schools.com/js/">tutorials</A> on the Web.
       
   503   <A HREF="http://jsbooks.revolunet.com">Here</A> is a list of free books on JavaScript.
       
   504   This is a project for a student who wants to get more familiar with JavaScript and Web-programming.
       
   505   A project from which you can draw inspiration is this
       
   506   <A HREF="http://jlongster.com/2012/01/04/outlet-my-lisp-to-javascript-experiment.html">List-to-JavaScript</A>
       
   507   translator. <A HREF="https://bitbucket.org/ktg/parenjs/overview">Here</A> is another such project.
       
   508   And <A HREF="https://github.com/viclib/liscript">another</A> in less than 100 lines of code.
       
   509   <A HREF="http://en.wikipedia.org/wiki/CoffeeScript">Coffeescript</A> is a similar project
       
   510   except that it is already quite <A HREF="http://coffeescript.org">mature</A>. And finally not to
       
   511   forget <A HREF="http://www.typescriptlang.org">TypeScript</A> developed by Microsoft. The main
       
   512   difference between these projects and this one is that they translate into relatively high-level
       
   513   JavaScript code; none of them use the much lower levels <A HREF="http://asmjs.org">asm.js</A> and 
       
   514   <A HREF="https://github.com/kripken/emscripten/wiki">emscripten</A>.
       
   515 </p>
       
   516 
       
   517 
       
   518 
       
   519 <li> <H4>[CU9] An Infrastructure for Displaying and Animating Code in a Web-Browser</H4>
       
   520   
       
   521 <p>
       
   522   <B>Description:</B>
       
   523   The project aim is to implement an infrastructure for displaying and
       
   524   animating code in a web-browser. The infrastructure should be agnostic
       
   525   with respect to the programming language, but should be configurable.
       
   526   I envisage something smaller than the projects 
       
   527   <A HREF="http://www.pythontutor.com">here</A> (for Python),
       
   528   <A HREF="http://ideone.com">here</A> (for Java),
       
   529   <A HREF="http://codepad.org">here</A> (for multiple languages),
       
   530   <A HREF="http://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro">here</A> (for HTML)
       
   531   <A HREF="http://repl.it/languages/JavaScript">here</A> (for JavaScript),
       
   532   and <A HREF="http://www.scala-tour.com/#/welcome">here</A> (for Scala).
       
   533   </p>
       
   534 
       
   535   <p>
       
   536   The tasks in this project are being able (1) to lex and parse languages and (2) to write an interpreter.
       
   537   The goal is to implement this as much as possible in a language-agnostic fashion.
       
   538   </p>
       
   539 
       
   540   <p>
       
   541   <B>Skills:</B> 
       
   542   Good skill in lexing and language parsing, as well as being fluent with web programming (for
       
   543   example JavaScript).
       
   544   </p>
       
   545 
       
   546 
       
   547 <li> <H4>[CU10] Implementation of a Distributed Clock-Synchronisation Algorithm developed at NASA</H4>
       
   548   
       
   549   <p>
       
   550   <B>Description:</B>
       
   551   There are many algorithms for synchronising clocks. This
       
   552   <A HREF="http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20120000054_2011025573.pdf">paper</A> 
       
   553   describes a new algorithm for clocks that communicate by exchanging
       
   554   messages and thereby reach a state in which (within some bound) all clocks are synchronised.
       
   555   A slightly longer and more detailed paper about the algorithm is 
       
   556   <A HREF="http://hdl.handle.net/2060/20110020812">here</A>.
       
   557   The point of this project is to implement this algorithm and simulate networks of clocks.
       
   558   </p>
       
   559 
       
   560   <p>
       
   561   <B>Literature:</B> 
       
   562   There is a wide range of literature on clock synchronisation algorithms. 
       
   563   Some pointers are given in this
       
   564   <A HREF="http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20120000054_2011025573.pdf">paper</A>,
       
   565   which describes the algorithm to be implemented in this project. Pointers
       
   566   are given also <A HREF="http://en.wikipedia.org/wiki/Clock_synchronization">here</A>.
       
   567   </p>
       
   568 
       
   569   <p>
       
   570   <B>Skills:</B> 
       
   571   In order to implement a simulation of a network of clocks, you need to tackle
       
   572   concurrency. You can do this for example in the programming language
       
   573   <A HREF="http://www.scala-lang.org/">Scala</A> with the help of the 
       
   574   <A HREF="http://akka.io">Akka</a> library. This library enables you to send messages
       
   575   between different <I>actors</I>. <A HREF="http://www.scala-lang.org/node/242">Here</A> 
       
   576   are some examples that explain how to implement exchanging messages between actors. 
       
   577   </p>
       
   578 
       
   579 <li> <H4>[CU11] Proving the Correctness of Programs</H4>
       
   580 
       
   581  <p>
       
   582  I am one of the main developers of the interactive theorem prover
       
   583  <A HREF="http://isabelle.in.tum.de">Isabelle</A>. This theorem prover
       
   584  has been used to establish the correctness of some quite large
       
   585  programs (for example an <A HREF="http://ertos.nicta.com.au/research/l4.verified/">operating system</A>).
       
   586  Together with colleagues from Nanjing, I used this theorem prover to establish the correctness of a
       
   587  scheduling algorithm, called
       
   588  <A HREF="http://en.wikipedia.org/wiki/Priority_inheritance">Priority Inheritance</A>,
       
   589  for real time operating systems. This scheduling algorithm is part of the operating
       
   590  system that drives, for example, the 
       
   591  <A HREF="http://en.wikipedia.org/wiki/Mars_Exploration_Rover">Mars rovers</A>.
       
   592  Actually, the very first Mars rover mission in 1997 did not have this
       
   593  algorithm switched on and it almost caused a catastrophic mission failure (see
       
   594  this youtube video <A HREF="http://www.youtube.com/watch?v=lyx7kARrGeM">here</A>
       
   595  for an explanation what happened).
       
   596  We were able to prove the correctness of this algorithm, but were also able to
       
   597  establish the correctness of some optimisations in this
       
   598  <A HREF="http://www.inf.kcl.ac.uk/staff/urbanc/Publications/pip.pdf">paper</A>.
       
   599  </p>
       
   600 
       
   601  <p>On a much smaller scale, there are a few small programs and underlying algorithms where it
       
   602  is not really understood whether they always compute a correct result (for example the
       
   603  regular expression matcher by Sulzmann and Lu in project [CU1]). The aim of this
       
   604  project is to completely specify an algorithm in Isabelle and then prove it correct (that is,
       
   605  it always computes the correct result).
       
   606 </p>
       
   607 
       
   608   <p>
       
   609   <B>Skills:</B> 
       
   610   This project is for a very good student with a knack for theoretical things and formal reasoning.
       
   611   </p>
       
   612 
       
   613 <li> <H4>Earlier Projects</H4>
       
   614 
       
   615  I am also open to project suggestions from you. You might find some inspiration from my earlier projects:
       
   616  <A HREF="http://www.inf.kcl.ac.uk/staff/urbanc/bsc-projects-12.html">BSc 2012/13</A>, 
       
   617  <A HREF="http://www.inf.kcl.ac.uk/staff/urbanc/msc-projects-12.html">MSc 2012/13</A>, 
       
   618  <A HREF="http://www.inf.kcl.ac.uk/staff/urbanc/bsc-projects-13.html">BSc 2013/14</A>
       
   619  <A HREF="http://www.inf.kcl.ac.uk/staff/urbanc/msc-projects-13.html">MSc 2013/14</A> 
       
   620 </ul>
       
   621 </TD>
       
   622 </TR>
       
   623 </TABLE>
       
   624 
       
   625 <P>
       
   626 <!-- hhmts start --> Last modified: Sun Nov  9 21:37:30 GMT 2014 <!-- hhmts end -->
       
   627 <a href="http://validator.w3.org/check/referer">[Validate this page.]</a>
       
   628 </BODY>
       
   629 </HTML>