<?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=Samirajk</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=Samirajk"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Samirajk"/>
	<updated>2026-09-05T00:37:29Z</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=90406</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=90406"/>
		<updated>2014-10-29T04:08:48Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;http://en.wikipedia.org/wiki/Servo_(layout_engine)&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://en.wikipedia.org/wiki/Rust_(programming_language)&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;
= 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90405</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=90405"/>
		<updated>2014-10-29T04:07:47Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;http://en.wikipedia.org/wiki/Servo_(layout_engine)&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;
= 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90404</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=90404"/>
		<updated>2014-10-29T04:05:38Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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 [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;
= 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90402</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=90402"/>
		<updated>2014-10-29T04:03:08Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90399</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=90399"/>
		<updated>2014-10-29T04:00:47Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90398</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=90398"/>
		<updated>2014-10-29T04:00:31Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;
*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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90395</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=90395"/>
		<updated>2014-10-29T03:58:07Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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 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 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90394</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=90394"/>
		<updated>2014-10-29T03:57:28Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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 [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;
&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 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;
[[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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90393</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=90393"/>
		<updated>2014-10-29T03:56:50Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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 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;
[[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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90385</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=90385"/>
		<updated>2014-10-29T03:42:30Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;
= 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90380</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=90380"/>
		<updated>2014-10-29T03:38:12Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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 [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/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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90378</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=90378"/>
		<updated>2014-10-29T03:37:16Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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)&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90377</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=90377"/>
		<updated>2014-10-29T03:36:55Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90375</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=90375"/>
		<updated>2014-10-29T03:35:58Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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)&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 '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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90368</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=90368"/>
		<updated>2014-10-29T03:32:40Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;
[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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90362</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=90362"/>
		<updated>2014-10-29T03:29:52Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;, 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&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]]&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90361</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=90361"/>
		<updated>2014-10-29T03:28:24Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;, 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&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]]&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90358</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=90358"/>
		<updated>2014-10-29T03:26:53Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;, 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. 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]]&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90357</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=90357"/>
		<updated>2014-10-29T03:24:50Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;, 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 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]]&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90352</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=90352"/>
		<updated>2014-10-29T03:22:00Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* Implementing proper JS error reporting */&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]]&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90350</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=90350"/>
		<updated>2014-10-29T03:17:49Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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]]&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90349</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=90349"/>
		<updated>2014-10-29T03:17:11Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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]]&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|frame|left|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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90339</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=90339"/>
		<updated>2014-10-29T03:08:06Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;, 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;
*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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90335</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=90335"/>
		<updated>2014-10-29T03:06:12Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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;, 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90332</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=90332"/>
		<updated>2014-10-29T03:03:55Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* Implementing proper JS error reporting */&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;
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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90329</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=90329"/>
		<updated>2014-10-29T03:03:24Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* Implementing proper JS error reporting */&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/Debug_code#Print_debugging 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90323</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=90323"/>
		<updated>2014-10-29T02:59:48Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90322</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=90322"/>
		<updated>2014-10-29T02:59:27Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90320</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=90320"/>
		<updated>2014-10-29T02:58:56Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90319</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=90319"/>
		<updated>2014-10-29T02:58:38Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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 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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90317</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=90317"/>
		<updated>2014-10-29T02:57:32Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* References */&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;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90312</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=90312"/>
		<updated>2014-10-29T02:53:26Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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, 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;
&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90305</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=90305"/>
		<updated>2014-10-29T02:49:46Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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 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;
==='''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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90302</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=90302"/>
		<updated>2014-10-29T02:47:53Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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, 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;
&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>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90299</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=90299"/>
		<updated>2014-10-29T02:45:15Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* 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, 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;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90295</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=90295"/>
		<updated>2014-10-29T02:42:17Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: Created page with &amp;quot;= '''Implementing proper JS error reporting''' =  This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.  __TO...&amp;quot;&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;
&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;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Talk:CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90291</id>
		<title>Talk:CSC/ECE 517 Fall 2014/oss M1454 rss</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Talk:CSC/ECE_517_Fall_2014/oss_M1454_rss&amp;diff=90291"/>
		<updated>2014-10-29T02:41:04Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: Created page with &amp;quot;= '''Implementing proper JS error reporting''' =  This wiki page contains the implementation of JS error reporting for the Mozilla project using RUST  programming language.  __TO...&amp;quot;&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;
&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;
== Future work ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=88670</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=88670"/>
		<updated>2014-09-26T03:10:57Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* Comparison with other debugging tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Debugging&amp;lt;/ref&amp;gt; easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, debugging in rails using PRY is being explained.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, the ''require 'pry' '' and ''binding.pry'' lines need to be included in the program that needs to be debugged. The line ''binding.pry'' could be inserted at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. Changes could be made to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the ''step'' command would take us into ''method3'' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the ''step'' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the ''finish'' command. The ''finish'' command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in ''method3'', the ''finish'' command would complete the code execution in ''method3'' and return back to ''method2''.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another ''binding.pry'', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following ''binding.pry'' statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The ''show-doc'' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
:Interested people can learn more about using Pry as a debugger by watching the video [http://www.youtube.com/watch?v=o90CCPjcIKE tutorial].&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
Other Debuggers available in the market are:&lt;br /&gt;
:*[http://www.jetbrains.com/ruby/quickstart/ JetBrains RubyMine] Commercial but very easy to use windows based debugger. It supports Ruby versions from 1.8.6 to 2.1.&lt;br /&gt;
:*[http://komodoide.com/features/ Komodo] Commercial IDE used for Ruby and other languages like Perl and java. It has graphical debugger and supports multi-process debugging.&lt;br /&gt;
:*[http://www.jackkinsella.ie/2014/06/06/debugging-rails-with-chrome-devtools.html Chrome Dev-tools] The elements tab is used to debug and get rapid feedback about experimental design changes in HTML or CSS.&lt;br /&gt;
:*[http://www.jackkinsella.ie/2014/06/06/debugging-rails-with-memcached.html Memcached] In production environment this tool can be used in addition with Heroku to access detailed stats about Memcached usage to find if you have high hit rate or low eviction rate.&lt;br /&gt;
:*[http://www.jackkinsella.ie/2014/06/06/debugging-rails-with-operating-system-tools.html Operating System Tools] Mostly a mixture of commands used to debug only specific errors for example, Curl to debug URL's or G Debugger to debug infinite loops.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=88499</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=88499"/>
		<updated>2014-09-25T22:52:41Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* List of other commonly used commands: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Debugging&amp;lt;/ref&amp;gt; easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, debugging in rails using PRY is being explained.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, the ''require 'pry' '' and ''binding.pry'' lines need to be included in the program that needs to be debugged. The line ''binding.pry'' could be inserted at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. Changes could be made to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the ''step'' command would take us into ''method3'' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the ''step'' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the ''finish'' command. The ''finish'' command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in ''method3'', the ''finish'' command would complete the code execution in ''method3'' and return back to ''method2''.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another ''binding.pry'', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following ''binding.pry'' statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The ''show-doc'' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
:Interested people can learn more about using Pry as a debugger by watching the video [http://www.youtube.com/watch?v=o90CCPjcIKE tutorial].&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
[http://www.jackkinsella.ie/2014/06/06/debugging-rails-with-pry-debugger.html This website has a lot of comparison between Pry Debugger with other debuggers available in market.]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=88498</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=88498"/>
		<updated>2014-09-25T22:50:43Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* Introduction to Pry debugger */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Debugging&amp;lt;/ref&amp;gt; easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, debugging in rails using PRY is being explained.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, the ''require 'pry' '' and ''binding.pry'' lines need to be included in the program that needs to be debugged. The line ''binding.pry'' could be inserted at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. Changes could be made to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the ''step'' command would take us into ''method3'' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the ''step'' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the ''finish'' command. The ''finish'' command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in ''method3'', the ''finish'' command would complete the code execution in ''method3'' and return back to ''method2''.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another ''binding.pry'', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following ''binding.pry'' statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The ''show-doc'' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
:Interested people can learn more about using Pry as a debugger by watching this video [http://www.youtube.com/watch?v=o90CCPjcIKE tutorial].&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
[http://www.jackkinsella.ie/2014/06/06/debugging-rails-with-pry-debugger.html This website has a lot of comparison between Pry Debugger with other debuggers available in market.]&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86903</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86903"/>
		<updated>2014-09-19T20:53:11Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* Debugging in Rails using Pry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Debugging&amp;lt;/ref&amp;gt; easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the ''step'' command would take us into ''method3'' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the ''step'' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the ''finish'' command. The ''finish'' command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in ''method3'', the ''finish'' command would complete the code execution in ''method3'' and return back to ''method2''.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another ''binding.pry'', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following ''binding.pry'' statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The ''show-doc'' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86902</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86902"/>
		<updated>2014-09-19T20:51:51Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* View the documentation or source for a method: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the ''step'' command would take us into ''method3'' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the ''step'' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the ''finish'' command. The ''finish'' command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in ''method3'', the ''finish'' command would complete the code execution in ''method3'' and return back to ''method2''.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another ''binding.pry'', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following ''binding.pry'' statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The ''show-doc'' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86900</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86900"/>
		<updated>2014-09-19T20:51:09Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* The Continue command: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the ''step'' command would take us into ''method3'' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the ''step'' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the ''finish'' command. The ''finish'' command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in ''method3'', the ''finish'' command would complete the code execution in ''method3'' and return back to ''method2''.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another ''binding.pry'', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following ''binding.pry'' statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The 'show-doc' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86899</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86899"/>
		<updated>2014-09-19T20:50:30Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* The Finish command: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the ''step'' command would take us into ''method3'' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the ''step'' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the ''finish'' command. The ''finish'' command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in ''method3'', the ''finish'' command would complete the code execution in ''method3'' and return back to ''method2''.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another 'binding.pry', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following binding.pry statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The 'show-doc' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86894</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86894"/>
		<updated>2014-09-19T20:49:24Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* The Step command: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the ''step'' command would take us into ''method3'' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the 'step' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the 'finish' command. The finish command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in method3, the finish command would complete the code execution in method3 and return back to method2.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another 'binding.pry', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following binding.pry statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The 'show-doc' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86891</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86891"/>
		<updated>2014-09-19T20:49:03Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* The Step command: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the ''step'' command would take us into 'method3' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the 'step' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the 'finish' command. The finish command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in method3, the finish command would complete the code execution in method3 and return back to method2.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another 'binding.pry', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following binding.pry statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The 'show-doc' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86886</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86886"/>
		<updated>2014-09-19T20:46:18Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* Remote Debugginghttp://wiki.freepascal.org/Remote_Debugging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the step command would take us into 'method3' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the 'step' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the 'finish' command. The finish command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in method3, the finish command would complete the code execution in method3 and return back to method2.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another 'binding.pry', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following binding.pry statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The 'show-doc' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client can connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86884</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86884"/>
		<updated>2014-09-19T20:45:07Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* Remote Debugginghttp://wiki.freepascal.org/Remote_Debugging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the step command would take us into 'method3' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the 'step' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the 'finish' command. The finish command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in method3, the finish command would complete the code execution in method3 and return back to method2.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another 'binding.pry', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following binding.pry statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The 'show-doc' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client ca connect to&amp;lt;ref&amp;gt;http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html&amp;lt;/ref&amp;gt;. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86878</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86878"/>
		<updated>2014-09-19T20:42:27Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* The Edit command: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the step command would take us into 'method3' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the 'step' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the 'finish' command. The finish command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in method3, the finish command would complete the code execution in method3 and return back to method2.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another 'binding.pry', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following binding.pry statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command&amp;lt;ref&amp;gt;http://kgrz.io/pry/2014/02/07/Prys-edit-command.html&amp;lt;/ref&amp;gt;. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The 'show-doc' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client ca connect to. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86799</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 26 sn</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_26_sn&amp;diff=86799"/>
		<updated>2014-09-19T02:08:25Z</updated>

		<summary type="html">&lt;p&gt;Samirajk: /* List of other commonly used commands: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= '''Debugging in Rails using Pry''' =&lt;br /&gt;
&lt;br /&gt;
Debugging is a process of finding and reducing the bugs or defects in a computer program thereby making it behave as expected. Few of the debugging techniques are [http://en.wikipedia.org/wiki/Debug_code#Print_debugging  Print debugging] (also known as printf debugging), Log debugging and Interactive debugging&amp;lt;ref&amp;gt;http://rubylearning.com/satishtalim/ruby_logging.html&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://object.io/site/2011/getting-to-know-ruby-debugger/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ruby_on_Rails Rails] provides a range of options to make debugging easier which include debug helpers, loggers, graphical debuggers, Pry, and so on&amp;lt;ref&amp;gt;http://guides.rubyonrails.org/debugging_rails_applications.html&amp;lt;/ref&amp;gt;. In the following sections, we would be discussing about debugging in Rails using Pry.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Introduction to Pry debugger =&lt;br /&gt;
&lt;br /&gt;
:Pry is an [http://en.wikipedia.org/wiki/Shell_(computing) interactive shell] for the Ruby programming language. Pry could be started at any point within a running program. Due to this, programmers can inspect the program, correct the source code, or change its current state without having to restart the process. Pry is thus notable for its ability to start a [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] within a running program.&lt;br /&gt;
&lt;br /&gt;
:Pry has many features that make it extremely efficient to use. One of the example here could be Pry's ''hist --grep'' that makes it easy to search through your Pry history. Also, Pry uses the filesystem metaphor for exposing most of its introspective capabilities such as the ''ls'' command to list the methods and variables and the ''cd'' command to start interacting with a particular object.&lt;br /&gt;
&lt;br /&gt;
:To start a debugging session, you need to include the ''require 'pry' '' and ''binding.pry'' lines in your program that needs to be debugged. You could insert the line ''binding.pry'' at any point in your program. Whenever the Ruby interpreter executes this line, it opens a Pry REPL session. The code after the ''binding.pry'' statement is not executed unless instructed by the programmer. We could make changes to fix the code and then return to running program from same point.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
:To use Pry for debugging a Rails application, you first need to download and install Pry-debugger. If you are using Ruby version 2.0 or higher, then download pry-debugger from [https://github.com/deivid-rodriguez/pry-byebug here]. If you are using Ruby version 1.9 or lower, then download pry-debugger from [https://rubygems.org/gems/pry-debugger here].&lt;br /&gt;
&lt;br /&gt;
:To install the debugger use the following command:&amp;lt;ref&amp;gt;http://pryrepl.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-debugger.gem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Include the following line of code on the gem file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'pry-rails', :group =&amp;gt; :development&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once that is done, the necessary dependencies could be installed using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Execution Commands =&lt;br /&gt;
:To use the execution command, invoke pry normally. There is no need to start your script or application differently. For the sake of clarity in explanation, we would refer to the program below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'pry'&lt;br /&gt;
def method1 (seller)&lt;br /&gt;
	puts 'Inside method 1'&lt;br /&gt;
	method2(seller)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
def method2(seller)&lt;br /&gt;
  binding.pry      	# Execution will stop here.&lt;br /&gt;
  new_products = method3(seller)&lt;br /&gt;
  puts 'After calling method3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def method3(seller)&lt;br /&gt;
	puts 'Inside method 3'&lt;br /&gt;
	puts 'Continuing in method 3'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
method1('xyz')&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Step command: ===&lt;br /&gt;
:The ''step'' command continues execution by moving into the method on the next line. To put it in another way, the command takes us deeper into the method. Following our example, the step command would take us into 'method3' at which point we would be asked what to do next. The following screenshot demonstrates our example:&lt;br /&gt;
&lt;br /&gt;
[[File:Step.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Next command: ===&lt;br /&gt;
:The ''next'' command runs the current line and moves to the next line in the current context.  If the next line in the code is a method call, then unlike the ''step'' method the execution does not go deeper into the method. Following our example, if we execute the above code, the execution stop at the ''binding.pry'' line and the debugger asks us for the further action. On using the ''next'' command, the execution moves to the next line that is '' new_products = method3(seller)'' without going deeper into the method. The debugger now waits for another instruction from the programmer and if the command is ''next'' again, the debugger simply goes to the next line of code after executing the method. Thus, all the code within the ''method3'' method (which would otherwise be many steps), has been concluded with a single use of the ''next'' command. The example could be seen in the following screenshot:&lt;br /&gt;
&lt;br /&gt;
[[File:Next.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== The Finish command: ===&lt;br /&gt;
:Now once we have stepped into a method using the 'step' command, the debugger would ask us what needs to be done next. Now if we want to jump to the end of the method without the debugger asking us our choice of navigation command at the end of each line, we could use the 'finish' command. The finish command would execute the code in the method and return back to the point from where the method was called. In our example, while the debugger is in method3, the finish command would complete the code execution in method3 and return back to method2.&lt;br /&gt;
&lt;br /&gt;
=== The Continue command: ===&lt;br /&gt;
:With this command we can abandon the pry session and continue the normal execution of the program. If the interpreter encounters another 'binding.pry', a pry session is again opened. This can be incredibly annoying, since our program will stop and we’ll have to navigate the debugger every single time, so we’ll probably want to type exit-program to cancel the effect of any following binding.pry statements, thereby exiting our rails application.&lt;br /&gt;
&lt;br /&gt;
=== Breakpoints: ===&lt;br /&gt;
:You could set or change the breakpoints in a program directly using Pry. The ''break'' command is used for this purpose. You could set breakpoints in the current file, or in any other file, or a method. Conditional breakpoints could also be changed or set using optional expressions.&lt;br /&gt;
&lt;br /&gt;
:Command to display the list of breakpoints and conditional breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --condition 4 x &amp;gt; 2      Change condition on breakpoint #4 to 'x &amp;gt; 2'.&lt;br /&gt;
break --condition 6            Remove the condition on breakpoint #6.&lt;br /&gt;
break                          List all breakpoints. (Same as `breakpoints`)&lt;br /&gt;
break --show 2                 Show details about breakpoint #2.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Setting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break 5                        Break at line 5 in the current file.&lt;br /&gt;
break &amp;lt;class_name&amp;gt;#run         Break at the start of `&amp;lt;class_name&amp;gt;#run`.&lt;br /&gt;
break app/models/test.rb:4     Break at line 4 in test.rb.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Deleting breakpoints:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
break --delete 5               Delete breakpoint #5.&lt;br /&gt;
break --disable-all            Disable all breakpoints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Edit command: ===&lt;br /&gt;
:You could edit the code in a file by just switching to the editor rather than having to end the Pry session. This could be done using the ''edit'' command. On using the ''edit'' command, a new editor window pops up thereby enabling the programmer to edit the code. However, you need to specify the type of editor in the ''.pryrc'' file. For example, in order to edit the code using a Notepad editor, you need to specify the following in the ''.pryrc'' file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pry.config.editor = 'Notepad'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:SnOutput1.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== View the documentation or source for a method: ===&lt;br /&gt;
:You sometimes would want to know how a particular method works or what kind of arguments it takes. The 'show-doc' method could help you determine that. Also, you would want to know the source of the method. This could be done using the ''show-method'' command.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pry(main)&amp;gt; def foo&lt;br /&gt;
pry(main)*   puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
pry(main)* end  &lt;br /&gt;
=&amp;gt; nil&lt;br /&gt;
pry(main)&amp;gt; show-method foo&lt;br /&gt;
 &lt;br /&gt;
From: (pry) @ line 3:&lt;br /&gt;
Number of lines: 3&lt;br /&gt;
Owner: Object&lt;br /&gt;
Visibility: private&lt;br /&gt;
 &lt;br /&gt;
def foo&lt;br /&gt;
  puts &amp;quot;Welcome to the foo!!&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of other commonly used commands: ===&lt;br /&gt;
:The other list of commands could be found by typing ''help''&amp;lt;ref&amp;gt;https://github.com/pry/pry/wiki/Command-system#Help_command&amp;lt;/ref&amp;gt;. The following shows other list of commands:&lt;br /&gt;
&lt;br /&gt;
[[File:Help1.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Remote Debugging&amp;lt;ref&amp;gt;http://wiki.freepascal.org/Remote_Debugging&amp;lt;/ref&amp;gt; =&lt;br /&gt;
:So far, Pry has been a good tool to digging into the code and checking how the code is actually working and what is exactly going on inside the code. We used ''binding.pry'' inside the program where the execution stops and the user is asked to give further instructions. However, there are situations where the execution of the program would not stop and the would not allow you to inspect the code especially in situations when [https://github.com/yegrb/yeg-wiki/wiki/Managing-application-processes-with-the-Foreman-gem Foreman] is used to manage processes. In such situation, ''pry-remote'' could be of help.&lt;br /&gt;
&lt;br /&gt;
:When a process that is being run by Foreman comes across ''binding.pry'', it would halt but a Pry session would not be opened. You would be forced to kill the process as the application actually freezes. Thus, in such cases ''pry-remote'' would be a great solution and in order to work around with this, you need to first install the gem:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install pry-remote&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Then run bundler:&lt;br /&gt;
&amp;lt;pre&amp;gt;    &lt;br /&gt;
bundle install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Once you have installed ''pry-remote'', a breakpoint can be added using ''binding.remote_pry'' anywhere in the program from where the code needs to be debugged. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def index&lt;br /&gt;
    binding.remote_pry&lt;br /&gt;
    ...&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:''Pry-remote'' would block your program when it hits the ''binding.remote_pry'' and open a Drb endpoint that a client ca connect to. Running pry-remote in a shell will then connect to the session. You would then be able to interact with Pry as you would normally do. You could unblock the program by using ''exit''.&lt;br /&gt;
&lt;br /&gt;
= Comparison with other debugging tools =&lt;br /&gt;
Pry is a replacement for Ruby's default REPL,irb. It has many more additional features as compared to irb. Some of the features that provide Pry an edge over the other debugging tools are as follows:&lt;br /&gt;
:*Pry enables code or syntax highlighting, auto identation and a runtime debugging console.&lt;br /&gt;
:*It has the ability to load any portion of the file in your text editor directly into the REPL session.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Samirajk</name></author>
	</entry>
</feed>