Ultraviolet

Ultraviolet is a html syntax highlighting library.

Syntax Gallery

These are just some examples of the languages that ultraviolet handles. The complete list is [here http://macromates.com/svn/Bundles/trunk/Bundles/].

C

   1  void Init_oregexp() {
   2     mOniguruma = rb_define_module("Oniguruma");
   3     VALUE cORegexp = rb_define_class_under(mOniguruma, "ORegexp", rb_cObject);
   4     rb_define_alloc_func(cORegexp, oregexp_allocate);
   5     rb_define_method( cORegexp, "initialize", oregexp_initialize, 2 );
   6     rb_define_method( cORegexp, "match", oregexp_match, -1 );
   7     rb_define_method( cORegexp, "=~", oregexp_match_op, 1 );
   8     rb_define_method( cORegexp, "gsub", oregexp_m_gsub, -1 );
   9     rb_define_method( cORegexp, "sub",  oregexp_m_sub,  -1 );
  10     rb_define_method( cORegexp, "gsub!", oregexp_m_gsub_bang, -1 );
  11     rb_define_method( cORegexp, "sub!",  oregexp_m_sub_bang,  -1 );
  12     rb_define_method( cORegexp, "scan",  oregexp_m_scan,  1 );
  13     rb_define_method( cORegexp, "===",  oregexp_m_eqq,  1 );
  14     rb_define_const( mOniguruma, "VERSION", rb_str_new2(onig_version()) );
  15  }

C++

   1  #ifndef UNIT_H_
   2  #define UNIT_H_
   3  
   4  #include "Traits.h"
   5  #include <set>
   6  #include <deque>
   7  
   8  namespace Learning {
   9     template <
  10        typename Real,
  11        template <typename> class Son,
  12        typename traits = Traits<Real, Son> >
  13     class Unit {
  14     public:
  15        typedef typename traits::vector_type vector_type;
  16        typedef typename traits::unit_type unit_type;
  17  
  18        template <typename InputIterator>
  19        Unit(
  20           InputIterator begin,
  21           InputIterator end
  22        ) :
  23           value( begin, end )
  24        {}
  25  
  26        virtual void addNeighbor( const unit_type & unit ) {
  27           neighbors.insert( &unit );
  28           neighborList.push_back( &unit );
  29        }
  30  
  31        virtual void deleteNeighbor( const unit_type & unit ) {
  32           neighbors.erase( &unit );
  33           typename std::deque< const unit_type* >::iterator i;
  34           for ( i = neighborList.begin(); i != neighborList.end(); i++ ) {
  35              if ( (*i) == &unit ) {
  36                 neighborList.erase( i );
  37                 break;
  38              }
  39           }
  40        }
  41  
  42        bool hasNeighbor( const unit_type & unit ) {
  43           return neighbors.find( &unit) != neighbors.end();
  44        }
  45  
  46        int getNeighborCount() {
  47           return neighbors.size();
  48        }
  49  
  50        unit_type & getNeighbor( int pos ) {
  51           return *( const_cast< unit_type* >(neighborList[pos]) );
  52        }
  53  
  54        vector_type & getValue() {
  55           return value;
  56        }
  57  
  58        virtual ~Unit() {
  59        }
  60     private:
  61        Unit( const unit_type & );
  62        std::set< const unit_type * > neighbors;
  63        std::deque< const unit_type* > neighborList;
  64        vector_type value;
  65     };
  66  }
  67  
  68  
  69  #endif /*UNIT_H_*/

Bibtex

   1  @String{icra04 = {2004 IEEE Int. Conf. on Robotics and Automation}}
   2  @String{icra04_address = {New Orleans, USA}}
   3  
   4  @Article{roweisghahramani99,
   5    author    = {Sam Roweis and Zoubin Ghahramani},
   6    title     = {A Unifying Review of Linear Gaussian Models},
   7    journal   = {Neural Computation},
   8    year      = {1999},
   9    number    = {11},
  10    pages     = {305-345}
  11  }
  12  
  13  @PhdThesis{murphy01,
  14    author    = {Kevin Patrick Murphy},
  15    title     = {Dynamic Bayesian Networks: Representation, Inference and Learning},
  16    school    = {University of California, Berkeley},
  17    year      = {2001}
  18  }

Latex

   1  %------------------------------------------------------------------------------
   2  \subsection{Measuring prediction accuracy}
   3  %------------------------------------------------------------------------------
   4  
   5  A common performance metric for probabilistic approaches is the maximum data
   6  likelihood or approximations like the \ac{bic} (see \S
   7  \ref{sec:hmm:structure_learning}). However, for our particular application,
   8  this metric has the drawback of not having any geometric interpretation.
   9  Intuitively, we would like to know \emph{how far} was the predicted state from
  10  the real one. Hence, we have preferred to measure the performance of our
  11  algorithm in terms of the average error, computed as the expected distance between
  12  the prediction for a time horizon $H$ and the effective observation $O_{t+H}$.
  13  
  14  \begin{equation}
  15    \langle E \rangle = \sum_{i \in \states} P([S_{t+H}=i] \mid O_{1:t}) \lVert
  16    O_{t+H} - \mu_i \rVert^{1/2}
  17  \label{eq:results:expected_distance}
  18  \end{equation}
  19  
  20  \noindent for a single time step. This measure may be generalized for a complete
  21  data set containing $K$ observation sequences:
  22  
  23  \begin{equation}
  24    \langle E \rangle =
  25      \frac{1}{K}
  26      \sum_{k = 1}^{K}
  27        \frac{1}{T^k-H}
  28        \sum_{t = 1}^{T^k - H}
  29          \sum_{i \in \states}
  30            P([S_{t+H}=i] \mid O_{1:t}^k) \lVert O^k_{t+H} - \mu_i \rVert^{1/2}
  31  \label{eq:results:expected_distance_general}
  32  \end{equation}
  33  
  34  It is worth noting that, as opposed to the standard approach in machine
  35  learning of conducting tests using a ``learning'' and a ``testing'' data  sets,
  36  the experiments we have presented here will use only a single data set. The
  37  reason is that, since learning takes place after prediction, there is no need
  38  to such separation: every observation sequence is ``unknown'' when prediction
  39  takes place.

Diff

   1  --- /etc/apache2/apache2.conf 2006-11-15 22:13:53.000000000 +0100
   2  +++ /etc/apache2/apache2.conf.dpkg-new 2007-01-15 19:10:51.000000000 +0100
   3  @@ -1,50 +1,91 @@
   4  +#
   5   # Based upon the NCSA server configuration files originally by Rob McCool.
   6  -# Changed extensively for the Debian package by Daniel Stone <daniel@sfarc.net>
   7  -# and also by Thom May <thom@debian.org>.
   8  +#
   9  +# This is the main Apache server configuration file.  It contains the
  10  +# configuration directives that give the server its instructions.
  11  +# See <URL:http://httpd.apache.org/docs-2.1/> for detailed information about
  12  +# the directives.

HTML

   1  <?xml version="1.0" encoding="iso-8859-1"?>
   2  <!DOCTYPE html
   3       PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   4       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
   5  
   6  <!--
   7  
   8      RDoc Documentation
   9  
  10    -->
  11  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  12  <head>
  13    <title>RDoc Documentation</title>
  14    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  15  </head>
  16  <frameset rows="20%, 80%">
  17      <frameset cols="25%,35%,45%">
  18          <frame src="fr_file_index.html"   title="Files" name="Files" />
  19          <frame src="fr_class_index.html"  name="Classes" />
  20          <frame src="fr_method_index.html" name="Methods" />
  21      </frameset>
  22      <frame src="files/lib/oniguruma_rb.html" name="docwin" />
  23  </frameset>
  24  </html>

CSS

   1  /* === Classes =================================== */
   2  
   3  table.header-table {
   4      color: white;
   5      font-size: small;
   6  }
   7  
   8  .type-note {
   9      font-size: small;
  10      color: #DEDEDE;
  11  }
  12  
  13  .xxsection-bar {
  14      background: #eee;
  15      color: #333;
  16      padding: 3px;
  17  }
  18  
  19  .section-bar {
  20     color: #333;
  21     border-bottom: 1px solid #999;
  22      margin-left: -20px;
  23  }
  24  
  25  
  26  .section-title {
  27      background: #79a;
  28      color: #eee;
  29      padding: 3px;
  30      margin-top: 2em;
  31      margin-left: -30px;
  32      border: 1px solid #999;
  33  }
  34  
  35  .top-aligned-row {  vertical-align: top }
  36  .bottom-aligned-row { vertical-align: bottom }

Theme Gallery

   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end
   1  module Uv
   2    def self..parse text, output = "xhtml", syntax_name = nil, line_numbers = false, render_style = "classic"
   3      init_syntaxes unless @syntaxes
   4      renderer = File.join( File.dirname(__FILE__), '..',"render", output,"#{render_style}.render")
   5      css_class = render_style
   6      render_options = YAML.load( File.open(  renderer ) )
   7      if output == "xhtml"
   8         render_processor = HtmlProcessor.new( render_options, line_numbers )
   9         @syntaxes[syntax_name].parse( text,  render_processor )
  10         "<pre class ="#{css_class}">#{render_processor.string}</pre>"
  11      else
  12         raise( ArgumentError, "Output for #{output} is not yet implemented" )
  13      end
  14    end
  15  end