<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nchinth</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nchinth"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Nchinth"/>
	<updated>2026-05-15T10:06:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90989</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90989"/>
		<updated>2014-10-29T23:45:48Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a [http://en.wikipedia.org/wiki/Document_Object_Model DOM]. Currently Servo have parsers to do this but the ability to turn [http://en.wikipedia.org/wiki/XHTML XHTML] into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new Parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90584</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90584"/>
		<updated>2014-10-29T17:35:22Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Project Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a [http://en.wikipedia.org/wiki/Document_Object_Model DOM]. Currently Servo has html parser but the ability to turn [http://en.wikipedia.org/wiki/XHTML XHTML] into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new Parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90583</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90583"/>
		<updated>2014-10-29T17:34:38Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a [http://en.wikipedia.org/wiki/Document_Object_Model DOM]. Currently Servo has html parser but the ability to turn [http://en.wikipedia.org/wiki/XHTML XHTML] into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90582</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90582"/>
		<updated>2014-10-29T17:34:28Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a [http://en.wikipedia.org/wiki/Document_Object_Model DOM]. Currently Servo has html parser but the ability to turn [http://en.wikipedia.org/wiki/XHTML XHTML] into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90580</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90580"/>
		<updated>2014-10-29T17:34:11Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a [http://en.wikipedia.org/wiki/Document_Object_Model DOM]. Currently Servo has html parser but the ability to turn [http://en.wikipedia.org/wiki/XHTML XHTML] into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&amp;lt;br&amp;gt;[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90579</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90579"/>
		<updated>2014-10-29T17:33:46Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a [http://en.wikipedia.org/wiki/Document_Object_Model DOM]. Currently Servo has html parser but the ability to turn [http://en.wikipedia.org/wiki/XHTML XHTML] into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90578</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90578"/>
		<updated>2014-10-29T17:33:33Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a [http://en.wikipedia.org/wiki/Document_Object_Model DOM]. Currently Servo has html parser but the ability to turn [http://en.wikipedia.org/wiki/XHTML XHTML] into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90576</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90576"/>
		<updated>2014-10-29T17:32:16Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a [http://en.wikipedia.org/wiki/Document_Object_Model DOM]. Currently Servo has html parser but the ability to turn [http://en.wikipedia.org/wiki/XHTML XHTML] into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90575</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90575"/>
		<updated>2014-10-29T17:31:28Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn [http://en.wikipedia.org/wiki/XHTML XHTML] into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90574</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90574"/>
		<updated>2014-10-29T17:30:33Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Project Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90573</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90573"/>
		<updated>2014-10-29T17:30:24Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Project Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
&lt;br /&gt;
As part of our OSS project , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90571</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90571"/>
		<updated>2014-10-29T17:28:17Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/XML-parser-student-project&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
As part of OSS , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90567</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90567"/>
		<updated>2014-10-29T17:25:24Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
As part of OSS , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90566</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90566"/>
		<updated>2014-10-29T17:25:11Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
As part of OSS , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://www.artima.com/lejava/articles/designprinciples.html &amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90565</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90565"/>
		<updated>2014-10-29T17:24:35Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
As part of OSS , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
http://www.artima.com/lejava/articles/designprinciples.html &lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90564</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90564"/>
		<updated>2014-10-29T17:24:19Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Design Patterns/Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
As part of OSS , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed [http://www.artima.com/lejava/articles/designprinciples.html “Programming to Interfaces, not an implementation”] design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90562</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90562"/>
		<updated>2014-10-29T17:23:00Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Design Patterns/Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
As part of OSS , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” &amp;lt;ref&amp;gt; http://www.artima.com/lejava/articles/designprinciples.html &amp;lt;/ref&amp;gt; design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90560</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90560"/>
		<updated>2014-10-29T17:22:16Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Design Patterns/Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
As part of OSS , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation”&amp;lt;ref&amp;gt;http://www.artima.com/lejava/articles/designprinciples.html&amp;lt;/ref&amp;gt; design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90558</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90558"/>
		<updated>2014-10-29T17:21:45Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Design Patterns/Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
As part of OSS , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle&amp;lt;ref&amp;gt;http://www.artima.com/lejava/articles/designprinciples.html&amp;lt;/ref&amp;gt; while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90552</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90552"/>
		<updated>2014-10-29T17:18:39Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Steps of Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Implementation =&lt;br /&gt;
As part of OSS , we have created a new parser trait and have implemented it for ServoHTMLParser struct as follows. &lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90546</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90546"/>
		<updated>2014-10-29T17:15:49Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90545</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90545"/>
		<updated>2014-10-29T17:15:35Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90544</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90544"/>
		<updated>2014-10-29T17:14:53Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
 An important part of loading web pages is the process of turning HTML source into a DOM. Currently Servo has html parser but the ability to turn XHTML into DOM is missing. The goal of our project is to integrate an xml parser into servo such that it can parse XHTML as well. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90542</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90542"/>
		<updated>2014-10-29T17:11:53Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
 An important&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90541</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90541"/>
		<updated>2014-10-29T17:11:34Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Integrating an XML Parser ==&lt;br /&gt;
&lt;br /&gt;
 An important&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90539</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90539"/>
		<updated>2014-10-29T17:09:56Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
 An important&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90538</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90538"/>
		<updated>2014-10-29T17:09:26Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90537</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90537"/>
		<updated>2014-10-29T17:09:07Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
 [https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
  An important part of loading web pages is the process of turning HTML source into a DOM&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90536</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90536"/>
		<updated>2014-10-29T17:08:57Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
 [https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
  An important part of loading web pages is the process of turning HTML source into a DOM&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90535</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90535"/>
		<updated>2014-10-29T17:08:39Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
  An important part of loading web pages is the process of turning HTML source into a DOM&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90534</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90534"/>
		<updated>2014-10-29T17:07:24Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
 &lt;br /&gt;
  An important part of loading web pages is the process of turning HTML source into a DOM&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90533</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90533"/>
		<updated>2014-10-29T17:07:14Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description] &amp;lt;/ref&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  An important part of loading web pages is the process of turning HTML source into a DOM&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90532</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90532"/>
		<updated>2014-10-29T17:06:41Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
 &lt;br /&gt;
  An important part of loading web pages is the process of turning HTML source into a DOM&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90529</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90529"/>
		<updated>2014-10-29T17:03:57Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
 &lt;br /&gt;
asd&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90528</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90528"/>
		<updated>2014-10-29T17:03:47Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90527</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90527"/>
		<updated>2014-10-29T17:03:29Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
   Servo has the html parser but the ability to parse an XHTML into DOM is missing. The goal of this project is to integrate an     &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90526</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90526"/>
		<updated>2014-10-29T17:03:04Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
  Servo has the html parser but the ability to parse an XHTML into DOM is missing. The goal of this project is to integrate an    [https://github.com/Florob/RustyXML xml parser] into Servo &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90525</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90525"/>
		<updated>2014-10-29T17:01:28Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
  &lt;br /&gt;
  Servo has the html parser but the ability to parse an XHTML into DOM is missing. The goal of this project is to integrate an xml parser(https://github.com/Florob/RustyXML) into Servo &lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90523</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90523"/>
		<updated>2014-10-29T16:50:56Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90522</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90522"/>
		<updated>2014-10-29T16:50:31Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Integrating an XML Parser */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
[https://github.com/servo/servo/wiki/XML-parser-student-project Project Description]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90521</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90521"/>
		<updated>2014-10-29T16:48:27Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Servo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90520</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90520"/>
		<updated>2014-10-29T16:47:39Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Background Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is an experimental project to build a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90518</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90518"/>
		<updated>2014-10-29T16:44:08Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Design Patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is an experimental project to build a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns/Principles =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. This principle is really about dependency relationships which have to be carefully managed . When you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that's a healthy dependency relationship . We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser.Thereby in future,if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90515</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90515"/>
		<updated>2014-10-29T16:34:15Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is an experimental project to build a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Building Servo =&lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser .Thereby in future , if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90514</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90514"/>
		<updated>2014-10-29T16:33:47Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is an experimental project to build a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Building Servo == &lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser .Thereby in future , if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90074</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90074"/>
		<updated>2014-10-28T17:07:32Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* Background Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rust ===&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Servo ===&lt;br /&gt;
[https://github.com/servo/servo Servo] is an experimental project to build a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Building Servo''' &lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser .Thereby in future , if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90068</id>
		<title>CSC/ECE 517 Fall 2014/oss M1452 jns</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1452_jns&amp;diff=90068"/>
		<updated>2014-10-28T15:47:21Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Integrating an XML Parser =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Background Information =&lt;br /&gt;
Servo is an experimental web browser layout engine being developed by Mozilla Research. The prototype seeks to create a highly parallel environment, in which many components (such as rendering, layout, HTML parsing, image decoding, etc.) are handled by fine-grained, isolated tasks. The project has a symbiotic relationship with the Rust programming language, in which it is being developed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rust ==&lt;br /&gt;
[http://www.rust-lang.org/ Rust] is a systems language for writing high performance applications that are usually written in C or C++ but it was developed to prevent some of the problems related to invalid memory accesses that generate segmentation faults. It covers imperative, functional and object-oriented programming.&lt;br /&gt;
It's designed to support concurrency and parallelism in building platforms that take full advantage of modern hardware. Its static type system is safe and expressive and it provides strong guarantees about isolation, concurrency execution and memory safety. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rust combines powerful and flexible modern programming constructs with a clear performance model to make program efficiency predictable and manageable. One important way it achieves this is by allowing fine-grained control over memory allocation through contiguous records and stack allocation. This control is balanced with the absolute requirement of safety: Rust’s type system and runtime guarantee the absence of data races, buffer overflow, stack overflow or access to uninitialized or deallocated memory. &amp;lt;ref name=Rust&amp;gt;[https://www.mozilla.org/en-US/research/projects/ Overview of Mozilla Research Projects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
[https://github.com/servo/servo Servo] is an experimental project to build a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. With Servo, Mozilla are rethinking the browser at every level of the technology stack — from input parsing to page layout to graphics rendering — to optimize for power efficiency and maximum parallelism.&lt;br /&gt;
&lt;br /&gt;
Servo builds on top of Rust to provide a secure and reliable foundation. Memory safety at the core of the platform ensures a high degree of assurance in the browser’s trusted computing base. Rust’s lightweight task mechanism also promises to allow fine-grained isolation between browser components, such as tabs and extensions, without the need for expensive runtime protection schemes, like operating system process isolation.&amp;lt;ref name=Rust&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Task Supervision Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram1.jpg]]&lt;br /&gt;
&lt;br /&gt;
''Task Projection Diagram''&lt;br /&gt;
&lt;br /&gt;
[[File:Diagram2.jpg]]&lt;br /&gt;
&lt;br /&gt;
•	'' Each box '' represents a Rust task.&lt;br /&gt;
&lt;br /&gt;
•	'' Blue boxes '' represent the primary tasks in the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' Gray boxes '' represent tasks auxiliary to the browser pipeline.&lt;br /&gt;
&lt;br /&gt;
•	'' White boxes '' represent worker tasks. Each such box represents several tasks, the precise number of which will vary with the workload.&lt;br /&gt;
&lt;br /&gt;
•	'' Dashed lines '' indicate supervisor relationships.&lt;br /&gt;
&lt;br /&gt;
•	'' Solid lines '' indicate communication channels.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
'''Installing Dependencies for Servo'''  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The list of commands to install the dependencies on various platforms are&amp;lt;ref name = github&amp;gt;[https://github.com/servo/servo Servo Github]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X (homebrew):&lt;br /&gt;
&lt;br /&gt;
    brew install automake pkg-config python glfw3 cmake&lt;br /&gt;
    pip install virtualenv&lt;br /&gt;
&lt;br /&gt;
On OS X (MacPorts):&lt;br /&gt;
&lt;br /&gt;
    sudo port install python27 py27-virtualenv cmake&lt;br /&gt;
&lt;br /&gt;
On Debian-based Linuxes:&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install curl freeglut3-dev \&lt;br /&gt;
    libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \&lt;br /&gt;
    msttcorefonts gperf g++ cmake python-virtualenv \&lt;br /&gt;
    libssl-dev libglfw-dev&lt;br /&gt;
&lt;br /&gt;
On Fedora:&lt;br /&gt;
&lt;br /&gt;
    sudo yum install curl freeglut-devel libtool gcc-c++ libXi-devel \&lt;br /&gt;
        freetype-devel mesa-libGL-devel glib2-devel libX11-devel libXrandr-devel gperf \&lt;br /&gt;
        fontconfig-devel cabextract ttmkfdir python python-virtualenv expat-devel \&lt;br /&gt;
        rpm-build openssl-devel glfw-devel cmake&lt;br /&gt;
    pushd .&lt;br /&gt;
    cd /tmp&lt;br /&gt;
    wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec&lt;br /&gt;
    rpmbuild -bb msttcorefonts-2.5-1.spec&lt;br /&gt;
    sudo yum install $HOME/rpmbuild/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm&lt;br /&gt;
    popd&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Arch Linux:&lt;br /&gt;
&lt;br /&gt;
    sudo pacman -S base-devel git python2 python2-virtualenv mesa glfw ttf-font cmake&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Building Servo''' &lt;br /&gt;
&lt;br /&gt;
''Normal Build''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ./mach build&lt;br /&gt;
    ./mach run tests/html/about-mozilla.html &lt;br /&gt;
&lt;br /&gt;
''Building for Android target''&lt;br /&gt;
&lt;br /&gt;
    git clone https://github.com/servo/servo&lt;br /&gt;
    cd servo&lt;br /&gt;
    ANDROID_TOOLCHAIN=/path/to/toolchain ANDROID_NDK=/path/to/ndk PATH=$PATH:/path/to/toolchain/bin ./mach build --android&lt;br /&gt;
    cd ports/android&lt;br /&gt;
    ANDROID_SDK=/path/to/sdk make install&lt;br /&gt;
&lt;br /&gt;
= Steps of Implementation =&lt;br /&gt;
&lt;br /&gt;
→ Created a new file mod.rs in the following directory:   &amp;lt;code&amp;gt; servo/components/script/parse/mod.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
→ Created a Parser Trait with the parse_chunk method in this mod.rs&lt;br /&gt;
&lt;br /&gt;
    pub mod html;&lt;br /&gt;
    pub trait Parser {&lt;br /&gt;
        fn parse_chunk(&amp;amp;self,input: String);&lt;br /&gt;
        fn finish(&amp;amp;self);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Implementation of this Parser trait for the ServoHTML Parser struct is in the servo &amp;lt;code&amp;gt;/components/script/dom/servohtmlparser.rs&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    impl Parser for ServoHTMLParser{&lt;br /&gt;
        fn parse_chunk(&amp;amp;self, input: String) {&lt;br /&gt;
  	    self.tokenizer().borrow_mut().feed(input);&lt;br /&gt;
        }&lt;br /&gt;
        fn finish(&amp;amp;self){&lt;br /&gt;
  	    self.tokenizer().borrow_mut().end();&lt;br /&gt;
        }  &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
→ Modified &amp;lt;code&amp;gt;servo/components/script/parse/html.rs&amp;lt;/code&amp;gt; to invoke the parse_chunk method appropriately.&lt;br /&gt;
&lt;br /&gt;
     InputString(s) =&amp;gt; {&lt;br /&gt;
            parser.parse_chunk(s);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
    InputUrl(url) =&amp;gt; {&lt;br /&gt;
            let load_response = load_response.unwrap();&lt;br /&gt;
            match load_response.metadata.content_type {&lt;br /&gt;
                Some((ref t, _)) if t.as_slice().eq_ignore_ascii_case(&amp;quot;image&amp;quot;) =&amp;gt; {&lt;br /&gt;
                    let page = format!(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;img src='{:s}' /&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;, base_url.as_ref().unwrap().serialize());&lt;br /&gt;
                    parser.parse_chunk(page);&lt;br /&gt;
                },&lt;br /&gt;
    &lt;br /&gt;
    Payload(data) =&amp;gt; {&lt;br /&gt;
                                // FIXME: use Vec&amp;lt;u8&amp;gt; (html5ever #34)&lt;br /&gt;
                                let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();&lt;br /&gt;
                                parser.parse_chunk(data);&lt;br /&gt;
                            }&lt;br /&gt;
&lt;br /&gt;
= Design Patterns =&lt;br /&gt;
We have followed “Programming to Interfaces, not an implementation” design principle while implementing initial step of our project. We have modified the code of html.rs to invoke Parser trait’s parse_chunk method instead of directly invoking the methods of ServoHtmlParser .Thereby in future , if in case we use any other parser instance instead of ServoHtmlParser , we need not modify the invocation logic in html.rs function.(Traits are similar  to interfaces in other languages).&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_6_bn&amp;diff=87022</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 6 bn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_6_bn&amp;diff=87022"/>
		<updated>2014-09-19T22:27:14Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* GWT RPC communication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Gwt-logo.png|right|]]&lt;br /&gt;
==Google Web Toolkit==&lt;br /&gt;
&lt;br /&gt;
'''Google Web Toolkit(GWT)'''&amp;lt;ref&amp;gt;http://www.gwtproject.org/GWTPolicy.html&amp;lt;/ref&amp;gt; is a set of tools used to develop browser based RICH Web Applications([http://en.wikipedia.org/wiki/Rich_Internet_application RIA]). It is a free open source web framework released in 2006 under Apache 2.0 License. The focus of this toolkit is to provide great user experience by bringing the features and feel similar to that of a desktop application to the browser based web applications. GWT as a framework can be used to build large scale and high performance easy-to-maintain web appliations. GWT is used by many products at Google, including AdWords, AdSense, Flights, Hotel Finder, Offers, Wallet, Blogger, Maps.&lt;br /&gt;
&lt;br /&gt;
The latest Version of GWT (GWT 2.6.1) was released on May 10, 2014.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==GWT Features==&lt;br /&gt;
#'''Backend Language Support:''' Developers can use the language of their choice for developing the back-end code.&lt;br /&gt;
#'''XHR Handling:''' GWT handles all the XHR calls for the developers irrespective of the method of communication(JSON, XML, or GWT's optimized Remote Procedure Call (RPC) system)&lt;br /&gt;
#'''Dynamic Optimization:''' GWT creates a separate compiled version of your application that is optimized for a particular user's environment. &lt;br /&gt;
#'''Re-usability of code:''' GWT supports packaging of the user generated UI components. These packages can be loaded into the other projects facilitating the reuse of UI components.&lt;br /&gt;
#'''Support for Browser History:''' GWT adds state to the browser's back button history making the use of browsers &amp;quot;Back&amp;quot; button with the application easy.&lt;br /&gt;
#'''Internationalization:''' GWT provides tools to create efficient internationalized applications and libraries, including bi-directionality.&lt;br /&gt;
#'''Testing using JUnit:''' GWT supports testing of the code using JUnit in debugger, browser and even with asynchronous RPCs direct integration with JUnit lets us use  unit test both in a debugger and in a browser and you can even unit test asynchronous RPCs.&lt;br /&gt;
#'''Native Javascript Support:''' GWT supports and allows for embedding JavaScript within Java enabling the integration and use of pre-existing Javascript libraries.&lt;br /&gt;
&lt;br /&gt;
==Contents of the Toolkit==&lt;br /&gt;
&lt;br /&gt;
The Toolkit consists of a software development kit (GWT SDK) and an eclipse Plugin (Plugin for Eclipse).&amp;lt;ref&amp;gt;http://www.gwtproject.org/overview.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GWT SDK===&lt;br /&gt;
GWT SDK contains the Java API libraries, compiler, and development server. It lets you write client-side applications in Java and deploy them as JavaScript.&amp;lt;ref&amp;gt;http://www.tutorialspoint.com/gwt/index.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;GWT in Action, by Robert Hanning &amp;amp; Adam Tacy,Manning, 2007&amp;lt;/ref&amp;gt;&lt;br /&gt;
The three major components of the SDK are:&lt;br /&gt;
====GWT Java to JavaScript compiler====&lt;br /&gt;
This is the most important part of GWT which makes it a powerful tool for building RIAs. The GWT compiler is used to translate all the application code written in Java into JavaScript.It also supports mixing of Java code with existing JavaScript code using '''JavaScript Native Interface (JSNI)''', which allows embedding of JavaScript code within Java classes in order to facilitate Java-to-JavaScript communication. An example of embedded javascript in java is shown below.&lt;br /&gt;
 private native void nativeMethod()&lt;br /&gt;
 /*-{&lt;br /&gt;
      $wnd.jsFunction = function(x) {&lt;br /&gt;
        alert(x);&lt;br /&gt;
      };&lt;br /&gt;
      alert(&amp;quot;hello&amp;quot;);&lt;br /&gt;
 }-*/;&lt;br /&gt;
&lt;br /&gt;
One key feature of the GWT compiler is that it generates multiple output JavaScript files from the input code, one per each browser to ensure cross browser compatibility of the application. The browsers currently supported by the compiler include &lt;br /&gt;
:Firefox&lt;br /&gt;
:Internet Explorer 8, 9, 10, 11&lt;br /&gt;
:Safari 5, 6&lt;br /&gt;
:Chromium and Google Chrome&lt;br /&gt;
:Opera latest version&lt;br /&gt;
=====Compiler Modes=====&lt;br /&gt;
The compiler has three style modes that determine what the resulting Java-Script looks like. &lt;br /&gt;
The default style is '''obfuscate''', which makes the JavaScript look like alphabet soup. Everything is compressed and nearly impossible to decipher.An example of the obfuscated code is given below&lt;br /&gt;
 function x(){return this.y + '#' + this.b();}&lt;br /&gt;
The second style is '''pretty''' which generates readable JavaScript as shown below.&lt;br /&gt;
 function _toString(){&lt;br /&gt;
   return this._typeName + '#' + this._length();&lt;br /&gt;
 }&lt;br /&gt;
The third style is '''detailed''', which produces JavaScript code that looks like the pretty style with the addition of the full class name as part of the JavaScript method name. An Example would look like&lt;br /&gt;
 function java_lang_Object_toString__(){&lt;br /&gt;
 return this.java_lang_Object_typeName + '#' + this.length__();&lt;br /&gt;
 }&lt;br /&gt;
Generally Obfuscate is used for production as it is the most optimized and compressed version of the output code and would result in faster pages. Using Obfuscate also provides a certain amount of security to the output code and can prevent code theft by making it difficult to read the output. Pretty and detailed modes are used mainly in development to aid in debugging. &lt;br /&gt;
====JRE Emulation library====&lt;br /&gt;
Google Web Toolkit includes a library that emulates a subset of the Java runtime library. The list includes java.lang, java.lang.annotation, java.math, java.io, java.sql, java.util and java.util.logging.&lt;br /&gt;
&lt;br /&gt;
====GWT UI building library==== &lt;br /&gt;
This part of GWT consists of many subparts which includes the actual UI components, RPC support, History management. GWT ships with a large set of widgets and panels for laying out UI. &lt;br /&gt;
&lt;br /&gt;
===Plugin for Eclipse=== &lt;br /&gt;
Plugin for Eclipse provides IDE support for GWT and App Engine web projects.&lt;br /&gt;
&lt;br /&gt;
== GWT Web Development Modes ==&lt;br /&gt;
&lt;br /&gt;
GWT supports two different modes for developing Web Applications.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Google_Web_Toolkit&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Development mode:''' The Application is run on the local system as bytecode in the Java Virtual Machine(JVM). This mode supports hotswapping of the code, real time debugging and is typically used for development. &lt;br /&gt;
&lt;br /&gt;
*'''Production mode:''' The application is run as pure JavaScript and HTML, compiled from the Java source. This mode is typically used for deployment.&lt;br /&gt;
&lt;br /&gt;
== GWT Web Development Process Flowchart ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:GWT Process Flow.jpg]]&amp;lt;/div&amp;gt; &lt;br /&gt;
== Contents of GWT Application== &lt;br /&gt;
&lt;br /&gt;
Every GWT application contains the following four parts &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/gwt/gwt_applications.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Module descriptors===&lt;br /&gt;
In GWT, applications are segregated into modules. A GWT &amp;quot;module&amp;quot; is simply an encapsulation of functionality. A module is defined by an XML descriptor file ending with the extension &amp;quot;.gwt.xml&amp;quot;, and the name of that file determines the name of the module. This xml file is known as  module descriptor.&lt;br /&gt;
&lt;br /&gt;
Typically module descriptors contain the following &lt;br /&gt;
#Inherited modules (A module can inherit the existing modules)&lt;br /&gt;
#an entry point application class name; these are optional, although any module referred to in HTML must have at least one entry-point class specified&lt;br /&gt;
#source path entries&lt;br /&gt;
#public path entries&lt;br /&gt;
&lt;br /&gt;
===Public resources===&lt;br /&gt;
These are all files referenced by your GWT module, such as Host HTML page, CSS or images. The location of these resources can be configured using &amp;lt;public path=&amp;quot;path&amp;quot; /&amp;gt; element in module descriptor  file. By default, it is the public subdirectory underneath where the Module XML File is stored.&lt;br /&gt;
&lt;br /&gt;
===Client Side Code===&lt;br /&gt;
This is the actual Java code written implementing the business logic of the application and that the GWT compiler translates into JavaScript, which will eventually run inside the browser. The location of these resources can be configured using &amp;lt;source path=&amp;quot;path&amp;quot; /&amp;gt; element in module configuration file.&lt;br /&gt;
&lt;br /&gt;
===Server Side Code===&lt;br /&gt;
This is the server side part of your application and its very much optional. If you are not doing any backend processing with-in your application then you do not need this part, but if there is some processing required at backend and your client-side application interact with the server then you will have to develop these components.&lt;br /&gt;
&lt;br /&gt;
==Sample Application in GWT==&lt;br /&gt;
For this sample GWT application we will be creating a module with one entry point and a host html page. &lt;br /&gt;
&lt;br /&gt;
An entry point is the starting point for a GWT module, similar to the main method in a standard Java program. We define the code for Entry point through java classes and these java classes must implement com.google.gwt.core.client.EntryPoint and define method onModuleLoad().&lt;br /&gt;
&lt;br /&gt;
In order to run a gwt module, it must be loaded from a web page of some sort. Any HTML page can include a GWT application via a SCRIPTtag. This HTML page is referred to as Host page from the GWT application's point of view&lt;br /&gt;
&lt;br /&gt;
===Creating GWT entry point===&lt;br /&gt;
Define the following Java class &amp;quot;HelloGwt&amp;quot; which implements EntryPoint interface.&amp;lt;ref&amp;gt;http://www.vogella.com/tutorials/GWT/article.html#firstgwt_entrypoint&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  public class HelloGwt implements com.google.gwt.core.client.EntryPoint {&lt;br /&gt;
    public void onModuleLoad() {&lt;br /&gt;
       Label label = new Label(&amp;quot;Hello GWT !!!&amp;quot;);&lt;br /&gt;
       Button button = new Button(&amp;quot;Say something&amp;quot;);&lt;br /&gt;
       button.addClickHandler(new ClickHandler() {&lt;br /&gt;
       @Override&lt;br /&gt;
       public void onClick(ClickEvent event) {&lt;br /&gt;
         Window.alert(&amp;quot;Hello, again&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
     });&lt;br /&gt;
    RootPanel.get().add(label);&lt;br /&gt;
    RootPanel.get().add(button);&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
===Creating Module Descriptor===&lt;br /&gt;
Create the file &amp;quot;helloworld.gwt.xml&amp;quot; like as follows.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;module rename-to='helloworld'&amp;gt;&lt;br /&gt;
  &amp;lt;!-- Inherit the core Web Toolkit stuff.--&amp;gt;&lt;br /&gt;
  &amp;lt;inherits name='com.google.gwt.user.User'/&amp;gt;&lt;br /&gt;
  &amp;lt;inherits name='com.google.gwt.user.theme.standard.Standard'/&amp;gt;&lt;br /&gt;
  &amp;lt;!-- Specify the app entry point class. --&amp;gt;&lt;br /&gt;
  &amp;lt;entry-point class='HelloGwt'/&amp;gt;&lt;br /&gt;
  &amp;lt;/module&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating HTML Host Page===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;meta http-equiv=&amp;quot;content-type&amp;quot; content=&amp;quot;text/html; charset=UTF-8&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;link type=&amp;quot;text/css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;helloworld.css&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;My First GWT applicaton&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot; src=&amp;quot;helloworld/ helloworld.nocache.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/head&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modify Web.xml===&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;!DOCTYPE web-app&lt;br /&gt;
    PUBLIC &amp;quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&amp;quot;&lt;br /&gt;
    &amp;quot;http://java.sun.com/dtd/web-app_2_3.dtd&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;web-app&amp;gt;&lt;br /&gt;
   &amp;lt;!-- Default page to serve --&amp;gt;&lt;br /&gt;
   &amp;lt;welcome-file-list&amp;gt;&lt;br /&gt;
   &amp;lt;welcome-file&amp;gt;helloworld.html&amp;lt;/welcome-file&amp;gt;&lt;br /&gt;
   &amp;lt;/welcome-file-list&amp;gt;&lt;br /&gt;
   &amp;lt;/web-app&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Running the application===&lt;br /&gt;
To run the application in development mode in GWT IDE, you can right-click the project and select Run As -&amp;gt; &amp;quot;Web application&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Deploying the application==&lt;br /&gt;
&lt;br /&gt;
There are three different ways to deploy a GWT Web Application.&amp;lt;ref&amp;gt; http://www.gwtproject.org/doc/latest/DevGuideDeploying.html#DevGuideDeployingAppEngine &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Deploying on a web server===&lt;br /&gt;
To deploy a GWT application to a web server just copy the generated GWT application files after compilation and host them on the web server. The next step is to setup the server side code. This can take on a number of different forms: communicating through JSONP and working with JSON data, server-side scripts that receive and parse HTTP requests sent through the GWT RequestBuilder, or GWT RPC depending on the XHR mechanism used.&lt;br /&gt;
&lt;br /&gt;
Important points to ensure proper deployment:&lt;br /&gt;
&lt;br /&gt;
*The host HTML page can actually reside anywhere on your web server.&lt;br /&gt;
*The bootstrap script can also reside anywhere on your web server.&lt;br /&gt;
*The GWT application files must reside in the same directory as the bootstrap script, since the script looks for the application files relative to its own location.&lt;br /&gt;
*The host HTML page must reference the bootstrap script in its appropriate location on the web server.&lt;br /&gt;
*Any public resources can also be placed anywhere on the web server, but these should ideally mirror the resources' path relative to the war folder during development. Otherwise, references to these resources might not hold when deployed (e,g, an Image widget referencing some .png file).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Deploying on a servlet container using RPC===&lt;br /&gt;
Deploying a GWT application on a servlet container is an easy process. GWT compiler generates output in a directory structure that is already compliant to the Servlet 2.5 API specification. This makes it possible to deploy your application from the output directory itself. &lt;br /&gt;
    &lt;br /&gt;
===Deploying on Google App Engine===&lt;br /&gt;
To Deploy the application on Google App Engine, compile the application with the GWT compiler to generate the application files in the standard war directory structure, then upload and deploy your application using the appcfg utility.&lt;br /&gt;
&lt;br /&gt;
If webAppCreator was used to create your project, the application can be compiled with:&lt;br /&gt;
&lt;br /&gt;
 ant build&lt;br /&gt;
&lt;br /&gt;
and then deployed by invoking the appcfg utility with the update option:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;appengine_home_dir&amp;gt;/appcfg.sh update war&lt;br /&gt;
&lt;br /&gt;
The appengine-web.xml file has to properly configured beforehand, and you should have a Google account to deploy it on the App Engine.&lt;br /&gt;
&lt;br /&gt;
==GWT RPC communication==&lt;br /&gt;
A GWT based application generally consists of both client side code and server side code. Client side code runs in browser and server side code runs in web server. In order to access or manipulate data , Client side code has to make an HTTP request accross the network .&lt;br /&gt;
RPC, Remote Procedure Call is the mechansim used by GWT through which client code can invoke the server side methods. The implementation of GWT RPC is based on the servlet technology. The server side servlet is usually referred to as a &amp;quot;service&amp;quot;.and the remote procedure call is referred to as &amp;quot;invoking a service.&lt;br /&gt;
&amp;lt;ref&amp;gt;http://www.tutorialspoint.com/gwt/gwt_rpc_communication.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
===GWT RPC Components===&lt;br /&gt;
Following are the three components used in GWT RPC communication mechanism&lt;br /&gt;
&lt;br /&gt;
#A remote service (server-side servlet) that runs on the server.&lt;br /&gt;
#Client code to invoke that service.&lt;br /&gt;
#Java data objects which will be passed between client and server.&lt;br /&gt;
&lt;br /&gt;
GWT client and server both serialize and deserialize data automatically so developers are not required to serialize/deserialize objects and data objects can travel over HTTP.&lt;br /&gt;
&lt;br /&gt;
==History Management==&lt;br /&gt;
&lt;br /&gt;
In GWT as we are making rpc calls , there will be problem with the browser history. In static website, as each click leads to another page , the browser would be able to maintain the history of pages visited so far and when we click on back or forward button it directs us back to the previous page or later page respectively. Unlike static websites, GWT applications won’t redirect us to new pages and data is fetched through rpc calls and is refreshed in the same page itself. So browser will not have the scope to maintain history.&lt;br /&gt;
&lt;br /&gt;
GWT provides a mechanism through which activate browser history. For each page that is to be navigable in the history, the application would generate a unique history token. A token is simply a string that the application can parse to return to a particular state. This token will be saved in browser history as a URL fragment (in the location bar, after the &amp;quot;#&amp;quot;), and this fragment is passed back to the application when the user goes back or forward in history, or follows a link.&amp;lt;ref&amp;gt;http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, a history token named &amp;quot;page1&amp;quot; would be added to a URL as follows:&lt;br /&gt;
&lt;br /&gt;
     http://www.example.com/com.example.gwt.HistoryExample/HistoryExample.html#page1&lt;br /&gt;
&lt;br /&gt;
When the application wants to push a placeholder onto the browser's history stack, it simply invokes History.newItem(token). When the user uses the back button, a call will be made to any object that was added as a handler with History.addValueChangeHandler(). It is up to the application to restore the state according to the value of the new token.&lt;br /&gt;
&lt;br /&gt;
To use GWT History support, you must first embed an iframe into your host HTML page.&lt;br /&gt;
  &amp;lt;iframe src=&amp;quot;javascript:''&amp;quot;&lt;br /&gt;
          id=&amp;quot;__gwt_historyFrame&amp;quot;&lt;br /&gt;
          style=&amp;quot;position:absolute;width:0;height:0;border:0&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And in EntryPoint class add History.newItem(token) and History.addValueChangeHandler() invocations as show below.&lt;br /&gt;
&lt;br /&gt;
  public class BrowserHistoryExample implements EntryPoint {&lt;br /&gt;
  TabPanel tabPanel;&lt;br /&gt;
  &lt;br /&gt;
  public void onModuleLoad() {&lt;br /&gt;
    tabPanel = new TabPanel();&lt;br /&gt;
    tabPanel.add(new HTML(&amp;quot;Page 0 Content: Llamas&amp;quot;),&amp;quot; Page 0 &amp;quot;);&lt;br /&gt;
    tabPanel.add(new HTML(&amp;quot;Page 1 Content: Alpacas&amp;quot;),&amp;quot; Page 1 &amp;quot;);&lt;br /&gt;
    tabPanel.add(new HTML(&amp;quot;Page 2 Content: Camels&amp;quot;),&amp;quot; Page 2 &amp;quot;);&lt;br /&gt;
    tabPanel.addSelectionHandler(new SelectionHandler&amp;lt;Integer&amp;gt;(){&lt;br /&gt;
      public void onSelection(SelectionEvent&amp;lt;Integer&amp;gt; event) {&lt;br /&gt;
        History.newItem(&amp;quot;page&amp;quot; + event.getSelectedItem());&lt;br /&gt;
     );&lt;br /&gt;
    History.addValueChangeHandler(new ValueChangeHandler&amp;lt;String&amp;gt;() {&lt;br /&gt;
      public void onValueChange(ValueChangeEvent&amp;lt;String&amp;gt; event) {&lt;br /&gt;
        String historyToken = event.getValue();&lt;br /&gt;
        // Parse the history token&lt;br /&gt;
        try {&lt;br /&gt;
          if (historyToken.substring(0, 4).equals(&amp;quot;page&amp;quot;)) {&lt;br /&gt;
            String tabIndexToken = historyToken.substring(4, 5);&lt;br /&gt;
            int tabIndex = Integer.parseInt(tabIndexToken);&lt;br /&gt;
            // Select the specified tab panel&lt;br /&gt;
            tabPanel.selectTab(tabIndex);&lt;br /&gt;
          } else {&lt;br /&gt;
            tabPanel.selectTab(0);&lt;br /&gt;
          }&lt;br /&gt;
        } catch (IndexOutOfBoundsException e) {&lt;br /&gt;
          tabPanel.selectTab(0);&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    tabPanel.selectTab(0);&lt;br /&gt;
    RootPanel.get().add(tabPanel);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
==Internationalization==&lt;br /&gt;
&lt;br /&gt;
GWT Supports three different modes of internationalization.&amp;lt;ref&amp;gt;http://www.gwtproject.org/doc/latest/tutorial/i18n.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Static String Internationalization''': The translated strings and parameterized messages are stored in standard Java properties file. These values are then retrieved by the strongly-typed Java Interfaces based on the browsers locale.This is the simplest form of Internationalization GWT offers and carries very little overhead at runtime.&lt;br /&gt;
&lt;br /&gt;
'''Dynamic String Internationalization''': This method is used to integrate a GWT application with an existing server-side localization system.Applications using this technique look up localized strings in the module's host page; therefore, they do not need to be recompiled when adding a new locale.Dynamic string internationalization is slower than static string internationalization, but is very flexible. &lt;br /&gt;
&lt;br /&gt;
'''Localizable Interface'''&lt;br /&gt;
The most powerful technique in GWT to implement internationalization is the Localizable interface. Implementing Localizable in the application creates localized versions of custom types used in the application. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCheckBox GWT Features and Samples Showcase ]&lt;br /&gt;
&lt;br /&gt;
[http://www.gwtproject.org/index.html Google Web Toolkit Home Page]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/#!forum/google-web-toolkit GWT Discussion Forum]&lt;br /&gt;
&lt;br /&gt;
[http://googlewebtoolkit.blogspot.com/ GWT Official Blog]&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_6_bn&amp;diff=87021</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 6 bn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_6_bn&amp;diff=87021"/>
		<updated>2014-09-19T22:26:47Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* GWT RPC communication */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Gwt-logo.png|right|]]&lt;br /&gt;
==Google Web Toolkit==&lt;br /&gt;
&lt;br /&gt;
'''Google Web Toolkit(GWT)'''&amp;lt;ref&amp;gt;http://www.gwtproject.org/GWTPolicy.html&amp;lt;/ref&amp;gt; is a set of tools used to develop browser based RICH Web Applications([http://en.wikipedia.org/wiki/Rich_Internet_application RIA]). It is a free open source web framework released in 2006 under Apache 2.0 License. The focus of this toolkit is to provide great user experience by bringing the features and feel similar to that of a desktop application to the browser based web applications. GWT as a framework can be used to build large scale and high performance easy-to-maintain web appliations. GWT is used by many products at Google, including AdWords, AdSense, Flights, Hotel Finder, Offers, Wallet, Blogger, Maps.&lt;br /&gt;
&lt;br /&gt;
The latest Version of GWT (GWT 2.6.1) was released on May 10, 2014.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==GWT Features==&lt;br /&gt;
#'''Backend Language Support:''' Developers can use the language of their choice for developing the back-end code.&lt;br /&gt;
#'''XHR Handling:''' GWT handles all the XHR calls for the developers irrespective of the method of communication(JSON, XML, or GWT's optimized Remote Procedure Call (RPC) system)&lt;br /&gt;
#'''Dynamic Optimization:''' GWT creates a separate compiled version of your application that is optimized for a particular user's environment. &lt;br /&gt;
#'''Re-usability of code:''' GWT supports packaging of the user generated UI components. These packages can be loaded into the other projects facilitating the reuse of UI components.&lt;br /&gt;
#'''Support for Browser History:''' GWT adds state to the browser's back button history making the use of browsers &amp;quot;Back&amp;quot; button with the application easy.&lt;br /&gt;
#'''Internationalization:''' GWT provides tools to create efficient internationalized applications and libraries, including bi-directionality.&lt;br /&gt;
#'''Testing using JUnit:''' GWT supports testing of the code using JUnit in debugger, browser and even with asynchronous RPCs direct integration with JUnit lets us use  unit test both in a debugger and in a browser and you can even unit test asynchronous RPCs.&lt;br /&gt;
#'''Native Javascript Support:''' GWT supports and allows for embedding JavaScript within Java enabling the integration and use of pre-existing Javascript libraries.&lt;br /&gt;
&lt;br /&gt;
==Contents of the Toolkit==&lt;br /&gt;
&lt;br /&gt;
The Toolkit consists of a software development kit (GWT SDK) and an eclipse Plugin (Plugin for Eclipse).&amp;lt;ref&amp;gt;http://www.gwtproject.org/overview.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GWT SDK===&lt;br /&gt;
GWT SDK contains the Java API libraries, compiler, and development server. It lets you write client-side applications in Java and deploy them as JavaScript.&amp;lt;ref&amp;gt;http://www.tutorialspoint.com/gwt/index.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;GWT in Action, by Robert Hanning &amp;amp; Adam Tacy,Manning, 2007&amp;lt;/ref&amp;gt;&lt;br /&gt;
The three major components of the SDK are:&lt;br /&gt;
====GWT Java to JavaScript compiler====&lt;br /&gt;
This is the most important part of GWT which makes it a powerful tool for building RIAs. The GWT compiler is used to translate all the application code written in Java into JavaScript.It also supports mixing of Java code with existing JavaScript code using '''JavaScript Native Interface (JSNI)''', which allows embedding of JavaScript code within Java classes in order to facilitate Java-to-JavaScript communication. An example of embedded javascript in java is shown below.&lt;br /&gt;
 private native void nativeMethod()&lt;br /&gt;
 /*-{&lt;br /&gt;
      $wnd.jsFunction = function(x) {&lt;br /&gt;
        alert(x);&lt;br /&gt;
      };&lt;br /&gt;
      alert(&amp;quot;hello&amp;quot;);&lt;br /&gt;
 }-*/;&lt;br /&gt;
&lt;br /&gt;
One key feature of the GWT compiler is that it generates multiple output JavaScript files from the input code, one per each browser to ensure cross browser compatibility of the application. The browsers currently supported by the compiler include &lt;br /&gt;
:Firefox&lt;br /&gt;
:Internet Explorer 8, 9, 10, 11&lt;br /&gt;
:Safari 5, 6&lt;br /&gt;
:Chromium and Google Chrome&lt;br /&gt;
:Opera latest version&lt;br /&gt;
=====Compiler Modes=====&lt;br /&gt;
The compiler has three style modes that determine what the resulting Java-Script looks like. &lt;br /&gt;
The default style is '''obfuscate''', which makes the JavaScript look like alphabet soup. Everything is compressed and nearly impossible to decipher.An example of the obfuscated code is given below&lt;br /&gt;
 function x(){return this.y + '#' + this.b();}&lt;br /&gt;
The second style is '''pretty''' which generates readable JavaScript as shown below.&lt;br /&gt;
 function _toString(){&lt;br /&gt;
   return this._typeName + '#' + this._length();&lt;br /&gt;
 }&lt;br /&gt;
The third style is '''detailed''', which produces JavaScript code that looks like the pretty style with the addition of the full class name as part of the JavaScript method name. An Example would look like&lt;br /&gt;
 function java_lang_Object_toString__(){&lt;br /&gt;
 return this.java_lang_Object_typeName + '#' + this.length__();&lt;br /&gt;
 }&lt;br /&gt;
Generally Obfuscate is used for production as it is the most optimized and compressed version of the output code and would result in faster pages. Using Obfuscate also provides a certain amount of security to the output code and can prevent code theft by making it difficult to read the output. Pretty and detailed modes are used mainly in development to aid in debugging. &lt;br /&gt;
====JRE Emulation library====&lt;br /&gt;
Google Web Toolkit includes a library that emulates a subset of the Java runtime library. The list includes java.lang, java.lang.annotation, java.math, java.io, java.sql, java.util and java.util.logging.&lt;br /&gt;
&lt;br /&gt;
====GWT UI building library==== &lt;br /&gt;
This part of GWT consists of many subparts which includes the actual UI components, RPC support, History management. GWT ships with a large set of widgets and panels for laying out UI. &lt;br /&gt;
&lt;br /&gt;
===Plugin for Eclipse=== &lt;br /&gt;
Plugin for Eclipse provides IDE support for GWT and App Engine web projects.&lt;br /&gt;
&lt;br /&gt;
== GWT Web Development Modes ==&lt;br /&gt;
&lt;br /&gt;
GWT supports two different modes for developing Web Applications.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Google_Web_Toolkit&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Development mode:''' The Application is run on the local system as bytecode in the Java Virtual Machine(JVM). This mode supports hotswapping of the code, real time debugging and is typically used for development. &lt;br /&gt;
&lt;br /&gt;
*'''Production mode:''' The application is run as pure JavaScript and HTML, compiled from the Java source. This mode is typically used for deployment.&lt;br /&gt;
&lt;br /&gt;
== GWT Web Development Process Flowchart ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:GWT Process Flow.jpg]]&amp;lt;/div&amp;gt; &lt;br /&gt;
== Contents of GWT Application== &lt;br /&gt;
&lt;br /&gt;
Every GWT application contains the following four parts &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/gwt/gwt_applications.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Module descriptors===&lt;br /&gt;
In GWT, applications are segregated into modules. A GWT &amp;quot;module&amp;quot; is simply an encapsulation of functionality. A module is defined by an XML descriptor file ending with the extension &amp;quot;.gwt.xml&amp;quot;, and the name of that file determines the name of the module. This xml file is known as  module descriptor.&lt;br /&gt;
&lt;br /&gt;
Typically module descriptors contain the following &lt;br /&gt;
#Inherited modules (A module can inherit the existing modules)&lt;br /&gt;
#an entry point application class name; these are optional, although any module referred to in HTML must have at least one entry-point class specified&lt;br /&gt;
#source path entries&lt;br /&gt;
#public path entries&lt;br /&gt;
&lt;br /&gt;
===Public resources===&lt;br /&gt;
These are all files referenced by your GWT module, such as Host HTML page, CSS or images. The location of these resources can be configured using &amp;lt;public path=&amp;quot;path&amp;quot; /&amp;gt; element in module descriptor  file. By default, it is the public subdirectory underneath where the Module XML File is stored.&lt;br /&gt;
&lt;br /&gt;
===Client Side Code===&lt;br /&gt;
This is the actual Java code written implementing the business logic of the application and that the GWT compiler translates into JavaScript, which will eventually run inside the browser. The location of these resources can be configured using &amp;lt;source path=&amp;quot;path&amp;quot; /&amp;gt; element in module configuration file.&lt;br /&gt;
&lt;br /&gt;
===Server Side Code===&lt;br /&gt;
This is the server side part of your application and its very much optional. If you are not doing any backend processing with-in your application then you do not need this part, but if there is some processing required at backend and your client-side application interact with the server then you will have to develop these components.&lt;br /&gt;
&lt;br /&gt;
==Sample Application in GWT==&lt;br /&gt;
For this sample GWT application we will be creating a module with one entry point and a host html page. &lt;br /&gt;
&lt;br /&gt;
An entry point is the starting point for a GWT module, similar to the main method in a standard Java program. We define the code for Entry point through java classes and these java classes must implement com.google.gwt.core.client.EntryPoint and define method onModuleLoad().&lt;br /&gt;
&lt;br /&gt;
In order to run a gwt module, it must be loaded from a web page of some sort. Any HTML page can include a GWT application via a SCRIPTtag. This HTML page is referred to as Host page from the GWT application's point of view&lt;br /&gt;
&lt;br /&gt;
===Creating GWT entry point===&lt;br /&gt;
Define the following Java class &amp;quot;HelloGwt&amp;quot; which implements EntryPoint interface.&amp;lt;ref&amp;gt;http://www.vogella.com/tutorials/GWT/article.html#firstgwt_entrypoint&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  public class HelloGwt implements com.google.gwt.core.client.EntryPoint {&lt;br /&gt;
    public void onModuleLoad() {&lt;br /&gt;
       Label label = new Label(&amp;quot;Hello GWT !!!&amp;quot;);&lt;br /&gt;
       Button button = new Button(&amp;quot;Say something&amp;quot;);&lt;br /&gt;
       button.addClickHandler(new ClickHandler() {&lt;br /&gt;
       @Override&lt;br /&gt;
       public void onClick(ClickEvent event) {&lt;br /&gt;
         Window.alert(&amp;quot;Hello, again&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
     });&lt;br /&gt;
    RootPanel.get().add(label);&lt;br /&gt;
    RootPanel.get().add(button);&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
===Creating Module Descriptor===&lt;br /&gt;
Create the file &amp;quot;helloworld.gwt.xml&amp;quot; like as follows.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;module rename-to='helloworld'&amp;gt;&lt;br /&gt;
  &amp;lt;!-- Inherit the core Web Toolkit stuff.--&amp;gt;&lt;br /&gt;
  &amp;lt;inherits name='com.google.gwt.user.User'/&amp;gt;&lt;br /&gt;
  &amp;lt;inherits name='com.google.gwt.user.theme.standard.Standard'/&amp;gt;&lt;br /&gt;
  &amp;lt;!-- Specify the app entry point class. --&amp;gt;&lt;br /&gt;
  &amp;lt;entry-point class='HelloGwt'/&amp;gt;&lt;br /&gt;
  &amp;lt;/module&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating HTML Host Page===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;meta http-equiv=&amp;quot;content-type&amp;quot; content=&amp;quot;text/html; charset=UTF-8&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;link type=&amp;quot;text/css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;helloworld.css&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;My First GWT applicaton&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot; src=&amp;quot;helloworld/ helloworld.nocache.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/head&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modify Web.xml===&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;!DOCTYPE web-app&lt;br /&gt;
    PUBLIC &amp;quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&amp;quot;&lt;br /&gt;
    &amp;quot;http://java.sun.com/dtd/web-app_2_3.dtd&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;web-app&amp;gt;&lt;br /&gt;
   &amp;lt;!-- Default page to serve --&amp;gt;&lt;br /&gt;
   &amp;lt;welcome-file-list&amp;gt;&lt;br /&gt;
   &amp;lt;welcome-file&amp;gt;helloworld.html&amp;lt;/welcome-file&amp;gt;&lt;br /&gt;
   &amp;lt;/welcome-file-list&amp;gt;&lt;br /&gt;
   &amp;lt;/web-app&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Running the application===&lt;br /&gt;
To run the application in development mode in GWT IDE, you can right-click the project and select Run As -&amp;gt; &amp;quot;Web application&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Deploying the application==&lt;br /&gt;
&lt;br /&gt;
There are three different ways to deploy a GWT Web Application.&amp;lt;ref&amp;gt; http://www.gwtproject.org/doc/latest/DevGuideDeploying.html#DevGuideDeployingAppEngine &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Deploying on a web server===&lt;br /&gt;
To deploy a GWT application to a web server just copy the generated GWT application files after compilation and host them on the web server. The next step is to setup the server side code. This can take on a number of different forms: communicating through JSONP and working with JSON data, server-side scripts that receive and parse HTTP requests sent through the GWT RequestBuilder, or GWT RPC depending on the XHR mechanism used.&lt;br /&gt;
&lt;br /&gt;
Important points to ensure proper deployment:&lt;br /&gt;
&lt;br /&gt;
*The host HTML page can actually reside anywhere on your web server.&lt;br /&gt;
*The bootstrap script can also reside anywhere on your web server.&lt;br /&gt;
*The GWT application files must reside in the same directory as the bootstrap script, since the script looks for the application files relative to its own location.&lt;br /&gt;
*The host HTML page must reference the bootstrap script in its appropriate location on the web server.&lt;br /&gt;
*Any public resources can also be placed anywhere on the web server, but these should ideally mirror the resources' path relative to the war folder during development. Otherwise, references to these resources might not hold when deployed (e,g, an Image widget referencing some .png file).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Deploying on a servlet container using RPC===&lt;br /&gt;
Deploying a GWT application on a servlet container is an easy process. GWT compiler generates output in a directory structure that is already compliant to the Servlet 2.5 API specification. This makes it possible to deploy your application from the output directory itself. &lt;br /&gt;
    &lt;br /&gt;
===Deploying on Google App Engine===&lt;br /&gt;
To Deploy the application on Google App Engine, compile the application with the GWT compiler to generate the application files in the standard war directory structure, then upload and deploy your application using the appcfg utility.&lt;br /&gt;
&lt;br /&gt;
If webAppCreator was used to create your project, the application can be compiled with:&lt;br /&gt;
&lt;br /&gt;
 ant build&lt;br /&gt;
&lt;br /&gt;
and then deployed by invoking the appcfg utility with the update option:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;appengine_home_dir&amp;gt;/appcfg.sh update war&lt;br /&gt;
&lt;br /&gt;
The appengine-web.xml file has to properly configured beforehand, and you should have a Google account to deploy it on the App Engine.&lt;br /&gt;
&lt;br /&gt;
==GWT RPC communication==&lt;br /&gt;
A GWT based application generally consists of both client side code and server side code. Client side code runs in browser and server side code runs in web server. In order to access or manipulate data , Client side code has to make an HTTP request accross the network .&amp;lt;ref&amp;gt;http://www.tutorialspoint.com/gwt/gwt_rpc_communication.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
RPC, Remote Procedure Call is the mechansim used by GWT through which client code can invoke the server side methods. The implementation of GWT RPC is based on the servlet technology. The server side servlet is usually referred to as a &amp;quot;service&amp;quot;.and the remote procedure call is referred to as &amp;quot;invoking a service.&lt;br /&gt;
&lt;br /&gt;
===GWT RPC Components===&lt;br /&gt;
Following are the three components used in GWT RPC communication mechanism&lt;br /&gt;
&lt;br /&gt;
#A remote service (server-side servlet) that runs on the server.&lt;br /&gt;
#Client code to invoke that service.&lt;br /&gt;
#Java data objects which will be passed between client and server.&lt;br /&gt;
&lt;br /&gt;
GWT client and server both serialize and deserialize data automatically so developers are not required to serialize/deserialize objects and data objects can travel over HTTP.&lt;br /&gt;
&lt;br /&gt;
==History Management==&lt;br /&gt;
&lt;br /&gt;
In GWT as we are making rpc calls , there will be problem with the browser history. In static website, as each click leads to another page , the browser would be able to maintain the history of pages visited so far and when we click on back or forward button it directs us back to the previous page or later page respectively. Unlike static websites, GWT applications won’t redirect us to new pages and data is fetched through rpc calls and is refreshed in the same page itself. So browser will not have the scope to maintain history.&lt;br /&gt;
&lt;br /&gt;
GWT provides a mechanism through which activate browser history. For each page that is to be navigable in the history, the application would generate a unique history token. A token is simply a string that the application can parse to return to a particular state. This token will be saved in browser history as a URL fragment (in the location bar, after the &amp;quot;#&amp;quot;), and this fragment is passed back to the application when the user goes back or forward in history, or follows a link.&amp;lt;ref&amp;gt;http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, a history token named &amp;quot;page1&amp;quot; would be added to a URL as follows:&lt;br /&gt;
&lt;br /&gt;
     http://www.example.com/com.example.gwt.HistoryExample/HistoryExample.html#page1&lt;br /&gt;
&lt;br /&gt;
When the application wants to push a placeholder onto the browser's history stack, it simply invokes History.newItem(token). When the user uses the back button, a call will be made to any object that was added as a handler with History.addValueChangeHandler(). It is up to the application to restore the state according to the value of the new token.&lt;br /&gt;
&lt;br /&gt;
To use GWT History support, you must first embed an iframe into your host HTML page.&lt;br /&gt;
  &amp;lt;iframe src=&amp;quot;javascript:''&amp;quot;&lt;br /&gt;
          id=&amp;quot;__gwt_historyFrame&amp;quot;&lt;br /&gt;
          style=&amp;quot;position:absolute;width:0;height:0;border:0&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And in EntryPoint class add History.newItem(token) and History.addValueChangeHandler() invocations as show below.&lt;br /&gt;
&lt;br /&gt;
  public class BrowserHistoryExample implements EntryPoint {&lt;br /&gt;
  TabPanel tabPanel;&lt;br /&gt;
  &lt;br /&gt;
  public void onModuleLoad() {&lt;br /&gt;
    tabPanel = new TabPanel();&lt;br /&gt;
    tabPanel.add(new HTML(&amp;quot;Page 0 Content: Llamas&amp;quot;),&amp;quot; Page 0 &amp;quot;);&lt;br /&gt;
    tabPanel.add(new HTML(&amp;quot;Page 1 Content: Alpacas&amp;quot;),&amp;quot; Page 1 &amp;quot;);&lt;br /&gt;
    tabPanel.add(new HTML(&amp;quot;Page 2 Content: Camels&amp;quot;),&amp;quot; Page 2 &amp;quot;);&lt;br /&gt;
    tabPanel.addSelectionHandler(new SelectionHandler&amp;lt;Integer&amp;gt;(){&lt;br /&gt;
      public void onSelection(SelectionEvent&amp;lt;Integer&amp;gt; event) {&lt;br /&gt;
        History.newItem(&amp;quot;page&amp;quot; + event.getSelectedItem());&lt;br /&gt;
     );&lt;br /&gt;
    History.addValueChangeHandler(new ValueChangeHandler&amp;lt;String&amp;gt;() {&lt;br /&gt;
      public void onValueChange(ValueChangeEvent&amp;lt;String&amp;gt; event) {&lt;br /&gt;
        String historyToken = event.getValue();&lt;br /&gt;
        // Parse the history token&lt;br /&gt;
        try {&lt;br /&gt;
          if (historyToken.substring(0, 4).equals(&amp;quot;page&amp;quot;)) {&lt;br /&gt;
            String tabIndexToken = historyToken.substring(4, 5);&lt;br /&gt;
            int tabIndex = Integer.parseInt(tabIndexToken);&lt;br /&gt;
            // Select the specified tab panel&lt;br /&gt;
            tabPanel.selectTab(tabIndex);&lt;br /&gt;
          } else {&lt;br /&gt;
            tabPanel.selectTab(0);&lt;br /&gt;
          }&lt;br /&gt;
        } catch (IndexOutOfBoundsException e) {&lt;br /&gt;
          tabPanel.selectTab(0);&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    tabPanel.selectTab(0);&lt;br /&gt;
    RootPanel.get().add(tabPanel);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
==Internationalization==&lt;br /&gt;
&lt;br /&gt;
GWT Supports three different modes of internationalization.&amp;lt;ref&amp;gt;http://www.gwtproject.org/doc/latest/tutorial/i18n.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Static String Internationalization''': The translated strings and parameterized messages are stored in standard Java properties file. These values are then retrieved by the strongly-typed Java Interfaces based on the browsers locale.This is the simplest form of Internationalization GWT offers and carries very little overhead at runtime.&lt;br /&gt;
&lt;br /&gt;
'''Dynamic String Internationalization''': This method is used to integrate a GWT application with an existing server-side localization system.Applications using this technique look up localized strings in the module's host page; therefore, they do not need to be recompiled when adding a new locale.Dynamic string internationalization is slower than static string internationalization, but is very flexible. &lt;br /&gt;
&lt;br /&gt;
'''Localizable Interface'''&lt;br /&gt;
The most powerful technique in GWT to implement internationalization is the Localizable interface. Implementing Localizable in the application creates localized versions of custom types used in the application. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCheckBox GWT Features and Samples Showcase ]&lt;br /&gt;
&lt;br /&gt;
[http://www.gwtproject.org/index.html Google Web Toolkit Home Page]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/#!forum/google-web-toolkit GWT Discussion Forum]&lt;br /&gt;
&lt;br /&gt;
[http://googlewebtoolkit.blogspot.com/ GWT Official Blog]&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_6_bn&amp;diff=87020</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 6 bn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_6_bn&amp;diff=87020"/>
		<updated>2014-09-19T22:25:59Z</updated>

		<summary type="html">&lt;p&gt;Nchinth: /* History Management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Gwt-logo.png|right|]]&lt;br /&gt;
==Google Web Toolkit==&lt;br /&gt;
&lt;br /&gt;
'''Google Web Toolkit(GWT)'''&amp;lt;ref&amp;gt;http://www.gwtproject.org/GWTPolicy.html&amp;lt;/ref&amp;gt; is a set of tools used to develop browser based RICH Web Applications([http://en.wikipedia.org/wiki/Rich_Internet_application RIA]). It is a free open source web framework released in 2006 under Apache 2.0 License. The focus of this toolkit is to provide great user experience by bringing the features and feel similar to that of a desktop application to the browser based web applications. GWT as a framework can be used to build large scale and high performance easy-to-maintain web appliations. GWT is used by many products at Google, including AdWords, AdSense, Flights, Hotel Finder, Offers, Wallet, Blogger, Maps.&lt;br /&gt;
&lt;br /&gt;
The latest Version of GWT (GWT 2.6.1) was released on May 10, 2014.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==GWT Features==&lt;br /&gt;
#'''Backend Language Support:''' Developers can use the language of their choice for developing the back-end code.&lt;br /&gt;
#'''XHR Handling:''' GWT handles all the XHR calls for the developers irrespective of the method of communication(JSON, XML, or GWT's optimized Remote Procedure Call (RPC) system)&lt;br /&gt;
#'''Dynamic Optimization:''' GWT creates a separate compiled version of your application that is optimized for a particular user's environment. &lt;br /&gt;
#'''Re-usability of code:''' GWT supports packaging of the user generated UI components. These packages can be loaded into the other projects facilitating the reuse of UI components.&lt;br /&gt;
#'''Support for Browser History:''' GWT adds state to the browser's back button history making the use of browsers &amp;quot;Back&amp;quot; button with the application easy.&lt;br /&gt;
#'''Internationalization:''' GWT provides tools to create efficient internationalized applications and libraries, including bi-directionality.&lt;br /&gt;
#'''Testing using JUnit:''' GWT supports testing of the code using JUnit in debugger, browser and even with asynchronous RPCs direct integration with JUnit lets us use  unit test both in a debugger and in a browser and you can even unit test asynchronous RPCs.&lt;br /&gt;
#'''Native Javascript Support:''' GWT supports and allows for embedding JavaScript within Java enabling the integration and use of pre-existing Javascript libraries.&lt;br /&gt;
&lt;br /&gt;
==Contents of the Toolkit==&lt;br /&gt;
&lt;br /&gt;
The Toolkit consists of a software development kit (GWT SDK) and an eclipse Plugin (Plugin for Eclipse).&amp;lt;ref&amp;gt;http://www.gwtproject.org/overview.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GWT SDK===&lt;br /&gt;
GWT SDK contains the Java API libraries, compiler, and development server. It lets you write client-side applications in Java and deploy them as JavaScript.&amp;lt;ref&amp;gt;http://www.tutorialspoint.com/gwt/index.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;GWT in Action, by Robert Hanning &amp;amp; Adam Tacy,Manning, 2007&amp;lt;/ref&amp;gt;&lt;br /&gt;
The three major components of the SDK are:&lt;br /&gt;
====GWT Java to JavaScript compiler====&lt;br /&gt;
This is the most important part of GWT which makes it a powerful tool for building RIAs. The GWT compiler is used to translate all the application code written in Java into JavaScript.It also supports mixing of Java code with existing JavaScript code using '''JavaScript Native Interface (JSNI)''', which allows embedding of JavaScript code within Java classes in order to facilitate Java-to-JavaScript communication. An example of embedded javascript in java is shown below.&lt;br /&gt;
 private native void nativeMethod()&lt;br /&gt;
 /*-{&lt;br /&gt;
      $wnd.jsFunction = function(x) {&lt;br /&gt;
        alert(x);&lt;br /&gt;
      };&lt;br /&gt;
      alert(&amp;quot;hello&amp;quot;);&lt;br /&gt;
 }-*/;&lt;br /&gt;
&lt;br /&gt;
One key feature of the GWT compiler is that it generates multiple output JavaScript files from the input code, one per each browser to ensure cross browser compatibility of the application. The browsers currently supported by the compiler include &lt;br /&gt;
:Firefox&lt;br /&gt;
:Internet Explorer 8, 9, 10, 11&lt;br /&gt;
:Safari 5, 6&lt;br /&gt;
:Chromium and Google Chrome&lt;br /&gt;
:Opera latest version&lt;br /&gt;
=====Compiler Modes=====&lt;br /&gt;
The compiler has three style modes that determine what the resulting Java-Script looks like. &lt;br /&gt;
The default style is '''obfuscate''', which makes the JavaScript look like alphabet soup. Everything is compressed and nearly impossible to decipher.An example of the obfuscated code is given below&lt;br /&gt;
 function x(){return this.y + '#' + this.b();}&lt;br /&gt;
The second style is '''pretty''' which generates readable JavaScript as shown below.&lt;br /&gt;
 function _toString(){&lt;br /&gt;
   return this._typeName + '#' + this._length();&lt;br /&gt;
 }&lt;br /&gt;
The third style is '''detailed''', which produces JavaScript code that looks like the pretty style with the addition of the full class name as part of the JavaScript method name. An Example would look like&lt;br /&gt;
 function java_lang_Object_toString__(){&lt;br /&gt;
 return this.java_lang_Object_typeName + '#' + this.length__();&lt;br /&gt;
 }&lt;br /&gt;
Generally Obfuscate is used for production as it is the most optimized and compressed version of the output code and would result in faster pages. Using Obfuscate also provides a certain amount of security to the output code and can prevent code theft by making it difficult to read the output. Pretty and detailed modes are used mainly in development to aid in debugging. &lt;br /&gt;
====JRE Emulation library====&lt;br /&gt;
Google Web Toolkit includes a library that emulates a subset of the Java runtime library. The list includes java.lang, java.lang.annotation, java.math, java.io, java.sql, java.util and java.util.logging.&lt;br /&gt;
&lt;br /&gt;
====GWT UI building library==== &lt;br /&gt;
This part of GWT consists of many subparts which includes the actual UI components, RPC support, History management. GWT ships with a large set of widgets and panels for laying out UI. &lt;br /&gt;
&lt;br /&gt;
===Plugin for Eclipse=== &lt;br /&gt;
Plugin for Eclipse provides IDE support for GWT and App Engine web projects.&lt;br /&gt;
&lt;br /&gt;
== GWT Web Development Modes ==&lt;br /&gt;
&lt;br /&gt;
GWT supports two different modes for developing Web Applications.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Google_Web_Toolkit&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Development mode:''' The Application is run on the local system as bytecode in the Java Virtual Machine(JVM). This mode supports hotswapping of the code, real time debugging and is typically used for development. &lt;br /&gt;
&lt;br /&gt;
*'''Production mode:''' The application is run as pure JavaScript and HTML, compiled from the Java source. This mode is typically used for deployment.&lt;br /&gt;
&lt;br /&gt;
== GWT Web Development Process Flowchart ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;[[File:GWT Process Flow.jpg]]&amp;lt;/div&amp;gt; &lt;br /&gt;
== Contents of GWT Application== &lt;br /&gt;
&lt;br /&gt;
Every GWT application contains the following four parts &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/gwt/gwt_applications.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Module descriptors===&lt;br /&gt;
In GWT, applications are segregated into modules. A GWT &amp;quot;module&amp;quot; is simply an encapsulation of functionality. A module is defined by an XML descriptor file ending with the extension &amp;quot;.gwt.xml&amp;quot;, and the name of that file determines the name of the module. This xml file is known as  module descriptor.&lt;br /&gt;
&lt;br /&gt;
Typically module descriptors contain the following &lt;br /&gt;
#Inherited modules (A module can inherit the existing modules)&lt;br /&gt;
#an entry point application class name; these are optional, although any module referred to in HTML must have at least one entry-point class specified&lt;br /&gt;
#source path entries&lt;br /&gt;
#public path entries&lt;br /&gt;
&lt;br /&gt;
===Public resources===&lt;br /&gt;
These are all files referenced by your GWT module, such as Host HTML page, CSS or images. The location of these resources can be configured using &amp;lt;public path=&amp;quot;path&amp;quot; /&amp;gt; element in module descriptor  file. By default, it is the public subdirectory underneath where the Module XML File is stored.&lt;br /&gt;
&lt;br /&gt;
===Client Side Code===&lt;br /&gt;
This is the actual Java code written implementing the business logic of the application and that the GWT compiler translates into JavaScript, which will eventually run inside the browser. The location of these resources can be configured using &amp;lt;source path=&amp;quot;path&amp;quot; /&amp;gt; element in module configuration file.&lt;br /&gt;
&lt;br /&gt;
===Server Side Code===&lt;br /&gt;
This is the server side part of your application and its very much optional. If you are not doing any backend processing with-in your application then you do not need this part, but if there is some processing required at backend and your client-side application interact with the server then you will have to develop these components.&lt;br /&gt;
&lt;br /&gt;
==Sample Application in GWT==&lt;br /&gt;
For this sample GWT application we will be creating a module with one entry point and a host html page. &lt;br /&gt;
&lt;br /&gt;
An entry point is the starting point for a GWT module, similar to the main method in a standard Java program. We define the code for Entry point through java classes and these java classes must implement com.google.gwt.core.client.EntryPoint and define method onModuleLoad().&lt;br /&gt;
&lt;br /&gt;
In order to run a gwt module, it must be loaded from a web page of some sort. Any HTML page can include a GWT application via a SCRIPTtag. This HTML page is referred to as Host page from the GWT application's point of view&lt;br /&gt;
&lt;br /&gt;
===Creating GWT entry point===&lt;br /&gt;
Define the following Java class &amp;quot;HelloGwt&amp;quot; which implements EntryPoint interface.&amp;lt;ref&amp;gt;http://www.vogella.com/tutorials/GWT/article.html#firstgwt_entrypoint&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  public class HelloGwt implements com.google.gwt.core.client.EntryPoint {&lt;br /&gt;
    public void onModuleLoad() {&lt;br /&gt;
       Label label = new Label(&amp;quot;Hello GWT !!!&amp;quot;);&lt;br /&gt;
       Button button = new Button(&amp;quot;Say something&amp;quot;);&lt;br /&gt;
       button.addClickHandler(new ClickHandler() {&lt;br /&gt;
       @Override&lt;br /&gt;
       public void onClick(ClickEvent event) {&lt;br /&gt;
         Window.alert(&amp;quot;Hello, again&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
     });&lt;br /&gt;
    RootPanel.get().add(label);&lt;br /&gt;
    RootPanel.get().add(button);&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
===Creating Module Descriptor===&lt;br /&gt;
Create the file &amp;quot;helloworld.gwt.xml&amp;quot; like as follows.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;module rename-to='helloworld'&amp;gt;&lt;br /&gt;
  &amp;lt;!-- Inherit the core Web Toolkit stuff.--&amp;gt;&lt;br /&gt;
  &amp;lt;inherits name='com.google.gwt.user.User'/&amp;gt;&lt;br /&gt;
  &amp;lt;inherits name='com.google.gwt.user.theme.standard.Standard'/&amp;gt;&lt;br /&gt;
  &amp;lt;!-- Specify the app entry point class. --&amp;gt;&lt;br /&gt;
  &amp;lt;entry-point class='HelloGwt'/&amp;gt;&lt;br /&gt;
  &amp;lt;/module&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating HTML Host Page===&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;meta http-equiv=&amp;quot;content-type&amp;quot; content=&amp;quot;text/html; charset=UTF-8&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;link type=&amp;quot;text/css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;helloworld.css&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;My First GWT applicaton&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot; src=&amp;quot;helloworld/ helloworld.nocache.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/head&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modify Web.xml===&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;!DOCTYPE web-app&lt;br /&gt;
    PUBLIC &amp;quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&amp;quot;&lt;br /&gt;
    &amp;quot;http://java.sun.com/dtd/web-app_2_3.dtd&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;web-app&amp;gt;&lt;br /&gt;
   &amp;lt;!-- Default page to serve --&amp;gt;&lt;br /&gt;
   &amp;lt;welcome-file-list&amp;gt;&lt;br /&gt;
   &amp;lt;welcome-file&amp;gt;helloworld.html&amp;lt;/welcome-file&amp;gt;&lt;br /&gt;
   &amp;lt;/welcome-file-list&amp;gt;&lt;br /&gt;
   &amp;lt;/web-app&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Running the application===&lt;br /&gt;
To run the application in development mode in GWT IDE, you can right-click the project and select Run As -&amp;gt; &amp;quot;Web application&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Deploying the application==&lt;br /&gt;
&lt;br /&gt;
There are three different ways to deploy a GWT Web Application.&amp;lt;ref&amp;gt; http://www.gwtproject.org/doc/latest/DevGuideDeploying.html#DevGuideDeployingAppEngine &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Deploying on a web server===&lt;br /&gt;
To deploy a GWT application to a web server just copy the generated GWT application files after compilation and host them on the web server. The next step is to setup the server side code. This can take on a number of different forms: communicating through JSONP and working with JSON data, server-side scripts that receive and parse HTTP requests sent through the GWT RequestBuilder, or GWT RPC depending on the XHR mechanism used.&lt;br /&gt;
&lt;br /&gt;
Important points to ensure proper deployment:&lt;br /&gt;
&lt;br /&gt;
*The host HTML page can actually reside anywhere on your web server.&lt;br /&gt;
*The bootstrap script can also reside anywhere on your web server.&lt;br /&gt;
*The GWT application files must reside in the same directory as the bootstrap script, since the script looks for the application files relative to its own location.&lt;br /&gt;
*The host HTML page must reference the bootstrap script in its appropriate location on the web server.&lt;br /&gt;
*Any public resources can also be placed anywhere on the web server, but these should ideally mirror the resources' path relative to the war folder during development. Otherwise, references to these resources might not hold when deployed (e,g, an Image widget referencing some .png file).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Deploying on a servlet container using RPC===&lt;br /&gt;
Deploying a GWT application on a servlet container is an easy process. GWT compiler generates output in a directory structure that is already compliant to the Servlet 2.5 API specification. This makes it possible to deploy your application from the output directory itself. &lt;br /&gt;
    &lt;br /&gt;
===Deploying on Google App Engine===&lt;br /&gt;
To Deploy the application on Google App Engine, compile the application with the GWT compiler to generate the application files in the standard war directory structure, then upload and deploy your application using the appcfg utility.&lt;br /&gt;
&lt;br /&gt;
If webAppCreator was used to create your project, the application can be compiled with:&lt;br /&gt;
&lt;br /&gt;
 ant build&lt;br /&gt;
&lt;br /&gt;
and then deployed by invoking the appcfg utility with the update option:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;appengine_home_dir&amp;gt;/appcfg.sh update war&lt;br /&gt;
&lt;br /&gt;
The appengine-web.xml file has to properly configured beforehand, and you should have a Google account to deploy it on the App Engine.&lt;br /&gt;
&lt;br /&gt;
==GWT RPC communication==&lt;br /&gt;
A GWT based application generally consists of both client side code and server side code. Client side code runs in browser and server side code runs in web server. In order to access or manipulate data , Client side code has to make an HTTP request accross the network .&lt;br /&gt;
&lt;br /&gt;
RPC, Remote Procedure Call is the mechansim used by GWT through which client code can invoke the server side methods. The implementation of GWT RPC is based on the servlet technology. The server side servlet is usually referred to as a &amp;quot;service&amp;quot;.and the remote procedure call is referred to as &amp;quot;invoking a service.&lt;br /&gt;
&lt;br /&gt;
===GWT RPC Components===&lt;br /&gt;
Following are the three components used in GWT RPC communication mechanism&lt;br /&gt;
&lt;br /&gt;
#A remote service (server-side servlet) that runs on the server.&lt;br /&gt;
#Client code to invoke that service.&lt;br /&gt;
#Java data objects which will be passed between client and server.&lt;br /&gt;
&lt;br /&gt;
GWT client and server both serialize and deserialize data automatically so developers are not required to serialize/deserialize objects and data objects can travel over HTTP.&lt;br /&gt;
&lt;br /&gt;
==History Management==&lt;br /&gt;
&lt;br /&gt;
In GWT as we are making rpc calls , there will be problem with the browser history. In static website, as each click leads to another page , the browser would be able to maintain the history of pages visited so far and when we click on back or forward button it directs us back to the previous page or later page respectively. Unlike static websites, GWT applications won’t redirect us to new pages and data is fetched through rpc calls and is refreshed in the same page itself. So browser will not have the scope to maintain history.&lt;br /&gt;
&lt;br /&gt;
GWT provides a mechanism through which activate browser history. For each page that is to be navigable in the history, the application would generate a unique history token. A token is simply a string that the application can parse to return to a particular state. This token will be saved in browser history as a URL fragment (in the location bar, after the &amp;quot;#&amp;quot;), and this fragment is passed back to the application when the user goes back or forward in history, or follows a link.&amp;lt;ref&amp;gt;http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsHistory.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, a history token named &amp;quot;page1&amp;quot; would be added to a URL as follows:&lt;br /&gt;
&lt;br /&gt;
     http://www.example.com/com.example.gwt.HistoryExample/HistoryExample.html#page1&lt;br /&gt;
&lt;br /&gt;
When the application wants to push a placeholder onto the browser's history stack, it simply invokes History.newItem(token). When the user uses the back button, a call will be made to any object that was added as a handler with History.addValueChangeHandler(). It is up to the application to restore the state according to the value of the new token.&lt;br /&gt;
&lt;br /&gt;
To use GWT History support, you must first embed an iframe into your host HTML page.&lt;br /&gt;
  &amp;lt;iframe src=&amp;quot;javascript:''&amp;quot;&lt;br /&gt;
          id=&amp;quot;__gwt_historyFrame&amp;quot;&lt;br /&gt;
          style=&amp;quot;position:absolute;width:0;height:0;border:0&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And in EntryPoint class add History.newItem(token) and History.addValueChangeHandler() invocations as show below.&lt;br /&gt;
&lt;br /&gt;
  public class BrowserHistoryExample implements EntryPoint {&lt;br /&gt;
  TabPanel tabPanel;&lt;br /&gt;
  &lt;br /&gt;
  public void onModuleLoad() {&lt;br /&gt;
    tabPanel = new TabPanel();&lt;br /&gt;
    tabPanel.add(new HTML(&amp;quot;Page 0 Content: Llamas&amp;quot;),&amp;quot; Page 0 &amp;quot;);&lt;br /&gt;
    tabPanel.add(new HTML(&amp;quot;Page 1 Content: Alpacas&amp;quot;),&amp;quot; Page 1 &amp;quot;);&lt;br /&gt;
    tabPanel.add(new HTML(&amp;quot;Page 2 Content: Camels&amp;quot;),&amp;quot; Page 2 &amp;quot;);&lt;br /&gt;
    tabPanel.addSelectionHandler(new SelectionHandler&amp;lt;Integer&amp;gt;(){&lt;br /&gt;
      public void onSelection(SelectionEvent&amp;lt;Integer&amp;gt; event) {&lt;br /&gt;
        History.newItem(&amp;quot;page&amp;quot; + event.getSelectedItem());&lt;br /&gt;
     );&lt;br /&gt;
    History.addValueChangeHandler(new ValueChangeHandler&amp;lt;String&amp;gt;() {&lt;br /&gt;
      public void onValueChange(ValueChangeEvent&amp;lt;String&amp;gt; event) {&lt;br /&gt;
        String historyToken = event.getValue();&lt;br /&gt;
        // Parse the history token&lt;br /&gt;
        try {&lt;br /&gt;
          if (historyToken.substring(0, 4).equals(&amp;quot;page&amp;quot;)) {&lt;br /&gt;
            String tabIndexToken = historyToken.substring(4, 5);&lt;br /&gt;
            int tabIndex = Integer.parseInt(tabIndexToken);&lt;br /&gt;
            // Select the specified tab panel&lt;br /&gt;
            tabPanel.selectTab(tabIndex);&lt;br /&gt;
          } else {&lt;br /&gt;
            tabPanel.selectTab(0);&lt;br /&gt;
          }&lt;br /&gt;
        } catch (IndexOutOfBoundsException e) {&lt;br /&gt;
          tabPanel.selectTab(0);&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    tabPanel.selectTab(0);&lt;br /&gt;
    RootPanel.get().add(tabPanel);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
==Internationalization==&lt;br /&gt;
&lt;br /&gt;
GWT Supports three different modes of internationalization.&amp;lt;ref&amp;gt;http://www.gwtproject.org/doc/latest/tutorial/i18n.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Static String Internationalization''': The translated strings and parameterized messages are stored in standard Java properties file. These values are then retrieved by the strongly-typed Java Interfaces based on the browsers locale.This is the simplest form of Internationalization GWT offers and carries very little overhead at runtime.&lt;br /&gt;
&lt;br /&gt;
'''Dynamic String Internationalization''': This method is used to integrate a GWT application with an existing server-side localization system.Applications using this technique look up localized strings in the module's host page; therefore, they do not need to be recompiled when adding a new locale.Dynamic string internationalization is slower than static string internationalization, but is very flexible. &lt;br /&gt;
&lt;br /&gt;
'''Localizable Interface'''&lt;br /&gt;
The most powerful technique in GWT to implement internationalization is the Localizable interface. Implementing Localizable in the application creates localized versions of custom types used in the application. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
&lt;br /&gt;
[http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCheckBox GWT Features and Samples Showcase ]&lt;br /&gt;
&lt;br /&gt;
[http://www.gwtproject.org/index.html Google Web Toolkit Home Page]&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/#!forum/google-web-toolkit GWT Discussion Forum]&lt;br /&gt;
&lt;br /&gt;
[http://googlewebtoolkit.blogspot.com/ GWT Official Blog]&lt;/div&gt;</summary>
		<author><name>Nchinth</name></author>
	</entry>
</feed>