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