bsc-projects.html
changeset 613 52af9da48885
child 614 1391ef09c0b9
equal deleted inserted replaced
612:166ab11a3a1d 613:52af9da48885
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
       
     3 <HEAD>
       
     4 <TITLE>2018/19 BSc Projects</TITLE>
       
     5 <BASE HREF="https://nms.kcl.ac.uk/christian.urban/">
       
     6 <script type="text/javascript" src="striper.js"></script>
       
     7 <link rel="stylesheet" href="nominal.css">
       
     8 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
       
     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>BSc Projects</H2>
       
    34 <H4>Supervisor: Christian Urban</H4> 
       
    35 <H4>Email: christian dot urban at kcl dot ac dot uk,  Office: Bush House N7.07</H4>
       
    36 
       
    37 <H4>Note that besides being a lecturer at the theoretical end of Computer Science, I am also a passionate
       
    38     <A HREF="http://en.wikipedia.org/wiki/Hacker_(programmer_subculture)">hacker</A> &hellip;
       
    39     defined as &ldquo;a person who enjoys exploring the details of programmable systems and 
       
    40     stretching their capabilities, as opposed to most users, who prefer to learn only the minimum 
       
    41     necessary.&rdquo; I am always happy to supervise like-minded students.
       
    42 </H4>
       
    43 
       
    44 <H4>In 2013/14, I was nominated by the students
       
    45     for the best BSc project supervisor and best MSc project supervisor awards in the NMS
       
    46     faculty. Somehow I won both. In 2014/15 I was nominated again for the best MSc
       
    47     project supervisor, but did not win it. ;o)
       
    48 </H4>  
       
    49 
       
    50 <ul class="striped">
       
    51 <li> <H4 id="regex">[CU1] Regular Expressions, Lexing and Derivatives</H4>
       
    52 
       
    53   <p>
       
    54   <B>Description:</b>  
       
    55   <A HREF="http://en.wikipedia.org/wiki/Regular_expression">Regular expressions</A> 
       
    56   are extremely useful for many text-processing tasks, such as finding patterns in hostile 
       
    57   <A HREF="https://www.snort.org">network traffic</A>,
       
    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. On the top of my head, I can give
       
    62   you at least ten research papers that appeared in the last few years.
       
    63   For example
       
    64   <A HREF="http://www.home.hs-karlsruhe.de/~suma0002/publications/regex-parsing-derivatives.pdf">this paper</A> 
       
    65   about regular expression matching and derivatives was presented in 2014 at the international 
       
    66   FLOPS conference. Another <A HREF="https://nms.kcl.ac.uk/christian.urban/Publications/posix.pdf">paper</A> by my PhD student and me was presented in 2016
       
    67   at the international ITP conference.
       
    68   The task in this project is to implement these results and use them for lexing.</p>
       
    69 
       
    70   <p>The background for this project is that some regular expressions are 
       
    71   &ldquo;<A HREF="http://en.wikipedia.org/wiki/ReDoS#Examples">evil</A>&rdquo;
       
    72   and can &ldquo;stab you in the back&rdquo; according to
       
    73   this <A HREF="http://peterscott.github.io/2013/01/17/regular-expressions-will-stab-you-in-the-back/">blog post</A>.
       
    74   For example, if you use in <A HREF="http://www.python.org">Python</A> or 
       
    75   in <A HREF="http://www.ruby-lang.org/en/">Ruby</A> (or also in a number of other mainstream programming languages) the 
       
    76   innocently looking regular expression <code>a?{28}a{28}</code> and match it, say, against the string 
       
    77   <code>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</code> (that is 28 <code>a</code>s), you will soon notice that your CPU usage goes to 100%. In fact,
       
    78   Python and Ruby need approximately 30 seconds of hard work for matching this string. You can try it for yourself:
       
    79   <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.py">catastrophic.py</A> (Python version) and 
       
    80   <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.rb">catastrophic.rb</A> 
       
    81   (Ruby version). Here is a similar problem with the regular expression <code>(a*)*b</code> in Java: 
       
    82   <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/catastrophic.java">catastrophic.java</A> 
       
    83   </p> 
       
    84 
       
    85   <p>
       
    86   You can imagine an attacker
       
    87   mounting a nice <A HREF="http://en.wikipedia.org/wiki/Denial-of-service_attack">DoS attack</A> against 
       
    88   your program if it contains such an &ldquo;evil&rdquo; regular expression. But it can also happen by accident:
       
    89   on 20 July 2016 the website <A HREF="http://stackstatus.net/post/147710624694/outage-postmortem-july-20-2016">Stack Exchange</A>
       
    90   was knocked offline because of an evil regular expression. One of their engineers talks about this in this
       
    91   <A HREF="https://vimeo.com/112065252">video</A>. A similar problem needed to be fixed in the
       
    92   <A HREF="http://davidvgalbraith.com/how-i-fixed-atom/">Atom</A> editor.
       
    93   A few implementations of regular expression matchers are almost immune from such problems.
       
    94   For example, <A HREF="http://www.scala-lang.org/">Scala</A> can deal with strings of up to 4,300 <code>a</code>s in less than a second. But if you scale
       
    95   the regular expression and string further to, say, 4,600 <code>a</code>s, then you get a <code>StackOverflowError</code> 
       
    96   potentially crashing your program. Moreover (beside the "minor" problem of being painfully slow) according to this
       
    97   <A HREF="http://www.haskell.org/haskellwiki/Regex_Posix">report</A>
       
    98   nearly all regular expression matchers using the POSIX rules are actually buggy.
       
    99   </p>
       
   100 
       
   101   <p>
       
   102   On a rainy afternoon, I implemented 
       
   103   <A HREF="http://talisker.inf.kcl.ac.uk/cgi-bin/repos.cgi/afl-material/raw-file/tip/progs/re3.scala">this</A> 
       
   104   regular expression matcher in Scala. It is not as fast as the official one in Scala, but
       
   105   it can match up to 11,000 <code>a</code>s in less than 5 seconds  without raising any exception
       
   106   (remember Python and Ruby both need nearly 30 seconds to process 28(!) <code>a</code>s, and Scala's
       
   107   official matcher maxes out at 4,600 <code>a</code>s). My matcher is approximately
       
   108   85 lines of code and based on the concept of 
       
   109   <A HREF="http://lambda-the-ultimate.org/node/2293">derivatives of regular expressions</A>.
       
   110   These derivatives were introduced in 1964 by <A HREF="http://en.wikipedia.org/wiki/Janusz_Brzozowski_(computer_scientist)">
       
   111   Janusz Brzozowski</A>, but according to this
       
   112   <A HREF="https://www.cs.kent.ac.uk/people/staff/sao/documents/jfp09.pdf">paper</A> had been lost in the &ldquo;sands of time&rdquo;.
       
   113   The advantage of derivatives is that they side-step completely the usual 
       
   114   <A HREF="http://hackingoff.com/compilers/regular-expression-to-nfa-dfa">translations</A> of regular expressions
       
   115   into NFAs or DFAs, which can introduce the exponential behaviour exhibited by the regular
       
   116   expression matchers in Python, Java and Ruby.
       
   117   </p>
       
   118 
       
   119   <p>
       
   120   Now the authors from the 
       
   121   <A HREF="http://www.home.hs-karlsruhe.de/~suma0002/publications/regex-parsing-derivatives.pdf">FLOPS'14-paper</A> mentioned 
       
   122   above claim they are even faster than me and can deal with even more features of regular expressions
       
   123   (for example subexpression matching, which my rainy-afternoon matcher cannot). I am sure they thought
       
   124   about the problem much longer than a single afternoon. The task 
       
   125   in this project is to find out how good they actually are by implementing the results from their paper. 
       
   126   Their approach to regular expression matching is also based on the concept of derivatives.
       
   127   I used derivatives very successfully once for something completely different in a
       
   128   <A HREF="https://nms.kcl.ac.uk/christian.urban/Publications/rexp.pdf">paper</A> 
       
   129   about the <A HREF="http://en.wikipedia.org/wiki/Myhill–Nerode_theorem">Myhill-Nerode theorem</A>.
       
   130   So I know they are worth their money. Still, it would be interesting to actually compare their results
       
   131   with my simple rainy-afternoon matcher and potentially &ldquo;blow away&rdquo; the regular expression matchers 
       
   132   in Python, Ruby and Java (and possibly in Scala too). The application would be to implement a fast lexer for
       
   133   programming languages, or improve the network traffic analysers in the tools <A HREF="https://www.snort.org">Snort</A> and
       
   134   <A HREF="https://www.bro.org">Bro</A>.
       
   135   </p>
       
   136 
       
   137   <p>
       
   138   <B>Literature:</B> 
       
   139   The place to start with this project is obviously this
       
   140   <A HREF="http://www.home.hs-karlsruhe.de/~suma0002/publications/regex-parsing-derivatives.pdf">paper</A>
       
   141   and this <A HREF="https://nms.kcl.ac.uk/christian.urban/Publications/posix.pdf">one</A>.
       
   142   Traditional methods for regular expression matching are explained
       
   143   in the Wikipedia articles 
       
   144   <A HREF="http://en.wikipedia.org/wiki/DFA_minimization">here</A> and 
       
   145   <A HREF="http://en.wikipedia.org/wiki/Powerset_construction">here</A>.
       
   146   The authoritative <A HREF="http://infolab.stanford.edu/~ullman/ialc.html">book</A>
       
   147   on automata and regular expressions is by John Hopcroft and Jeffrey Ullmann (available in the library). 
       
   148   There is also an online course about this topic by Ullman at 
       
   149   <A HREF="https://www.coursera.org/course/automata">Coursera</A>, though IMHO not 
       
   150   done with love. 
       
   151   There are millions of other pointers about regular expression
       
   152   matching on the Web. I found the chapter on Lexing in this
       
   153   <A HREF="http://www.diku.dk/~torbenm/Basics/">online book</A> very helpful. Finally, it will
       
   154   be of great help for this project to take part in my Compiler and Formal Language module (6CCS3CFL).
       
   155   Test cases for &ldquo;<A HREF="http://en.wikipedia.org/wiki/ReDoS#Examples">evil</A>&rdquo;
       
   156   regular expressions can be obtained from <A HREF="http://www.haskell.org/haskellwiki/Regex_Posix">here</A>.
       
   157   </p>
       
   158 
       
   159   <p>
       
   160   <B>Skills:</B> 
       
   161   This is a project for a student with an interest in theory and with
       
   162   good programming skills. The project can be easily implemented
       
   163   in functional languages like
       
   164   <A HREF="http://www.scala-lang.org/">Scala</A>,
       
   165   <A HREF="http://fsharp.org">F#</A>, 
       
   166   <A HREF="http://en.wikipedia.org/wiki/Standard_ML">ML</A>,  
       
   167   <A HREF="http://haskell.org/haskellwiki/Haskell">Haskell</A>, etc. Python and other non-functional languages
       
   168   can be also used, but seem much less convenient. If you do attend my Compilers and Formal Languages
       
   169   module, that would obviously give you a head-start with this project.
       
   170   </p>
       
   171 
       
   172 <li> <H4>[CU2] Grammars and Derivative-Based Parsing Algorithms</H4>
       
   173 
       
   174 <p>
       
   175 Parsing is an old nut. Generations of software developers need to do parsing of data or text.
       
   176 There are zillions of links, tools, papers and textbooks about parsing. One particular
       
   177 <A HREF="https://dickgrune.com/Books/PTAPG_1st_Edition/BookBody.pdf">book</A> contains something
       
   178 like 700 different algorithm, nicely analysed and described. Surely, parsing must be a solved problem. Or is it? 
       
   179 Laurie Tratt has a blog <A HREF="https://tratt.net/laurie/blog/entries/parsing_the_solved_problem_that_isnt.html">post</A>
       
   180 about <i>Parsing: The Solved Problem That Isn't</i>. IMHO parsing is still a wide open field and not solved at all.
       
   181 PEG parsing, error reporting, error correction, runtime to name just a few are aspects that seem to cause headaches
       
   182 to developers, and to researchers.</p>   
       
   183 
       
   184 <p>
       
   185 A recent <A HREF="https://www.cl.cam.ac.uk/~jdy22/papers/a-typed-algebraic-approach-to-parsing.pdf">paper</A> 
       
   186 follows an idea for regular expressions: it adapts the notion of 
       
   187 derivatives of regular expressions to grammars. The idea is to implement in a functional programming language
       
   188 the parsing algorithm proposed in this paper and to try it out with some sample data. There is also 
       
   189 a recent PhD thesis about derivative-based parsing 
       
   190 <A HREF="https://infoscience.epfl.ch/record/287059?ln=en">Efficient Parsing with Derivatives and Zippers</A>.
       
   191 </p>
       
   192 
       
   193 <p>
       
   194 <B>Literature:</B> <A HREF="https://www.cl.cam.ac.uk/~jdy22/papers/a-typed-algebraic-approach-to-parsing.pdf">paper</A>,
       
   195 <A HREF="https://lara.epfl.ch/~kuncak/papers/EdelmannETAL20ZippyLLParsingDerivatives.pdf">paper</A>  
       
   196 </p>
       
   197 
       
   198 <p>
       
   199 <B>Skills:</B> See [CU1].
       
   200 </p>
       
   201 
       
   202 
       
   203 <li> <H4>[CU3] A Compiler for a small Programming Language</H4>
       
   204 
       
   205   <p>
       
   206   <b>Description:</b> 
       
   207   Compilers translate high-level programs that humans can read and write into
       
   208   efficient machine code that can be run on a CPU or virtual machine.
       
   209   A compiler for a simple functional language generating X86 code is described
       
   210   <A HREF="https://libraries.io/github/chameco/Shade">here</A>.
       
   211   I recently implemented a very simple compiler for an even simpler functional
       
   212   programming language following this 
       
   213   <A HREF="https://www.cs.princeton.edu/~dpw/papers/tal-toplas.pdf">paper</A> 
       
   214   (also described <A HREF="https://www.cs.princeton.edu/~dpw/papers/tal-tr.pdf">here</A>).
       
   215   My code, written in <A HREF="http://www.scala-lang.org/">Scala</A>, of this compiler is 
       
   216   <A HREF="https://nms.kcl.ac.uk/christian.urban/compiler.scala">here</A>.
       
   217   The compiler can deal with simple programs involving natural numbers, such
       
   218   as Fibonacci numbers or factorial (but it can be easily extended - that is not the point).
       
   219   </p>
       
   220 
       
   221   <p>
       
   222   While the hard work has been done (understanding the two papers above),
       
   223   my compiler only produces some idealised machine code. For example I
       
   224   assume there are infinitely many registers. The goal of this
       
   225   project is to generate machine code that is more realistic and can
       
   226   run on a CPU, like X86, or run on a virtual machine, say the JVM. 
       
   227   This gives probably a speedup of thousand times in comparison to
       
   228   my naive machine code and virtual machine. The project
       
   229   requires to dig into the literature about real CPUs and generating 
       
   230   real machine code. 
       
   231   </p>
       
   232   <p>
       
   233   An alternative is to not generate machine code, but build a compiler that compiles to
       
   234   <A HREF="http://www.w3schools.com/js/">JavaScript</A>. This is the language that is supported by most
       
   235   browsers and therefore is a favourite
       
   236   vehicle for Web-programming. Some call it <B>the</B> scripting language of the Web.
       
   237   Unfortunately, JavaScript is also probably one of the worst
       
   238   languages to program in (being designed and released in a hurry). <B>But</B> it can be used as a convenient target
       
   239   for translating programs from other languages. In particular there are two
       
   240   very optimised subsets of JavaScript that can be used for this purpose:
       
   241   one is <A HREF="http://asmjs.org">asm.js</A> and the other is
       
   242   <A HREF="https://github.com/kripken/emscripten/wiki">emscripten</A>. Since
       
   243   last year there is even the official <A HREF="http://webassembly.org">Webassembly</A>
       
   244   There is a <A HREF="http://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html">tutorial</A> for emscripten
       
   245   and an impressive <A HREF="https://youtu.be/c2uNDlP4RiE">demo</A> which runs the
       
   246   <A HREF="http://en.wikipedia.org/wiki/Unreal_Engine">Unreal Engine 3</A>
       
   247   in a browser with spectacular speed. This was achieved by compiling the
       
   248   C-code of the Unreal Engine to the LLVM intermediate language and then translating the LLVM
       
   249   code to JavaScript.
       
   250   </p>
       
   251 
       
   252   <p>
       
   253   <B>Literature:</B>
       
   254   There is a lot of literature about compilers 
       
   255   (for example <A HREF="http://www.cs.princeton.edu/~appel/papers/cwc.html">this book</A> -
       
   256   I can lend you my copy for the duration of the project, or this
       
   257   <A HREF="http://www.diku.dk/~torbenm/Basics/">online book</A>). A very good overview article
       
   258   about implementing compilers by 
       
   259   <A HREF="http://tratt.net/laurie/">Laurie Tratt</A> is 
       
   260   <A HREF="http://tratt.net/laurie/tech_articles/articles/how_difficult_is_it_to_write_a_compiler">here</A>.
       
   261   An online book about the Art of Assembly Language is
       
   262   <A HREF="http://flint.cs.yale.edu/cs422/doc/art-of-asm/pdf/">here</A>.
       
   263   An introduction into x86 machine code is <A HREF="http://ianseyler.github.com/easy_x86-64/">here</A>.
       
   264   Intel's official manual for the x86 instruction is 
       
   265   <A HREF="http://download.intel.com/design/intarch/manuals/24319101.pdf">here</A>. 
       
   266   Two assemblers for the JVM are described <A HREF="http://jasmin.sourceforge.net">here</A>
       
   267   and <A HREF="https://github.com/Storyyeller/Krakatau">here</A>.
       
   268   An interesting twist of this project is to not generate code for a CPU, but
       
   269   for the intermediate language of the <A HREF="http://llvm.org">LLVM</A> compiler
       
   270   (also described <A HREF="http://llvm.org/docs/LangRef.html">here</A>). If you want to see
       
   271   what machine code looks like you can compile your C-program using gcc -S.
       
   272   </p>
       
   273   <p>
       
   274   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.
       
   275   <A HREF="http://jsbooks.revolunet.com">Here</A> is a list of free books on JavaScript.
       
   276   A project from which you can draw inspiration is this
       
   277   <A HREF="http://jlongster.com/Outlet--My-Lisp-to-Javascript-Experiment">Lisp-to-JavaScript</A>
       
   278   translator. <A HREF="https://bitbucket.org/ktg/parenjs/overview">Here</A> is another such project.
       
   279   And <A HREF="https://github.com/viclib/liscript">another</A> in less than 100 lines of code.
       
   280   <A HREF="http://en.wikipedia.org/wiki/CoffeeScript">Coffeescript</A> is a similar project
       
   281   except that it is already quite <A HREF="http://coffeescript.org">mature</A>. And finally not to
       
   282   forget <A HREF="http://www.typescriptlang.org">TypeScript</A> developed by Microsoft. The main
       
   283   difference between these projects and this one is that they translate into relatively high-level
       
   284   JavaScript code; none of them use the much lower levels <A HREF="http://asmjs.org">asm.js</A> and 
       
   285   <A HREF="https://github.com/kripken/emscripten/wiki">emscripten</A>.
       
   286   </p>
       
   287   <p>
       
   288   <B>Skills:</B> 
       
   289   This is a project for a student with a deep interest in programming languages and
       
   290   compilers. Since my compiler is implemented in <A HREF="http://www.scala-lang.org/">Scala</A>,
       
   291   it would make sense to continue this project in this language. I can be
       
   292   of help with questions and books about <A HREF="http://www.scala-lang.org/">Scala</A>.
       
   293   But if Scala is a problem, my code can also be translated quickly into any other functional
       
   294   language. Again,  it will be of great help for this project to take part in
       
   295   my Compiler and Formal Language module (6CCS3CFL).
       
   296   </p>
       
   297 
       
   298   <p>
       
   299   <B>PS:</B> Compiler projects consistently received high marks in the past.
       
   300   I have supervised eight so far and most of them received a mark above 70% - one even was awarded a prize.
       
   301   </p>
       
   302 
       
   303 <li> <H4>[CU4] Webassembly Interpreter / Compiler</H4>
       
   304 
       
   305 <p>
       
   306 Webassembly is a recently agreed standard for speeding up web applications in browsers. In this 
       
   307 project the aim is to implement an interpreter or compiler for webassembly. There are already
       
   308 <A HREF="https://github.com/WebAssembly/spec/tree/master/interpreter">reference interpreters</A>,
       
   309 but people take different views, for example implement a 
       
   310 <A HREF="https://groups.google.com/forum/#!topic/comp.lang.forth/CvNrP_AOmmw">Forth</A> language on top of webassembly. 
       
   311 What is good about webassembly is that is a rather simple format, which can be generated quite
       
   312 easily, unlike Java class files, which need some head-standing when you generate them. 
       
   313 </p>
       
   314 
       
   315 <p>
       
   316 A <A HREF="https://github.com/WebAssembly/spec/tree/master/interpreter">reference interpreter</A> for webassembly.  
       
   317 </p>
       
   318 <p>
       
   319 <B>Skills:</B> See [CU1].
       
   320 </p>
       
   321 
       
   322 <li> <H4>[CU5] Slide-Making in the Web-Age</H4>
       
   323 
       
   324   <p>
       
   325   The standard technology for writing scientific papers in Computer Science  is to use
       
   326   <A HREF="http://en.wikipedia.org/wiki/LaTeX">LaTeX</A>, a document preparation
       
   327   system originally implemented by <A HREF="http://en.wikipedia.org/wiki/Donald_Knuth">Donald Knuth</A>
       
   328   and <A HREF="http://en.wikipedia.org/wiki/Leslie_Lamport">Leslie Lamport</A>.
       
   329   LaTeX produces very pleasantly looking documents, can deal nicely with mathematical
       
   330   formulas and is very flexible. If you are interested, <A HREF="http://openwetware.org/wiki/Word_vs._LaTeX">here</A>
       
   331   is a side-by-side comparison between Word and LaTeX (which LaTeX &ldquo;wins&rdquo; with 18 out of 21 points).
       
   332   Computer scientists not only use LaTeX for documents,
       
   333   but also for slides (really, nobody who wants to be cool uses Keynote or Powerpoint).
       
   334   </p>
       
   335 
       
   336   <p>
       
   337   Although used widely, LaTeX seems nowadays a bit dated for producing
       
   338   slides. Unlike documents, which are typically &ldquo;static&rdquo; and published in a book or journal,
       
   339   slides often contain changing contents that might first only be partially visible and
       
   340   only later be revealed as the &ldquo;story&rdquo; of a talk or lecture demands.
       
   341   Also slides often contain animated algorithms where each state in the
       
   342   calculation is best explained by highlighting the changing data.
       
   343   </p>
       
   344 
       
   345   <p>
       
   346   It seems HTML and JavaScript are much better suited for generating
       
   347   such animated slides. This <A HREF="http://www.impressivewebs.com/html-slidedeck-toolkits/">page</A>
       
   348   links to slide-generating programs using this combination of technologies. 
       
   349   However, the problem with all of these project is that they depend heavily on the users being
       
   350   able to write JavaScript, CCS or HTML...not something one would like to depend on given that
       
   351   &ldquo;normal&rdquo; users likely only have a LaTeX background. The aim of this project is to invent a
       
   352   very simple language that is inspired by LaTeX and then generate from code written in this language
       
   353   slides that can be displayed in a web-browser. An example would be the
       
   354   <A HREF="https://www.madoko.net">Madoko</A> project.
       
   355   </p>
       
   356 
       
   357  <p>
       
   358  This sounds complicated, but there is already some help available:
       
   359  <A HREF="http://www.mathjax.org">Mathjax</A> is a JavaScript library that can
       
   360  be used to display mathematical text, for example</p>
       
   361 
       
   362  <blockquote>
       
   363  <p>When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
       
   364  \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\).</p>
       
   365  </blockquote>
       
   366 
       
   367  <p> 
       
   368  by writing code in the familiar LaTeX-way. This can be reused.
       
   369  Another such library is <A HREF="http://khan.github.io/KaTeX/">KaTeX</A>.
       
   370  There are also plenty of JavaScript
       
   371  libraries for graphical animations (for example
       
   372  <A HREF="http://raphaeljs.com">Raphael</A>,
       
   373  <A HREF="http://svgjs.com">SVG.JS</A>,
       
   374  <A HREF="http://bonsaijs.org">Bonsaijs</A>,
       
   375  <A HREF="http://jsxgraph.uni-bayreuth.de/wp/">JSXGraph</A>). The inspiration for how the user should be able to write
       
   376  slides could come from the LaTeX packages <A HREF="http://en.wikipedia.org/wiki/Beamer_(LaTeX)">Beamer</A>
       
   377  and <A HREF="http://en.wikipedia.org/wiki/PGF/TikZ">PGF/TikZ</A>. A slide-making project from which
       
   378  inspiration can be drawn is <A HREF="http://maciejczyzewski.me/hyhyhy/">hyhyhy</A>.
       
   379  </p>
       
   380 
       
   381   <p>
       
   382   <B>Skills:</B> 
       
   383   This is a project that requires good knowledge of JavaScript. You need to be able to
       
   384   parse a language and translate it to a suitable part of JavaScript using
       
   385   appropriate libraries. Tutorials for JavaScript are <A HREF="http://www.w3schools.com/js/">here</A>.
       
   386   A parser generator for JavaScript is <A HREF="http://pegjs.majda.cz">here</A>. There are probably also
       
   387   others. If you want to avoid JavaScript there are a number of alternatives: for example the
       
   388   <A HREF="http://elm-lang.org">Elm</A>
       
   389   language has been especially designed for implementing interactive animations, which would be
       
   390   very convenient for this project. A nice slide making project done by a previous student is 
       
   391   <A HREF="http://www.markslides.org">MarkSlides</A> by Oleksandr Cherednychenko. 
       
   392   </p>
       
   393 
       
   394 <li> <H4>[CU6] Raspberry Pi's and Arduinos</H4>
       
   395 
       
   396   <p>
       
   397   <B>Description:</B>
       
   398   This project is for true hackers! <A HREF="http://en.wikipedia.org/wiki/Raspberry_Pi">Raspberry Pi's</A>
       
   399   are small Linux computers the size of a credit-card and only cost &pound;26, the
       
   400   simplest version even costs only &pound;5 (see pictures on the left below). They were introduced
       
   401   in 2012 and people went crazy...well some of them. There is a
       
   402   <A HREF="https://plus.google.com/communities/113390432655174294208?hl=en">Google+</A>
       
   403   community about Raspberry Pi's that has more
       
   404   than 300k of followers. A similar number follow the corresponding <A HREF="https://www.facebook.com/raspberrypi/">group</A>
       
   405   on Facebook. It is hard to keep up with what people do with these small computers. The possibilities
       
   406   seem to be limitless. The main resource for Raspberry Pi's is <A HREF="http://www.raspberrypi.org">here</A>.
       
   407   There are <A HREF="https://www.raspberrypi.org/magpi/">magazines</A> dedicated to them and tons of
       
   408   <A HREF="http://www.raspberrypi.org/phpBB3/viewforum.php?f=39">books</A> (not to mention
       
   409   floods of <A HREF="https://www.google.co.uk/search?q=raspberry+pi">online</A> material,
       
   410   such as the <A HREF="https://www.raspberrypi.org/magpi-issues/Projects_Book_v1.pdf">RPi projects book</A>).
       
   411   Google just released a
       
   412   <A HREF="http://googlecreativelab.github.io/coder/">framework</A>
       
   413   for web-programming on Raspberry Pi's turning them into webservers.
       
   414   In my home one Raspberry Pi has the very important task of automatically filtering out
       
   415   nearly all advertisments using the 
       
   416   <A HREF="https://github.com/pi-hole/pi-hole">Pi-Hole</A> software
       
   417   (you cannot imagine what difference this does to your web experience).
       
   418   </p>
       
   419 
       
   420   <p>
       
   421   <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
       
   422   are small single-board micro-controllers that can talk to various external gadgets (sensors, motors, etc). Since Arduinos
       
   423   are open-software and open-hardware there are many clones and add-on boards. Like for the Raspberry Pi, there
       
   424   is a lot of material <A HREF="https://www.google.co.uk/search?q=arduino">available</A> about Arduinos.
       
   425   The main reference is <A HREF="http://www.arduino.cc">here</A>. Like the Raspberry Pi's, the good thing about
       
   426   Arduinos is that they can be powered with simple AA-batteries.
       
   427   </p>
       
   428 
       
   429   <p>
       
   430   I have several Raspberry Pi's including wifi-connectors and two <A HREF="http://www.raspberrypi.org/camera">cameras</A>.
       
   431   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
       
   432   students for one or two projects. However, the aim is to first come up with an idea for a project. Popular projects are
       
   433   automated temperature sensors, network servers, robots, web-cams (<A HREF="http://www.secretbatcave.co.uk/electronics/shard-rain-cam/">here</A>
       
   434   is a <A HREF="http://www.raspberrypi.org/archives/3547">web-cam</A> directed at the Shard that can
       
   435   <A HREF="http://www.secretbatcave.co.uk/software/shard-rain-cam-quantifying-cloudy/">tell</A>
       
   436   you whether it is raining or cloudy). There are plenty more ideas listed
       
   437   <A HREF="http://www.raspberrypi.org/phpBB3/viewforum.php?f=15">here</A> for Raspberry Pi's and
       
   438   <A HREF="http://playground.arduino.cc/projects/ideas">here</A> for Arduinos.
       
   439   </p>
       
   440 
       
   441   <p>
       
   442   There are essentially two kinds of projects: One is purely software-based. Software projects for Raspberry Pi's are often
       
   443   written in <A HREF="http://www.python.org">Python</A>, but since these are Linux-capable computers any other
       
   444   language would do as well. You can also write your own operating system as done
       
   445   <A HREF="http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/">here</A>. For example the students
       
   446   <A HREF="http://www.recantha.co.uk/blog/?p=4918">here</A> developed their own bare-metal OS and then implemented
       
   447   a chess-program on top of it (have a look at their very impressive
       
   448   <A HREF="http://www.youtube.com/watch?v=-03bouPsfEQ&amp;feature=player_embedded">youtube</A> video).
       
   449   The other kind of project is a combination of hardware and software; usually attaching some sensors
       
   450   or motors to the Raspberry Pi or Arduino. This might require some soldering or what is called
       
   451   a <A HREF="http://en.wikipedia.org/wiki/Breadboard">bread-board</A>. But be careful before choosing a project
       
   452   involving new hardware: these devices
       
   453   can be destroyed (if &ldquo;Vin connected to GND&rdquo; or &ldquo;drawing more than 30mA from a GPIO&rdquo;
       
   454   does not make sense to you, you should probably stay away from such a project). 
       
   455   </p>
       
   456 
       
   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"
       
   460          alt="Raspberry Pi"
       
   461          width="313" height="209">
       
   462 
       
   463     <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;"
       
   464          src="https://upload.wikimedia.org/wikipedia/commons/7/7e/Raspberry-Pi-Zero-FL.jpg"
       
   465          alt="Raspberry Pi Zero"
       
   466          width="313" height="209">  
       
   467 
       
   468     <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;"
       
   469          src="http://upload.wikimedia.org/wikipedia/commons/3/38/Arduino_Uno_-_R3.jpg"
       
   470          alt="Arduino"
       
   471          width="240" height="209">
       
   472   </center>
       
   473   
       
   474 
       
   475   <p>
       
   476   <B>Skills:</B> 
       
   477   Well, you must be a hacker; happy to make things. Your desk might look like the photo below on the left.
       
   478   The photo below on the middle shows an earlier student project which connects wirelessly a wearable Arduino (packaged
       
   479   in a "self-3d-printed" watch) to a Raspberry Pi seen in the background. The Arduino in the foreground takes
       
   480   measurements of 
       
   481   heart rate and body temperature; the Raspberry Pi collects this data and makes it accessible via a simple
       
   482   web-service. The picture on the right is another project that implements an airmouse using an Arduino.
       
   483 
       
   484   <center>
       
   485     <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;"
       
   486          src="https://nms.kcl.ac.uk/christian.urban/rpi-photo.jpg"
       
   487          alt="Raspberry Pi"
       
   488          width="209" height="313">
       
   489 
       
   490     <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;"
       
   491          src="https://nms.kcl.ac.uk/christian.urban/rpi-watch.jpg"
       
   492          alt="Raspberry Pi"
       
   493          width="450" height="254">
       
   494 
       
   495     <img style="-webkit-user-select: none; cursor: -webkit-zoom-in;"
       
   496          src="https://nms.kcl.ac.uk/christian.urban/rpi-airmouse.jpg"
       
   497          alt="Raspberry Pi"
       
   498          width="250" height="254">  
       
   499   </center><p>
       
   500 
       
   501 
       
   502     A really cool project using a toy helicopter and two Raspberry Pi's was done by Nikolaos Kyknas. He transformed
       
   503     an off-the-shelf toy helicopter into an autonomous flying machine. He attached a Raspberry Pi Zero and an ultrasound
       
   504     sensor to the helicopter for measuring the distance from ground. Another Raspberry Pi is attached to the &ldquo;ground control
       
   505     unit&rdquo; in order to give instructions to the throttle of the helicopter. Both Raspberry Pi's communicate over WiFi for calculating
       
   506     the next flight instruction. The goal is to find and maintain a steady altitude. Sounds simple? Well, not so fast! 
       
   507     First you need to get the balance of the helicopter plus Raspberry Pi plus its power source just right,
       
   508     otherwise the helicopter will simply take off in random directions. Also the flight instructions need to be just right,
       
   509     otherwise the helicopter would at best &ldquo;oscillate&rdquo; around the set altitude, but never be steady. To solve this problem, 
       
   510     Nikolaos used exactly the same algorithm that keeps cars at a steady pace when in cruise control. 
       
   511 
       
   512     <center>
       
   513       <video width="320" height="576" controls>
       
   514         <source src="https://nms.kcl.ac.uk/christian.urban/h1.mp4" type="video/mp4">
       
   515           Your browser does not support the video tag.
       
   516       </video>
       
   517       <video width="320" height="576" controls>
       
   518         <source src="https://nms.kcl.ac.uk/christian.urban/h3.mp4">
       
   519           Your browser does not support the video tag.
       
   520       </video>
       
   521     </center>  
       
   522 
       
   523 <li> <H4>[CU7] An Infrastructure for Displaying and Animating Code in a Web-Browser</H4>
       
   524   
       
   525 <p>
       
   526   <B>Description:</B>
       
   527   The project aim is to implement an infrastructure for displaying and
       
   528   animating code in a web-browser. The infrastructure should be agnostic
       
   529   with respect to the programming language, but should be configurable.
       
   530   I envisage something smaller than the projects 
       
   531   <A HREF="http://www.pythontutor.com">here</A> (for Python),
       
   532   <A HREF="http://ideone.com">here</A> (for Java),
       
   533   <A HREF="http://codepad.org">here</A> (for multiple languages),
       
   534   <A HREF="http://www.w3schools.com/html/tryit.asp?filename=tryhtml_intro">here</A> (for HTML)
       
   535   <A HREF="http://repl.it/languages/JavaScript">here</A> (for JavaScript),
       
   536   and <A HREF="http://www.scala-tour.com/#/welcome">here</A> (for Scala).
       
   537   </p>
       
   538 
       
   539   <p>
       
   540   The tasks in this project are being able (1) to lex and parse languages and (2) to write an interpreter.
       
   541   The goal is to implement this as much as possible in a language-agnostic fashion.
       
   542   </p>
       
   543 
       
   544   <p>
       
   545   <B>Skills:</B> 
       
   546   Good skills in lexing and language parsing, as well as being fluent with web programming (for
       
   547   example JavaScript).
       
   548   </p>
       
   549 
       
   550 
       
   551 <li> <H4>[CU8] Proving the Correctness of Programs</H4>
       
   552 
       
   553  <p>
       
   554  I am one of the main developers of the interactive theorem prover
       
   555  <A HREF="http://isabelle.in.tum.de">Isabelle</A>. This theorem prover
       
   556  has been used to establish the correctness of some quite large
       
   557  programs (for example an <A HREF="http://ertos.nicta.com.au/research/l4.verified/">operating system</A>).
       
   558  Together with colleagues from Nanjing, I used this theorem prover to establish the correctness of a
       
   559  scheduling algorithm, called
       
   560  <A HREF="http://en.wikipedia.org/wiki/Priority_inheritance">Priority Inheritance</A>,
       
   561  for real-time operating systems. This scheduling algorithm is part of the operating
       
   562  system that drives, for example, the 
       
   563  <A HREF="http://en.wikipedia.org/wiki/Mars_Exploration_Rover">Mars rovers</A>.
       
   564  Actually, the very first Mars rover mission in 1997 did not have this
       
   565  algorithm switched on and it almost caused a catastrophic mission failure (see
       
   566  this youtube video <A HREF="http://www.youtube.com/watch?v=lyx7kARrGeM">here</A>
       
   567  for an explanation what happened).
       
   568  We were able to prove the correctness of this algorithm, but were also able to
       
   569  establish the correctness of some optimisations in this
       
   570  <A HREF="https://nms.kcl.ac.uk/christian.urban/Publications/pip.pdf">paper</A>.
       
   571  </p>
       
   572 
       
   573  <p>On a much smaller scale, there are a few small programs and underlying algorithms where it
       
   574  is not really understood whether they always compute a correct result (for example the
       
   575  regular expression matcher by Sulzmann and Lu in project [CU1]). The aim of this
       
   576  project is to completely specify an algorithm in Isabelle and then prove it correct (that is,
       
   577  it always computes the correct result).
       
   578 </p>
       
   579 
       
   580   <p>
       
   581   <B>Skills:</B> 
       
   582   This project is for a very good student with a knack for theoretical things and formal reasoning.
       
   583   </p>
       
   584 
       
   585 <li> <H4>[CU9] Anything Security Related that is Interesting</H4>
       
   586   
       
   587 <p>
       
   588 If you have your own project that is related to security (must be
       
   589 something interesting), please propose it. We can then have a look
       
   590 whether it would be suitable for a project.
       
   591 </p>
       
   592 
       
   593 <li> <H4>[CU10] Anything Interesting in the Areas</H4>
       
   594   
       
   595 <ul>
       
   596 <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)
       
   597 <li><A HREF="http://www.smlserver.org/smltojs/">SMLtoJS</A> (a ML compiler to JavaScript; or anything else related to
       
   598   sane languages that compile to JavaScript)
       
   599 <li>Any statistical data related to Bitcoins (in the spirit of this
       
   600 <A HREF="http://people.csail.mit.edu/spillai/data/papers/bitcoin-transaction-graph-analysis.pdf">paper</A> or
       
   601   this <A HREF="https://eprint.iacr.org/2012/584.pdf">one</A>; this will probably require some extensive C knowledge or any
       
   602   other heavy-duty programming language)
       
   603 <li>Anything related to programming languages and formal methods (like
       
   604   <A HREF="http://matt.might.net/articles/intro-static-analysis/">static program analysis</A>)  
       
   605 <li>Anything related to low-cost, hands-on hardware like Raspberry Pi, Arduino,
       
   606   <A HREF="http://en.wikipedia.org/wiki/Cubieboard">Cubieboard</A>
       
   607 <li>Anything related to unikernel operating systems, like
       
   608   <A HREF="http://www.xenproject.org">Xen</A> or
       
   609   <A HREF="http://www.openmirage.org">Mirage OS</A>
       
   610 <li>Any kind of applied hacking, for example the Arduino-based keylogger described
       
   611    <A HREF="http://samy.pl/keysweeper/">here</A>
       
   612 <li>Anything related to code books, like this
       
   613    <A HREF="http://www.joelotter.com/kajero/">one</A>
       
   614 </ul>
       
   615 
       
   616 
       
   617 
       
   618 <li> <H4>Earlier Projects</H4>
       
   619 
       
   620  I am also open to project suggestions from you. You might find some inspiration from my earlier projects:
       
   621  <A HREF="https://nms.kcl.ac.uk/christian.urban/bsc-projects-12.html">BSc 2012/13</A>, 
       
   622  <A HREF="https://nms.kcl.ac.uk/christian.urban/msc-projects-12.html">MSc 2012/13</A>, 
       
   623  <A HREF="https://nms.kcl.ac.uk/christian.urban/bsc-projects-13.html">BSc 2013/14</A>,
       
   624  <A HREF="https://nms.kcl.ac.uk/christian.urban/msc-projects-13.html">MSc 2013/14</A>, 
       
   625  <A HREF="https://nms.kcl.ac.uk/christian.urban/bsc-projects-14.html">BSc 2014/15</A>,
       
   626  <A HREF="https://nms.kcl.ac.uk/christian.urban/msc-projects-14.html">MSc 2014/15</A>, 
       
   627  <A HREF="https://nms.kcl.ac.uk/christian.urban/bsc-projects-15.html">BSc 2015/16</A>,
       
   628  <A HREF="https://nms.kcl.ac.uk/christian.urban/msc-projects-15.html">MSc 2015/16</A>, 
       
   629  <A HREF="https://nms.kcl.ac.uk/christian.urban/bsc-projects-16.html">BSc 2016/17</A>,
       
   630  <A HREF="https://nms.kcl.ac.uk/christian.urban/msc-projects-16.html">MSc 2016/17</A>,
       
   631  <A HREF="https://nms.kcl.ac.uk/christian.urban/bsc-projects-17.html">BSc 2017/18</A>,
       
   632  <A HREF="https://nms.kcl.ac.uk/christian.urban/msc-projects-17.html">MSc 2017/18</A>,
       
   633  <A HREF="https://nms.kcl.ac.uk/christian.urban/bsc-projects-17.html">BSc 2018/19</A>
       
   634 </ul>
       
   635 </TD>
       
   636 </TR>  
       
   637 </TABLE>
       
   638         
       
   639 <P>
       
   640 2018-09-24 12:12:35 by Christian Urban
       
   641 <a href="https://validator.w3.org/check/referer">[Validate this page.]</a>
       
   642 </P>
       
   643 </BODY>
       
   644 </HTML>
       
   645  
       
   646  
       
   647