<?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=Sbastik</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=Sbastik"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sbastik"/>
	<updated>2026-05-09T04:02:13Z</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_M1454_rss&amp;diff=90400</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90400"/>
		<updated>2014-10-29T04:01:23Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Step 2: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
==='''Step 1:'''===&lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&lt;br /&gt;
==='''Step 2:'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to ''components/script/dom/webidls''.&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the ''components/script/dom location''.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
*The first step is to install Rust in your machine. Steps can be found at &amp;lt;ref&amp;gt;https://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The next step is to build Servo. Steps can be found at &amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:Build servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
*Our implementation files are “[https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs errorevent.rs]” and “[https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl errorevent.webidl]”.&lt;br /&gt;
*Binding will be automatically generated. The binding file is “ErrorEventBinding.rs”&lt;br /&gt;
*Build servo again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*We can now run the servo using the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90397</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90397"/>
		<updated>2014-10-29T03:59:16Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Step 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to ''components/script/dom/webidls''.&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the ''components/script/dom location''.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
*The first step is to install Rust in your machine. Steps can be found at &amp;lt;ref&amp;gt;https://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The next step is to build Servo. Steps can be found at &amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:Build servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
*Our implementation files are “[https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs errorevent.rs]” and “[https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl errorevent.webidl]”.&lt;br /&gt;
*Binding will be automatically generated. The binding file is “ErrorEventBinding.rs”&lt;br /&gt;
*Build servo again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*We can now run the servo using the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90396</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90396"/>
		<updated>2014-10-29T03:59:03Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to ''components/script/dom/webidls''.&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the ''components/script/dom location''.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
*The first step is to install Rust in your machine. Steps can be found at &amp;lt;ref&amp;gt;https://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The next step is to build Servo. Steps can be found at &amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:Build servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
*Our implementation files are “[https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs errorevent.rs]” and “[https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl errorevent.webidl]”.&lt;br /&gt;
*Binding will be automatically generated. The binding file is “ErrorEventBinding.rs”&lt;br /&gt;
*Build servo again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*We can now run the servo using the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90392</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90392"/>
		<updated>2014-10-29T03:55:41Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Steps to execute our program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to ''components/script/dom/webidls''.&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the ''components/script/dom location''.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
*The first step is to install Rust in your machine. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The next step is to build Servo. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:Build servo.png]]&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
*Our implementation files are “[https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs errorevent.rs]” and “[https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl errorevent.webidl]”.&lt;br /&gt;
*Binding will be automatically generated. The binding file is “ErrorEventBinding.rs”&lt;br /&gt;
*Build servo again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*We can now run the servo using the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90391</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90391"/>
		<updated>2014-10-29T03:54:55Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Steps to execute our program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to ''components/script/dom/webidls''.&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the ''components/script/dom location''.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
*The first step is to install Rust in your machine. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The next step is to build Servo. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:Build servo.png]]&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
*Our implementation files are “errorevent.rs” and “errorevent.webidl”.&lt;br /&gt;
*Binding will be automatically generated. The binding file is “ErrorEventBinding.rs”&lt;br /&gt;
*Build servo again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*We can now run the servo using the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90390</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90390"/>
		<updated>2014-10-29T03:54:12Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to ''components/script/dom/webidls''.&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the ''components/script/dom location''.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
1.The first step is to install Rust in your machine. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt;&lt;br /&gt;
2.The next step is to build Servo. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:Build servo.png]]&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
3.Our implementation files are “errorevent.rs” and “errorevent.webidl”.&lt;br /&gt;
4.Binding will be automatically generated. The binding file is “ErrorEventBinding.rs”&lt;br /&gt;
5.Build servo again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6.We can now run the servo using the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90389</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90389"/>
		<updated>2014-10-29T03:53:41Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Implementation Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to ''components/script/dom/webidls''.&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the ''components/script/dom location''.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Steps to execute our program:&lt;br /&gt;
1.The first step is to install Rust in your machine. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt;&lt;br /&gt;
2.The next step is to build Servo. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:Build servo.png]]&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
3.Our implementation files are “errorevent.rs” and “errorevent.webidl”.&lt;br /&gt;
4.Binding will be automatically generated. The binding file is “ErrorEventBinding.rs”&lt;br /&gt;
5.Build servo again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6.We can now run the servo using the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90388</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90388"/>
		<updated>2014-10-29T03:52:03Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to ''components/script/dom/webidls''.&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the ''components/script/dom location''.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Steps to execute our program:&lt;br /&gt;
1.The first step is to install Rust in your machine. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt;&lt;br /&gt;
2.The next step is to build Servo. Steps can be found on &amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:Build servo.png]]&lt;br /&gt;
[[File:Build servo fin.png]]&lt;br /&gt;
3.Our implementation files are “errorevent.rs” and “errorevent.webidl”.&lt;br /&gt;
4.Binding will be automatically generated. The binding file is “ErrorEventBinding.rs”&lt;br /&gt;
5.Build servo again&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
6.We can now run the servo using the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90387</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90387"/>
		<updated>2014-10-29T03:48:21Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to ''components/script/dom/webidls''.&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the ''components/script/dom location''.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90383</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90383"/>
		<updated>2014-10-29T03:38:53Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Implementation Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to components/script/dom/webidls&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90381</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90381"/>
		<updated>2014-10-29T03:38:18Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Step 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generated ErrorEventBinding.rs file.&lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file 'errorevent.webidl' along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a 'errorevent.rs' file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates 'erroreventBinding.rs' file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/blob/master/components/script/dom/webidls/ErrorEvent.webidl 'ErrorEvent.webidl'] and add it to components/script/dom/webidls&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90376</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90376"/>
		<updated>2014-10-29T03:36:42Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Step 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
= RUST Programming Language =&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
= Servo =&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Just-in-time_compilation&amp;lt;/ref&amp;gt; compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file 'errorevent.webidl' along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a 'errorevent.rs' file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates 'erroreventBinding.rs' file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file [https://github.com/RonakNisher/servo/tree/master/components/script/dom/webidls 'errorevent.webidl'] and add it to components/script/dom/webidls&lt;br /&gt;
*Create the [https://github.com/RonakNisher/servo/blob/master/components/script/dom/errorevent.rs 'errorevent.rs'] file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90374</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90374"/>
		<updated>2014-10-29T03:34:54Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Implementation Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
= RUST Programming Language =&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
= Servo =&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file 'errorevent.webidl' along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a 'errorevent.rs' file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates 'erroreventBinding.rs' file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file 'errorevent.webidl' and add it to components/script/dom/webidls&lt;br /&gt;
*Create the 'errorevent.rs' file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90372</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90372"/>
		<updated>2014-10-29T03:34:03Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Servo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
= RUST Programming Language =&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
= Servo =&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ARM_architecture&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a 'errorevent.rs' file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates 'erroreventBinding.rs' file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file 'errorevent.webidl' and add it to components/script/dom/webidls&lt;br /&gt;
*Create the 'errorevent.rs' file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90370</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90370"/>
		<updated>2014-10-29T03:33:12Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
= RUST Programming Language =&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Servo_(layout_engine) Servo] is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
= Servo =&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a 'errorevent.rs' file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates 'erroreventBinding.rs' file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file 'errorevent.webidl' and add it to components/script/dom/webidls&lt;br /&gt;
*Create the 'errorevent.rs' file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90366</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90366"/>
		<updated>2014-10-29T03:31:47Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* RUST Programming Language */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. With the main goal of creating an architecture that is parallel at many levels, common sources of bugs and security vulnerabilities associated with incorrect memory management are thereby eliminated.&lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the [http://en.wikipedia.org/wiki/JavaScript JavaScript] search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. SpiderMonkey has been written in C/C++. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named ''rust-mozjs'' library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
= RUST Programming Language =&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
= Servo =&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
= Project Description =&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Implementation Steps =&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a 'errorevent.rs' file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates 'erroreventBinding.rs' file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
= Steps to execute our program =&lt;br /&gt;
=='''Step 1'''== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Step 2'''==&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file 'errorevent.webidl' and add it to components/script/dom/webidls&lt;br /&gt;
*Create the 'errorevent.rs' file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Building servo fin.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png]]&lt;br /&gt;
&lt;br /&gt;
= Design Principles =&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
= Future work =&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90346</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90346"/>
		<updated>2014-10-29T03:14:20Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Implementation Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a 'errorevent.rs' file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates 'erroreventBinding.rs' file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file 'errorevent.webidl' and add it to components/script/dom/webidls&lt;br /&gt;
*Create the 'errorevent.rs' file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png|frame|center|alt = Building Servo|Step to build servo]]&lt;br /&gt;
[[File:Building servo fin.png|frame|center|alt = Building Servo|After Building Servo]]&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png|frame|center|alt = Running servo|After running servo]]&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90345</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90345"/>
		<updated>2014-10-29T03:13:43Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Step 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file 'errorevent.webidl' and add it to components/script/dom/webidls&lt;br /&gt;
*Create the 'errorevent.rs' file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png|frame|center|alt = Building Servo|Step to build servo]]&lt;br /&gt;
[[File:Building servo fin.png|frame|center|alt = Building Servo|After Building Servo]]&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png|frame|center|alt = Running servo|After running servo]]&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90343</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90343"/>
		<updated>2014-10-29T03:12:47Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Servo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
[[File:Servo arch.png|frame|center|alt = Servo Architecture|Servo Achitecture]]&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png|frame|center|alt = Building Servo|Step to build servo]]&lt;br /&gt;
[[File:Building servo fin.png|frame|center|alt = Building Servo|After Building Servo]]&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png|frame|center|alt = Running servo|After running servo]]&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Servo_arch.png&amp;diff=90341</id>
		<title>File:Servo arch.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Servo_arch.png&amp;diff=90341"/>
		<updated>2014-10-29T03:11:44Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90340</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90340"/>
		<updated>2014-10-29T03:08:58Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Steps to execute our program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance [http://en.wikipedia.org/wiki/Graphics_processing_unit GPUs]. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png|frame|center|alt = Building Servo|Step to build servo]]&lt;br /&gt;
[[File:Building servo fin.png|frame|center|alt = Building Servo|After Building Servo]]&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:After running program.png|frame|center|alt = Running servo|After running servo]]&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90337</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90337"/>
		<updated>2014-10-29T03:06:40Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Steps to execute our program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png|frame|center|alt = Building Servo|Step to build servo]]&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90336</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90336"/>
		<updated>2014-10-29T03:06:19Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Steps to execute our program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using [http://en.wikipedia.org/wiki/Rust_(programming_language) RUST]  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[http://en.wikipedia.org/wiki/Mozilla Mozilla] is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Building servo.png|frame|left|alt = Building Servo|Step to build servo]]&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:After_running_program.png&amp;diff=90331</id>
		<title>File:After running program.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:After_running_program.png&amp;diff=90331"/>
		<updated>2014-10-29T03:03:49Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Building_servo_fin.png&amp;diff=90330</id>
		<title>File:Building servo fin.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Building_servo_fin.png&amp;diff=90330"/>
		<updated>2014-10-29T03:03:33Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Building_servo.png&amp;diff=90328</id>
		<title>File:Building servo.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Building_servo.png&amp;diff=90328"/>
		<updated>2014-10-29T03:03:22Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90327</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90327"/>
		<updated>2014-10-29T03:01:01Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&lt;br /&gt;
&amp;lt;/ref&amp;gt; programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90326</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90326"/>
		<updated>2014-10-29T03:00:23Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file errorevent.webidl along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90324</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90324"/>
		<updated>2014-10-29T02:59:59Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL&amp;lt;ref&amp;gt;https://github.com/servo/servo/wiki/Adding-a-new-WebIDL-binding&amp;lt;/ref&amp;gt; file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
* The file on compilation generates ErrorEventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90321</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90321"/>
		<updated>2014-10-29T02:58:57Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* RUST Programming Language */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo&amp;lt;ref&amp;gt;http://www.zdnet.com/servo-inside-mozillas-mission-to-reinvent-the-web-browser-for-the-multi-core-age-7000026606/&lt;br /&gt;
&amp;lt;/ref&amp;gt; is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
* The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90318</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90318"/>
		<updated>2014-10-29T02:58:28Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* RUST Programming Language */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST&amp;lt;ref&amp;gt;http://github.com/rust-lang/rust/wiki/Note-getting-started-developing-Rust&amp;lt;/ref&amp;gt; programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
:* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:* The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
:*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90316</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90316"/>
		<updated>2014-10-29T02:57:16Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey&amp;lt;ref&amp;gt;https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey&amp;lt;/ref&amp;gt; has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
:* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:* The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
:*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90315</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90315"/>
		<updated>2014-10-29T02:55:45Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo&amp;lt;ref&amp;gt;https://github.com/servo/servo&amp;lt;/ref&amp;gt;, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
:* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:* The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
:*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90314</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90314"/>
		<updated>2014-10-29T02:54:46Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Steps to execute our program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
:* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:* The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
:*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1'''=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2'''===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90313</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90313"/>
		<updated>2014-10-29T02:53:42Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Implementation Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
:* The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:* We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:* The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:* The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
:*The project requirements needed us to build a Servo, add a new file ErrorEvent WebIDL file along with its RUST implementation, and create the errorevent interface. &lt;br /&gt;
:*We were required to write a errorevent.rs file, which is written in RUST programming language.&lt;br /&gt;
:*The file on compilation generates erroreventBinding.rs file &lt;br /&gt;
:*The project was then rebuilt and recompiled on the Servo engine.&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1''':=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2''':===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90311</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90311"/>
		<updated>2014-10-29T02:52:33Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Step 2: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1''':=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2''':===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90310</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90310"/>
		<updated>2014-10-29T02:52:12Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Step 2: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1''':=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2''':===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webidl’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Check if it works using this command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach run tests/html/about-mozilla.html&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90306</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90306"/>
		<updated>2014-10-29T02:49:57Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Step 1: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
Mozilla has planned to deliver its new browser Servo which facilitates great features like parallel processing in the browser in order to utilize many cores present in the modern mobile devices such as smartphones and tablets in order to carry out tasks concurrently. Even the giant and famous browsers like Chrome, Internet Explorer, Firefox, Safari,  have tried to implement parallel processing via different ways such as aggregating the JIT (Just in Time) compilation technique to their JS engines. But, performance and security gains need re-modelling the browser stacks of these browsers. Servo, that is being designed to be compatible with the Android OS devices, will work with the Arm-based processors.&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1''':=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./mach build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Step 2''':===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webild’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90304</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90304"/>
		<updated>2014-10-29T02:49:04Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Steps to execute our program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
Servo is written in RUST programming language which is developed by Mozilla research. It is memory safe thereby ensuring a high degree of assurance in the browser’s trusted computing base. RUST also guarantees concurrency thus avoiding the problem of ‘data races’ and ensures safety and speed. Rust’s lightweight task mechanism also allows fine-grained isolation between browser components.&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
==='''Step 1''':=== &lt;br /&gt;
The first step includes building Servo.&lt;br /&gt;
==='''Step 2''':===&lt;br /&gt;
Once the Servo is built, the next step is to create an errorevent interface by adding a new WebIDL binding. The following are the steps to create a new WebIDL file:&lt;br /&gt;
:*Create a new file ‘errorevent.webild’ and add it to components/script/dom/webidls&lt;br /&gt;
:*Create the errorevent.rs file containing a Reflector at minimum, as well as implementation of the Reflectable trait and add it at the components/script/dom location.&lt;br /&gt;
:*Add the implementation's module to the script crate lib.rs to ensure it is compiled.&lt;br /&gt;
:*Build servo and fix any compile errors in the implementation.&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90301</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90301"/>
		<updated>2014-10-29T02:46:19Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Design Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We have tried to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we have made our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We have tried and made our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code gives the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90300</id>
		<title>CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90300"/>
		<updated>2014-10-29T02:45:33Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Design Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Implementing proper JS error reporting''' =&lt;br /&gt;
&lt;br /&gt;
This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Mozilla is currently working on a research project called Servo, which is a Web browser engine for a new generation of hardware: mobile devices, multi-core processors and high-performance GPUs. The goal is to create an architecture that is parallel at many levels thereby eliminating common sources of bugs and security vulnerabilities associated with incorrect memory management. &lt;br /&gt;
&lt;br /&gt;
For the new browser Mozilla servo, SpiderMonkey has been used as the JavaScript search engine. SpiderMonkey basically exposes a user-specifiable callback that executes JS and throws an exception that is not caught. But, SpiderMonkey has been written in C/C++. It exposes a user-specifiable callback executing JS that throws an exception that is not caught. Initially, the library (which wraps the C-based mozjs aka SpiderMonkey) named rust-mozjs library sets this callback to a simple function that pushed the error logs on to the terminal. Thus, as a part of our OSS project, based on the requirements, we have presented a way to replace this in Servo with an ErrorEvent interface which has methods that implements the error reporting specification for web browsers.&lt;br /&gt;
&lt;br /&gt;
== RUST Programming Language ==&lt;br /&gt;
&lt;br /&gt;
== Servo ==&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
&lt;br /&gt;
== Steps to execute our program ==&lt;br /&gt;
&lt;br /&gt;
==  Design Principles ==&lt;br /&gt;
&lt;br /&gt;
:*'''Simple''': We would try to not complicate the code but keep it simple.&lt;br /&gt;
:*'''Readable''': By adding necessary and required comments, we would make our code readable to other programmers.&lt;br /&gt;
:*'''Reusable''': We would try and make our code capable of being used in a completely different setting.&lt;br /&gt;
:*'''Efficient''': Our code would give the results in reasonable amount of time.&lt;br /&gt;
&lt;br /&gt;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014&amp;diff=90040</id>
		<title>CSC/ECE 517 Fall 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014&amp;diff=90040"/>
		<updated>2014-10-28T02:45:53Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE_517_Fall_2014/sample_page]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a 22 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 19 mx]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 3 zq]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 4 lf]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 4 wl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a a7 ch]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 25 rs]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 25 jf]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 8 os]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 8 sn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 15 gs]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 10 hu]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 20 kv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 21 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 24 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 26 sn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 6 rl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 2 ss]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 16 av]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 1 rm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 1 sj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 23 ss]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 20 rn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 22 sp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss M1454 rss]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 26 gn]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 13 va]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 9 aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 9 kn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 11 ap]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 25 ks]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 7 kz]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a_6_bn]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a 10 zz]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a 16 va]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a F1415 rv]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a_3_cp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1b 26 sa]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b_28_cg]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b 29 ry]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b 30 cs]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b_33_jy]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b_27_js]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss E1465 oak]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss_M1456_kdv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss_M1453_sst]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss_E1456_akk]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_M1455_asa]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_E1458_sst]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_E1457_ags]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_E1466_gjf]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_M1452_jns]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/oss_E1462_nms]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/OSS_S1455_ajp]]&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87247</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 8 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87247"/>
		<updated>2014-09-19T23:56:15Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Other Frameworks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Django Framework''' ==  &lt;br /&gt;
&lt;br /&gt;
Django&amp;lt;ref&amp;gt;https://www.djangoproject.com/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.djangobook.com/en/2.0/index.html&amp;lt;/ref&amp;gt;(2005) is a high level, but heavy, open source Python&amp;lt;ref&amp;gt;http://www.python.org/&amp;lt;/ref&amp;gt; web framework used to build a large scale web application. Django is named after Django Reinhardt, a gypsy jazz guitarist from the 1930s to early 1950s. A web framework is necessary to help the developers and the testers to develop highly scalable and efficient large scale web applications. Django deals with the most important problem in the domain of Web development – repetition. Even though web development is a really interesting task, there are a lot of things that require unnecessary efforts and time of the developers as well as the testers. With an MVT&amp;lt;ref&amp;gt;http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names&amp;lt;/ref&amp;gt; (Model View Template) Framework, Django is very modular and thus very much suitable for highly cohesive&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Cohesion_(computer_science)&amp;lt;/ref&amp;gt; and low coupling&amp;lt;ref&amp;gt; http://en.wikipedia.org/wiki/Coupling_(computer_programming)&amp;lt;/ref&amp;gt; tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== '''History''' ==&lt;br /&gt;
In 1998, Python CGI&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/CGI&amp;lt;/ref&amp;gt; was used to develop web applications from scratch using Python. In order to create a web application using Python CGI, we just have to create a Python script that generates output in the HTML format. We then save the script to a Web server with a &amp;lt;code&amp;gt;“.cgi”&amp;lt;/code&amp;gt; extension and visit the page in our Web browser. Following is the sample way of creating a simple website using the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import MySQLdb&lt;br /&gt;
print &amp;quot;Content-Type: text/html\n&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Food items&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;body&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;h1&amp;gt;Food items&amp;lt;/h1&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
connection = MySQLdb.connect(user='username', passwd='password', db='food_db')&lt;br /&gt;
cursor = connection.cursor()&lt;br /&gt;
cursor.execute(&amp;quot;SELECT food_item_name FROM food_table ORDER BY rating DESC LIMIT 10&amp;quot;)&lt;br /&gt;
for row in cursor.fetchall():&lt;br /&gt;
	print &amp;quot;&amp;lt;li&amp;gt;%s&amp;lt;/li&amp;gt;&amp;quot; % row[0]&lt;br /&gt;
print &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
connection.close()&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The above script generates an HTML page which will display a list of all the food items in the descending order of their rating by interacting with the corresponding table in the database.&lt;br /&gt;
&lt;br /&gt;
Even though the code has several advantages such as making a website (with only one page) from the scratch is not difficult. The code is readable and understandable to all audiences, etc. But this approach has a lot of disadvantages. The disadvantages include repetition of code (such as database connection, authentication, etc.) for a multi-page web application. Also, if discrete entities, like databases with different configuration, are to be included in the project then we will have to rewrite and reconfigure all the pages in the web application. Thus, using CGI for web application development makes it inefficient to build and deploy.&lt;br /&gt;
&lt;br /&gt;
Almost all of the problems posed by Python CGI scripting mentioned above were solved by Django. Django provided a programming infrastructure for large scale web applications, so that the developers can focus on writing clean, maintainable code without worrying about the different aspects of Project Scaffolding&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Scaffold_(programming)&amp;lt;/ref&amp;gt;. Based on the DRY&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Don't_repeat_yourself&amp;lt;/ref&amp;gt;(Don’t Repeat Yourself) principle, Django aims at reducing repetitive pieces of information of all kinds in software development. Django also supports pluggability of different applications into the web applications that you are developing.&lt;br /&gt;
&lt;br /&gt;
Also, Major websites such as [http://pinterest.com Pinterest], [http://instagram.com Instagram] were developed using Django.&lt;br /&gt;
&lt;br /&gt;
=== Other Frameworks ===&lt;br /&gt;
:*Flask&amp;lt;ref&amp;gt;http://flask.pocoo.org/&amp;lt;/ref&amp;gt;: It is a web framework that only provides the important and skeletal libraries required for basic web-development. Features such as data abstraction, unlike Django, is not provided by Flask.&lt;br /&gt;
:*Pyramid&amp;lt;ref&amp;gt;http://www.pylonsproject.org/projects/pyramid/about&amp;lt;/ref&amp;gt;: It is a web framework which strictly follows MVC pattern. It has an additional feature, unlike Django, of maintaining a dictionary of View-to-URL-Mapping.&lt;br /&gt;
:*Ruby on Rails&amp;lt;ref&amp;gt;http://rubyonrails.org/&amp;lt;/ref&amp;gt;It is a framework which strictly follows MVC pattern. It follows the Don't Repeat Yourself(DRY) and Convention over Configuration(CoC)&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Convention_over_configuration&amp;lt;/ref&amp;gt; principle.&lt;br /&gt;
:*web2py&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;: It is a web framework which follows the convention of Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
== '''Architecture''' ==&lt;br /&gt;
&lt;br /&gt;
[[File:Django_layers.png|frame|right|alt = MVT Architecture|Django's Model-View-Template Achitecture]]&lt;br /&gt;
&lt;br /&gt;
Most of the web frameworks- such as Ruby on Rails framework- are based on the MVC pattern. MVC, which stands for Model View Controller, is a pattern which provides loose coupling among different parts of the application. In MVC Pattern, Model deals with the direct interaction with the databases. Views deal with the representation of the data on the browser. Controller deals with the user interactions and redirecting each of the user interactions to the respective module responsible for dealing with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand, Django framework does not really fit into the MVC framework. As mentioned earlier, it follows the MTV framework which stands for (Model Template View) Framework. Controller corresponds to the View in Django Framework. In case of the Views in Django, it plays the role of the controller. It fetches the data and decides how the data is to be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
&lt;br /&gt;
In Django terminology, an installation of Django is considered as a “Project”. &lt;br /&gt;
&lt;br /&gt;
The smallest logical subset of files/folders that is fairly independent from the rest of the project can be called as an application. These subset of files include (but are not limited to) models, views, templates, static files, URLs, etc. A single Django project can have multiple applications, each of which contains the files that define an application.&lt;br /&gt;
&lt;br /&gt;
All the applications that must be included inside the main project should be explicitly mentioned inside the variable &amp;lt;code&amp;gt;INSTALLED_APPS&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;INSTALLED_APPS = (&lt;br /&gt;
    'django.contrib.admin',&lt;br /&gt;
    'django.contrib.auth',&lt;br /&gt;
    'django.contrib.contenttypes',&lt;br /&gt;
    'django.contrib.sessions',&lt;br /&gt;
    'django.contrib.messages',&lt;br /&gt;
    'django.contrib.staticfiles',&lt;br /&gt;
    'books'&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
In Django, a model is defined as the single source for all the data. It defines how data is accessed, processed and validated. It also contains the structure and relationship of all the data that is used by the application. Models are used to define the structure of your database. Each model is converted into a database table and each attribute inside a model is converted into a column of that table. All this is handled by Django implicitly.&lt;br /&gt;
&lt;br /&gt;
Consider the following example about an application called ‘books’ that contains:&lt;br /&gt;
:*Author: which has a first_name and last_name attributes&lt;br /&gt;
:*Book: which has title, author and publication date as its attributes&lt;br /&gt;
&lt;br /&gt;
We can write models for the above application like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;class Author(models.Model):&lt;br /&gt;
   first_name = models.CharField(max_length=30)&lt;br /&gt;
   last_name = models.CharField(max_length=40)&lt;br /&gt;
&lt;br /&gt;
class Book(models.Model):&lt;br /&gt;
   title = models.CharField(max_length=100)&lt;br /&gt;
   authors = models.ManyToManyField(Author)&lt;br /&gt;
   publication_date = models.DateField()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all the models for your application have been created, you can validate them by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py validate &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Django also dynamically generates “Create Table” statements for each of these models. These statement can be viewed using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py sqlall &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above command would give the following output:&lt;br /&gt;
&amp;lt;pre&amp;gt;BEGIN;&lt;br /&gt;
CREATE TABLE &amp;quot;books_author&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;first_name&amp;quot; varchar(30) NOT NULL,&lt;br /&gt;
    &amp;quot;last_name&amp;quot; varchar(40) NOT NULL,&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;title&amp;quot; varchar(100) NOT NULL,&lt;br /&gt;
    &amp;quot;publication_date&amp;quot; date NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book_authors&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;book_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_book&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    &amp;quot;author_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_author&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    UNIQUE (&amp;quot;book_id&amp;quot;, &amp;quot;author_id&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
COMMIT;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and all the tables would be created immediately as soon as you run the command stated below:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py syncdb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
The front-end of the web-application is equally important as the model and the controllers. The basic function of the view is to accept an HTTP request and send a response. Basically Django has two types of views – Generic Views &amp;amp; Class based views. Generic views just take one parameter – “request”. Following is the format of the code to display Hello World.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from django.http import HttpResponse&lt;br /&gt;
    	def hello_world(request)&lt;br /&gt;
                    	return HttpResponse(“hello world”)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the method class hello_world has a parameter called “request”. This is the parameter that contains all the information of the HttpRequest. After the request has been processed, the HttpResponse object is returned back. This HttpResponse object is initialized with the string “hello world”.&lt;br /&gt;
&lt;br /&gt;
Generic views mostly consist of functions. Maintaining a program with a lot of functions is difficult. This reduces the modularity of the program. In order to support classes, Class based views were introduced. Class based views consist of classes which handle all the functionality in the front end. Classes are extensible and hence reusable. We can inherit different views(classes) and include it in our class. For example, if we want to include a view which displays the contacts, we will write the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;from django.views.generic import ListView&lt;br /&gt;
from books.models import contacts&lt;br /&gt;
class ContactsList(ListView)&lt;br /&gt;
    	model = contacts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above program, we have imported the ListView from the generic module. As we want to display the contacts from the database, we have imported the database “contacts”. The class ContactsList inherits the ListView class and extracts all the functionality in that class. The “contacts” database is imported and assigned to the model so as to display the contacts in the form of a list view.&lt;br /&gt;
&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function.&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function. In order to do that, we will have to write the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    	from django.conf.urls.defaults import patterns, include, url&lt;br /&gt;
    	from hellworldproject.views import hello&lt;br /&gt;
    	urlpatterns = patterns(‘’. url(r’hello_world/$, hello_world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code, the “pattern” function saves the required URL pattern in the “urlpatters” attribute.&lt;br /&gt;
So, after everything is set up, we run our web application with a url say &amp;lt;code&amp;gt;[web-address]/hello_world/&amp;lt;/code&amp;gt;. Now, Django first goes to the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt; file in the project directory and searches for the files which handles the URLConf part. Suppose the name of the files is &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It dives into the urls.py files and linearly matches the requested url with the url patterns in the file and checks which method call is responsible to handle the request. After that, when it finds the method(here, hello_world), it passes an HttpRequest object to the method. After the required processing the request, it creates an HttpResponse object and then continues with the further processes the response by converting it into HTML code by adding the necessary formatting to the response in order for it to be displayed as a view on the screen.&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
In Django, templates are generally used to define how webpages of the application are supposed to look like. Template defines the structure of the webpage and also has additional elements that help access variables, run python statements and much more.&lt;br /&gt;
&lt;br /&gt;
Data can be passed to templates which can be used by the templates to display to the user or perform actions on the data and create dynamic views based on the data.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
We can access any data passed to the templates and use them as regular python variables. The below lines of code shows how variables can be accessed:&lt;br /&gt;
&amp;lt;pre&amp;gt;Author: {{author.last_name}}, {{ author.first_name }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will just print the author’s name on the webpage.&lt;br /&gt;
&lt;br /&gt;
==== Tags ====&lt;br /&gt;
Templates also provide the ability to write python code inside them and execute them just like they would run inside a &amp;lt;code&amp;gt;“.py”&amp;lt;/code&amp;gt; file. These elements are known as tags and look like &amp;lt;code&amp;gt;{% tag %}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given below is the example of a “for” loop that is defined inside a template:&lt;br /&gt;
&amp;lt;pre&amp;gt;{% for book in books_list %}&lt;br /&gt;
    &amp;lt;li&amp;gt;{{ book.title }}&amp;lt;/li&amp;gt;&lt;br /&gt;
{% endfor %}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can process data (though it is not logical to do so in a template), write conditional statements or just declare variables inside tags and used them later in the template file.&lt;br /&gt;
&lt;br /&gt;
==== Filters ====&lt;br /&gt;
Filters in templates can be defined as helper functions. They are a very powerful tool that reduces the code needed for basic (or sometimes even complex) post-processing of data. &lt;br /&gt;
&lt;br /&gt;
For example, the title of a book could be added to your application as one of ‘HARRY POTTER’, ‘HaRrY pOtTeR’ or ‘harry potter’. To standardize the format of the book title which you want to show on your website, we can simply write&lt;br /&gt;
&amp;lt;pre&amp;gt;{{book.title|title }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which capitalizes the first character of each word and turn all other characters to lower.&lt;br /&gt;
&lt;br /&gt;
Django also provide the ability to write custom filters and make it available to all the templates in your application. Django provides template tags and filters to control internationalization in templates. They allow for granular control of translations, formatting, and time zone conversions.&lt;br /&gt;
&lt;br /&gt;
=== Admin Site ===&lt;br /&gt;
For a certain class of Web sites, an admin interface is an essential part of the infrastructure.&lt;br /&gt;
&lt;br /&gt;
This is a Web-based interface, limited to trusted site administrators, that enables the adding, editing and deletion of site content. So the admin site has to authenticate users, display and handle forms, validate input, and so on. But the best part about Django is that it does all of this and more for you – in just a few of lines of code. This is also one of the reasons why Django is called a “heavy” web development framework.&lt;br /&gt;
&lt;br /&gt;
To access the Django admin interface, we just have to add &amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt; to your project url. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin01.png|frame|center|alt = This is the login page of Django Admin Site|Django Admin site login page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would also have to create a superuser, which can be done by following the steps given below.&lt;br /&gt;
&amp;lt;pre&amp;gt;$ python manage.py createsuperuser&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the admin username and email address:&lt;br /&gt;
&amp;lt;pre&amp;gt;Username: admin&lt;br /&gt;
Email address: admin@example.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
Choose the password for the admin account:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Password: **********&lt;br /&gt;
    Password (again): *********&lt;br /&gt;
    Superuser created successfully.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin02.png|frame|center|alt = The default first page of the admin site|Default admin site home page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django contains a file called &amp;lt;code&amp;gt;admin.py&amp;lt;/code&amp;gt; where you can define models for the admin site and then enable them so that they will appear on the admin site.&lt;br /&gt;
Using the example of the Author Model described in the sections above, let us add it to the admin site:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class AuthorAdmin(admin.ModelAdmin):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
    admin.site.register(Author);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These out-of-the-box features of the Django framework is what makes it the perfect option for creating content driven websites in relatively no time at all.&lt;br /&gt;
&lt;br /&gt;
== '''Features''' ==&lt;br /&gt;
Django has the following features to name a few:&lt;br /&gt;
:*It facilitates developers with a template comprising minimal number of classes, modules, packages etc. so that the developers can focus more on the core business logic.&lt;br /&gt;
:*It contains an ORM (Object-Relational Mapper) that allows for the use of standard Python language. The developers need not learn any query processing language.&lt;br /&gt;
:*It provides with a template framework suitable for making the views.&lt;br /&gt;
:*It supports pluggability – that is it supports including other installed applications into your own application.&lt;br /&gt;
:*It has a built in administrative interface to manage the web application from an administrative level, thus providing access control.&lt;br /&gt;
:*It is multi-lingual&lt;br /&gt;
:*It supports a very useful Geographical web framework &amp;quot;GeoDjango&amp;quot;&amp;lt;ref&amp;gt;https://docs.djangoproject.com/en/1.6/ref/contrib/gis/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Comparison with other web frameworks''' ==&lt;br /&gt;
=== Django vs Ruby on Rails ===&lt;br /&gt;
Most of the differences lie in the way the MVC pattern is interpreted by both the frameworks.&amp;lt;ref&amp;gt;https://bernardopires.com/2014/03/rails-vs-django-an-in-depth-technical-comparison/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Models:====&lt;br /&gt;
Everything in Ruby on Rails is based on migrations. If at any point of time, the schema of the database is changed and if it has to be reverted back to the previous schema then we can do that with the help of migrations. In case of Django, we need to depend on a third-party extension “South” (until Django 1.6) to support migrations.&lt;br /&gt;
&lt;br /&gt;
==== Controllers: ====&lt;br /&gt;
Django considers the entire framework as the controller but Ruby on Rails has a separate entity called controllers that manage the task of interpreting the user interactions and routing to the correct method that handles the request. That is why Django is said to follow the MVT(Model View Template) framework and Ruby on Rails strictly follows MVC framework.&lt;br /&gt;
&lt;br /&gt;
==== Views: ====&lt;br /&gt;
In Django, the amount of code that can be pushed into the views(i.e., the template) part of the application is very stringent. Only basic codes like conditional statements and simple loops are allowed. As the controller objects are not really accessible in the views, not much of the manipulation can be done in the views section of the application. This enforces a strict modularity between the models, views and templates section in the Django application making the application maintenance easier. In case of Rails, as the controller objects are accessible in the views as well, a lot of unnecessary calculations can be included in the views. This reduces modularity in the application. Thus, Django has an upper hand over Rails for this reason.&lt;br /&gt;
&lt;br /&gt;
==== Other Features ====&lt;br /&gt;
Django has in-built features like User authentication and admin support in its web applications. This makes developing admin based web application very easy. There is no such thing in Rails as such.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Django vs Web2py ===&lt;br /&gt;
&lt;br /&gt;
Web2py is inspired by Ruby on Rails. It supports Convention over Configuration just like Ruby on Rails. The administrative interface can be accessed from the browser for web2py. But, for Django, the developer has to manually configure everything.&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;&lt;br /&gt;
====Models====&lt;br /&gt;
Django doesn’t support migrations by itself(until 1.6). web2py supports database migrations. Also, many to many references between the tables are represented in a different way in Django and web2py. Django creates an intermediate link table whereas web2py includes the references as fields in the table.&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
Web2py manages all the imports, and other things related to project scaffolding by itself. The developer just has to focus on the application development unlike Django wherein the user has to take care of all the imports in the code. &lt;br /&gt;
&lt;br /&gt;
====Views====&lt;br /&gt;
If a view is undefined, then Django throws an error. But in case of web2py, it searches for mycontroller/index.html in the myapp. If that file is not present, then it creates a generic view which contains the raw response in a dictionary format on the browser.&lt;br /&gt;
&lt;br /&gt;
====Other features====&lt;br /&gt;
One feature, Transactions, is supported by both Django and web2py. But the way transaction “commits” are executed is different. Django has two options “auto-commit” and “commit_on_success”. But in case of web2py, it by default commits if the transaction is success and doesn’t commit in case of failure of the transaction.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87238</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 8 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87238"/>
		<updated>2014-09-19T23:53:10Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Other Frameworks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Django Framework''' ==  &lt;br /&gt;
&lt;br /&gt;
Django&amp;lt;ref&amp;gt;https://www.djangoproject.com/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.djangobook.com/en/2.0/index.html&amp;lt;/ref&amp;gt;(2005) is a high level, but heavy, open source Python&amp;lt;ref&amp;gt;http://www.python.org/&amp;lt;/ref&amp;gt; web framework used to build a large scale web application. Django is named after Django Reinhardt, a gypsy jazz guitarist from the 1930s to early 1950s. A web framework is necessary to help the developers and the testers to develop highly scalable and efficient large scale web applications. Django deals with the most important problem in the domain of Web development – repetition. Even though web development is a really interesting task, there are a lot of things that require unnecessary efforts and time of the developers as well as the testers. With an MVT&amp;lt;ref&amp;gt;http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names&amp;lt;/ref&amp;gt; (Model View Template) Framework, Django is very modular and thus very much suitable for highly cohesive&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Cohesion_(computer_science)&amp;lt;/ref&amp;gt; and low coupling&amp;lt;ref&amp;gt; http://en.wikipedia.org/wiki/Coupling_(computer_programming)&amp;lt;/ref&amp;gt; tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== '''History''' ==&lt;br /&gt;
In 1998, Python CGI&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/CGI&amp;lt;/ref&amp;gt; was used to develop web applications from scratch using Python. In order to create a web application using Python CGI, we just have to create a Python script that generates output in the HTML format. We then save the script to a Web server with a &amp;lt;code&amp;gt;“.cgi”&amp;lt;/code&amp;gt; extension and visit the page in our Web browser. Following is the sample way of creating a simple website using the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import MySQLdb&lt;br /&gt;
print &amp;quot;Content-Type: text/html\n&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Food items&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;body&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;h1&amp;gt;Food items&amp;lt;/h1&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
connection = MySQLdb.connect(user='username', passwd='password', db='food_db')&lt;br /&gt;
cursor = connection.cursor()&lt;br /&gt;
cursor.execute(&amp;quot;SELECT food_item_name FROM food_table ORDER BY rating DESC LIMIT 10&amp;quot;)&lt;br /&gt;
for row in cursor.fetchall():&lt;br /&gt;
	print &amp;quot;&amp;lt;li&amp;gt;%s&amp;lt;/li&amp;gt;&amp;quot; % row[0]&lt;br /&gt;
print &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
connection.close()&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The above script generates an HTML page which will display a list of all the food items in the descending order of their rating by interacting with the corresponding table in the database.&lt;br /&gt;
&lt;br /&gt;
Even though the code has several advantages such as making a website (with only one page) from the scratch is not difficult. The code is readable and understandable to all audiences, etc. But this approach has a lot of disadvantages. The disadvantages include repetition of code (such as database connection, authentication, etc.) for a multi-page web application. Also, if discrete entities, like databases with different configuration, are to be included in the project then we will have to rewrite and reconfigure all the pages in the web application. Thus, using CGI for web application development makes it inefficient to build and deploy.&lt;br /&gt;
&lt;br /&gt;
Almost all of the problems posed by Python CGI scripting mentioned above were solved by Django. Django provided a programming infrastructure for large scale web applications, so that the developers can focus on writing clean, maintainable code without worrying about the different aspects of Project Scaffolding&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Scaffold_(programming)&amp;lt;/ref&amp;gt;. Based on the DRY&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Don't_repeat_yourself&amp;lt;/ref&amp;gt;(Don’t Repeat Yourself) principle, Django aims at reducing repetitive pieces of information of all kinds in software development. Django also supports pluggability of different applications into the web applications that you are developing.&lt;br /&gt;
&lt;br /&gt;
Also, Major websites such as [http://pinterest.com Pinterest], [http://instagram.com Instagram] were developed using Django.&lt;br /&gt;
&lt;br /&gt;
=== Other Frameworks ===&lt;br /&gt;
:*Flask&amp;lt;ref&amp;gt;http://flask.pocoo.org/&amp;lt;/ref&amp;gt;: It is a web framework that only provides the important and skeletal libraries required for basic web-development. Features such as data abstraction, unlike Django, is not provided by Flask.&lt;br /&gt;
:*Pyramid&amp;lt;ref&amp;gt;http://www.pylonsproject.org/projects/pyramid/about&amp;lt;/ref&amp;gt;: It is a web framework which strictly follows MVC pattern. It has an additional feature, unlike Django, of maintaining a dictionary of View-to-URL-Mapping.&lt;br /&gt;
:*Ruby on Rails&amp;lt;ref&amp;gt;http://rubyonrails.org/&amp;lt;/ref&amp;gt;It is a framework which strictly follows MVC pattern. It follows the Don't Repeat Yourself(DRY) and Convention over Configuration(CoC) principle.&lt;br /&gt;
:*web2py&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;: It is a web framework which follows the convention of Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
== '''Architecture''' ==&lt;br /&gt;
&lt;br /&gt;
[[File:Django_layers.png|frame|right|alt = MVT Architecture|Django's Model-View-Template Achitecture]]&lt;br /&gt;
&lt;br /&gt;
Most of the web frameworks- such as Ruby on Rails framework- are based on the MVC pattern. MVC, which stands for Model View Controller, is a pattern which provides loose coupling among different parts of the application. In MVC Pattern, Model deals with the direct interaction with the databases. Views deal with the representation of the data on the browser. Controller deals with the user interactions and redirecting each of the user interactions to the respective module responsible for dealing with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand, Django framework does not really fit into the MVC framework. As mentioned earlier, it follows the MTV framework which stands for (Model Template View) Framework. Controller corresponds to the View in Django Framework. In case of the Views in Django, it plays the role of the controller. It fetches the data and decides how the data is to be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
&lt;br /&gt;
In Django terminology, an installation of Django is considered as a “Project”. &lt;br /&gt;
&lt;br /&gt;
The smallest logical subset of files/folders that is fairly independent from the rest of the project can be called as an application. These subset of files include (but are not limited to) models, views, templates, static files, URLs, etc. A single Django project can have multiple applications, each of which contains the files that define an application.&lt;br /&gt;
&lt;br /&gt;
All the applications that must be included inside the main project should be explicitly mentioned inside the variable &amp;lt;code&amp;gt;INSTALLED_APPS&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;INSTALLED_APPS = (&lt;br /&gt;
    'django.contrib.admin',&lt;br /&gt;
    'django.contrib.auth',&lt;br /&gt;
    'django.contrib.contenttypes',&lt;br /&gt;
    'django.contrib.sessions',&lt;br /&gt;
    'django.contrib.messages',&lt;br /&gt;
    'django.contrib.staticfiles',&lt;br /&gt;
    'books'&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
In Django, a model is defined as the single source for all the data. It defines how data is accessed, processed and validated. It also contains the structure and relationship of all the data that is used by the application. Models are used to define the structure of your database. Each model is converted into a database table and each attribute inside a model is converted into a column of that table. All this is handled by Django implicitly.&lt;br /&gt;
&lt;br /&gt;
Consider the following example about an application called ‘books’ that contains:&lt;br /&gt;
:*Author: which has a first_name and last_name attributes&lt;br /&gt;
:*Book: which has title, author and publication date as its attributes&lt;br /&gt;
&lt;br /&gt;
We can write models for the above application like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;class Author(models.Model):&lt;br /&gt;
   first_name = models.CharField(max_length=30)&lt;br /&gt;
   last_name = models.CharField(max_length=40)&lt;br /&gt;
&lt;br /&gt;
class Book(models.Model):&lt;br /&gt;
   title = models.CharField(max_length=100)&lt;br /&gt;
   authors = models.ManyToManyField(Author)&lt;br /&gt;
   publication_date = models.DateField()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all the models for your application have been created, you can validate them by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py validate &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Django also dynamically generates “Create Table” statements for each of these models. These statement can be viewed using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py sqlall &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above command would give the following output:&lt;br /&gt;
&amp;lt;pre&amp;gt;BEGIN;&lt;br /&gt;
CREATE TABLE &amp;quot;books_author&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;first_name&amp;quot; varchar(30) NOT NULL,&lt;br /&gt;
    &amp;quot;last_name&amp;quot; varchar(40) NOT NULL,&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;title&amp;quot; varchar(100) NOT NULL,&lt;br /&gt;
    &amp;quot;publication_date&amp;quot; date NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book_authors&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;book_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_book&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    &amp;quot;author_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_author&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    UNIQUE (&amp;quot;book_id&amp;quot;, &amp;quot;author_id&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
COMMIT;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and all the tables would be created immediately as soon as you run the command stated below:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py syncdb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
The front-end of the web-application is equally important as the model and the controllers. The basic function of the view is to accept an HTTP request and send a response. Basically Django has two types of views – Generic Views &amp;amp; Class based views. Generic views just take one parameter – “request”. Following is the format of the code to display Hello World.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from django.http import HttpResponse&lt;br /&gt;
    	def hello_world(request)&lt;br /&gt;
                    	return HttpResponse(“hello world”)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the method class hello_world has a parameter called “request”. This is the parameter that contains all the information of the HttpRequest. After the request has been processed, the HttpResponse object is returned back. This HttpResponse object is initialized with the string “hello world”.&lt;br /&gt;
&lt;br /&gt;
Generic views mostly consist of functions. Maintaining a program with a lot of functions is difficult. This reduces the modularity of the program. In order to support classes, Class based views were introduced. Class based views consist of classes which handle all the functionality in the front end. Classes are extensible and hence reusable. We can inherit different views(classes) and include it in our class. For example, if we want to include a view which displays the contacts, we will write the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;from django.views.generic import ListView&lt;br /&gt;
from books.models import contacts&lt;br /&gt;
class ContactsList(ListView)&lt;br /&gt;
    	model = contacts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above program, we have imported the ListView from the generic module. As we want to display the contacts from the database, we have imported the database “contacts”. The class ContactsList inherits the ListView class and extracts all the functionality in that class. The “contacts” database is imported and assigned to the model so as to display the contacts in the form of a list view.&lt;br /&gt;
&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function.&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function. In order to do that, we will have to write the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    	from django.conf.urls.defaults import patterns, include, url&lt;br /&gt;
    	from hellworldproject.views import hello&lt;br /&gt;
    	urlpatterns = patterns(‘’. url(r’hello_world/$, hello_world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code, the “pattern” function saves the required URL pattern in the “urlpatters” attribute.&lt;br /&gt;
So, after everything is set up, we run our web application with a url say &amp;lt;code&amp;gt;[web-address]/hello_world/&amp;lt;/code&amp;gt;. Now, Django first goes to the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt; file in the project directory and searches for the files which handles the URLConf part. Suppose the name of the files is &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It dives into the urls.py files and linearly matches the requested url with the url patterns in the file and checks which method call is responsible to handle the request. After that, when it finds the method(here, hello_world), it passes an HttpRequest object to the method. After the required processing the request, it creates an HttpResponse object and then continues with the further processes the response by converting it into HTML code by adding the necessary formatting to the response in order for it to be displayed as a view on the screen.&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
In Django, templates are generally used to define how webpages of the application are supposed to look like. Template defines the structure of the webpage and also has additional elements that help access variables, run python statements and much more.&lt;br /&gt;
&lt;br /&gt;
Data can be passed to templates which can be used by the templates to display to the user or perform actions on the data and create dynamic views based on the data.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
We can access any data passed to the templates and use them as regular python variables. The below lines of code shows how variables can be accessed:&lt;br /&gt;
&amp;lt;pre&amp;gt;Author: {{author.last_name}}, {{ author.first_name }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will just print the author’s name on the webpage.&lt;br /&gt;
&lt;br /&gt;
==== Tags ====&lt;br /&gt;
Templates also provide the ability to write python code inside them and execute them just like they would run inside a &amp;lt;code&amp;gt;“.py”&amp;lt;/code&amp;gt; file. These elements are known as tags and look like &amp;lt;code&amp;gt;{% tag %}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given below is the example of a “for” loop that is defined inside a template:&lt;br /&gt;
&amp;lt;pre&amp;gt;{% for book in books_list %}&lt;br /&gt;
    &amp;lt;li&amp;gt;{{ book.title }}&amp;lt;/li&amp;gt;&lt;br /&gt;
{% endfor %}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can process data (though it is not logical to do so in a template), write conditional statements or just declare variables inside tags and used them later in the template file.&lt;br /&gt;
&lt;br /&gt;
==== Filters ====&lt;br /&gt;
Filters in templates can be defined as helper functions. They are a very powerful tool that reduces the code needed for basic (or sometimes even complex) post-processing of data. &lt;br /&gt;
&lt;br /&gt;
For example, the title of a book could be added to your application as one of ‘HARRY POTTER’, ‘HaRrY pOtTeR’ or ‘harry potter’. To standardize the format of the book title which you want to show on your website, we can simply write&lt;br /&gt;
&amp;lt;pre&amp;gt;{{book.title|title }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which capitalizes the first character of each word and turn all other characters to lower.&lt;br /&gt;
&lt;br /&gt;
Django also provide the ability to write custom filters and make it available to all the templates in your application. Django provides template tags and filters to control internationalization in templates. They allow for granular control of translations, formatting, and time zone conversions.&lt;br /&gt;
&lt;br /&gt;
=== Admin Site ===&lt;br /&gt;
For a certain class of Web sites, an admin interface is an essential part of the infrastructure.&lt;br /&gt;
&lt;br /&gt;
This is a Web-based interface, limited to trusted site administrators, that enables the adding, editing and deletion of site content. So the admin site has to authenticate users, display and handle forms, validate input, and so on. But the best part about Django is that it does all of this and more for you – in just a few of lines of code. This is also one of the reasons why Django is called a “heavy” web development framework.&lt;br /&gt;
&lt;br /&gt;
To access the Django admin interface, we just have to add &amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt; to your project url. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin01.png|frame|center|alt = This is the login page of Django Admin Site|Django Admin site login page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would also have to create a superuser, which can be done by following the steps given below.&lt;br /&gt;
&amp;lt;pre&amp;gt;$ python manage.py createsuperuser&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the admin username and email address:&lt;br /&gt;
&amp;lt;pre&amp;gt;Username: admin&lt;br /&gt;
Email address: admin@example.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
Choose the password for the admin account:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Password: **********&lt;br /&gt;
    Password (again): *********&lt;br /&gt;
    Superuser created successfully.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin02.png|frame|center|alt = The default first page of the admin site|Default admin site home page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django contains a file called &amp;lt;code&amp;gt;admin.py&amp;lt;/code&amp;gt; where you can define models for the admin site and then enable them so that they will appear on the admin site.&lt;br /&gt;
Using the example of the Author Model described in the sections above, let us add it to the admin site:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class AuthorAdmin(admin.ModelAdmin):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
    admin.site.register(Author);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These out-of-the-box features of the Django framework is what makes it the perfect option for creating content driven websites in relatively no time at all.&lt;br /&gt;
&lt;br /&gt;
== '''Features''' ==&lt;br /&gt;
Django has the following features to name a few:&lt;br /&gt;
:*It facilitates developers with a template comprising minimal number of classes, modules, packages etc. so that the developers can focus more on the core business logic.&lt;br /&gt;
:*It contains an ORM (Object-Relational Mapper) that allows for the use of standard Python language. The developers need not learn any query processing language.&lt;br /&gt;
:*It provides with a template framework suitable for making the views.&lt;br /&gt;
:*It supports pluggability – that is it supports including other installed applications into your own application.&lt;br /&gt;
:*It has a built in administrative interface to manage the web application from an administrative level, thus providing access control.&lt;br /&gt;
:*It is multi-lingual&lt;br /&gt;
:*It supports a very useful Geographical web framework &amp;quot;GeoDjango&amp;quot;&amp;lt;ref&amp;gt;https://docs.djangoproject.com/en/1.6/ref/contrib/gis/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Comparison with other web frameworks''' ==&lt;br /&gt;
=== Django vs Ruby on Rails ===&lt;br /&gt;
Most of the differences lie in the way the MVC pattern is interpreted by both the frameworks.&amp;lt;ref&amp;gt;https://bernardopires.com/2014/03/rails-vs-django-an-in-depth-technical-comparison/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Models:====&lt;br /&gt;
Everything in Ruby on Rails is based on migrations. If at any point of time, the schema of the database is changed and if it has to be reverted back to the previous schema then we can do that with the help of migrations. In case of Django, we need to depend on a third-party extension “South” (until Django 1.6) to support migrations.&lt;br /&gt;
&lt;br /&gt;
==== Controllers: ====&lt;br /&gt;
Django considers the entire framework as the controller but Ruby on Rails has a separate entity called controllers that manage the task of interpreting the user interactions and routing to the correct method that handles the request. That is why Django is said to follow the MVT(Model View Template) framework and Ruby on Rails strictly follows MVC framework.&lt;br /&gt;
&lt;br /&gt;
==== Views: ====&lt;br /&gt;
In Django, the amount of code that can be pushed into the views(i.e., the template) part of the application is very stringent. Only basic codes like conditional statements and simple loops are allowed. As the controller objects are not really accessible in the views, not much of the manipulation can be done in the views section of the application. This enforces a strict modularity between the models, views and templates section in the Django application making the application maintenance easier. In case of Rails, as the controller objects are accessible in the views as well, a lot of unnecessary calculations can be included in the views. This reduces modularity in the application. Thus, Django has an upper hand over Rails for this reason.&lt;br /&gt;
&lt;br /&gt;
==== Other Features ====&lt;br /&gt;
Django has in-built features like User authentication and admin support in its web applications. This makes developing admin based web application very easy. There is no such thing in Rails as such.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Django vs Web2py ===&lt;br /&gt;
&lt;br /&gt;
Web2py is inspired by Ruby on Rails. It supports Convention over Configuration just like Ruby on Rails. The administrative interface can be accessed from the browser for web2py. But, for Django, the developer has to manually configure everything.&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;&lt;br /&gt;
====Models====&lt;br /&gt;
Django doesn’t support migrations by itself(until 1.6). web2py supports database migrations. Also, many to many references between the tables are represented in a different way in Django and web2py. Django creates an intermediate link table whereas web2py includes the references as fields in the table.&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
Web2py manages all the imports, and other things related to project scaffolding by itself. The developer just has to focus on the application development unlike Django wherein the user has to take care of all the imports in the code. &lt;br /&gt;
&lt;br /&gt;
====Views====&lt;br /&gt;
If a view is undefined, then Django throws an error. But in case of web2py, it searches for mycontroller/index.html in the myapp. If that file is not present, then it creates a generic view which contains the raw response in a dictionary format on the browser.&lt;br /&gt;
&lt;br /&gt;
====Other features====&lt;br /&gt;
One feature, Transactions, is supported by both Django and web2py. But the way transaction “commits” are executed is different. Django has two options “auto-commit” and “commit_on_success”. But in case of web2py, it by default commits if the transaction is success and doesn’t commit in case of failure of the transaction.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87233</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 8 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87233"/>
		<updated>2014-09-19T23:50:56Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Comparison with other web frameworks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Django Framework''' ==  &lt;br /&gt;
&lt;br /&gt;
Django&amp;lt;ref&amp;gt;https://www.djangoproject.com/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.djangobook.com/en/2.0/index.html&amp;lt;/ref&amp;gt;(2005) is a high level, but heavy, open source Python&amp;lt;ref&amp;gt;http://www.python.org/&amp;lt;/ref&amp;gt; web framework used to build a large scale web application. Django is named after Django Reinhardt, a gypsy jazz guitarist from the 1930s to early 1950s. A web framework is necessary to help the developers and the testers to develop highly scalable and efficient large scale web applications. Django deals with the most important problem in the domain of Web development – repetition. Even though web development is a really interesting task, there are a lot of things that require unnecessary efforts and time of the developers as well as the testers. With an MVT&amp;lt;ref&amp;gt;http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names&amp;lt;/ref&amp;gt; (Model View Template) Framework, Django is very modular and thus very much suitable for highly cohesive&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Cohesion_(computer_science)&amp;lt;/ref&amp;gt; and low coupling&amp;lt;ref&amp;gt; http://en.wikipedia.org/wiki/Coupling_(computer_programming)&amp;lt;/ref&amp;gt; tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== '''History''' ==&lt;br /&gt;
In 1998, Python CGI&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/CGI&amp;lt;/ref&amp;gt; was used to develop web applications from scratch using Python. In order to create a web application using Python CGI, we just have to create a Python script that generates output in the HTML format. We then save the script to a Web server with a &amp;lt;code&amp;gt;“.cgi”&amp;lt;/code&amp;gt; extension and visit the page in our Web browser. Following is the sample way of creating a simple website using the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import MySQLdb&lt;br /&gt;
print &amp;quot;Content-Type: text/html\n&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Food items&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;body&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;h1&amp;gt;Food items&amp;lt;/h1&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
connection = MySQLdb.connect(user='username', passwd='password', db='food_db')&lt;br /&gt;
cursor = connection.cursor()&lt;br /&gt;
cursor.execute(&amp;quot;SELECT food_item_name FROM food_table ORDER BY rating DESC LIMIT 10&amp;quot;)&lt;br /&gt;
for row in cursor.fetchall():&lt;br /&gt;
	print &amp;quot;&amp;lt;li&amp;gt;%s&amp;lt;/li&amp;gt;&amp;quot; % row[0]&lt;br /&gt;
print &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
connection.close()&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The above script generates an HTML page which will display a list of all the food items in the descending order of their rating by interacting with the corresponding table in the database.&lt;br /&gt;
&lt;br /&gt;
Even though the code has several advantages such as making a website (with only one page) from the scratch is not difficult. The code is readable and understandable to all audiences, etc. But this approach has a lot of disadvantages. The disadvantages include repetition of code (such as database connection, authentication, etc.) for a multi-page web application. Also, if discrete entities, like databases with different configuration, are to be included in the project then we will have to rewrite and reconfigure all the pages in the web application. Thus, using CGI for web application development makes it inefficient to build and deploy.&lt;br /&gt;
&lt;br /&gt;
Almost all of the problems posed by Python CGI scripting mentioned above were solved by Django. Django provided a programming infrastructure for large scale web applications, so that the developers can focus on writing clean, maintainable code without worrying about the different aspects of Project Scaffolding&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Scaffold_(programming)&amp;lt;/ref&amp;gt;. Based on the DRY&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Don't_repeat_yourself&amp;lt;/ref&amp;gt;(Don’t Repeat Yourself) principle, Django aims at reducing repetitive pieces of information of all kinds in software development. Django also supports pluggability of different applications into the web applications that you are developing.&lt;br /&gt;
&lt;br /&gt;
Also, Major websites such as [http://pinterest.com Pinterest], [http://instagram.com Instagram] were developed using Django.&lt;br /&gt;
&lt;br /&gt;
=== Other Frameworks ===&lt;br /&gt;
:*Flask&amp;lt;ref&amp;gt;http://flask.pocoo.org/&amp;lt;/ref&amp;gt;: It is a web framework that only provides the important and skeletal libraries required for basic web-development. Features such as data abstraction, unlike Django, is not provided by Flask.&lt;br /&gt;
:*Pyramid&amp;lt;ref&amp;gt;http://www.pylonsproject.org/projects/pyramid/about&amp;lt;/ref&amp;gt;: It is a web framework which strictly follows MVC pattern. It has an additional feature, unlike Django, of maintaining a dictionary of View-to-URL-Mapping.&lt;br /&gt;
:*web2py&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;: It is a web framework which follows the convention of Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
== '''Architecture''' ==&lt;br /&gt;
&lt;br /&gt;
[[File:Django_layers.png|frame|right|alt = MVT Architecture|Django's Model-View-Template Achitecture]]&lt;br /&gt;
&lt;br /&gt;
Most of the web frameworks- such as Ruby on Rails framework- are based on the MVC pattern. MVC, which stands for Model View Controller, is a pattern which provides loose coupling among different parts of the application. In MVC Pattern, Model deals with the direct interaction with the databases. Views deal with the representation of the data on the browser. Controller deals with the user interactions and redirecting each of the user interactions to the respective module responsible for dealing with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand, Django framework does not really fit into the MVC framework. As mentioned earlier, it follows the MTV framework which stands for (Model Template View) Framework. Controller corresponds to the View in Django Framework. In case of the Views in Django, it plays the role of the controller. It fetches the data and decides how the data is to be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
&lt;br /&gt;
In Django terminology, an installation of Django is considered as a “Project”. &lt;br /&gt;
&lt;br /&gt;
The smallest logical subset of files/folders that is fairly independent from the rest of the project can be called as an application. These subset of files include (but are not limited to) models, views, templates, static files, URLs, etc. A single Django project can have multiple applications, each of which contains the files that define an application.&lt;br /&gt;
&lt;br /&gt;
All the applications that must be included inside the main project should be explicitly mentioned inside the variable &amp;lt;code&amp;gt;INSTALLED_APPS&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;INSTALLED_APPS = (&lt;br /&gt;
    'django.contrib.admin',&lt;br /&gt;
    'django.contrib.auth',&lt;br /&gt;
    'django.contrib.contenttypes',&lt;br /&gt;
    'django.contrib.sessions',&lt;br /&gt;
    'django.contrib.messages',&lt;br /&gt;
    'django.contrib.staticfiles',&lt;br /&gt;
    'books'&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
In Django, a model is defined as the single source for all the data. It defines how data is accessed, processed and validated. It also contains the structure and relationship of all the data that is used by the application. Models are used to define the structure of your database. Each model is converted into a database table and each attribute inside a model is converted into a column of that table. All this is handled by Django implicitly.&lt;br /&gt;
&lt;br /&gt;
Consider the following example about an application called ‘books’ that contains:&lt;br /&gt;
:*Author: which has a first_name and last_name attributes&lt;br /&gt;
:*Book: which has title, author and publication date as its attributes&lt;br /&gt;
&lt;br /&gt;
We can write models for the above application like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;class Author(models.Model):&lt;br /&gt;
   first_name = models.CharField(max_length=30)&lt;br /&gt;
   last_name = models.CharField(max_length=40)&lt;br /&gt;
&lt;br /&gt;
class Book(models.Model):&lt;br /&gt;
   title = models.CharField(max_length=100)&lt;br /&gt;
   authors = models.ManyToManyField(Author)&lt;br /&gt;
   publication_date = models.DateField()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all the models for your application have been created, you can validate them by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py validate &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Django also dynamically generates “Create Table” statements for each of these models. These statement can be viewed using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py sqlall &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above command would give the following output:&lt;br /&gt;
&amp;lt;pre&amp;gt;BEGIN;&lt;br /&gt;
CREATE TABLE &amp;quot;books_author&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;first_name&amp;quot; varchar(30) NOT NULL,&lt;br /&gt;
    &amp;quot;last_name&amp;quot; varchar(40) NOT NULL,&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;title&amp;quot; varchar(100) NOT NULL,&lt;br /&gt;
    &amp;quot;publication_date&amp;quot; date NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book_authors&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;book_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_book&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    &amp;quot;author_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_author&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    UNIQUE (&amp;quot;book_id&amp;quot;, &amp;quot;author_id&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
COMMIT;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and all the tables would be created immediately as soon as you run the command stated below:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py syncdb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
The front-end of the web-application is equally important as the model and the controllers. The basic function of the view is to accept an HTTP request and send a response. Basically Django has two types of views – Generic Views &amp;amp; Class based views. Generic views just take one parameter – “request”. Following is the format of the code to display Hello World.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from django.http import HttpResponse&lt;br /&gt;
    	def hello_world(request)&lt;br /&gt;
                    	return HttpResponse(“hello world”)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the method class hello_world has a parameter called “request”. This is the parameter that contains all the information of the HttpRequest. After the request has been processed, the HttpResponse object is returned back. This HttpResponse object is initialized with the string “hello world”.&lt;br /&gt;
&lt;br /&gt;
Generic views mostly consist of functions. Maintaining a program with a lot of functions is difficult. This reduces the modularity of the program. In order to support classes, Class based views were introduced. Class based views consist of classes which handle all the functionality in the front end. Classes are extensible and hence reusable. We can inherit different views(classes) and include it in our class. For example, if we want to include a view which displays the contacts, we will write the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;from django.views.generic import ListView&lt;br /&gt;
from books.models import contacts&lt;br /&gt;
class ContactsList(ListView)&lt;br /&gt;
    	model = contacts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above program, we have imported the ListView from the generic module. As we want to display the contacts from the database, we have imported the database “contacts”. The class ContactsList inherits the ListView class and extracts all the functionality in that class. The “contacts” database is imported and assigned to the model so as to display the contacts in the form of a list view.&lt;br /&gt;
&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function.&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function. In order to do that, we will have to write the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    	from django.conf.urls.defaults import patterns, include, url&lt;br /&gt;
    	from hellworldproject.views import hello&lt;br /&gt;
    	urlpatterns = patterns(‘’. url(r’hello_world/$, hello_world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code, the “pattern” function saves the required URL pattern in the “urlpatters” attribute.&lt;br /&gt;
So, after everything is set up, we run our web application with a url say &amp;lt;code&amp;gt;[web-address]/hello_world/&amp;lt;/code&amp;gt;. Now, Django first goes to the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt; file in the project directory and searches for the files which handles the URLConf part. Suppose the name of the files is &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It dives into the urls.py files and linearly matches the requested url with the url patterns in the file and checks which method call is responsible to handle the request. After that, when it finds the method(here, hello_world), it passes an HttpRequest object to the method. After the required processing the request, it creates an HttpResponse object and then continues with the further processes the response by converting it into HTML code by adding the necessary formatting to the response in order for it to be displayed as a view on the screen.&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
In Django, templates are generally used to define how webpages of the application are supposed to look like. Template defines the structure of the webpage and also has additional elements that help access variables, run python statements and much more.&lt;br /&gt;
&lt;br /&gt;
Data can be passed to templates which can be used by the templates to display to the user or perform actions on the data and create dynamic views based on the data.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
We can access any data passed to the templates and use them as regular python variables. The below lines of code shows how variables can be accessed:&lt;br /&gt;
&amp;lt;pre&amp;gt;Author: {{author.last_name}}, {{ author.first_name }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will just print the author’s name on the webpage.&lt;br /&gt;
&lt;br /&gt;
==== Tags ====&lt;br /&gt;
Templates also provide the ability to write python code inside them and execute them just like they would run inside a &amp;lt;code&amp;gt;“.py”&amp;lt;/code&amp;gt; file. These elements are known as tags and look like &amp;lt;code&amp;gt;{% tag %}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given below is the example of a “for” loop that is defined inside a template:&lt;br /&gt;
&amp;lt;pre&amp;gt;{% for book in books_list %}&lt;br /&gt;
    &amp;lt;li&amp;gt;{{ book.title }}&amp;lt;/li&amp;gt;&lt;br /&gt;
{% endfor %}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can process data (though it is not logical to do so in a template), write conditional statements or just declare variables inside tags and used them later in the template file.&lt;br /&gt;
&lt;br /&gt;
==== Filters ====&lt;br /&gt;
Filters in templates can be defined as helper functions. They are a very powerful tool that reduces the code needed for basic (or sometimes even complex) post-processing of data. &lt;br /&gt;
&lt;br /&gt;
For example, the title of a book could be added to your application as one of ‘HARRY POTTER’, ‘HaRrY pOtTeR’ or ‘harry potter’. To standardize the format of the book title which you want to show on your website, we can simply write&lt;br /&gt;
&amp;lt;pre&amp;gt;{{book.title|title }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which capitalizes the first character of each word and turn all other characters to lower.&lt;br /&gt;
&lt;br /&gt;
Django also provide the ability to write custom filters and make it available to all the templates in your application. Django provides template tags and filters to control internationalization in templates. They allow for granular control of translations, formatting, and time zone conversions.&lt;br /&gt;
&lt;br /&gt;
=== Admin Site ===&lt;br /&gt;
For a certain class of Web sites, an admin interface is an essential part of the infrastructure.&lt;br /&gt;
&lt;br /&gt;
This is a Web-based interface, limited to trusted site administrators, that enables the adding, editing and deletion of site content. So the admin site has to authenticate users, display and handle forms, validate input, and so on. But the best part about Django is that it does all of this and more for you – in just a few of lines of code. This is also one of the reasons why Django is called a “heavy” web development framework.&lt;br /&gt;
&lt;br /&gt;
To access the Django admin interface, we just have to add &amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt; to your project url. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin01.png|frame|center|alt = This is the login page of Django Admin Site|Django Admin site login page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would also have to create a superuser, which can be done by following the steps given below.&lt;br /&gt;
&amp;lt;pre&amp;gt;$ python manage.py createsuperuser&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the admin username and email address:&lt;br /&gt;
&amp;lt;pre&amp;gt;Username: admin&lt;br /&gt;
Email address: admin@example.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
Choose the password for the admin account:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Password: **********&lt;br /&gt;
    Password (again): *********&lt;br /&gt;
    Superuser created successfully.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin02.png|frame|center|alt = The default first page of the admin site|Default admin site home page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django contains a file called &amp;lt;code&amp;gt;admin.py&amp;lt;/code&amp;gt; where you can define models for the admin site and then enable them so that they will appear on the admin site.&lt;br /&gt;
Using the example of the Author Model described in the sections above, let us add it to the admin site:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class AuthorAdmin(admin.ModelAdmin):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
    admin.site.register(Author);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These out-of-the-box features of the Django framework is what makes it the perfect option for creating content driven websites in relatively no time at all.&lt;br /&gt;
&lt;br /&gt;
== '''Features''' ==&lt;br /&gt;
Django has the following features to name a few:&lt;br /&gt;
:*It facilitates developers with a template comprising minimal number of classes, modules, packages etc. so that the developers can focus more on the core business logic.&lt;br /&gt;
:*It contains an ORM (Object-Relational Mapper) that allows for the use of standard Python language. The developers need not learn any query processing language.&lt;br /&gt;
:*It provides with a template framework suitable for making the views.&lt;br /&gt;
:*It supports pluggability – that is it supports including other installed applications into your own application.&lt;br /&gt;
:*It has a built in administrative interface to manage the web application from an administrative level, thus providing access control.&lt;br /&gt;
:*It is multi-lingual&lt;br /&gt;
:*It supports a very useful Geographical web framework &amp;quot;GeoDjango&amp;quot;&amp;lt;ref&amp;gt;https://docs.djangoproject.com/en/1.6/ref/contrib/gis/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Comparison with other web frameworks''' ==&lt;br /&gt;
=== Django vs Ruby on Rails ===&lt;br /&gt;
Most of the differences lie in the way the MVC pattern is interpreted by both the frameworks.&amp;lt;ref&amp;gt;https://bernardopires.com/2014/03/rails-vs-django-an-in-depth-technical-comparison/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Models:====&lt;br /&gt;
Everything in Ruby on Rails is based on migrations. If at any point of time, the schema of the database is changed and if it has to be reverted back to the previous schema then we can do that with the help of migrations. In case of Django, we need to depend on a third-party extension “South” (until Django 1.6) to support migrations.&lt;br /&gt;
&lt;br /&gt;
==== Controllers: ====&lt;br /&gt;
Django considers the entire framework as the controller but Ruby on Rails has a separate entity called controllers that manage the task of interpreting the user interactions and routing to the correct method that handles the request. That is why Django is said to follow the MVT(Model View Template) framework and Ruby on Rails strictly follows MVC framework.&lt;br /&gt;
&lt;br /&gt;
==== Views: ====&lt;br /&gt;
In Django, the amount of code that can be pushed into the views(i.e., the template) part of the application is very stringent. Only basic codes like conditional statements and simple loops are allowed. As the controller objects are not really accessible in the views, not much of the manipulation can be done in the views section of the application. This enforces a strict modularity between the models, views and templates section in the Django application making the application maintenance easier. In case of Rails, as the controller objects are accessible in the views as well, a lot of unnecessary calculations can be included in the views. This reduces modularity in the application. Thus, Django has an upper hand over Rails for this reason.&lt;br /&gt;
&lt;br /&gt;
==== Other Features ====&lt;br /&gt;
Django has in-built features like User authentication and admin support in its web applications. This makes developing admin based web application very easy. There is no such thing in Rails as such.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Django vs Web2py ===&lt;br /&gt;
&lt;br /&gt;
Web2py is inspired by Ruby on Rails. It supports Convention over Configuration just like Ruby on Rails. The administrative interface can be accessed from the browser for web2py. But, for Django, the developer has to manually configure everything.&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;&lt;br /&gt;
====Models====&lt;br /&gt;
Django doesn’t support migrations by itself(until 1.6). web2py supports database migrations. Also, many to many references between the tables are represented in a different way in Django and web2py. Django creates an intermediate link table whereas web2py includes the references as fields in the table.&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
Web2py manages all the imports, and other things related to project scaffolding by itself. The developer just has to focus on the application development unlike Django wherein the user has to take care of all the imports in the code. &lt;br /&gt;
&lt;br /&gt;
====Views====&lt;br /&gt;
If a view is undefined, then Django throws an error. But in case of web2py, it searches for mycontroller/index.html in the myapp. If that file is not present, then it creates a generic view which contains the raw response in a dictionary format on the browser.&lt;br /&gt;
&lt;br /&gt;
====Other features====&lt;br /&gt;
One feature, Transactions, is supported by both Django and web2py. But the way transaction “commits” are executed is different. Django has two options “auto-commit” and “commit_on_success”. But in case of web2py, it by default commits if the transaction is success and doesn’t commit in case of failure of the transaction.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87231</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 8 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87231"/>
		<updated>2014-09-19T23:50:46Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Django Framework''' ==  &lt;br /&gt;
&lt;br /&gt;
Django&amp;lt;ref&amp;gt;https://www.djangoproject.com/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.djangobook.com/en/2.0/index.html&amp;lt;/ref&amp;gt;(2005) is a high level, but heavy, open source Python&amp;lt;ref&amp;gt;http://www.python.org/&amp;lt;/ref&amp;gt; web framework used to build a large scale web application. Django is named after Django Reinhardt, a gypsy jazz guitarist from the 1930s to early 1950s. A web framework is necessary to help the developers and the testers to develop highly scalable and efficient large scale web applications. Django deals with the most important problem in the domain of Web development – repetition. Even though web development is a really interesting task, there are a lot of things that require unnecessary efforts and time of the developers as well as the testers. With an MVT&amp;lt;ref&amp;gt;http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names&amp;lt;/ref&amp;gt; (Model View Template) Framework, Django is very modular and thus very much suitable for highly cohesive&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Cohesion_(computer_science)&amp;lt;/ref&amp;gt; and low coupling&amp;lt;ref&amp;gt; http://en.wikipedia.org/wiki/Coupling_(computer_programming)&amp;lt;/ref&amp;gt; tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== '''History''' ==&lt;br /&gt;
In 1998, Python CGI&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/CGI&amp;lt;/ref&amp;gt; was used to develop web applications from scratch using Python. In order to create a web application using Python CGI, we just have to create a Python script that generates output in the HTML format. We then save the script to a Web server with a &amp;lt;code&amp;gt;“.cgi”&amp;lt;/code&amp;gt; extension and visit the page in our Web browser. Following is the sample way of creating a simple website using the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import MySQLdb&lt;br /&gt;
print &amp;quot;Content-Type: text/html\n&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Food items&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;body&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;h1&amp;gt;Food items&amp;lt;/h1&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
connection = MySQLdb.connect(user='username', passwd='password', db='food_db')&lt;br /&gt;
cursor = connection.cursor()&lt;br /&gt;
cursor.execute(&amp;quot;SELECT food_item_name FROM food_table ORDER BY rating DESC LIMIT 10&amp;quot;)&lt;br /&gt;
for row in cursor.fetchall():&lt;br /&gt;
	print &amp;quot;&amp;lt;li&amp;gt;%s&amp;lt;/li&amp;gt;&amp;quot; % row[0]&lt;br /&gt;
print &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
connection.close()&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The above script generates an HTML page which will display a list of all the food items in the descending order of their rating by interacting with the corresponding table in the database.&lt;br /&gt;
&lt;br /&gt;
Even though the code has several advantages such as making a website (with only one page) from the scratch is not difficult. The code is readable and understandable to all audiences, etc. But this approach has a lot of disadvantages. The disadvantages include repetition of code (such as database connection, authentication, etc.) for a multi-page web application. Also, if discrete entities, like databases with different configuration, are to be included in the project then we will have to rewrite and reconfigure all the pages in the web application. Thus, using CGI for web application development makes it inefficient to build and deploy.&lt;br /&gt;
&lt;br /&gt;
Almost all of the problems posed by Python CGI scripting mentioned above were solved by Django. Django provided a programming infrastructure for large scale web applications, so that the developers can focus on writing clean, maintainable code without worrying about the different aspects of Project Scaffolding&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Scaffold_(programming)&amp;lt;/ref&amp;gt;. Based on the DRY&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Don't_repeat_yourself&amp;lt;/ref&amp;gt;(Don’t Repeat Yourself) principle, Django aims at reducing repetitive pieces of information of all kinds in software development. Django also supports pluggability of different applications into the web applications that you are developing.&lt;br /&gt;
&lt;br /&gt;
Also, Major websites such as [http://pinterest.com Pinterest], [http://instagram.com Instagram] were developed using Django.&lt;br /&gt;
&lt;br /&gt;
=== Other Frameworks ===&lt;br /&gt;
:*Flask&amp;lt;ref&amp;gt;http://flask.pocoo.org/&amp;lt;/ref&amp;gt;: It is a web framework that only provides the important and skeletal libraries required for basic web-development. Features such as data abstraction, unlike Django, is not provided by Flask.&lt;br /&gt;
:*Pyramid&amp;lt;ref&amp;gt;http://www.pylonsproject.org/projects/pyramid/about&amp;lt;/ref&amp;gt;: It is a web framework which strictly follows MVC pattern. It has an additional feature, unlike Django, of maintaining a dictionary of View-to-URL-Mapping.&lt;br /&gt;
:*web2py&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;: It is a web framework which follows the convention of Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
== '''Architecture''' ==&lt;br /&gt;
&lt;br /&gt;
[[File:Django_layers.png|frame|right|alt = MVT Architecture|Django's Model-View-Template Achitecture]]&lt;br /&gt;
&lt;br /&gt;
Most of the web frameworks- such as Ruby on Rails framework- are based on the MVC pattern. MVC, which stands for Model View Controller, is a pattern which provides loose coupling among different parts of the application. In MVC Pattern, Model deals with the direct interaction with the databases. Views deal with the representation of the data on the browser. Controller deals with the user interactions and redirecting each of the user interactions to the respective module responsible for dealing with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand, Django framework does not really fit into the MVC framework. As mentioned earlier, it follows the MTV framework which stands for (Model Template View) Framework. Controller corresponds to the View in Django Framework. In case of the Views in Django, it plays the role of the controller. It fetches the data and decides how the data is to be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
&lt;br /&gt;
In Django terminology, an installation of Django is considered as a “Project”. &lt;br /&gt;
&lt;br /&gt;
The smallest logical subset of files/folders that is fairly independent from the rest of the project can be called as an application. These subset of files include (but are not limited to) models, views, templates, static files, URLs, etc. A single Django project can have multiple applications, each of which contains the files that define an application.&lt;br /&gt;
&lt;br /&gt;
All the applications that must be included inside the main project should be explicitly mentioned inside the variable &amp;lt;code&amp;gt;INSTALLED_APPS&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;INSTALLED_APPS = (&lt;br /&gt;
    'django.contrib.admin',&lt;br /&gt;
    'django.contrib.auth',&lt;br /&gt;
    'django.contrib.contenttypes',&lt;br /&gt;
    'django.contrib.sessions',&lt;br /&gt;
    'django.contrib.messages',&lt;br /&gt;
    'django.contrib.staticfiles',&lt;br /&gt;
    'books'&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
In Django, a model is defined as the single source for all the data. It defines how data is accessed, processed and validated. It also contains the structure and relationship of all the data that is used by the application. Models are used to define the structure of your database. Each model is converted into a database table and each attribute inside a model is converted into a column of that table. All this is handled by Django implicitly.&lt;br /&gt;
&lt;br /&gt;
Consider the following example about an application called ‘books’ that contains:&lt;br /&gt;
:*Author: which has a first_name and last_name attributes&lt;br /&gt;
:*Book: which has title, author and publication date as its attributes&lt;br /&gt;
&lt;br /&gt;
We can write models for the above application like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;class Author(models.Model):&lt;br /&gt;
   first_name = models.CharField(max_length=30)&lt;br /&gt;
   last_name = models.CharField(max_length=40)&lt;br /&gt;
&lt;br /&gt;
class Book(models.Model):&lt;br /&gt;
   title = models.CharField(max_length=100)&lt;br /&gt;
   authors = models.ManyToManyField(Author)&lt;br /&gt;
   publication_date = models.DateField()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all the models for your application have been created, you can validate them by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py validate &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Django also dynamically generates “Create Table” statements for each of these models. These statement can be viewed using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py sqlall &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above command would give the following output:&lt;br /&gt;
&amp;lt;pre&amp;gt;BEGIN;&lt;br /&gt;
CREATE TABLE &amp;quot;books_author&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;first_name&amp;quot; varchar(30) NOT NULL,&lt;br /&gt;
    &amp;quot;last_name&amp;quot; varchar(40) NOT NULL,&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;title&amp;quot; varchar(100) NOT NULL,&lt;br /&gt;
    &amp;quot;publication_date&amp;quot; date NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book_authors&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;book_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_book&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    &amp;quot;author_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_author&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    UNIQUE (&amp;quot;book_id&amp;quot;, &amp;quot;author_id&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
COMMIT;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and all the tables would be created immediately as soon as you run the command stated below:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py syncdb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
The front-end of the web-application is equally important as the model and the controllers. The basic function of the view is to accept an HTTP request and send a response. Basically Django has two types of views – Generic Views &amp;amp; Class based views. Generic views just take one parameter – “request”. Following is the format of the code to display Hello World.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from django.http import HttpResponse&lt;br /&gt;
    	def hello_world(request)&lt;br /&gt;
                    	return HttpResponse(“hello world”)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the method class hello_world has a parameter called “request”. This is the parameter that contains all the information of the HttpRequest. After the request has been processed, the HttpResponse object is returned back. This HttpResponse object is initialized with the string “hello world”.&lt;br /&gt;
&lt;br /&gt;
Generic views mostly consist of functions. Maintaining a program with a lot of functions is difficult. This reduces the modularity of the program. In order to support classes, Class based views were introduced. Class based views consist of classes which handle all the functionality in the front end. Classes are extensible and hence reusable. We can inherit different views(classes) and include it in our class. For example, if we want to include a view which displays the contacts, we will write the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;from django.views.generic import ListView&lt;br /&gt;
from books.models import contacts&lt;br /&gt;
class ContactsList(ListView)&lt;br /&gt;
    	model = contacts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above program, we have imported the ListView from the generic module. As we want to display the contacts from the database, we have imported the database “contacts”. The class ContactsList inherits the ListView class and extracts all the functionality in that class. The “contacts” database is imported and assigned to the model so as to display the contacts in the form of a list view.&lt;br /&gt;
&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function.&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function. In order to do that, we will have to write the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    	from django.conf.urls.defaults import patterns, include, url&lt;br /&gt;
    	from hellworldproject.views import hello&lt;br /&gt;
    	urlpatterns = patterns(‘’. url(r’hello_world/$, hello_world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code, the “pattern” function saves the required URL pattern in the “urlpatters” attribute.&lt;br /&gt;
So, after everything is set up, we run our web application with a url say &amp;lt;code&amp;gt;[web-address]/hello_world/&amp;lt;/code&amp;gt;. Now, Django first goes to the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt; file in the project directory and searches for the files which handles the URLConf part. Suppose the name of the files is &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It dives into the urls.py files and linearly matches the requested url with the url patterns in the file and checks which method call is responsible to handle the request. After that, when it finds the method(here, hello_world), it passes an HttpRequest object to the method. After the required processing the request, it creates an HttpResponse object and then continues with the further processes the response by converting it into HTML code by adding the necessary formatting to the response in order for it to be displayed as a view on the screen.&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
In Django, templates are generally used to define how webpages of the application are supposed to look like. Template defines the structure of the webpage and also has additional elements that help access variables, run python statements and much more.&lt;br /&gt;
&lt;br /&gt;
Data can be passed to templates which can be used by the templates to display to the user or perform actions on the data and create dynamic views based on the data.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
We can access any data passed to the templates and use them as regular python variables. The below lines of code shows how variables can be accessed:&lt;br /&gt;
&amp;lt;pre&amp;gt;Author: {{author.last_name}}, {{ author.first_name }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will just print the author’s name on the webpage.&lt;br /&gt;
&lt;br /&gt;
==== Tags ====&lt;br /&gt;
Templates also provide the ability to write python code inside them and execute them just like they would run inside a &amp;lt;code&amp;gt;“.py”&amp;lt;/code&amp;gt; file. These elements are known as tags and look like &amp;lt;code&amp;gt;{% tag %}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given below is the example of a “for” loop that is defined inside a template:&lt;br /&gt;
&amp;lt;pre&amp;gt;{% for book in books_list %}&lt;br /&gt;
    &amp;lt;li&amp;gt;{{ book.title }}&amp;lt;/li&amp;gt;&lt;br /&gt;
{% endfor %}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can process data (though it is not logical to do so in a template), write conditional statements or just declare variables inside tags and used them later in the template file.&lt;br /&gt;
&lt;br /&gt;
==== Filters ====&lt;br /&gt;
Filters in templates can be defined as helper functions. They are a very powerful tool that reduces the code needed for basic (or sometimes even complex) post-processing of data. &lt;br /&gt;
&lt;br /&gt;
For example, the title of a book could be added to your application as one of ‘HARRY POTTER’, ‘HaRrY pOtTeR’ or ‘harry potter’. To standardize the format of the book title which you want to show on your website, we can simply write&lt;br /&gt;
&amp;lt;pre&amp;gt;{{book.title|title }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which capitalizes the first character of each word and turn all other characters to lower.&lt;br /&gt;
&lt;br /&gt;
Django also provide the ability to write custom filters and make it available to all the templates in your application. Django provides template tags and filters to control internationalization in templates. They allow for granular control of translations, formatting, and time zone conversions.&lt;br /&gt;
&lt;br /&gt;
=== Admin Site ===&lt;br /&gt;
For a certain class of Web sites, an admin interface is an essential part of the infrastructure.&lt;br /&gt;
&lt;br /&gt;
This is a Web-based interface, limited to trusted site administrators, that enables the adding, editing and deletion of site content. So the admin site has to authenticate users, display and handle forms, validate input, and so on. But the best part about Django is that it does all of this and more for you – in just a few of lines of code. This is also one of the reasons why Django is called a “heavy” web development framework.&lt;br /&gt;
&lt;br /&gt;
To access the Django admin interface, we just have to add &amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt; to your project url. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin01.png|frame|center|alt = This is the login page of Django Admin Site|Django Admin site login page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would also have to create a superuser, which can be done by following the steps given below.&lt;br /&gt;
&amp;lt;pre&amp;gt;$ python manage.py createsuperuser&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the admin username and email address:&lt;br /&gt;
&amp;lt;pre&amp;gt;Username: admin&lt;br /&gt;
Email address: admin@example.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
Choose the password for the admin account:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Password: **********&lt;br /&gt;
    Password (again): *********&lt;br /&gt;
    Superuser created successfully.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin02.png|frame|center|alt = The default first page of the admin site|Default admin site home page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django contains a file called &amp;lt;code&amp;gt;admin.py&amp;lt;/code&amp;gt; where you can define models for the admin site and then enable them so that they will appear on the admin site.&lt;br /&gt;
Using the example of the Author Model described in the sections above, let us add it to the admin site:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class AuthorAdmin(admin.ModelAdmin):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
    admin.site.register(Author);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These out-of-the-box features of the Django framework is what makes it the perfect option for creating content driven websites in relatively no time at all.&lt;br /&gt;
&lt;br /&gt;
== '''Features''' ==&lt;br /&gt;
Django has the following features to name a few:&lt;br /&gt;
:*It facilitates developers with a template comprising minimal number of classes, modules, packages etc. so that the developers can focus more on the core business logic.&lt;br /&gt;
:*It contains an ORM (Object-Relational Mapper) that allows for the use of standard Python language. The developers need not learn any query processing language.&lt;br /&gt;
:*It provides with a template framework suitable for making the views.&lt;br /&gt;
:*It supports pluggability – that is it supports including other installed applications into your own application.&lt;br /&gt;
:*It has a built in administrative interface to manage the web application from an administrative level, thus providing access control.&lt;br /&gt;
:*It is multi-lingual&lt;br /&gt;
:*It supports a very useful Geographical web framework &amp;quot;GeoDjango&amp;quot;&amp;lt;ref&amp;gt;https://docs.djangoproject.com/en/1.6/ref/contrib/gis/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison with other web frameworks ==&lt;br /&gt;
=== Django vs Ruby on Rails ===&lt;br /&gt;
Most of the differences lie in the way the MVC pattern is interpreted by both the frameworks.&amp;lt;ref&amp;gt;https://bernardopires.com/2014/03/rails-vs-django-an-in-depth-technical-comparison/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Models:====&lt;br /&gt;
Everything in Ruby on Rails is based on migrations. If at any point of time, the schema of the database is changed and if it has to be reverted back to the previous schema then we can do that with the help of migrations. In case of Django, we need to depend on a third-party extension “South” (until Django 1.6) to support migrations.&lt;br /&gt;
&lt;br /&gt;
==== Controllers: ====&lt;br /&gt;
Django considers the entire framework as the controller but Ruby on Rails has a separate entity called controllers that manage the task of interpreting the user interactions and routing to the correct method that handles the request. That is why Django is said to follow the MVT(Model View Template) framework and Ruby on Rails strictly follows MVC framework.&lt;br /&gt;
&lt;br /&gt;
==== Views: ====&lt;br /&gt;
In Django, the amount of code that can be pushed into the views(i.e., the template) part of the application is very stringent. Only basic codes like conditional statements and simple loops are allowed. As the controller objects are not really accessible in the views, not much of the manipulation can be done in the views section of the application. This enforces a strict modularity between the models, views and templates section in the Django application making the application maintenance easier. In case of Rails, as the controller objects are accessible in the views as well, a lot of unnecessary calculations can be included in the views. This reduces modularity in the application. Thus, Django has an upper hand over Rails for this reason.&lt;br /&gt;
&lt;br /&gt;
==== Other Features ====&lt;br /&gt;
Django has in-built features like User authentication and admin support in its web applications. This makes developing admin based web application very easy. There is no such thing in Rails as such.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Django vs Web2py ===&lt;br /&gt;
&lt;br /&gt;
Web2py is inspired by Ruby on Rails. It supports Convention over Configuration just like Ruby on Rails. The administrative interface can be accessed from the browser for web2py. But, for Django, the developer has to manually configure everything.&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;&lt;br /&gt;
====Models====&lt;br /&gt;
Django doesn’t support migrations by itself(until 1.6). web2py supports database migrations. Also, many to many references between the tables are represented in a different way in Django and web2py. Django creates an intermediate link table whereas web2py includes the references as fields in the table.&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
Web2py manages all the imports, and other things related to project scaffolding by itself. The developer just has to focus on the application development unlike Django wherein the user has to take care of all the imports in the code. &lt;br /&gt;
&lt;br /&gt;
====Views====&lt;br /&gt;
If a view is undefined, then Django throws an error. But in case of web2py, it searches for mycontroller/index.html in the myapp. If that file is not present, then it creates a generic view which contains the raw response in a dictionary format on the browser.&lt;br /&gt;
&lt;br /&gt;
====Other features====&lt;br /&gt;
One feature, Transactions, is supported by both Django and web2py. But the way transaction “commits” are executed is different. Django has two options “auto-commit” and “commit_on_success”. But in case of web2py, it by default commits if the transaction is success and doesn’t commit in case of failure of the transaction.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87230</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 8 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87230"/>
		<updated>2014-09-19T23:50:29Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Architecture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Django Framework''' ==  &lt;br /&gt;
&lt;br /&gt;
Django&amp;lt;ref&amp;gt;https://www.djangoproject.com/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.djangobook.com/en/2.0/index.html&amp;lt;/ref&amp;gt;(2005) is a high level, but heavy, open source Python&amp;lt;ref&amp;gt;http://www.python.org/&amp;lt;/ref&amp;gt; web framework used to build a large scale web application. Django is named after Django Reinhardt, a gypsy jazz guitarist from the 1930s to early 1950s. A web framework is necessary to help the developers and the testers to develop highly scalable and efficient large scale web applications. Django deals with the most important problem in the domain of Web development – repetition. Even though web development is a really interesting task, there are a lot of things that require unnecessary efforts and time of the developers as well as the testers. With an MVT&amp;lt;ref&amp;gt;http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names&amp;lt;/ref&amp;gt; (Model View Template) Framework, Django is very modular and thus very much suitable for highly cohesive&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Cohesion_(computer_science)&amp;lt;/ref&amp;gt; and low coupling&amp;lt;ref&amp;gt; http://en.wikipedia.org/wiki/Coupling_(computer_programming)&amp;lt;/ref&amp;gt; tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== '''History''' ==&lt;br /&gt;
In 1998, Python CGI&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/CGI&amp;lt;/ref&amp;gt; was used to develop web applications from scratch using Python. In order to create a web application using Python CGI, we just have to create a Python script that generates output in the HTML format. We then save the script to a Web server with a &amp;lt;code&amp;gt;“.cgi”&amp;lt;/code&amp;gt; extension and visit the page in our Web browser. Following is the sample way of creating a simple website using the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import MySQLdb&lt;br /&gt;
print &amp;quot;Content-Type: text/html\n&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Food items&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;body&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;h1&amp;gt;Food items&amp;lt;/h1&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
connection = MySQLdb.connect(user='username', passwd='password', db='food_db')&lt;br /&gt;
cursor = connection.cursor()&lt;br /&gt;
cursor.execute(&amp;quot;SELECT food_item_name FROM food_table ORDER BY rating DESC LIMIT 10&amp;quot;)&lt;br /&gt;
for row in cursor.fetchall():&lt;br /&gt;
	print &amp;quot;&amp;lt;li&amp;gt;%s&amp;lt;/li&amp;gt;&amp;quot; % row[0]&lt;br /&gt;
print &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
connection.close()&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The above script generates an HTML page which will display a list of all the food items in the descending order of their rating by interacting with the corresponding table in the database.&lt;br /&gt;
&lt;br /&gt;
Even though the code has several advantages such as making a website (with only one page) from the scratch is not difficult. The code is readable and understandable to all audiences, etc. But this approach has a lot of disadvantages. The disadvantages include repetition of code (such as database connection, authentication, etc.) for a multi-page web application. Also, if discrete entities, like databases with different configuration, are to be included in the project then we will have to rewrite and reconfigure all the pages in the web application. Thus, using CGI for web application development makes it inefficient to build and deploy.&lt;br /&gt;
&lt;br /&gt;
Almost all of the problems posed by Python CGI scripting mentioned above were solved by Django. Django provided a programming infrastructure for large scale web applications, so that the developers can focus on writing clean, maintainable code without worrying about the different aspects of Project Scaffolding&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Scaffold_(programming)&amp;lt;/ref&amp;gt;. Based on the DRY&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Don't_repeat_yourself&amp;lt;/ref&amp;gt;(Don’t Repeat Yourself) principle, Django aims at reducing repetitive pieces of information of all kinds in software development. Django also supports pluggability of different applications into the web applications that you are developing.&lt;br /&gt;
&lt;br /&gt;
Also, Major websites such as [http://pinterest.com Pinterest], [http://instagram.com Instagram] were developed using Django.&lt;br /&gt;
&lt;br /&gt;
=== Other Frameworks ===&lt;br /&gt;
:*Flask&amp;lt;ref&amp;gt;http://flask.pocoo.org/&amp;lt;/ref&amp;gt;: It is a web framework that only provides the important and skeletal libraries required for basic web-development. Features such as data abstraction, unlike Django, is not provided by Flask.&lt;br /&gt;
:*Pyramid&amp;lt;ref&amp;gt;http://www.pylonsproject.org/projects/pyramid/about&amp;lt;/ref&amp;gt;: It is a web framework which strictly follows MVC pattern. It has an additional feature, unlike Django, of maintaining a dictionary of View-to-URL-Mapping.&lt;br /&gt;
:*web2py&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;: It is a web framework which follows the convention of Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
== '''Architecture''' ==&lt;br /&gt;
&lt;br /&gt;
[[File:Django_layers.png|frame|right|alt = MVT Architecture|Django's Model-View-Template Achitecture]]&lt;br /&gt;
&lt;br /&gt;
Most of the web frameworks- such as Ruby on Rails framework- are based on the MVC pattern. MVC, which stands for Model View Controller, is a pattern which provides loose coupling among different parts of the application. In MVC Pattern, Model deals with the direct interaction with the databases. Views deal with the representation of the data on the browser. Controller deals with the user interactions and redirecting each of the user interactions to the respective module responsible for dealing with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand, Django framework does not really fit into the MVC framework. As mentioned earlier, it follows the MTV framework which stands for (Model Template View) Framework. Controller corresponds to the View in Django Framework. In case of the Views in Django, it plays the role of the controller. It fetches the data and decides how the data is to be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
&lt;br /&gt;
In Django terminology, an installation of Django is considered as a “Project”. &lt;br /&gt;
&lt;br /&gt;
The smallest logical subset of files/folders that is fairly independent from the rest of the project can be called as an application. These subset of files include (but are not limited to) models, views, templates, static files, URLs, etc. A single Django project can have multiple applications, each of which contains the files that define an application.&lt;br /&gt;
&lt;br /&gt;
All the applications that must be included inside the main project should be explicitly mentioned inside the variable &amp;lt;code&amp;gt;INSTALLED_APPS&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;INSTALLED_APPS = (&lt;br /&gt;
    'django.contrib.admin',&lt;br /&gt;
    'django.contrib.auth',&lt;br /&gt;
    'django.contrib.contenttypes',&lt;br /&gt;
    'django.contrib.sessions',&lt;br /&gt;
    'django.contrib.messages',&lt;br /&gt;
    'django.contrib.staticfiles',&lt;br /&gt;
    'books'&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
In Django, a model is defined as the single source for all the data. It defines how data is accessed, processed and validated. It also contains the structure and relationship of all the data that is used by the application. Models are used to define the structure of your database. Each model is converted into a database table and each attribute inside a model is converted into a column of that table. All this is handled by Django implicitly.&lt;br /&gt;
&lt;br /&gt;
Consider the following example about an application called ‘books’ that contains:&lt;br /&gt;
:*Author: which has a first_name and last_name attributes&lt;br /&gt;
:*Book: which has title, author and publication date as its attributes&lt;br /&gt;
&lt;br /&gt;
We can write models for the above application like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;class Author(models.Model):&lt;br /&gt;
   first_name = models.CharField(max_length=30)&lt;br /&gt;
   last_name = models.CharField(max_length=40)&lt;br /&gt;
&lt;br /&gt;
class Book(models.Model):&lt;br /&gt;
   title = models.CharField(max_length=100)&lt;br /&gt;
   authors = models.ManyToManyField(Author)&lt;br /&gt;
   publication_date = models.DateField()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all the models for your application have been created, you can validate them by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py validate &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Django also dynamically generates “Create Table” statements for each of these models. These statement can be viewed using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py sqlall &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above command would give the following output:&lt;br /&gt;
&amp;lt;pre&amp;gt;BEGIN;&lt;br /&gt;
CREATE TABLE &amp;quot;books_author&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;first_name&amp;quot; varchar(30) NOT NULL,&lt;br /&gt;
    &amp;quot;last_name&amp;quot; varchar(40) NOT NULL,&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;title&amp;quot; varchar(100) NOT NULL,&lt;br /&gt;
    &amp;quot;publication_date&amp;quot; date NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book_authors&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;book_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_book&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    &amp;quot;author_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_author&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    UNIQUE (&amp;quot;book_id&amp;quot;, &amp;quot;author_id&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
COMMIT;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and all the tables would be created immediately as soon as you run the command stated below:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py syncdb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
The front-end of the web-application is equally important as the model and the controllers. The basic function of the view is to accept an HTTP request and send a response. Basically Django has two types of views – Generic Views &amp;amp; Class based views. Generic views just take one parameter – “request”. Following is the format of the code to display Hello World.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from django.http import HttpResponse&lt;br /&gt;
    	def hello_world(request)&lt;br /&gt;
                    	return HttpResponse(“hello world”)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the method class hello_world has a parameter called “request”. This is the parameter that contains all the information of the HttpRequest. After the request has been processed, the HttpResponse object is returned back. This HttpResponse object is initialized with the string “hello world”.&lt;br /&gt;
&lt;br /&gt;
Generic views mostly consist of functions. Maintaining a program with a lot of functions is difficult. This reduces the modularity of the program. In order to support classes, Class based views were introduced. Class based views consist of classes which handle all the functionality in the front end. Classes are extensible and hence reusable. We can inherit different views(classes) and include it in our class. For example, if we want to include a view which displays the contacts, we will write the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;from django.views.generic import ListView&lt;br /&gt;
from books.models import contacts&lt;br /&gt;
class ContactsList(ListView)&lt;br /&gt;
    	model = contacts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above program, we have imported the ListView from the generic module. As we want to display the contacts from the database, we have imported the database “contacts”. The class ContactsList inherits the ListView class and extracts all the functionality in that class. The “contacts” database is imported and assigned to the model so as to display the contacts in the form of a list view.&lt;br /&gt;
&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function.&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function. In order to do that, we will have to write the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    	from django.conf.urls.defaults import patterns, include, url&lt;br /&gt;
    	from hellworldproject.views import hello&lt;br /&gt;
    	urlpatterns = patterns(‘’. url(r’hello_world/$, hello_world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code, the “pattern” function saves the required URL pattern in the “urlpatters” attribute.&lt;br /&gt;
So, after everything is set up, we run our web application with a url say &amp;lt;code&amp;gt;[web-address]/hello_world/&amp;lt;/code&amp;gt;. Now, Django first goes to the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt; file in the project directory and searches for the files which handles the URLConf part. Suppose the name of the files is &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It dives into the urls.py files and linearly matches the requested url with the url patterns in the file and checks which method call is responsible to handle the request. After that, when it finds the method(here, hello_world), it passes an HttpRequest object to the method. After the required processing the request, it creates an HttpResponse object and then continues with the further processes the response by converting it into HTML code by adding the necessary formatting to the response in order for it to be displayed as a view on the screen.&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
In Django, templates are generally used to define how webpages of the application are supposed to look like. Template defines the structure of the webpage and also has additional elements that help access variables, run python statements and much more.&lt;br /&gt;
&lt;br /&gt;
Data can be passed to templates which can be used by the templates to display to the user or perform actions on the data and create dynamic views based on the data.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
We can access any data passed to the templates and use them as regular python variables. The below lines of code shows how variables can be accessed:&lt;br /&gt;
&amp;lt;pre&amp;gt;Author: {{author.last_name}}, {{ author.first_name }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will just print the author’s name on the webpage.&lt;br /&gt;
&lt;br /&gt;
==== Tags ====&lt;br /&gt;
Templates also provide the ability to write python code inside them and execute them just like they would run inside a &amp;lt;code&amp;gt;“.py”&amp;lt;/code&amp;gt; file. These elements are known as tags and look like &amp;lt;code&amp;gt;{% tag %}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given below is the example of a “for” loop that is defined inside a template:&lt;br /&gt;
&amp;lt;pre&amp;gt;{% for book in books_list %}&lt;br /&gt;
    &amp;lt;li&amp;gt;{{ book.title }}&amp;lt;/li&amp;gt;&lt;br /&gt;
{% endfor %}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can process data (though it is not logical to do so in a template), write conditional statements or just declare variables inside tags and used them later in the template file.&lt;br /&gt;
&lt;br /&gt;
==== Filters ====&lt;br /&gt;
Filters in templates can be defined as helper functions. They are a very powerful tool that reduces the code needed for basic (or sometimes even complex) post-processing of data. &lt;br /&gt;
&lt;br /&gt;
For example, the title of a book could be added to your application as one of ‘HARRY POTTER’, ‘HaRrY pOtTeR’ or ‘harry potter’. To standardize the format of the book title which you want to show on your website, we can simply write&lt;br /&gt;
&amp;lt;pre&amp;gt;{{book.title|title }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which capitalizes the first character of each word and turn all other characters to lower.&lt;br /&gt;
&lt;br /&gt;
Django also provide the ability to write custom filters and make it available to all the templates in your application. Django provides template tags and filters to control internationalization in templates. They allow for granular control of translations, formatting, and time zone conversions.&lt;br /&gt;
&lt;br /&gt;
=== Admin Site ===&lt;br /&gt;
For a certain class of Web sites, an admin interface is an essential part of the infrastructure.&lt;br /&gt;
&lt;br /&gt;
This is a Web-based interface, limited to trusted site administrators, that enables the adding, editing and deletion of site content. So the admin site has to authenticate users, display and handle forms, validate input, and so on. But the best part about Django is that it does all of this and more for you – in just a few of lines of code. This is also one of the reasons why Django is called a “heavy” web development framework.&lt;br /&gt;
&lt;br /&gt;
To access the Django admin interface, we just have to add &amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt; to your project url. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin01.png|frame|center|alt = This is the login page of Django Admin Site|Django Admin site login page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would also have to create a superuser, which can be done by following the steps given below.&lt;br /&gt;
&amp;lt;pre&amp;gt;$ python manage.py createsuperuser&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the admin username and email address:&lt;br /&gt;
&amp;lt;pre&amp;gt;Username: admin&lt;br /&gt;
Email address: admin@example.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
Choose the password for the admin account:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Password: **********&lt;br /&gt;
    Password (again): *********&lt;br /&gt;
    Superuser created successfully.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin02.png|frame|center|alt = The default first page of the admin site|Default admin site home page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django contains a file called &amp;lt;code&amp;gt;admin.py&amp;lt;/code&amp;gt; where you can define models for the admin site and then enable them so that they will appear on the admin site.&lt;br /&gt;
Using the example of the Author Model described in the sections above, let us add it to the admin site:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class AuthorAdmin(admin.ModelAdmin):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
    admin.site.register(Author);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These out-of-the-box features of the Django framework is what makes it the perfect option for creating content driven websites in relatively no time at all.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
Django has the following features to name a few:&lt;br /&gt;
:*It facilitates developers with a template comprising minimal number of classes, modules, packages etc. so that the developers can focus more on the core business logic.&lt;br /&gt;
:*It contains an ORM (Object-Relational Mapper) that allows for the use of standard Python language. The developers need not learn any query processing language.&lt;br /&gt;
:*It provides with a template framework suitable for making the views.&lt;br /&gt;
:*It supports pluggability – that is it supports including other installed applications into your own application.&lt;br /&gt;
:*It has a built in administrative interface to manage the web application from an administrative level, thus providing access control.&lt;br /&gt;
:*It is multi-lingual&lt;br /&gt;
:*It supports a very useful Geographical web framework &amp;quot;GeoDjango&amp;quot;&amp;lt;ref&amp;gt;https://docs.djangoproject.com/en/1.6/ref/contrib/gis/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison with other web frameworks ==&lt;br /&gt;
=== Django vs Ruby on Rails ===&lt;br /&gt;
Most of the differences lie in the way the MVC pattern is interpreted by both the frameworks.&amp;lt;ref&amp;gt;https://bernardopires.com/2014/03/rails-vs-django-an-in-depth-technical-comparison/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Models:====&lt;br /&gt;
Everything in Ruby on Rails is based on migrations. If at any point of time, the schema of the database is changed and if it has to be reverted back to the previous schema then we can do that with the help of migrations. In case of Django, we need to depend on a third-party extension “South” (until Django 1.6) to support migrations.&lt;br /&gt;
&lt;br /&gt;
==== Controllers: ====&lt;br /&gt;
Django considers the entire framework as the controller but Ruby on Rails has a separate entity called controllers that manage the task of interpreting the user interactions and routing to the correct method that handles the request. That is why Django is said to follow the MVT(Model View Template) framework and Ruby on Rails strictly follows MVC framework.&lt;br /&gt;
&lt;br /&gt;
==== Views: ====&lt;br /&gt;
In Django, the amount of code that can be pushed into the views(i.e., the template) part of the application is very stringent. Only basic codes like conditional statements and simple loops are allowed. As the controller objects are not really accessible in the views, not much of the manipulation can be done in the views section of the application. This enforces a strict modularity between the models, views and templates section in the Django application making the application maintenance easier. In case of Rails, as the controller objects are accessible in the views as well, a lot of unnecessary calculations can be included in the views. This reduces modularity in the application. Thus, Django has an upper hand over Rails for this reason.&lt;br /&gt;
&lt;br /&gt;
==== Other Features ====&lt;br /&gt;
Django has in-built features like User authentication and admin support in its web applications. This makes developing admin based web application very easy. There is no such thing in Rails as such.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Django vs Web2py ===&lt;br /&gt;
&lt;br /&gt;
Web2py is inspired by Ruby on Rails. It supports Convention over Configuration just like Ruby on Rails. The administrative interface can be accessed from the browser for web2py. But, for Django, the developer has to manually configure everything.&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;&lt;br /&gt;
====Models====&lt;br /&gt;
Django doesn’t support migrations by itself(until 1.6). web2py supports database migrations. Also, many to many references between the tables are represented in a different way in Django and web2py. Django creates an intermediate link table whereas web2py includes the references as fields in the table.&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
Web2py manages all the imports, and other things related to project scaffolding by itself. The developer just has to focus on the application development unlike Django wherein the user has to take care of all the imports in the code. &lt;br /&gt;
&lt;br /&gt;
====Views====&lt;br /&gt;
If a view is undefined, then Django throws an error. But in case of web2py, it searches for mycontroller/index.html in the myapp. If that file is not present, then it creates a generic view which contains the raw response in a dictionary format on the browser.&lt;br /&gt;
&lt;br /&gt;
====Other features====&lt;br /&gt;
One feature, Transactions, is supported by both Django and web2py. But the way transaction “commits” are executed is different. Django has two options “auto-commit” and “commit_on_success”. But in case of web2py, it by default commits if the transaction is success and doesn’t commit in case of failure of the transaction.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87228</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 8 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87228"/>
		<updated>2014-09-19T23:50:19Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* History */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Django Framework''' ==  &lt;br /&gt;
&lt;br /&gt;
Django&amp;lt;ref&amp;gt;https://www.djangoproject.com/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.djangobook.com/en/2.0/index.html&amp;lt;/ref&amp;gt;(2005) is a high level, but heavy, open source Python&amp;lt;ref&amp;gt;http://www.python.org/&amp;lt;/ref&amp;gt; web framework used to build a large scale web application. Django is named after Django Reinhardt, a gypsy jazz guitarist from the 1930s to early 1950s. A web framework is necessary to help the developers and the testers to develop highly scalable and efficient large scale web applications. Django deals with the most important problem in the domain of Web development – repetition. Even though web development is a really interesting task, there are a lot of things that require unnecessary efforts and time of the developers as well as the testers. With an MVT&amp;lt;ref&amp;gt;http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names&amp;lt;/ref&amp;gt; (Model View Template) Framework, Django is very modular and thus very much suitable for highly cohesive&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Cohesion_(computer_science)&amp;lt;/ref&amp;gt; and low coupling&amp;lt;ref&amp;gt; http://en.wikipedia.org/wiki/Coupling_(computer_programming)&amp;lt;/ref&amp;gt; tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== '''History''' ==&lt;br /&gt;
In 1998, Python CGI&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/CGI&amp;lt;/ref&amp;gt; was used to develop web applications from scratch using Python. In order to create a web application using Python CGI, we just have to create a Python script that generates output in the HTML format. We then save the script to a Web server with a &amp;lt;code&amp;gt;“.cgi”&amp;lt;/code&amp;gt; extension and visit the page in our Web browser. Following is the sample way of creating a simple website using the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import MySQLdb&lt;br /&gt;
print &amp;quot;Content-Type: text/html\n&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Food items&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;body&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;h1&amp;gt;Food items&amp;lt;/h1&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
connection = MySQLdb.connect(user='username', passwd='password', db='food_db')&lt;br /&gt;
cursor = connection.cursor()&lt;br /&gt;
cursor.execute(&amp;quot;SELECT food_item_name FROM food_table ORDER BY rating DESC LIMIT 10&amp;quot;)&lt;br /&gt;
for row in cursor.fetchall():&lt;br /&gt;
	print &amp;quot;&amp;lt;li&amp;gt;%s&amp;lt;/li&amp;gt;&amp;quot; % row[0]&lt;br /&gt;
print &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
connection.close()&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The above script generates an HTML page which will display a list of all the food items in the descending order of their rating by interacting with the corresponding table in the database.&lt;br /&gt;
&lt;br /&gt;
Even though the code has several advantages such as making a website (with only one page) from the scratch is not difficult. The code is readable and understandable to all audiences, etc. But this approach has a lot of disadvantages. The disadvantages include repetition of code (such as database connection, authentication, etc.) for a multi-page web application. Also, if discrete entities, like databases with different configuration, are to be included in the project then we will have to rewrite and reconfigure all the pages in the web application. Thus, using CGI for web application development makes it inefficient to build and deploy.&lt;br /&gt;
&lt;br /&gt;
Almost all of the problems posed by Python CGI scripting mentioned above were solved by Django. Django provided a programming infrastructure for large scale web applications, so that the developers can focus on writing clean, maintainable code without worrying about the different aspects of Project Scaffolding&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Scaffold_(programming)&amp;lt;/ref&amp;gt;. Based on the DRY&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Don't_repeat_yourself&amp;lt;/ref&amp;gt;(Don’t Repeat Yourself) principle, Django aims at reducing repetitive pieces of information of all kinds in software development. Django also supports pluggability of different applications into the web applications that you are developing.&lt;br /&gt;
&lt;br /&gt;
Also, Major websites such as [http://pinterest.com Pinterest], [http://instagram.com Instagram] were developed using Django.&lt;br /&gt;
&lt;br /&gt;
=== Other Frameworks ===&lt;br /&gt;
:*Flask&amp;lt;ref&amp;gt;http://flask.pocoo.org/&amp;lt;/ref&amp;gt;: It is a web framework that only provides the important and skeletal libraries required for basic web-development. Features such as data abstraction, unlike Django, is not provided by Flask.&lt;br /&gt;
:*Pyramid&amp;lt;ref&amp;gt;http://www.pylonsproject.org/projects/pyramid/about&amp;lt;/ref&amp;gt;: It is a web framework which strictly follows MVC pattern. It has an additional feature, unlike Django, of maintaining a dictionary of View-to-URL-Mapping.&lt;br /&gt;
:*web2py&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;: It is a web framework which follows the convention of Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:Django_layers.png|frame|right|alt = MVT Architecture|Django's Model-View-Template Achitecture]]&lt;br /&gt;
&lt;br /&gt;
Most of the web frameworks- such as Ruby on Rails framework- are based on the MVC pattern. MVC, which stands for Model View Controller, is a pattern which provides loose coupling among different parts of the application. In MVC Pattern, Model deals with the direct interaction with the databases. Views deal with the representation of the data on the browser. Controller deals with the user interactions and redirecting each of the user interactions to the respective module responsible for dealing with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand, Django framework does not really fit into the MVC framework. As mentioned earlier, it follows the MTV framework which stands for (Model Template View) Framework. Controller corresponds to the View in Django Framework. In case of the Views in Django, it plays the role of the controller. It fetches the data and decides how the data is to be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
&lt;br /&gt;
In Django terminology, an installation of Django is considered as a “Project”. &lt;br /&gt;
&lt;br /&gt;
The smallest logical subset of files/folders that is fairly independent from the rest of the project can be called as an application. These subset of files include (but are not limited to) models, views, templates, static files, URLs, etc. A single Django project can have multiple applications, each of which contains the files that define an application.&lt;br /&gt;
&lt;br /&gt;
All the applications that must be included inside the main project should be explicitly mentioned inside the variable &amp;lt;code&amp;gt;INSTALLED_APPS&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;INSTALLED_APPS = (&lt;br /&gt;
    'django.contrib.admin',&lt;br /&gt;
    'django.contrib.auth',&lt;br /&gt;
    'django.contrib.contenttypes',&lt;br /&gt;
    'django.contrib.sessions',&lt;br /&gt;
    'django.contrib.messages',&lt;br /&gt;
    'django.contrib.staticfiles',&lt;br /&gt;
    'books'&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
In Django, a model is defined as the single source for all the data. It defines how data is accessed, processed and validated. It also contains the structure and relationship of all the data that is used by the application. Models are used to define the structure of your database. Each model is converted into a database table and each attribute inside a model is converted into a column of that table. All this is handled by Django implicitly.&lt;br /&gt;
&lt;br /&gt;
Consider the following example about an application called ‘books’ that contains:&lt;br /&gt;
:*Author: which has a first_name and last_name attributes&lt;br /&gt;
:*Book: which has title, author and publication date as its attributes&lt;br /&gt;
&lt;br /&gt;
We can write models for the above application like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;class Author(models.Model):&lt;br /&gt;
   first_name = models.CharField(max_length=30)&lt;br /&gt;
   last_name = models.CharField(max_length=40)&lt;br /&gt;
&lt;br /&gt;
class Book(models.Model):&lt;br /&gt;
   title = models.CharField(max_length=100)&lt;br /&gt;
   authors = models.ManyToManyField(Author)&lt;br /&gt;
   publication_date = models.DateField()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all the models for your application have been created, you can validate them by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py validate &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Django also dynamically generates “Create Table” statements for each of these models. These statement can be viewed using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py sqlall &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above command would give the following output:&lt;br /&gt;
&amp;lt;pre&amp;gt;BEGIN;&lt;br /&gt;
CREATE TABLE &amp;quot;books_author&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;first_name&amp;quot; varchar(30) NOT NULL,&lt;br /&gt;
    &amp;quot;last_name&amp;quot; varchar(40) NOT NULL,&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;title&amp;quot; varchar(100) NOT NULL,&lt;br /&gt;
    &amp;quot;publication_date&amp;quot; date NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book_authors&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;book_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_book&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    &amp;quot;author_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_author&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    UNIQUE (&amp;quot;book_id&amp;quot;, &amp;quot;author_id&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
COMMIT;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and all the tables would be created immediately as soon as you run the command stated below:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py syncdb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
The front-end of the web-application is equally important as the model and the controllers. The basic function of the view is to accept an HTTP request and send a response. Basically Django has two types of views – Generic Views &amp;amp; Class based views. Generic views just take one parameter – “request”. Following is the format of the code to display Hello World.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from django.http import HttpResponse&lt;br /&gt;
    	def hello_world(request)&lt;br /&gt;
                    	return HttpResponse(“hello world”)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the method class hello_world has a parameter called “request”. This is the parameter that contains all the information of the HttpRequest. After the request has been processed, the HttpResponse object is returned back. This HttpResponse object is initialized with the string “hello world”.&lt;br /&gt;
&lt;br /&gt;
Generic views mostly consist of functions. Maintaining a program with a lot of functions is difficult. This reduces the modularity of the program. In order to support classes, Class based views were introduced. Class based views consist of classes which handle all the functionality in the front end. Classes are extensible and hence reusable. We can inherit different views(classes) and include it in our class. For example, if we want to include a view which displays the contacts, we will write the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;from django.views.generic import ListView&lt;br /&gt;
from books.models import contacts&lt;br /&gt;
class ContactsList(ListView)&lt;br /&gt;
    	model = contacts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above program, we have imported the ListView from the generic module. As we want to display the contacts from the database, we have imported the database “contacts”. The class ContactsList inherits the ListView class and extracts all the functionality in that class. The “contacts” database is imported and assigned to the model so as to display the contacts in the form of a list view.&lt;br /&gt;
&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function.&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function. In order to do that, we will have to write the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    	from django.conf.urls.defaults import patterns, include, url&lt;br /&gt;
    	from hellworldproject.views import hello&lt;br /&gt;
    	urlpatterns = patterns(‘’. url(r’hello_world/$, hello_world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code, the “pattern” function saves the required URL pattern in the “urlpatters” attribute.&lt;br /&gt;
So, after everything is set up, we run our web application with a url say &amp;lt;code&amp;gt;[web-address]/hello_world/&amp;lt;/code&amp;gt;. Now, Django first goes to the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt; file in the project directory and searches for the files which handles the URLConf part. Suppose the name of the files is &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It dives into the urls.py files and linearly matches the requested url with the url patterns in the file and checks which method call is responsible to handle the request. After that, when it finds the method(here, hello_world), it passes an HttpRequest object to the method. After the required processing the request, it creates an HttpResponse object and then continues with the further processes the response by converting it into HTML code by adding the necessary formatting to the response in order for it to be displayed as a view on the screen.&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
In Django, templates are generally used to define how webpages of the application are supposed to look like. Template defines the structure of the webpage and also has additional elements that help access variables, run python statements and much more.&lt;br /&gt;
&lt;br /&gt;
Data can be passed to templates which can be used by the templates to display to the user or perform actions on the data and create dynamic views based on the data.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
We can access any data passed to the templates and use them as regular python variables. The below lines of code shows how variables can be accessed:&lt;br /&gt;
&amp;lt;pre&amp;gt;Author: {{author.last_name}}, {{ author.first_name }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will just print the author’s name on the webpage.&lt;br /&gt;
&lt;br /&gt;
==== Tags ====&lt;br /&gt;
Templates also provide the ability to write python code inside them and execute them just like they would run inside a &amp;lt;code&amp;gt;“.py”&amp;lt;/code&amp;gt; file. These elements are known as tags and look like &amp;lt;code&amp;gt;{% tag %}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given below is the example of a “for” loop that is defined inside a template:&lt;br /&gt;
&amp;lt;pre&amp;gt;{% for book in books_list %}&lt;br /&gt;
    &amp;lt;li&amp;gt;{{ book.title }}&amp;lt;/li&amp;gt;&lt;br /&gt;
{% endfor %}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can process data (though it is not logical to do so in a template), write conditional statements or just declare variables inside tags and used them later in the template file.&lt;br /&gt;
&lt;br /&gt;
==== Filters ====&lt;br /&gt;
Filters in templates can be defined as helper functions. They are a very powerful tool that reduces the code needed for basic (or sometimes even complex) post-processing of data. &lt;br /&gt;
&lt;br /&gt;
For example, the title of a book could be added to your application as one of ‘HARRY POTTER’, ‘HaRrY pOtTeR’ or ‘harry potter’. To standardize the format of the book title which you want to show on your website, we can simply write&lt;br /&gt;
&amp;lt;pre&amp;gt;{{book.title|title }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which capitalizes the first character of each word and turn all other characters to lower.&lt;br /&gt;
&lt;br /&gt;
Django also provide the ability to write custom filters and make it available to all the templates in your application. Django provides template tags and filters to control internationalization in templates. They allow for granular control of translations, formatting, and time zone conversions.&lt;br /&gt;
&lt;br /&gt;
=== Admin Site ===&lt;br /&gt;
For a certain class of Web sites, an admin interface is an essential part of the infrastructure.&lt;br /&gt;
&lt;br /&gt;
This is a Web-based interface, limited to trusted site administrators, that enables the adding, editing and deletion of site content. So the admin site has to authenticate users, display and handle forms, validate input, and so on. But the best part about Django is that it does all of this and more for you – in just a few of lines of code. This is also one of the reasons why Django is called a “heavy” web development framework.&lt;br /&gt;
&lt;br /&gt;
To access the Django admin interface, we just have to add &amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt; to your project url. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin01.png|frame|center|alt = This is the login page of Django Admin Site|Django Admin site login page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would also have to create a superuser, which can be done by following the steps given below.&lt;br /&gt;
&amp;lt;pre&amp;gt;$ python manage.py createsuperuser&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the admin username and email address:&lt;br /&gt;
&amp;lt;pre&amp;gt;Username: admin&lt;br /&gt;
Email address: admin@example.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
Choose the password for the admin account:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Password: **********&lt;br /&gt;
    Password (again): *********&lt;br /&gt;
    Superuser created successfully.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin02.png|frame|center|alt = The default first page of the admin site|Default admin site home page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django contains a file called &amp;lt;code&amp;gt;admin.py&amp;lt;/code&amp;gt; where you can define models for the admin site and then enable them so that they will appear on the admin site.&lt;br /&gt;
Using the example of the Author Model described in the sections above, let us add it to the admin site:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class AuthorAdmin(admin.ModelAdmin):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
    admin.site.register(Author);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These out-of-the-box features of the Django framework is what makes it the perfect option for creating content driven websites in relatively no time at all.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
Django has the following features to name a few:&lt;br /&gt;
:*It facilitates developers with a template comprising minimal number of classes, modules, packages etc. so that the developers can focus more on the core business logic.&lt;br /&gt;
:*It contains an ORM (Object-Relational Mapper) that allows for the use of standard Python language. The developers need not learn any query processing language.&lt;br /&gt;
:*It provides with a template framework suitable for making the views.&lt;br /&gt;
:*It supports pluggability – that is it supports including other installed applications into your own application.&lt;br /&gt;
:*It has a built in administrative interface to manage the web application from an administrative level, thus providing access control.&lt;br /&gt;
:*It is multi-lingual&lt;br /&gt;
:*It supports a very useful Geographical web framework &amp;quot;GeoDjango&amp;quot;&amp;lt;ref&amp;gt;https://docs.djangoproject.com/en/1.6/ref/contrib/gis/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison with other web frameworks ==&lt;br /&gt;
=== Django vs Ruby on Rails ===&lt;br /&gt;
Most of the differences lie in the way the MVC pattern is interpreted by both the frameworks.&amp;lt;ref&amp;gt;https://bernardopires.com/2014/03/rails-vs-django-an-in-depth-technical-comparison/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Models:====&lt;br /&gt;
Everything in Ruby on Rails is based on migrations. If at any point of time, the schema of the database is changed and if it has to be reverted back to the previous schema then we can do that with the help of migrations. In case of Django, we need to depend on a third-party extension “South” (until Django 1.6) to support migrations.&lt;br /&gt;
&lt;br /&gt;
==== Controllers: ====&lt;br /&gt;
Django considers the entire framework as the controller but Ruby on Rails has a separate entity called controllers that manage the task of interpreting the user interactions and routing to the correct method that handles the request. That is why Django is said to follow the MVT(Model View Template) framework and Ruby on Rails strictly follows MVC framework.&lt;br /&gt;
&lt;br /&gt;
==== Views: ====&lt;br /&gt;
In Django, the amount of code that can be pushed into the views(i.e., the template) part of the application is very stringent. Only basic codes like conditional statements and simple loops are allowed. As the controller objects are not really accessible in the views, not much of the manipulation can be done in the views section of the application. This enforces a strict modularity between the models, views and templates section in the Django application making the application maintenance easier. In case of Rails, as the controller objects are accessible in the views as well, a lot of unnecessary calculations can be included in the views. This reduces modularity in the application. Thus, Django has an upper hand over Rails for this reason.&lt;br /&gt;
&lt;br /&gt;
==== Other Features ====&lt;br /&gt;
Django has in-built features like User authentication and admin support in its web applications. This makes developing admin based web application very easy. There is no such thing in Rails as such.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Django vs Web2py ===&lt;br /&gt;
&lt;br /&gt;
Web2py is inspired by Ruby on Rails. It supports Convention over Configuration just like Ruby on Rails. The administrative interface can be accessed from the browser for web2py. But, for Django, the developer has to manually configure everything.&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;&lt;br /&gt;
====Models====&lt;br /&gt;
Django doesn’t support migrations by itself(until 1.6). web2py supports database migrations. Also, many to many references between the tables are represented in a different way in Django and web2py. Django creates an intermediate link table whereas web2py includes the references as fields in the table.&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
Web2py manages all the imports, and other things related to project scaffolding by itself. The developer just has to focus on the application development unlike Django wherein the user has to take care of all the imports in the code. &lt;br /&gt;
&lt;br /&gt;
====Views====&lt;br /&gt;
If a view is undefined, then Django throws an error. But in case of web2py, it searches for mycontroller/index.html in the myapp. If that file is not present, then it creates a generic view which contains the raw response in a dictionary format on the browser.&lt;br /&gt;
&lt;br /&gt;
====Other features====&lt;br /&gt;
One feature, Transactions, is supported by both Django and web2py. But the way transaction “commits” are executed is different. Django has two options “auto-commit” and “commit_on_success”. But in case of web2py, it by default commits if the transaction is success and doesn’t commit in case of failure of the transaction.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87223</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 8 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87223"/>
		<updated>2014-09-19T23:48:28Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Comparison with other web frameworks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Django Framework''' ==  &lt;br /&gt;
&lt;br /&gt;
Django&amp;lt;ref&amp;gt;https://www.djangoproject.com/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.djangobook.com/en/2.0/index.html&amp;lt;/ref&amp;gt;(2005) is a high level, but heavy, open source Python&amp;lt;ref&amp;gt;http://www.python.org/&amp;lt;/ref&amp;gt; web framework used to build a large scale web application. Django is named after Django Reinhardt, a gypsy jazz guitarist from the 1930s to early 1950s. A web framework is necessary to help the developers and the testers to develop highly scalable and efficient large scale web applications. Django deals with the most important problem in the domain of Web development – repetition. Even though web development is a really interesting task, there are a lot of things that require unnecessary efforts and time of the developers as well as the testers. With an MVT&amp;lt;ref&amp;gt;http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names&amp;lt;/ref&amp;gt; (Model View Template) Framework, Django is very modular and thus very much suitable for highly cohesive&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Cohesion_(computer_science)&amp;lt;/ref&amp;gt; and low coupling&amp;lt;ref&amp;gt; http://en.wikipedia.org/wiki/Coupling_(computer_programming)&amp;lt;/ref&amp;gt; tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
In 1998, Python CGI&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/CGI&amp;lt;/ref&amp;gt; was used to develop web applications from scratch using Python. In order to create a web application using Python CGI, we just have to create a Python script that generates output in the HTML format. We then save the script to a Web server with a &amp;lt;code&amp;gt;“.cgi”&amp;lt;/code&amp;gt; extension and visit the page in our Web browser. Following is the sample way of creating a simple website using the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import MySQLdb&lt;br /&gt;
print &amp;quot;Content-Type: text/html\n&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Food items&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;body&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;h1&amp;gt;Food items&amp;lt;/h1&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
connection = MySQLdb.connect(user='username', passwd='password', db='food_db')&lt;br /&gt;
cursor = connection.cursor()&lt;br /&gt;
cursor.execute(&amp;quot;SELECT food_item_name FROM food_table ORDER BY rating DESC LIMIT 10&amp;quot;)&lt;br /&gt;
for row in cursor.fetchall():&lt;br /&gt;
	print &amp;quot;&amp;lt;li&amp;gt;%s&amp;lt;/li&amp;gt;&amp;quot; % row[0]&lt;br /&gt;
print &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
connection.close()&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The above script generates an HTML page which will display a list of all the food items in the descending order of their rating by interacting with the corresponding table in the database.&lt;br /&gt;
&lt;br /&gt;
Even though the code has several advantages such as making a website (with only one page) from the scratch is not difficult. The code is readable and understandable to all audiences, etc. But this approach has a lot of disadvantages. The disadvantages include repetition of code (such as database connection, authentication, etc.) for a multi-page web application. Also, if discrete entities, like databases with different configuration, are to be included in the project then we will have to rewrite and reconfigure all the pages in the web application. Thus, using CGI for web application development makes it inefficient to build and deploy.&lt;br /&gt;
&lt;br /&gt;
Almost all of the problems posed by Python CGI scripting mentioned above were solved by Django. Django provided a programming infrastructure for large scale web applications, so that the developers can focus on writing clean, maintainable code without worrying about the different aspects of Project Scaffolding&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Scaffold_(programming)&amp;lt;/ref&amp;gt;. Based on the DRY&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Don't_repeat_yourself&amp;lt;/ref&amp;gt;(Don’t Repeat Yourself) principle, Django aims at reducing repetitive pieces of information of all kinds in software development. Django also supports pluggability of different applications into the web applications that you are developing.&lt;br /&gt;
&lt;br /&gt;
Also, Major websites such as [http://pinterest.com Pinterest], [http://instagram.com Instagram] were developed using Django.&lt;br /&gt;
&lt;br /&gt;
=== Other Frameworks ===&lt;br /&gt;
:*Flask&amp;lt;ref&amp;gt;http://flask.pocoo.org/&amp;lt;/ref&amp;gt;: It is a web framework that only provides the important and skeletal libraries required for basic web-development. Features such as data abstraction, unlike Django, is not provided by Flask.&lt;br /&gt;
:*Pyramid&amp;lt;ref&amp;gt;http://www.pylonsproject.org/projects/pyramid/about&amp;lt;/ref&amp;gt;: It is a web framework which strictly follows MVC pattern. It has an additional feature, unlike Django, of maintaining a dictionary of View-to-URL-Mapping.&lt;br /&gt;
:*web2py&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;: It is a web framework which follows the convention of Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:Django_layers.png|frame|right|alt = MVT Architecture|Django's Model-View-Template Achitecture]]&lt;br /&gt;
&lt;br /&gt;
Most of the web frameworks- such as Ruby on Rails framework- are based on the MVC pattern. MVC, which stands for Model View Controller, is a pattern which provides loose coupling among different parts of the application. In MVC Pattern, Model deals with the direct interaction with the databases. Views deal with the representation of the data on the browser. Controller deals with the user interactions and redirecting each of the user interactions to the respective module responsible for dealing with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand, Django framework does not really fit into the MVC framework. As mentioned earlier, it follows the MTV framework which stands for (Model Template View) Framework. Controller corresponds to the View in Django Framework. In case of the Views in Django, it plays the role of the controller. It fetches the data and decides how the data is to be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
&lt;br /&gt;
In Django terminology, an installation of Django is considered as a “Project”. &lt;br /&gt;
&lt;br /&gt;
The smallest logical subset of files/folders that is fairly independent from the rest of the project can be called as an application. These subset of files include (but are not limited to) models, views, templates, static files, URLs, etc. A single Django project can have multiple applications, each of which contains the files that define an application.&lt;br /&gt;
&lt;br /&gt;
All the applications that must be included inside the main project should be explicitly mentioned inside the variable &amp;lt;code&amp;gt;INSTALLED_APPS&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;INSTALLED_APPS = (&lt;br /&gt;
    'django.contrib.admin',&lt;br /&gt;
    'django.contrib.auth',&lt;br /&gt;
    'django.contrib.contenttypes',&lt;br /&gt;
    'django.contrib.sessions',&lt;br /&gt;
    'django.contrib.messages',&lt;br /&gt;
    'django.contrib.staticfiles',&lt;br /&gt;
    'books'&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
In Django, a model is defined as the single source for all the data. It defines how data is accessed, processed and validated. It also contains the structure and relationship of all the data that is used by the application. Models are used to define the structure of your database. Each model is converted into a database table and each attribute inside a model is converted into a column of that table. All this is handled by Django implicitly.&lt;br /&gt;
&lt;br /&gt;
Consider the following example about an application called ‘books’ that contains:&lt;br /&gt;
:*Author: which has a first_name and last_name attributes&lt;br /&gt;
:*Book: which has title, author and publication date as its attributes&lt;br /&gt;
&lt;br /&gt;
We can write models for the above application like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;class Author(models.Model):&lt;br /&gt;
   first_name = models.CharField(max_length=30)&lt;br /&gt;
   last_name = models.CharField(max_length=40)&lt;br /&gt;
&lt;br /&gt;
class Book(models.Model):&lt;br /&gt;
   title = models.CharField(max_length=100)&lt;br /&gt;
   authors = models.ManyToManyField(Author)&lt;br /&gt;
   publication_date = models.DateField()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all the models for your application have been created, you can validate them by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py validate &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Django also dynamically generates “Create Table” statements for each of these models. These statement can be viewed using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py sqlall &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above command would give the following output:&lt;br /&gt;
&amp;lt;pre&amp;gt;BEGIN;&lt;br /&gt;
CREATE TABLE &amp;quot;books_author&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;first_name&amp;quot; varchar(30) NOT NULL,&lt;br /&gt;
    &amp;quot;last_name&amp;quot; varchar(40) NOT NULL,&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;title&amp;quot; varchar(100) NOT NULL,&lt;br /&gt;
    &amp;quot;publication_date&amp;quot; date NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book_authors&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;book_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_book&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    &amp;quot;author_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_author&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    UNIQUE (&amp;quot;book_id&amp;quot;, &amp;quot;author_id&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
COMMIT;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and all the tables would be created immediately as soon as you run the command stated below:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py syncdb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
The front-end of the web-application is equally important as the model and the controllers. The basic function of the view is to accept an HTTP request and send a response. Basically Django has two types of views – Generic Views &amp;amp; Class based views. Generic views just take one parameter – “request”. Following is the format of the code to display Hello World.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from django.http import HttpResponse&lt;br /&gt;
    	def hello_world(request)&lt;br /&gt;
                    	return HttpResponse(“hello world”)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the method class hello_world has a parameter called “request”. This is the parameter that contains all the information of the HttpRequest. After the request has been processed, the HttpResponse object is returned back. This HttpResponse object is initialized with the string “hello world”.&lt;br /&gt;
&lt;br /&gt;
Generic views mostly consist of functions. Maintaining a program with a lot of functions is difficult. This reduces the modularity of the program. In order to support classes, Class based views were introduced. Class based views consist of classes which handle all the functionality in the front end. Classes are extensible and hence reusable. We can inherit different views(classes) and include it in our class. For example, if we want to include a view which displays the contacts, we will write the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;from django.views.generic import ListView&lt;br /&gt;
from books.models import contacts&lt;br /&gt;
class ContactsList(ListView)&lt;br /&gt;
    	model = contacts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above program, we have imported the ListView from the generic module. As we want to display the contacts from the database, we have imported the database “contacts”. The class ContactsList inherits the ListView class and extracts all the functionality in that class. The “contacts” database is imported and assigned to the model so as to display the contacts in the form of a list view.&lt;br /&gt;
&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function.&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function. In order to do that, we will have to write the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    	from django.conf.urls.defaults import patterns, include, url&lt;br /&gt;
    	from hellworldproject.views import hello&lt;br /&gt;
    	urlpatterns = patterns(‘’. url(r’hello_world/$, hello_world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code, the “pattern” function saves the required URL pattern in the “urlpatters” attribute.&lt;br /&gt;
So, after everything is set up, we run our web application with a url say &amp;lt;code&amp;gt;[web-address]/hello_world/&amp;lt;/code&amp;gt;. Now, Django first goes to the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt; file in the project directory and searches for the files which handles the URLConf part. Suppose the name of the files is &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It dives into the urls.py files and linearly matches the requested url with the url patterns in the file and checks which method call is responsible to handle the request. After that, when it finds the method(here, hello_world), it passes an HttpRequest object to the method. After the required processing the request, it creates an HttpResponse object and then continues with the further processes the response by converting it into HTML code by adding the necessary formatting to the response in order for it to be displayed as a view on the screen.&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
In Django, templates are generally used to define how webpages of the application are supposed to look like. Template defines the structure of the webpage and also has additional elements that help access variables, run python statements and much more.&lt;br /&gt;
&lt;br /&gt;
Data can be passed to templates which can be used by the templates to display to the user or perform actions on the data and create dynamic views based on the data.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
We can access any data passed to the templates and use them as regular python variables. The below lines of code shows how variables can be accessed:&lt;br /&gt;
&amp;lt;pre&amp;gt;Author: {{author.last_name}}, {{ author.first_name }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will just print the author’s name on the webpage.&lt;br /&gt;
&lt;br /&gt;
==== Tags ====&lt;br /&gt;
Templates also provide the ability to write python code inside them and execute them just like they would run inside a &amp;lt;code&amp;gt;“.py”&amp;lt;/code&amp;gt; file. These elements are known as tags and look like &amp;lt;code&amp;gt;{% tag %}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given below is the example of a “for” loop that is defined inside a template:&lt;br /&gt;
&amp;lt;pre&amp;gt;{% for book in books_list %}&lt;br /&gt;
    &amp;lt;li&amp;gt;{{ book.title }}&amp;lt;/li&amp;gt;&lt;br /&gt;
{% endfor %}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can process data (though it is not logical to do so in a template), write conditional statements or just declare variables inside tags and used them later in the template file.&lt;br /&gt;
&lt;br /&gt;
==== Filters ====&lt;br /&gt;
Filters in templates can be defined as helper functions. They are a very powerful tool that reduces the code needed for basic (or sometimes even complex) post-processing of data. &lt;br /&gt;
&lt;br /&gt;
For example, the title of a book could be added to your application as one of ‘HARRY POTTER’, ‘HaRrY pOtTeR’ or ‘harry potter’. To standardize the format of the book title which you want to show on your website, we can simply write&lt;br /&gt;
&amp;lt;pre&amp;gt;{{book.title|title }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which capitalizes the first character of each word and turn all other characters to lower.&lt;br /&gt;
&lt;br /&gt;
Django also provide the ability to write custom filters and make it available to all the templates in your application. Django provides template tags and filters to control internationalization in templates. They allow for granular control of translations, formatting, and time zone conversions.&lt;br /&gt;
&lt;br /&gt;
=== Admin Site ===&lt;br /&gt;
For a certain class of Web sites, an admin interface is an essential part of the infrastructure.&lt;br /&gt;
&lt;br /&gt;
This is a Web-based interface, limited to trusted site administrators, that enables the adding, editing and deletion of site content. So the admin site has to authenticate users, display and handle forms, validate input, and so on. But the best part about Django is that it does all of this and more for you – in just a few of lines of code. This is also one of the reasons why Django is called a “heavy” web development framework.&lt;br /&gt;
&lt;br /&gt;
To access the Django admin interface, we just have to add &amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt; to your project url. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin01.png|frame|center|alt = This is the login page of Django Admin Site|Django Admin site login page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would also have to create a superuser, which can be done by following the steps given below.&lt;br /&gt;
&amp;lt;pre&amp;gt;$ python manage.py createsuperuser&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the admin username and email address:&lt;br /&gt;
&amp;lt;pre&amp;gt;Username: admin&lt;br /&gt;
Email address: admin@example.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
Choose the password for the admin account:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Password: **********&lt;br /&gt;
    Password (again): *********&lt;br /&gt;
    Superuser created successfully.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin02.png|frame|center|alt = The default first page of the admin site|Default admin site home page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django contains a file called &amp;lt;code&amp;gt;admin.py&amp;lt;/code&amp;gt; where you can define models for the admin site and then enable them so that they will appear on the admin site.&lt;br /&gt;
Using the example of the Author Model described in the sections above, let us add it to the admin site:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class AuthorAdmin(admin.ModelAdmin):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
    admin.site.register(Author);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These out-of-the-box features of the Django framework is what makes it the perfect option for creating content driven websites in relatively no time at all.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
Django has the following features to name a few:&lt;br /&gt;
:*It facilitates developers with a template comprising minimal number of classes, modules, packages etc. so that the developers can focus more on the core business logic.&lt;br /&gt;
:*It contains an ORM (Object-Relational Mapper) that allows for the use of standard Python language. The developers need not learn any query processing language.&lt;br /&gt;
:*It provides with a template framework suitable for making the views.&lt;br /&gt;
:*It supports pluggability – that is it supports including other installed applications into your own application.&lt;br /&gt;
:*It has a built in administrative interface to manage the web application from an administrative level, thus providing access control.&lt;br /&gt;
:*It is multi-lingual&lt;br /&gt;
:*It supports a very useful Geographical web framework &amp;quot;GeoDjango&amp;quot;&amp;lt;ref&amp;gt;https://docs.djangoproject.com/en/1.6/ref/contrib/gis/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison with other web frameworks ==&lt;br /&gt;
=== Django vs Ruby on Rails ===&lt;br /&gt;
Most of the differences lie in the way the MVC pattern is interpreted by both the frameworks.&amp;lt;ref&amp;gt;https://bernardopires.com/2014/03/rails-vs-django-an-in-depth-technical-comparison/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Models:====&lt;br /&gt;
Everything in Ruby on Rails is based on migrations. If at any point of time, the schema of the database is changed and if it has to be reverted back to the previous schema then we can do that with the help of migrations. In case of Django, we need to depend on a third-party extension “South” (until Django 1.6) to support migrations.&lt;br /&gt;
&lt;br /&gt;
==== Controllers: ====&lt;br /&gt;
Django considers the entire framework as the controller but Ruby on Rails has a separate entity called controllers that manage the task of interpreting the user interactions and routing to the correct method that handles the request. That is why Django is said to follow the MVT(Model View Template) framework and Ruby on Rails strictly follows MVC framework.&lt;br /&gt;
&lt;br /&gt;
==== Views: ====&lt;br /&gt;
In Django, the amount of code that can be pushed into the views(i.e., the template) part of the application is very stringent. Only basic codes like conditional statements and simple loops are allowed. As the controller objects are not really accessible in the views, not much of the manipulation can be done in the views section of the application. This enforces a strict modularity between the models, views and templates section in the Django application making the application maintenance easier. In case of Rails, as the controller objects are accessible in the views as well, a lot of unnecessary calculations can be included in the views. This reduces modularity in the application. Thus, Django has an upper hand over Rails for this reason.&lt;br /&gt;
&lt;br /&gt;
==== Other Features ====&lt;br /&gt;
Django has in-built features like User authentication and admin support in its web applications. This makes developing admin based web application very easy. There is no such thing in Rails as such.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Django vs Web2py ===&lt;br /&gt;
&lt;br /&gt;
Web2py is inspired by Ruby on Rails. It supports Convention over Configuration just like Ruby on Rails. The administrative interface can be accessed from the browser for web2py. But, for Django, the developer has to manually configure everything.&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;&lt;br /&gt;
====Models====&lt;br /&gt;
Django doesn’t support migrations by itself(until 1.6). web2py supports database migrations. Also, many to many references between the tables are represented in a different way in Django and web2py. Django creates an intermediate link table whereas web2py includes the references as fields in the table.&lt;br /&gt;
&lt;br /&gt;
====Controllers====&lt;br /&gt;
Web2py manages all the imports, and other things related to project scaffolding by itself. The developer just has to focus on the application development unlike Django wherein the user has to take care of all the imports in the code. &lt;br /&gt;
&lt;br /&gt;
====Views====&lt;br /&gt;
If a view is undefined, then Django throws an error. But in case of web2py, it searches for mycontroller/index.html in the myapp. If that file is not present, then it creates a generic view which contains the raw response in a dictionary format on the browser.&lt;br /&gt;
&lt;br /&gt;
====Other features====&lt;br /&gt;
One feature, Transactions, is supported by both Django and web2py. But the way transaction “commits” are executed is different. Django has two options “auto-commit” and “commit_on_success”. But in case of web2py, it by default commits if the transaction is success and doesn’t commit in case of failure of the transaction.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87187</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 8 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_8_sn&amp;diff=87187"/>
		<updated>2014-09-19T23:29:55Z</updated>

		<summary type="html">&lt;p&gt;Sbastik: /* Django vs Ruby on Rails */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Django Framework''' ==  &lt;br /&gt;
&lt;br /&gt;
Django&amp;lt;ref&amp;gt;https://www.djangoproject.com/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://www.djangobook.com/en/2.0/index.html&amp;lt;/ref&amp;gt;(2005) is a high level, but heavy, open source Python&amp;lt;ref&amp;gt;http://www.python.org/&amp;lt;/ref&amp;gt; web framework used to build a large scale web application. Django is named after Django Reinhardt, a gypsy jazz guitarist from the 1930s to early 1950s. A web framework is necessary to help the developers and the testers to develop highly scalable and efficient large scale web applications. Django deals with the most important problem in the domain of Web development – repetition. Even though web development is a really interesting task, there are a lot of things that require unnecessary efforts and time of the developers as well as the testers. With an MVT&amp;lt;ref&amp;gt;http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names&amp;lt;/ref&amp;gt; (Model View Template) Framework, Django is very modular and thus very much suitable for highly cohesive&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Cohesion_(computer_science)&amp;lt;/ref&amp;gt; and low coupling&amp;lt;ref&amp;gt; http://en.wikipedia.org/wiki/Coupling_(computer_programming)&amp;lt;/ref&amp;gt; tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
In 1998, Python CGI&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/CGI&amp;lt;/ref&amp;gt; was used to develop web applications from scratch using Python. In order to create a web application using Python CGI, we just have to create a Python script that generates output in the HTML format. We then save the script to a Web server with a &amp;lt;code&amp;gt;“.cgi”&amp;lt;/code&amp;gt; extension and visit the page in our Web browser. Following is the sample way of creating a simple website using the script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
import MySQLdb&lt;br /&gt;
print &amp;quot;Content-Type: text/html\n&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Food items&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;body&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;h1&amp;gt;Food items&amp;lt;/h1&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;ul&amp;gt;&amp;quot;&lt;br /&gt;
connection = MySQLdb.connect(user='username', passwd='password', db='food_db')&lt;br /&gt;
cursor = connection.cursor()&lt;br /&gt;
cursor.execute(&amp;quot;SELECT food_item_name FROM food_table ORDER BY rating DESC LIMIT 10&amp;quot;)&lt;br /&gt;
for row in cursor.fetchall():&lt;br /&gt;
	print &amp;quot;&amp;lt;li&amp;gt;%s&amp;lt;/li&amp;gt;&amp;quot; % row[0]&lt;br /&gt;
print &amp;quot;&amp;lt;/ul&amp;gt;&amp;quot;&lt;br /&gt;
print &amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;br /&gt;
connection.close()&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The above script generates an HTML page which will display a list of all the food items in the descending order of their rating by interacting with the corresponding table in the database.&lt;br /&gt;
&lt;br /&gt;
Even though the code has several advantages such as making a website (with only one page) from the scratch is not difficult. The code is readable and understandable to all audiences, etc. But this approach has a lot of disadvantages. The disadvantages include repetition of code (such as database connection, authentication, etc.) for a multi-page web application. Also, if discrete entities, like databases with different configuration, are to be included in the project then we will have to rewrite and reconfigure all the pages in the web application. Thus, using CGI for web application development makes it inefficient to build and deploy.&lt;br /&gt;
&lt;br /&gt;
Almost all of the problems posed by Python CGI scripting mentioned above were solved by Django. Django provided a programming infrastructure for large scale web applications, so that the developers can focus on writing clean, maintainable code without worrying about the different aspects of Project Scaffolding&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Scaffold_(programming)&amp;lt;/ref&amp;gt;. Based on the DRY&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Don't_repeat_yourself&amp;lt;/ref&amp;gt;(Don’t Repeat Yourself) principle, Django aims at reducing repetitive pieces of information of all kinds in software development. Django also supports pluggability of different applications into the web applications that you are developing.&lt;br /&gt;
&lt;br /&gt;
Also, Major websites such as [http://pinterest.com Pinterest], [http://instagram.com Instagram] were developed using Django.&lt;br /&gt;
&lt;br /&gt;
=== Other Frameworks ===&lt;br /&gt;
:*Flask&amp;lt;ref&amp;gt;http://flask.pocoo.org/&amp;lt;/ref&amp;gt;: It is a web framework that only provides the important and skeletal libraries required for basic web-development. Features such as data abstraction, unlike Django, is not provided by Flask.&lt;br /&gt;
:*Pyramid&amp;lt;ref&amp;gt;http://www.pylonsproject.org/projects/pyramid/about&amp;lt;/ref&amp;gt;: It is a web framework which strictly follows MVC pattern. It has an additional feature, unlike Django, of maintaining a dictionary of View-to-URL-Mapping.&lt;br /&gt;
:*web2py&amp;lt;ref&amp;gt;http://www.web2py.com/init/default/what&amp;lt;/ref&amp;gt;: It is a web framework which follows the convention of Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[File:Django_layers.png|frame|right|alt = MVT Architecture|Django's Model-View-Template Achitecture]]&lt;br /&gt;
&lt;br /&gt;
Most of the web frameworks- such as Ruby on Rails framework- are based on the MVC pattern. MVC, which stands for Model View Controller, is a pattern which provides loose coupling among different parts of the application. In MVC Pattern, Model deals with the direct interaction with the databases. Views deal with the representation of the data on the browser. Controller deals with the user interactions and redirecting each of the user interactions to the respective module responsible for dealing with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the other hand, Django framework does not really fit into the MVC framework. As mentioned earlier, it follows the MTV framework which stands for (Model Template View) Framework. Controller corresponds to the View in Django Framework. In case of the Views in Django, it plays the role of the controller. It fetches the data and decides how the data is to be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
&lt;br /&gt;
In Django terminology, an installation of Django is considered as a “Project”. &lt;br /&gt;
&lt;br /&gt;
The smallest logical subset of files/folders that is fairly independent from the rest of the project can be called as an application. These subset of files include (but are not limited to) models, views, templates, static files, URLs, etc. A single Django project can have multiple applications, each of which contains the files that define an application.&lt;br /&gt;
&lt;br /&gt;
All the applications that must be included inside the main project should be explicitly mentioned inside the variable &amp;lt;code&amp;gt;INSTALLED_APPS&amp;lt;/code&amp;gt; inside the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;INSTALLED_APPS = (&lt;br /&gt;
    'django.contrib.admin',&lt;br /&gt;
    'django.contrib.auth',&lt;br /&gt;
    'django.contrib.contenttypes',&lt;br /&gt;
    'django.contrib.sessions',&lt;br /&gt;
    'django.contrib.messages',&lt;br /&gt;
    'django.contrib.staticfiles',&lt;br /&gt;
    'books'&lt;br /&gt;
)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
&lt;br /&gt;
In Django, a model is defined as the single source for all the data. It defines how data is accessed, processed and validated. It also contains the structure and relationship of all the data that is used by the application. Models are used to define the structure of your database. Each model is converted into a database table and each attribute inside a model is converted into a column of that table. All this is handled by Django implicitly.&lt;br /&gt;
&lt;br /&gt;
Consider the following example about an application called ‘books’ that contains:&lt;br /&gt;
:*Author: which has a first_name and last_name attributes&lt;br /&gt;
:*Book: which has title, author and publication date as its attributes&lt;br /&gt;
&lt;br /&gt;
We can write models for the above application like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;class Author(models.Model):&lt;br /&gt;
   first_name = models.CharField(max_length=30)&lt;br /&gt;
   last_name = models.CharField(max_length=40)&lt;br /&gt;
&lt;br /&gt;
class Book(models.Model):&lt;br /&gt;
   title = models.CharField(max_length=100)&lt;br /&gt;
   authors = models.ManyToManyField(Author)&lt;br /&gt;
   publication_date = models.DateField()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all the models for your application have been created, you can validate them by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py validate &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Django also dynamically generates “Create Table” statements for each of these models. These statement can be viewed using the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py sqlall &amp;lt;app_name&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above command would give the following output:&lt;br /&gt;
&amp;lt;pre&amp;gt;BEGIN;&lt;br /&gt;
CREATE TABLE &amp;quot;books_author&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;first_name&amp;quot; varchar(30) NOT NULL,&lt;br /&gt;
    &amp;quot;last_name&amp;quot; varchar(40) NOT NULL,&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;title&amp;quot; varchar(100) NOT NULL,&lt;br /&gt;
    &amp;quot;publication_date&amp;quot; date NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;books_book_authors&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; serial NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;book_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_book&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    &amp;quot;author_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;books_author&amp;quot; (&amp;quot;id&amp;quot;) DEFERRABLE INITIALLY DEFERRED,&lt;br /&gt;
    UNIQUE (&amp;quot;book_id&amp;quot;, &amp;quot;author_id&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
COMMIT;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and all the tables would be created immediately as soon as you run the command stated below:&lt;br /&gt;
&amp;lt;pre&amp;gt;python manage.py syncdb&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
The front-end of the web-application is equally important as the model and the controllers. The basic function of the view is to accept an HTTP request and send a response. Basically Django has two types of views – Generic Views &amp;amp; Class based views. Generic views just take one parameter – “request”. Following is the format of the code to display Hello World.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from django.http import HttpResponse&lt;br /&gt;
    	def hello_world(request)&lt;br /&gt;
                    	return HttpResponse(“hello world”)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, the method class hello_world has a parameter called “request”. This is the parameter that contains all the information of the HttpRequest. After the request has been processed, the HttpResponse object is returned back. This HttpResponse object is initialized with the string “hello world”.&lt;br /&gt;
&lt;br /&gt;
Generic views mostly consist of functions. Maintaining a program with a lot of functions is difficult. This reduces the modularity of the program. In order to support classes, Class based views were introduced. Class based views consist of classes which handle all the functionality in the front end. Classes are extensible and hence reusable. We can inherit different views(classes) and include it in our class. For example, if we want to include a view which displays the contacts, we will write the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;from django.views.generic import ListView&lt;br /&gt;
from books.models import contacts&lt;br /&gt;
class ContactsList(ListView)&lt;br /&gt;
    	model = contacts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above program, we have imported the ListView from the generic module. As we want to display the contacts from the database, we have imported the database “contacts”. The class ContactsList inherits the ListView class and extracts all the functionality in that class. The “contacts” database is imported and assigned to the model so as to display the contacts in the form of a list view.&lt;br /&gt;
&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function.&lt;br /&gt;
Just making the views is not enough. We need to map the views with the URL requests. This is done in the URLConf file – &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It basically acts like a routing table to route the URL requests to the appropriate method call in the view.  Suppose we want to make Django aware that the function &amp;lt;code&amp;gt;hello_world()&amp;lt;/code&amp;gt; is actually a view function. In order to do that, we will have to write the following code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    	from django.conf.urls.defaults import patterns, include, url&lt;br /&gt;
    	from hellworldproject.views import hello&lt;br /&gt;
    	urlpatterns = patterns(‘’. url(r’hello_world/$, hello_world)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above code, the “pattern” function saves the required URL pattern in the “urlpatters” attribute.&lt;br /&gt;
So, after everything is set up, we run our web application with a url say &amp;lt;code&amp;gt;[web-address]/hello_world/&amp;lt;/code&amp;gt;. Now, Django first goes to the &amp;lt;code&amp;gt;settings.py&amp;lt;/code&amp;gt; file in the project directory and searches for the files which handles the URLConf part. Suppose the name of the files is &amp;lt;code&amp;gt;urls.py&amp;lt;/code&amp;gt;. It dives into the urls.py files and linearly matches the requested url with the url patterns in the file and checks which method call is responsible to handle the request. After that, when it finds the method(here, hello_world), it passes an HttpRequest object to the method. After the required processing the request, it creates an HttpResponse object and then continues with the further processes the response by converting it into HTML code by adding the necessary formatting to the response in order for it to be displayed as a view on the screen.&lt;br /&gt;
&lt;br /&gt;
=== Templates ===&lt;br /&gt;
In Django, templates are generally used to define how webpages of the application are supposed to look like. Template defines the structure of the webpage and also has additional elements that help access variables, run python statements and much more.&lt;br /&gt;
&lt;br /&gt;
Data can be passed to templates which can be used by the templates to display to the user or perform actions on the data and create dynamic views based on the data.&lt;br /&gt;
&lt;br /&gt;
==== Variables ====&lt;br /&gt;
We can access any data passed to the templates and use them as regular python variables. The below lines of code shows how variables can be accessed:&lt;br /&gt;
&amp;lt;pre&amp;gt;Author: {{author.last_name}}, {{ author.first_name }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will just print the author’s name on the webpage.&lt;br /&gt;
&lt;br /&gt;
==== Tags ====&lt;br /&gt;
Templates also provide the ability to write python code inside them and execute them just like they would run inside a &amp;lt;code&amp;gt;“.py”&amp;lt;/code&amp;gt; file. These elements are known as tags and look like &amp;lt;code&amp;gt;{% tag %}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given below is the example of a “for” loop that is defined inside a template:&lt;br /&gt;
&amp;lt;pre&amp;gt;{% for book in books_list %}&lt;br /&gt;
    &amp;lt;li&amp;gt;{{ book.title }}&amp;lt;/li&amp;gt;&lt;br /&gt;
{% endfor %}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can process data (though it is not logical to do so in a template), write conditional statements or just declare variables inside tags and used them later in the template file.&lt;br /&gt;
&lt;br /&gt;
==== Filters ====&lt;br /&gt;
Filters in templates can be defined as helper functions. They are a very powerful tool that reduces the code needed for basic (or sometimes even complex) post-processing of data. &lt;br /&gt;
&lt;br /&gt;
For example, the title of a book could be added to your application as one of ‘HARRY POTTER’, ‘HaRrY pOtTeR’ or ‘harry potter’. To standardize the format of the book title which you want to show on your website, we can simply write&lt;br /&gt;
&amp;lt;pre&amp;gt;{{book.title|title }}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which capitalizes the first character of each word and turn all other characters to lower.&lt;br /&gt;
&lt;br /&gt;
Django also provide the ability to write custom filters and make it available to all the templates in your application. Django provides template tags and filters to control internationalization in templates. They allow for granular control of translations, formatting, and time zone conversions.&lt;br /&gt;
&lt;br /&gt;
=== Admin Site ===&lt;br /&gt;
For a certain class of Web sites, an admin interface is an essential part of the infrastructure.&lt;br /&gt;
&lt;br /&gt;
This is a Web-based interface, limited to trusted site administrators, that enables the adding, editing and deletion of site content. So the admin site has to authenticate users, display and handle forms, validate input, and so on. But the best part about Django is that it does all of this and more for you – in just a few of lines of code. This is also one of the reasons why Django is called a “heavy” web development framework.&lt;br /&gt;
&lt;br /&gt;
To access the Django admin interface, we just have to add &amp;lt;code&amp;gt;/admin&amp;lt;/code&amp;gt; to your project url. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin01.png|frame|center|alt = This is the login page of Django Admin Site|Django Admin site login page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would also have to create a superuser, which can be done by following the steps given below.&lt;br /&gt;
&amp;lt;pre&amp;gt;$ python manage.py createsuperuser&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enter the admin username and email address:&lt;br /&gt;
&amp;lt;pre&amp;gt;Username: admin&lt;br /&gt;
Email address: admin@example.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
Choose the password for the admin account:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    Password: **********&lt;br /&gt;
    Password (again): *********&lt;br /&gt;
    Superuser created successfully.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Admin02.png|frame|center|alt = The default first page of the admin site|Default admin site home page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Django contains a file called &amp;lt;code&amp;gt;admin.py&amp;lt;/code&amp;gt; where you can define models for the admin site and then enable them so that they will appear on the admin site.&lt;br /&gt;
Using the example of the Author Model described in the sections above, let us add it to the admin site:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    class AuthorAdmin(admin.ModelAdmin):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
    admin.site.register(Author);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These out-of-the-box features of the Django framework is what makes it the perfect option for creating content driven websites in relatively no time at all.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
Django has the following features to name a few:&lt;br /&gt;
:*It facilitates developers with a template comprising minimal number of classes, modules, packages etc. so that the developers can focus more on the core business logic.&lt;br /&gt;
:*It contains an ORM (Object-Relational Mapper) that allows for the use of standard Python language. The developers need not learn any query processing language.&lt;br /&gt;
:*It provides with a template framework suitable for making the views.&lt;br /&gt;
:*It supports pluggability – that is it supports including other installed applications into your own application.&lt;br /&gt;
:*It has a built in administrative interface to manage the web application from an administrative level, thus providing access control.&lt;br /&gt;
:*It is multi-lingual&lt;br /&gt;
:*It supports a very useful Geographical web framework &amp;quot;GeoDjango&amp;quot;&amp;lt;ref&amp;gt;https://docs.djangoproject.com/en/1.6/ref/contrib/gis/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparison with other web frameworks ==&lt;br /&gt;
=== Django vs Ruby on Rails ===&lt;br /&gt;
Most of the differences lie in the way the MVC pattern is interpreted by both the frameworks.&amp;lt;ref&amp;gt;https://bernardopires.com/2014/03/rails-vs-django-an-in-depth-technical-comparison/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Models:====&lt;br /&gt;
Everything in Ruby on Rails is based on migrations. If at any point of time, the schema of the database is changed and if it has to be reverted back to the previous schema then we can do that with the help of migrations. In case of Django, we need to depend on a third-party extension “South” (until Django 1.6) to support migrations.&lt;br /&gt;
&lt;br /&gt;
==== Controllers: ====&lt;br /&gt;
Django considers the entire framework as the controller but Ruby on Rails has a separate entity called controllers that manage the task of interpreting the user interactions and routing to the correct method that handles the request. That is why Django is said to follow the MVT(Model View Template) framework and Ruby on Rails strictly follows MVC framework.&lt;br /&gt;
&lt;br /&gt;
==== Views: ====&lt;br /&gt;
In Django, the amount of code that can be pushed into the views(i.e., the template) part of the application is very stringent. Only basic codes like conditional statements and simple loops are allowed. As the controller objects are not really accessible in the views, not much of the manipulation can be done in the views section of the application. This enforces a strict modularity between the models, views and templates section in the Django application making the application maintenance easier. In case of Rails, as the controller objects are accessible in the views as well, a lot of unnecessary calculations can be included in the views. This reduces modularity in the application. Thus, Django has an upper hand over Rails for this reason.&lt;br /&gt;
&lt;br /&gt;
==== Other Features ====&lt;br /&gt;
Django has in-built features like User authentication and admin support in its web applications. This makes developing admin based web application very easy. There is no such thing in Rails as such.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbastik</name></author>
	</entry>
</feed>