<?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=Ndhanir</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=Ndhanir"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Ndhanir"/>
	<updated>2026-05-16T22:06:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Write_automated_tests_for_WebDriver&amp;diff=102395</id>
		<title>CSC/ECE 517 Spring 2016/Write automated tests for WebDriver</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Write_automated_tests_for_WebDriver&amp;diff=102395"/>
		<updated>2016-05-04T05:54:03Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{student editor|course = [[Wikipedia:Wiki_Ed/North_Carolina_State_University/Object-Oriented_Design_and_Development_(Spring_2016)]] }}&lt;br /&gt;
&lt;br /&gt;
== Write automated tests for the WebDriver server ==&lt;br /&gt;
&lt;br /&gt;
Servo is an open source prototype web browser layout engine being developed by Mozilla, and it is written in Rust language. It is currently developed on 64bit OS X, 64bit Linux, Android, and Gonk (Firefox OS). The main idea is to create a highly parallel environment, in which different components can be handled by fine grained, isolated tasks. The different components can be rendering, HTML parsing, etc.&lt;br /&gt;
&lt;br /&gt;
== Background information: ==&lt;br /&gt;
&lt;br /&gt;
=== Python: ===&lt;br /&gt;
Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. Python supports multiple programming paradigms, including object oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library. Modules for creating graphical user interfaces, connecting to relational databases, pseudorandom number generators, arithmetic with arbitrary precision decimals,[77] manipulating regular expressions, and doing unit testing are also included.&lt;br /&gt;
&lt;br /&gt;
=== Servo: ===&lt;br /&gt;
Servo is a project to develop a new Web browser engine to help mitigate vulnerabilities associated with incorrect memory management and data races. Servo is written in Rust, a new language designed specifically with Servo's requirements in mind. Rust provides a task-parallel infrastructure and a strong type system that enforces memory safety and data race freedom.&lt;br /&gt;
&lt;br /&gt;
Servo is focused both on supporting a full Web browser, through the use of the purely HTML-based user interface Browser.html and on creating a solid, embeddable engine. Although Servo was originally a research project, it was implemented with the goal of having production-quality code and is in the process of shipping several of its components in the Firefox browser.&lt;br /&gt;
&lt;br /&gt;
[[File:ServoArchitecture.JPG]]&lt;br /&gt;
&lt;br /&gt;
The above diagram denotes several of the tasks that are associated with building the Servo web browser. Each of the boxes represents a task that is implemented in Rust and the lines indicates relationships between the tasks.&lt;br /&gt;
&lt;br /&gt;
=== WebDriver: ===&lt;br /&gt;
The WebDriver specification defines a communication protocol for automating interactions with a web browser that would traditionally require a human being (eg. clicking the mouse on a particular link; typing text into an input field; etc.) This protocol is being implemented by major browsers such as Firefox, Edge, and Chrome, and Servo also provides a WebDriver server. The goal of this project is both to submit a broad range of automated client tests using the Python WebDriver API that can be run against multiple browsers, and also to report on how many of the tests Servo currently passes.&lt;br /&gt;
&lt;br /&gt;
== Scope ==&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
* Compile Servo and ensure that it runs on &amp;lt;code&amp;gt;tests/html/about-mozilla.html&amp;lt;/code&amp;gt;&lt;br /&gt;
* To run a simple webdriver script using the python client against Servo.&lt;br /&gt;
* Create a&amp;lt;code&amp;gt;mach&amp;lt;/code&amp;gt; command (&amp;lt;code&amp;gt;test-webdriver&amp;lt;/code&amp;gt;) in &amp;lt;code&amp;gt;python/servo/testing_commands.py&amp;lt;/code&amp;gt; that will import each python file in the directory and execute the &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt; method contained within it by invoking the Servo process before running each test, and killing it after each test finishes.&lt;br /&gt;
* Create a &amp;lt;code&amp;gt;webdriver&amp;lt;/code&amp;gt; directory under &amp;lt;code&amp;gt;tests&amp;lt;/code&amp;gt; where the forthcoming tests will reside.&lt;br /&gt;
* Writing an automated test for loading a particular URL, asserting that the resulting page is the expected url.&lt;br /&gt;
===Subsequent Steps===&lt;br /&gt;
* Writing tests that exercise the lower-level command API (eg. self.send_command(&amp;quot;POST&amp;quot;, &amp;quot;url&amp;quot;, body)) to test server capabilities:&lt;br /&gt;
* Writing a test with a simple get to a url that exists on the server, ensure that we get the right response type&lt;br /&gt;
* Sending a non-string as the URL and ensuring that we get the right kind of error message.&lt;br /&gt;
* Trying other kinds of non-conforming messages e.g. ones with extra fields (should be ignored) or no url field (should return the correct type of error)&lt;br /&gt;
* Testing that we are actually loading the correct page. This will require the use of some other webdriver functions e.g. to get an element's text, or take a screenshot&lt;br /&gt;
* Testing that Get always navigates the top level browsing context (by navigating to a page with an iframe, setting the current bc to that iframe, and ensuring that it is not just the iframe that is navigated).&lt;br /&gt;
* Trying Get with pages that return non-200 responses.&lt;br /&gt;
* Loading a page that loads slower than the timeout, and ensure we get the correct error message&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
Design patterns are not applicable as our task involved writing automated tests in python. However, the Implementation section below provides details of the steps the way it was implemented.&lt;br /&gt;
&lt;br /&gt;
We have implemented the test cases based on the input from the Mozilla team and there were several major tasks that were implemented.&lt;br /&gt;
&lt;br /&gt;
1. Execute tests on a standalone HTTP server: In this we wanted to test the functionality if a web page opens as expected on the wed driver engine. We have implemented this by giving a URL which opens a web page whose actual URL is different when the page opens. We matched the web page expected with the one that is opened to successfully execute the test case.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
===Initial Steps===&lt;br /&gt;
The following steps were followed to meet the project requirements as per this github page.&lt;br /&gt;
&lt;br /&gt;
=== Step 1: ===&lt;br /&gt;
We created a new &amp;lt;code&amp;gt;mach&amp;lt;/code&amp;gt; command (&amp;lt;code&amp;gt;test-webdriver&amp;lt;/code&amp;gt;) in &amp;lt;code&amp;gt;python/servo/testing_commands.py&amp;lt;/code&amp;gt; file. It imports each python file in the directory and executes the &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt; method contained within it. &lt;br /&gt;
&lt;br /&gt;
=== Step 2: ===&lt;br /&gt;
&lt;br /&gt;
We created tests in test.py and test1.py for loading a particular URL, asserting that the resulting page is the expected url.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Subsequent Steps===&lt;br /&gt;
===Step 1:===&lt;br /&gt;
We would create 3 different test.py files for each of the different tests that would reside in tests/webdriver folder.&lt;br /&gt;
&lt;br /&gt;
===Step 2:===&lt;br /&gt;
Creating a ServoProcess that would be used by the test.py files to start a servo session.&lt;br /&gt;
&lt;br /&gt;
===Step 3:===&lt;br /&gt;
Catching exceptions when the tests fail and displaying them in proper format based on the kind of different error.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
Following are the steps to run the automated tests for WebDriver:&lt;br /&gt;
 git clone &amp;lt;nowiki&amp;gt;https://github.com/krunal3103/servo&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
Note: Follow the steps listed in the Readme.md file of this link to clone and build servo on your local machine.&lt;br /&gt;
 cd servo &lt;br /&gt;
&lt;br /&gt;
 ./mach test-webdriver &lt;br /&gt;
You will see that all tests pass as expected.&lt;br /&gt;
&lt;br /&gt;
== Pull Request ==&lt;br /&gt;
Here is our [https://github.com/servo/servo/pull/10113 pull request]. In the link you can see all code snippets and commits as well as integration test progression information.&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101577</id>
		<title>CSC/ECE 517 Spring 2016/Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101577"/>
		<updated>2016-04-01T05:43:22Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1615. Refactoring the Review Mapping Controller==&lt;br /&gt;
&lt;br /&gt;
This page provides details about the OSS project which was based on refactoring one of controllers related to peer reviewing strategies used in Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=='''Expertiza '''==&lt;br /&gt;
&lt;br /&gt;
The Expertiza is a software project to create reusable learning objects through peer review. It is a Ruby on Rails based application which can be run on Windows, Linux and Mac OS X.&lt;br /&gt;
&lt;br /&gt;
Main Features of Expertiza are:&lt;br /&gt;
* Allows students to work in groups to improve others learning experiences&lt;br /&gt;
* The work done by students/team is subjeted to multiple reviews , minimizing plagiarism&lt;br /&gt;
* Reviewing is done by studnets, which allows instructor/TA to spend less time in grading &lt;br /&gt;
* Large classes can also be handled easily with the help of Expertiza&lt;br /&gt;
&lt;br /&gt;
=='''About Review mapping controller'''==&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the team for a submission , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Problem Statement'''===&lt;br /&gt;
&lt;br /&gt;
The main aim of this project is to&lt;br /&gt;
&lt;br /&gt;
* Refactor reporting method(response_report) which is big &lt;br /&gt;
* Use more efficient function sample instead of shuffle for random number selection&lt;br /&gt;
* Remove unused and assigned variables &lt;br /&gt;
* Simplify Automatic_review_mapping_strategy&lt;br /&gt;
&lt;br /&gt;
=='''Code Improvements'''==&lt;br /&gt;
&lt;br /&gt;
==='''Unused variables and arguments'''===&lt;br /&gt;
&lt;br /&gt;
There are unused variables in the methods which use the stack unnecessarily. So, it is better to remove the unused variables or at the least indicate that a variable is unused.&lt;br /&gt;
&lt;br /&gt;
For suppose when both keys and values are not used in a hash but are given as arguments, then the unused variables can be indicated by adding a &amp;quot;_&amp;quot; infront of the name or replace the unused variable with &amp;quot;_&amp;quot; to represent it as unused variable but allow them in arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above case teams_hash should consist of a hash with both keys and values but the sorting is done based on values. So the key is replaced with a &amp;quot;_&amp;quot; so that the user may deem it unused in the implementation of the process.&lt;br /&gt;
&lt;br /&gt;
==='''Use sample instead of shuffle'''===&lt;br /&gt;
&lt;br /&gt;
When sample is used, the elements in an array are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle. Also by using shuffle[0] we are shuffling all the elements in the array and then picking the first element instead of picking a single element randomly which is more efficient. The following are the couple of places where shuffle[0] was used and is replaced by sample.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Cyclomatic complexity of automatic_review_mapping_strategy method'''===&lt;br /&gt;
&lt;br /&gt;
The method automatic_review_mapping_strategy handles the number of reviews assigned to a individual and also the number of reviews that can be done with in a team. The method is very long and has many nested if statements due to which the complexity of the method is very high. Instead of a single method handling all the parts of the strategy, it is divided into several parts due to which the code is more readable and also the complexity of code is shared by each method.&lt;br /&gt;
&lt;br /&gt;
The method first checks the number of participants that are in an assignment and the number of teams that are present. It then sets the values for the maximum number of reviews that are possible and also the minimum number that are required. Then it assigns the reviews to each of the teams randomly when a request for review is made by a participant. At last it checks if the participant has the minimum number of reviews required after allotting the reviews. If not, it assigns more reviews to valid teams so that the minimum requirement is met.&lt;br /&gt;
&lt;br /&gt;
The part of the code that is moved out of automatic_review_mapping_strategy as peer_review_strategy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private&lt;br /&gt;
	def peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
		iterator = 0&lt;br /&gt;
		teams.each do |team|&lt;br /&gt;
		  selected_participants = Array.new&lt;br /&gt;
		  if !team.equal? teams.last&lt;br /&gt;
			#need to even out the # of reviews for teams&lt;br /&gt;
			while selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
			  num_participants_this_team = TeamsUser.where(team_id: team.id).size&lt;br /&gt;
			  #If there are some submitters or reviewers in this team, they are not treated as normal participants.&lt;br /&gt;
			  #They should be removed from 'num_participants_this_team'&lt;br /&gt;
			  TeamsUser.where(team_id: team.id).each do |team_user|&lt;br /&gt;
				temp_participant = Participant.where(user_id: team_user.user_id, parent_id: assignment_id).first&lt;br /&gt;
				num_participants_this_team -= 1 if temp_participant.can_review == false or temp_participant.can_submit == false&lt;br /&gt;
			  end&lt;br /&gt;
			  #if all outstanding participants are already in selected_participants, just break the loop.&lt;br /&gt;
			  break if selected_participants.size == participants.size - num_participants_this_team&lt;br /&gt;
&lt;br /&gt;
			  # generate random number&lt;br /&gt;
			  if iterator == 0&lt;br /&gt;
				rand_num = rand(0..num_participants-1)&lt;br /&gt;
			  else&lt;br /&gt;
				min_value = participants_hash.values.min&lt;br /&gt;
				#get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
				participants_with_min_assigned_reviews = Array.new&lt;br /&gt;
				participants.each do |participant|&lt;br /&gt;
				  participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
				end&lt;br /&gt;
				#if participants_with_min_assigned_reviews is blank &lt;br /&gt;
				if_condition_1 = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
				#or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
				if_condition_2 = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
				if if_condition_1 or if_condition_2&lt;br /&gt;
				  #use original method to get random number&lt;br /&gt;
				  rand_num = rand(0..num_participants-1)&lt;br /&gt;
				else&lt;br /&gt;
				  #rand_num should be the position of this participant in original array&lt;br /&gt;
				  rand_num = participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size-1)]&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			  # prohibit one student to review his/her own artifact&lt;br /&gt;
			  next if TeamsUser.exists?(team_id: team.id, user_id: participants[rand_num].user_id)&lt;br /&gt;
&lt;br /&gt;
			  if_condition_1 = (participants_hash[participants[rand_num].id] &amp;lt; student_review_num)&lt;br /&gt;
			  if_condition_2 = (!selected_participants.include? participants[rand_num].id)&lt;br /&gt;
			  if if_condition_1 and if_condition_2&lt;br /&gt;
				# selected_participants cannot include duplicate num&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participants[rand_num].id&lt;br /&gt;
				participants_hash[participants[rand_num].id] += 1&lt;br /&gt;
			  end &lt;br /&gt;
			  # remove students who have already been assigned enough num of reviews out of participants array&lt;br /&gt;
			  participants.each do |participant|&lt;br /&gt;
				if participants_hash[participant.id] == student_review_num&lt;br /&gt;
				  participants.delete_at(rand_num)&lt;br /&gt;
				  num_participants -= 1&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  else&lt;br /&gt;
			#review num for last team can be different from other teams.&lt;br /&gt;
			#prohibit one student to review his/her own artifact and selected_participants cannot include duplicate num&lt;br /&gt;
			participants.each do |participant| &lt;br /&gt;
			  # avoid last team receives too many peer reviews&lt;br /&gt;
			  if !TeamsUser.exists?(team_id: team.id, user_id: participant.user_id) and selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participant.id &lt;br /&gt;
				participants_hash[participant.id] += 1&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  end&lt;br /&gt;
&lt;br /&gt;
		  begin&lt;br /&gt;
			selected_participants.each {|index| ReviewResponseMap.where(:reviewee_id =&amp;gt; team.id, :reviewer_id =&amp;gt; index, :reviewed_object_id =&amp;gt; assignment_id).first_or_create}&lt;br /&gt;
		  rescue&lt;br /&gt;
			flash[:error] = &amp;quot;Automatic assignment of reviewer failed.&amp;quot;&lt;br /&gt;
		  end&lt;br /&gt;
		  iterator += 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The method is made private so that it can only be called with in the controller and cannot directly be called through a view.&lt;br /&gt;
&lt;br /&gt;
The complexity of the original method reduced after breaking it and can be easily readable now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def automatic_review_mapping_strategy(assignment_id, participants, teams, student_review_num=0, submission_review_num=0)&lt;br /&gt;
    participants_hash = {}&lt;br /&gt;
    participants.each { |participant| participants_hash[participant.id] = 0 }&lt;br /&gt;
    #calculate reviewers for each team&lt;br /&gt;
    num_participants = participants.size&lt;br /&gt;
    if student_review_num != 0 and submission_review_num == 0&lt;br /&gt;
      num_reviews_per_team = (participants.size * student_review_num * 1.0 / teams.size).round&lt;br /&gt;
      exact_num_of_review_needed = participants.size * student_review_num&lt;br /&gt;
    elsif student_review_num == 0 and submission_review_num != 0&lt;br /&gt;
      num_reviews_per_team = submission_review_num&lt;br /&gt;
      student_review_num = (teams.size * submission_review_num * 1.0 / participants.size).round&lt;br /&gt;
      exact_num_of_review_needed = teams.size * submission_review_num&lt;br /&gt;
    end&lt;br /&gt;
    #Exception detection: If instructor want to assign too many reviews done by each student, there will be an error msg.&lt;br /&gt;
    if student_review_num &amp;gt;= teams.size&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done by each student to be greater than or equal to total number of teams [or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
&lt;br /&gt;
    # after assigning peer reviews for each team, if there are still some peer reviewers not obtain enough peer review, just assign them to valid teams&lt;br /&gt;
    if ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and created_at &amp;gt; ? and calibrate_to = ?&amp;quot;, assignment_id, @@time_create_last_review_mapping_record, 0]).size &amp;lt; exact_num_of_review_needed&lt;br /&gt;
      participants_with_insufficient_review_num = Array.new&lt;br /&gt;
      participants_hash.each do |participant_id, review_num|&lt;br /&gt;
        participants_with_insufficient_review_num &amp;lt;&amp;lt; participant_id if review_num &amp;lt; student_review_num&lt;br /&gt;
      end&lt;br /&gt;
      unsorted_teams_hash = {}&lt;br /&gt;
      ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and calibrate_to = ?&amp;quot;, assignment_id, 0]).each do |response_map|&lt;br /&gt;
        unless unsorted_teams_hash.has_key? (response_map.reviewee_id)&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] = 1 &lt;br /&gt;
        else&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] += 1&lt;br /&gt;
        end&lt;br /&gt;
      end &lt;br /&gt;
      teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
      participants_with_insufficient_review_num.each do |participant_id|&lt;br /&gt;
        teams_hash.each do |team_id, num_review_received|&lt;br /&gt;
          unless TeamsUser.exists?(team_id: team_id, user_id: Participant.find(participant_id).user_id)&lt;br /&gt;
            ReviewResponseMap.where(:reviewee_id =&amp;gt; team_id, :reviewer_id =&amp;gt; participant_id, :reviewed_object_id =&amp;gt; assignment_id).first_or_create&lt;br /&gt;
            teams_hash[team_id] += 1&lt;br /&gt;
            teams_hash = teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
            break&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @@time_create_last_review_mapping_record = ReviewResponseMap.where(reviewed_object_id: assignment_id).last.created_at&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4. Moving code specific to models to models instead of controller'''&lt;br /&gt;
&lt;br /&gt;
The method response_report contains code which generates reports based on the input of one of the three of 'ReviewResponseMap', 'FeedbackResponseMap', 'TeammateReviewResponseMap' and 'Calibration'. Calibration is a special case and should be handled in the controller itself. But the other three are models that are subclasses of ResponseMap model. The report is generated for each of the three by calling the ResponseMap model and obtaining the values by querying the database. Moving the code to the models and calling the methods in the model through the controller makes more sense than writing the code in controller.&lt;br /&gt;
&lt;br /&gt;
The following is the code snippet from the original method which contains the calls to ResponseMap model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
      if params[:user].nil?&lt;br /&gt;
        # This is not a search, so find all reviewers for this assignment&lt;br /&gt;
        response_maps_with_distinct_participant_id = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ? and calibrate_to = ?&amp;quot;, @id, @type, 0])&lt;br /&gt;
        @reviewers = []&lt;br /&gt;
        response_maps_with_distinct_participant_id.each do |reviewer_id_from_response_map|&lt;br /&gt;
          @reviewers &amp;lt;&amp;lt; (AssignmentParticipant.find(reviewer_id_from_response_map.reviewer_id))&lt;br /&gt;
        end&lt;br /&gt;
        @reviewers = Participant.sort_by_name(@reviewers)&lt;br /&gt;
      else&lt;br /&gt;
        # This is a search, so find reviewers by user's full name&lt;br /&gt;
        user = User.select(&amp;quot;DISTINCT id&amp;quot;).where([&amp;quot;fullname LIKE ?&amp;quot;, '%'+params[:user][:fullname]+'%'])&lt;br /&gt;
        @reviewers = AssignmentParticipant.where([&amp;quot;user_id IN (?) and parent_id = ?&amp;quot;, user, @assignment.id])&lt;br /&gt;
      end&lt;br /&gt;
      #  @review_scores[reveiwer_id][reviewee_id] = score for assignments not using vary_rubric_by_rounds feature&lt;br /&gt;
      # @review_scores[reviewer_id][round][reviewee_id] = score for assignments using vary_rubric_by_rounds feature&lt;br /&gt;
      @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
      @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
    when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'FeedbackResponseMap' and &lt;br /&gt;
      #reviewed_object_id in (select id from responses where &lt;br /&gt;
      #map_id in (select id from response_maps where reviewed_object_id = 722 and type = 'ReviewResponseMap'))&lt;br /&gt;
      @review_response_map_ids = ResponseMap.select(&amp;quot;id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'ReviewResponseMap'])&lt;br /&gt;
      @response_ids = Response.select(&amp;quot;id&amp;quot;).where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id IN (?) and type = ?&amp;quot;, @response_ids, @type])&lt;br /&gt;
    when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'TeammateReviewResponseMap' and reviewed_object_id = 711&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'TeammateReviewResponseMap'])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same code after moving the methods to their respective models looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
      when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
        @review_user= params[:user]&lt;br /&gt;
        #If review response is required call review_response_report method in review_response_map model&lt;br /&gt;
        @reviewers = ReviewResponseMap.review_response_report(@id, @assignment,@type, @review_user)&lt;br /&gt;
        @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
        @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
      when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
        #If review report for feedback is required call feedback_response_report method in feedback_review_response_map model&lt;br /&gt;
        @reviewers = FeedbackResponseMap.feedback_response_report(@id, @type)&lt;br /&gt;
      when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
        #If review report for teammate is required call teammate_response_report method in teammate_review_response_map model&lt;br /&gt;
        @reviewers = TeammateReviewResponseMap.teammate_response_report(@id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
'''Peer review information:'''&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;br /&gt;
&lt;br /&gt;
'''Steps for testing UI:'''&lt;br /&gt;
# Login as an instructor (Using Instructor6 will help you import the participants from other assignments).&lt;br /&gt;
# Navigate to &amp;quot;Manage-&amp;gt;Assignments&amp;quot;.&lt;br /&gt;
# Click on &amp;quot;New Public Assignment&amp;quot; for creating a new assignment.&lt;br /&gt;
# Create a new assignment by providing assignment name, selecting a course, submission directory (Give any name) and description URL.&lt;br /&gt;
# Select &amp;quot;has teams?&amp;quot; and provide the team size. Click on create to create a new assignment.&lt;br /&gt;
## After that, click on review strategy and limit the number of reviews per submission.&lt;br /&gt;
## Click on &amp;quot;Due dates&amp;quot; and update date for submission and review. Adjust the review date and time in order to test the reviews.&lt;br /&gt;
## Click on &amp;quot;save&amp;quot;. A new assignment is created and it can be viewed in &amp;quot;Manage-&amp;gt;Assignments&amp;quot; section.&lt;br /&gt;
# In order to add participants, there are two methods to add students to the assignment.&lt;br /&gt;
## Click on &amp;quot;add participants&amp;quot; against the assignment. Enter the user login to add the student. Add atleast 6 participants so that the review mapping can be seen.&lt;br /&gt;
## Click on any previous assignment &amp;quot;add participants&amp;quot; and export the students list (I used wiki assignment).&lt;br /&gt;
## Click on your assignment &amp;quot;add participants&amp;quot; and import the students using the export file.&lt;br /&gt;
# Go back to &amp;quot;Assignments&amp;quot; section and click against &amp;quot;create teams&amp;quot;.&lt;br /&gt;
## After clicking on &amp;quot;create teams&amp;quot;, Click on &amp;quot;create teams&amp;quot; in the directed page.&lt;br /&gt;
### Teams can be formed either manually or automatically.&lt;br /&gt;
# Login as a student to submit the links for assignment (Valid hyperlink must be provided in the submission link). Add submission for atleast 5 students in order to check the automatic review mapping. (Password for student is password)&lt;br /&gt;
# After submitting the links for some students, Log in as an instructor to change the assignment phase to review phase.&lt;br /&gt;
## To change the review phase period, Go to assignments section and click on edit. Click on due dates and change the review due date.&lt;br /&gt;
# Now, login as a student and go to others work. Click on &amp;quot;Request a submission to review&amp;quot; and check whether a review is assigned automatically. If no assignments are submitted, then this cannot be tested.&lt;br /&gt;
# For teammate review report, author feedback report and review report, click against &amp;quot;review report&amp;quot; and all the review reports can be seen by selecting it in the drop down menu.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/harsha1007/expertiza Forked repository for the project]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Expertiza Main Page]&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101576</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101576"/>
		<updated>2016-04-01T05:42:36Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Testing UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
'''Peer review information:'''&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;br /&gt;
&lt;br /&gt;
'''Steps for testing UI:'''&lt;br /&gt;
# Login as an instructor (Using Instructor6 will help you import the participants from other assignments).&lt;br /&gt;
# Navigate to &amp;quot;Manage-&amp;gt;Assignments&amp;quot;.&lt;br /&gt;
# Click on &amp;quot;New Public Assignment&amp;quot; for creating a new assignment.&lt;br /&gt;
# Create a new assignment by providing assignment name, selecting a course, submission directory (Give any name) and description URL.&lt;br /&gt;
# Select &amp;quot;has teams?&amp;quot; and provide the team size. Click on create to create a new assignment.&lt;br /&gt;
## After that, click on review strategy and limit the number of reviews per submission.&lt;br /&gt;
## Click on &amp;quot;Due dates&amp;quot; and update date for submission and review. Adjust the review date and time in order to test the reviews.&lt;br /&gt;
## Click on &amp;quot;save&amp;quot;. A new assignment is created and it can be viewed in &amp;quot;Manage-&amp;gt;Assignments&amp;quot; section.&lt;br /&gt;
# In order to add participants, there are two methods to add students to the assignment.&lt;br /&gt;
## Click on &amp;quot;add participants&amp;quot; against the assignment. Enter the user login to add the student. Add atleast 6 participants so that the review mapping can be seen.&lt;br /&gt;
## Click on any previous assignment &amp;quot;add participants&amp;quot; and export the students list (I used wiki assignment).&lt;br /&gt;
## Click on your assignment &amp;quot;add participants&amp;quot; and import the students using the export file.&lt;br /&gt;
# Go back to &amp;quot;Assignments&amp;quot; section and click against &amp;quot;create teams&amp;quot;.&lt;br /&gt;
## After clicking on &amp;quot;create teams&amp;quot;, Click on &amp;quot;create teams&amp;quot; in the directed page.&lt;br /&gt;
### Teams can be formed either manually or automatically.&lt;br /&gt;
# Login as a student to submit the links for assignment (Valid hyperlink must be provided in the submission link). Add submission for atleast 5 students in order to check the automatic review mapping. (Password for student is password)&lt;br /&gt;
# After submitting the links for some students, Log in as an instructor to change the assignment phase to review phase.&lt;br /&gt;
## To change the review phase period, Go to assignments section and click on edit. Click on due dates and change the review due date.&lt;br /&gt;
# Now, login as a student and go to others work. Click on &amp;quot;Request a submission to review&amp;quot; and check whether a review is assigned automatically. If no assignments are submitted, then this cannot be tested.&lt;br /&gt;
# For teammate review report, author feedback report and review report, click against &amp;quot;review report&amp;quot; and all the review reports can be seen by selecting it in the drop down menu.&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101575</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101575"/>
		<updated>2016-04-01T05:41:49Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Testing UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
Peer review information:&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;br /&gt;
&lt;br /&gt;
Testing UI:&lt;br /&gt;
&lt;br /&gt;
# Login as an instructor (Using Instructor6 will help you import the participants from other assignments).&lt;br /&gt;
# Navigate to &amp;quot;Manage-&amp;gt;Assignments&amp;quot;.&lt;br /&gt;
# Click on &amp;quot;New Public Assignment&amp;quot; for creating a new assignment.&lt;br /&gt;
# Create a new assignment by providing assignment name, selecting a course, submission directory (Give any name) and description URL.&lt;br /&gt;
# Select &amp;quot;has teams?&amp;quot; and provide the team size. Click on create to create a new assignment.&lt;br /&gt;
## After that, click on review strategy and limit the number of reviews per submission.&lt;br /&gt;
## Click on &amp;quot;Due dates&amp;quot; and update date for submission and review. Adjust the review date and time in order to test the reviews.&lt;br /&gt;
## Click on &amp;quot;save&amp;quot;. A new assignment is created and it can be viewed in &amp;quot;Manage-&amp;gt;Assignments&amp;quot; section.&lt;br /&gt;
# In order to add participants, there are two methods to add students to the assignment.&lt;br /&gt;
## Click on &amp;quot;add participants&amp;quot; against the assignment. Enter the user login to add the student. Add atleast 6 participants so that the review mapping can be seen.&lt;br /&gt;
## Click on any previous assignment &amp;quot;add participants&amp;quot; and export the students list (I used wiki assignment).&lt;br /&gt;
## Click on your assignment &amp;quot;add participants&amp;quot; and import the students using the export file.&lt;br /&gt;
# Go back to &amp;quot;Assignments&amp;quot; section and click against &amp;quot;create teams&amp;quot;.&lt;br /&gt;
## After clicking on &amp;quot;create teams&amp;quot;, Click on &amp;quot;create teams&amp;quot; in the directed page.&lt;br /&gt;
### Teams can be formed either manually or automatically.&lt;br /&gt;
# Login as a student to submit the links for assignment (Valid hyperlink must be provided in the submission link). Add submission for atleast 5 students in order to check the automatic review mapping. (Password for student is password)&lt;br /&gt;
# After submitting the links for some students, Log in as an instructor to change the assignment phase to review phase.&lt;br /&gt;
## To change the review phase period, Go to assignments section and click on edit. Click on due dates and change the review due date.&lt;br /&gt;
# Now, login as a student and go to others work. Click on &amp;quot;Request a submission to review&amp;quot; and check whether a review is assigned automatically. If no assignments are submitted, then this cannot be tested.&lt;br /&gt;
# For teammate review report, author feedback report and review report, click against &amp;quot;review report&amp;quot; and all the review reports can be seen by selecting it in the drop down menu.&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101574</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101574"/>
		<updated>2016-04-01T04:56:45Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Testing UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
Peer review information:&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;br /&gt;
&lt;br /&gt;
Testing UI:&lt;br /&gt;
&lt;br /&gt;
# Login as an instructor (Using Instructor6 will help you import the participants from other assignments).&lt;br /&gt;
# Navigate to &amp;quot;Manage-&amp;gt;Assignments&amp;quot;.&lt;br /&gt;
# Click on &amp;quot;New Public Assignment&amp;quot; for creating a new assignment.&lt;br /&gt;
# Create a new assignment by providing assignment name, selecting a course, submission directory (Give any name) and description URL.&lt;br /&gt;
# Select &amp;quot;has teams?&amp;quot; and provide the team size. Click on create to create a new assignment.&lt;br /&gt;
## After that, click on review strategy and limit the number of reviews per submission.&lt;br /&gt;
## Click on &amp;quot;Due dates&amp;quot; and update date for submission and review. Adjust the review date and time in order to test the reviews.&lt;br /&gt;
## Click on &amp;quot;save&amp;quot;. A new assignment is created and it can be viewed in &amp;quot;Manage-&amp;gt;Assignments&amp;quot; section.&lt;br /&gt;
# In order to add participants, there are two methods to add students to the assignment.&lt;br /&gt;
## Click on &amp;quot;add participants&amp;quot; against the assignment. Enter the user login to add the student. Add atleast 6 participants so that the review mapping can be seen.&lt;br /&gt;
## Click on any previous assignment &amp;quot;add participants&amp;quot; and export the students list (I used wiki assignment).&lt;br /&gt;
## Click on your assignment &amp;quot;add participants&amp;quot; and import the students using the export file.&lt;br /&gt;
# Go back to &amp;quot;Assignments&amp;quot; section and click against &amp;quot;create teams&amp;quot;.&lt;br /&gt;
## After clicking on &amp;quot;create teams&amp;quot;, Click on &amp;quot;create teams&amp;quot; in the directed page.&lt;br /&gt;
### Teams can be formed either manually or automatically.&lt;br /&gt;
# Login as a student to submit the links for assignment (Valid hyperlink must be provided in the submission link). Add submission for atleast 5 students in order to check the automatic review mapping.&lt;br /&gt;
# After submitting the links for some students, Log in as an instructor to change the assignment phase to review phase.&lt;br /&gt;
## To change the review phase period, Go to assignments section and click on edit. Click on due dates and change the review due date.&lt;br /&gt;
# Now, login as a student and go to others work. Click on &amp;quot;Request a submission to review&amp;quot; and check whether a review is assigned automatically. If no assignments are submitted, then this cannot be tested.&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101557</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101557"/>
		<updated>2016-03-31T06:34:39Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Testing UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
Peer review information:&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;br /&gt;
&lt;br /&gt;
Testing UI:&lt;br /&gt;
&lt;br /&gt;
# Login as an instructor (Using Instructor6 will help you import the participants from other assignments).&lt;br /&gt;
# Navigate to &amp;quot;Manage-&amp;gt;Assignments&amp;quot;.&lt;br /&gt;
# Click on &amp;quot;New Public Assignment&amp;quot; for creating a new assignment.&lt;br /&gt;
# Create a new assignment by providing assignment name, selecting a course, submission directory (Give any name) and description URL.&lt;br /&gt;
# Select &amp;quot;has teams?&amp;quot; and provide the team size. Click on create to create a new assignment.&lt;br /&gt;
## After that, click on review strategy and limit the number of reviews per submission.&lt;br /&gt;
## Click on &amp;quot;Due dates&amp;quot; and update date for submission and review. Adjust the review date and time in order to test the reviews.&lt;br /&gt;
## Click on &amp;quot;save&amp;quot;. A new assignment is created and it can be viewed in &amp;quot;Manage-&amp;gt;Assignments&amp;quot; section.&lt;br /&gt;
# In order to add participants, there are two methods to add students to the assignment.&lt;br /&gt;
## Click on &amp;quot;add participants&amp;quot; against the assignment. Enter the user login to add the student. Add atleast 6 participants so that the review mapping can be seen.&lt;br /&gt;
## Click on any previous assignment &amp;quot;add participants&amp;quot; and export the students list (I used wiki assignment).&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101556</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101556"/>
		<updated>2016-03-31T06:33:07Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Testing UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
Peer review information:&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;br /&gt;
&lt;br /&gt;
Testing UI:&lt;br /&gt;
&lt;br /&gt;
# Login as an instructor (Using Instructor6 will help you import the participants from other assignments).&lt;br /&gt;
# Navigate to &amp;quot;Manage-&amp;gt;Assignments&amp;quot;.&lt;br /&gt;
# Click on &amp;quot;New Public Assignment&amp;quot; for creating a new assignment.&lt;br /&gt;
# Create a new assignment by providing assignment name, selecting a course, submission directory (Give any name) and description URL.&lt;br /&gt;
# Select &amp;quot;has teams?&amp;quot; and provide the team size. Click on create to create a new assignment.&lt;br /&gt;
## After that, click on review strategy and limit the number of reviews per submission.&lt;br /&gt;
## Click on &amp;quot;Due dates&amp;quot; and update date for submission and review. Adjust the review date and time in order to test the reviews.&lt;br /&gt;
## Click on &amp;quot;save&amp;quot;. A new assignment is created and it can be viewed in &amp;quot;Manage-&amp;gt;Assignments&amp;quot; section.&lt;br /&gt;
# In order to add participants, there are two methods to add students to the assignment.&lt;br /&gt;
## Click on add participants. Enter the user login to add the student. Add atleast 6 participants so that the review mapping can be seen.&lt;br /&gt;
## Click on any previous assignment &amp;quot;add participants&amp;quot; and export the students list (I used wiki assignment).&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101555</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101555"/>
		<updated>2016-03-31T06:22:42Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Testing UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
Peer review information:&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;br /&gt;
&lt;br /&gt;
Testing UI:&lt;br /&gt;
&lt;br /&gt;
# Login as an instructor (Using Instructor6 will help you import the participants from other assignments).&lt;br /&gt;
# Navigate to &amp;quot;Manage-&amp;gt;Assignments&amp;quot;.&lt;br /&gt;
# Click on &amp;quot;New Public Assignment&amp;quot; for creating a new assignment.&lt;br /&gt;
# Create a new assignment by providing assignment name, selecting a course, submission directory (Give any name) and description URL.&lt;br /&gt;
# Select &amp;quot;has teams?&amp;quot; and provide the team size. Click on create to create a new assignment.&lt;br /&gt;
## After that, click on review strategy and limit the number of reviews per submission.&lt;br /&gt;
## Click on &amp;quot;Due dates&amp;quot; and update date for submission and review. Adjust the review date and time in order to test the reviews.&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101554</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101554"/>
		<updated>2016-03-31T05:28:10Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Testing UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
Peer review information:&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;br /&gt;
&lt;br /&gt;
Testing UI:&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/OSS_E1601&amp;diff=101553</id>
		<title>CSC/ECE 517 Spring 2016/OSS E1601</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/OSS_E1601&amp;diff=101553"/>
		<updated>2016-03-31T05:27:34Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Peer Review Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== E1601: Refactor methods related to submitted_hyperlinks. ===&lt;br /&gt;
&lt;br /&gt;
This wiki is for the open source refactoring project E1601: Refactor methods related to submitted_hyperlinks for the course ECE/CSC 517.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
The reviewers may use the below student and instructor logins for the purpose of reviewing and testing the functionality. These students belong to the same team and work on an assignment created by the below instructor:&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student  login: username -&amp;gt; student5884,  password -&amp;gt; password &lt;br /&gt;
* Student login: username -&amp;gt; student6420,  password -&amp;gt; password&lt;br /&gt;
'''Please note''': Please do not delete the above users or their team. If you wish to do so, please add them back so as to aid other reviewers. Also note that the option to submit hyperlinks in the UI will be displayed to the enrolled students only if assignment deadline is in future and the assignment is not in &amp;quot;Finish&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
== Testing UI ==&lt;br /&gt;
&lt;br /&gt;
== Expertiza Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source web application which enhances the student's learning through peer reviews. The students can form teams and work on assignments given by course instructors. The peers can review the submissions and give feedback. The students also get to review the reviewers!&lt;br /&gt;
&lt;br /&gt;
== Problem statement ==&lt;br /&gt;
&lt;br /&gt;
'''Before''': When a student submitted files and hyperlinks for an assignment, that content was submitted on behalf of his team, and not individually (even if there is only one person in the team i.e a student working on an assignment cannot be without a team even if he is working alone). Some of the previous contributors had worked on a project which made this change and associated all the submitted content to teams instead of the individual participants: the submitted_hyperlinks and dirctory_num fields were moved to teams table. All the hyperlinks were now recorded in one submitted_hyperlinks field in the team model instead of being present in all the participants of the team. All the submitted files similarly were uploaded to the common file space and in the “course_folder/assignment_folder/team_folder” path.&lt;br /&gt;
&lt;br /&gt;
'''What was wrong with that''': There are multiple methods in assignment_participant.rb which still give the impression that the author is submitting the hyperlinks on behalf of himself and not the team even though the relevant fields have been moved to teams model. These methods are to be moved to assignment_teams.rb for improving the clarity and the efficiency of code.&lt;br /&gt;
&lt;br /&gt;
'''What refactoring we have done to improve the code''':&lt;br /&gt;
&lt;br /&gt;
''Task1::'' Removed “hyperlinks_array” method and “hyperlinks” method from assignment_participant.rb. Created “hyperlinks” method in assignment_team.rb.&lt;br /&gt;
&lt;br /&gt;
''Task2::'' Removed “submit_hyperlink” and “remove_hyperlink” from assignment_pariticpant.rb and created equivalent methods in assignment_team.rb.        &lt;br /&gt;
&lt;br /&gt;
''Task3::'' Removed “has_submissions?” from assginment_participant.rb and created the equivalent method in assignment_team.rb.          &lt;br /&gt;
&lt;br /&gt;
''Task4::'' All the calls to the above methods were refactored to call the appropriate method's functions.&lt;br /&gt;
&lt;br /&gt;
''Task5::'' Refactored some of the logic of controller methods.&lt;br /&gt;
&lt;br /&gt;
''Task6::'' Tests for submitting and removing submitted hyperlinks and files.&lt;br /&gt;
&lt;br /&gt;
== List of files changed ==&lt;br /&gt;
&lt;br /&gt;
Model Files:&lt;br /&gt;
&lt;br /&gt;
#assignment_participant.rb&lt;br /&gt;
#assignment_team.rb&lt;br /&gt;
#student_task.rb&lt;br /&gt;
&lt;br /&gt;
View Files:&lt;br /&gt;
&lt;br /&gt;
#submitted_content/_hyperlink.html.erb&lt;br /&gt;
#assignments/edit/_calibration.html.erb&lt;br /&gt;
#assignments/list_submissions.html.erb&lt;br /&gt;
#submitted_content/_main.html.erb&lt;br /&gt;
&lt;br /&gt;
Controller Files:&lt;br /&gt;
&lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
#submitted_content_controller.rb&lt;br /&gt;
&lt;br /&gt;
Files with major modifications:&lt;br /&gt;
&lt;br /&gt;
#The model: assignment_participant.rb&lt;br /&gt;
#The model: assignment_team.rb&lt;br /&gt;
#The controller: submitted_content_controller.rb&lt;br /&gt;
&lt;br /&gt;
== Key changes ==&lt;br /&gt;
&lt;br /&gt;
Four methods &amp;lt;code&amp;gt;hyperlinks&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;has_submissions?&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;submit_hyperlink&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;remove_hyperlink&amp;lt;/code&amp;gt; were moved from the assignment_participant.rb model to assignment_team.rb, and the &amp;lt;code&amp;gt;hyperlinks_array&amp;lt;/code&amp;gt; method was removed.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task1::''' The below methods &amp;lt;code&amp;gt;hyperlinks_array&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;hyperlinks&amp;lt;/code&amp;gt; were removed from the assignment_participant.rb. The &amp;lt;code&amp;gt;hyperlinks&amp;lt;/code&amp;gt; method which existed here seemed suspect as there was no &amp;lt;code&amp;gt;hyperlinks&amp;lt;/code&amp;gt; method in the AssignmentTeam/Team models so the &amp;lt;code&amp;gt;try&amp;lt;/code&amp;gt; would always fail and return an empty array. Also the &amp;lt;code&amp;gt;hyperlinks_array&amp;lt;/code&amp;gt; method retrieved the hyperlinks from the &amp;lt;code&amp;gt;submitted_hyperlinks&amp;lt;/code&amp;gt; field of the team model so in moving to AssignmentTeam model we just had to remove the .team quantifier.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def hyperlinks&lt;br /&gt;
    team.try(:hyperlinks) || []&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def hyperlinks_array&lt;br /&gt;
    self.team.submitted_hyperlinks.blank? ? [] : YAML::load(self.team.submitted_hyperlinks)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They are both merged into a new single &amp;lt;code&amp;gt;hyperlinks&amp;lt;/code&amp;gt; method in assignment_team.rb. All callers of both methods were refactored to use &amp;lt;code&amp;gt;hyperlinks&amp;lt;/code&amp;gt; method of AssignmentTeam.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def hyperlinks&lt;br /&gt;
        self.submitted_hyperlinks.blank? ? [] : YAML::load(self.submitted_hyperlinks)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task2::''' Earlier, the following method &amp;lt;code&amp;gt;submit_hyperlink&amp;lt;/code&amp;gt; was in assignment_participant.rb:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def submit_hyperlink(hyperlink)&lt;br /&gt;
    hyperlink.strip!&lt;br /&gt;
    raise &amp;quot;The hyperlink cannot be empty&amp;quot; if hyperlink.empty?&lt;br /&gt;
    url = URI.parse(hyperlink)&lt;br /&gt;
    # If not a valid URL, it will throw an exception&lt;br /&gt;
    Net::HTTP.start(url.host, url.port)&lt;br /&gt;
    hyperlinks = self.hyperlinks_array&lt;br /&gt;
    hyperlinks &amp;lt;&amp;lt; hyperlink&lt;br /&gt;
    team_object = self.team&lt;br /&gt;
    team_object.submitted_hyperlinks = YAML::dump(hyperlinks)&lt;br /&gt;
    team_object.save&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It has been now moved to assignment_team.rb as below. Again, as the method was moved to AssignmentTeam model, it obviated the need to invoke the &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def submit_hyperlink(hyperlink)&lt;br /&gt;
        hyperlink.strip!&lt;br /&gt;
        raise &amp;quot;The hyperlink cannot be empty&amp;quot; if hyperlink.empty?&lt;br /&gt;
        url = URI.parse(hyperlink)&lt;br /&gt;
        # If not a valid URL, it will throw an exception&lt;br /&gt;
        Net::HTTP.start(url.host, url.port)&lt;br /&gt;
        hyperlinks = self.hyperlinks&lt;br /&gt;
        hyperlinks &amp;lt;&amp;lt; hyperlink&lt;br /&gt;
        self.submitted_hyperlinks = YAML::dump(hyperlinks)&lt;br /&gt;
        self.save&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
A similar refactoring was done for &amp;lt;code&amp;gt;remove_hyperlinks&amp;lt;/code&amp;gt; method in assignment_participant.rb. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task3::''' The methods &amp;lt;code&amp;gt;has_submissions?&amp;lt;/code&amp;gt; earlier existed both in AssignmentTeam model and AssignmentParticipant model.&lt;br /&gt;
&lt;br /&gt;
'' In assignment_team.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def has_submissions?&lt;br /&gt;
        list_of_users = participants;&lt;br /&gt;
        list_of_users.each { |participant| return true if participant.has_submissions? }&lt;br /&gt;
        false&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
''In assignment_participant.rb''&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def has_submissions?&lt;br /&gt;
        return ((self.team.submitted_files.length &amp;gt; 0) or (hyperlinks_array.length &amp;gt; 0))&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What was happening earlier was that &amp;lt;code&amp;gt;has_submissions?&amp;lt;/code&amp;gt; (AssignmentTeam method) used to call &amp;lt;code&amp;gt;has_submissions?&amp;lt;/code&amp;gt; for each of the AssignmentParticipants in the team. This was redundant as  the &amp;lt;code&amp;gt;submitted_files&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;submitted_hyperlinks&amp;lt;/code&amp;gt; fields had been moved from the participant to the team model in earlier projects. So the participant objects again ended up again going to the team for retrieving these fields.&lt;br /&gt;
&lt;br /&gt;
So we removed &amp;lt;code&amp;gt;has_submissions?&amp;lt;/code&amp;gt; from the AssignmentParticipant and refactored the one already present in AssignmentTeam to the simple code below:&lt;br /&gt;
&lt;br /&gt;
''In assignment_team.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; &lt;br /&gt;
  def has_submissions?&lt;br /&gt;
        return ((self.submitted_files.length &amp;gt; 0) or (hyperlinks.length &amp;gt; 0))&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task4::''' Most importantly, at all the places in the Expertiza code, where there were calls to the above mentioned methods in assignment_participant.rb, they were refactored appropriately to call the newly created methods in assignment_team.rb.&lt;br /&gt;
&lt;br /&gt;
''Sample example :''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
        if (participant.submitted_at.nil? &amp;amp;&amp;amp; participant.hyperlinks.empty?)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''This was refactored as''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
        if (participant.submitted_at.nil? &amp;amp;&amp;amp; participant.team.hyperlinks.empty?)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In refactoring the call points, we used the existing &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt; method of AssignmentParticipant to get the AssignmentTeam object associated with the particular participant and then invoked the equivalent methods on the &amp;lt;code&amp;gt;team&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Task5 ::''' Refactoring some of controller code.&lt;br /&gt;
&lt;br /&gt;
In submitted_content_controller, &amp;lt;code&amp;gt;remove_hyperlink&amp;lt;/code&amp;gt; method used to cycle through all the participants belonging to the team of current participant, and for each participant call the &amp;lt;code&amp;gt;remove_hyperlink&amp;lt;/code&amp;gt; method of the AssignmentParticipant Model to delete the instance of input hyperlink.&lt;br /&gt;
&lt;br /&gt;
Since all the required hyperlink methods and fields are now in AssignmentTeam this would be redundant and waste cycles. So we refactored it to directly call the AssignmentTeam &amp;lt;code&amp;gt;remove_hyperlink&amp;lt;/code&amp;gt; method.&lt;br /&gt;
&lt;br /&gt;
''Earlier in submitted_content_controller.rb''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def remove_hyperlink&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:hyperlinks][:participant_id])&lt;br /&gt;
 &lt;br /&gt;
    return unless current_user_id?(@participant.user_id)&lt;br /&gt;
    hyperlink_to_delete = @participant.hyperlinks_array[params['chk_links'].to_i]&lt;br /&gt;
  &lt;br /&gt;
    team_id = TeamsUser.team_id(@participant.parent_id, @participant.user_id)&lt;br /&gt;
    team_participants = Array.new&lt;br /&gt;
    if Team.exists?(team_id)&lt;br /&gt;
      team_users = TeamsUser.where(team_id: team_id)&lt;br /&gt;
      team_users.each do |team_user|&lt;br /&gt;
        team_participants &amp;lt;&amp;lt; AssignmentParticipant.where(parent_id: @participant.parent_id, user_id: team_user.user_id).first&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      team_participants &amp;lt;&amp;lt; @participant&lt;br /&gt;
    end&lt;br /&gt;
  &lt;br /&gt;
    team_participants.each do |team_participant|&lt;br /&gt;
      team_participant.remove_hyperlink(hyperlink_to_delete)&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Refactored:''&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def remove_hyperlink&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:hyperlinks][:participant_id])&lt;br /&gt;
 &lt;br /&gt;
    return unless current_user_id?(@participant.user_id)&lt;br /&gt;
 &lt;br /&gt;
    team = @participant.team&lt;br /&gt;
    hyperlink_to_delete = team.hyperlinks[params['chk_links'].to_i]&lt;br /&gt;
    team.remove_hyperlink(hyperlink_to_delete)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing Details ==&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
There were no existing tests for the hyperlinks related methods. We used RSpec to write test cases using TTD approach. The assignment_team_spec.rb in the spec folder will have these tests. All the tests can be executed by rspec spec command, or can also be executed individually using the command &amp;quot;rspec spec/models/assignment_team_spec.rb&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Following are some of the steps which we performed to test this code from the User interface.&lt;br /&gt;
&lt;br /&gt;
''Before the test::'' Have two students in an assignment team (say student1 and student2, you can also use the student logins listed in this wiki) for an active assignment. Active assignment simply means that the due date is in future and the assignment is not in &amp;quot;Finish&amp;quot; state. You can use an instructor login (example username: instructor6 password: password) to create a new assignment or update the due dates of some previous assignment and assign the team to it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Test1:''  Login as student1. Submit a hyperlink (say : linkA) as student1.&lt;br /&gt;
&lt;br /&gt;
''Expected:'' Submit should go through. The hyperlink should be visible when you login as student2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Test2:'' Now as student2, submit another hyperlink (say linkB).&lt;br /&gt;
&lt;br /&gt;
''Expected:'' Submit should go through. Now both hyperlinks should be visible from both student1 and student2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Test3:'' As student1, try submitting linkB.&lt;br /&gt;
&lt;br /&gt;
''Expected:'' As linkB already exists in team's hyperlinks the submit should not go through.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Test4:'' Remove a hyperlink (say linkA).&lt;br /&gt;
&lt;br /&gt;
''Expected:'' Remove goes through. Now only linkB should be visible from both student accounts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Test5:'' Remove all hyperlinks.&lt;br /&gt;
&lt;br /&gt;
''Expected:'' Hyperlinks list is empty for team and this can be seen from both student accounts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Test6:'' Submit some hyperlink. Try dropping topic after submitting.&lt;br /&gt;
&lt;br /&gt;
''Expected:'' You are not allowed to drop if you have submitted some work. Only if you remove the submitted work it is possible for you to drop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Test7:'' Submit some hyperlink. Do a review of the team after logging in as a student in another team. The assignment should be in review stage for this to be possible, you can move the due dates via instructor login to achieve this.&lt;br /&gt;
&lt;br /&gt;
''Expected:'' Peer review should show the links submitted by the other team. Review should be submitted successfully.&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101552</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101552"/>
		<updated>2016-03-31T05:26:15Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Testing UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
Peer review information:&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101551</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101551"/>
		<updated>2016-03-31T05:26:02Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Testing UI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;br /&gt;
&lt;br /&gt;
Peer review insformation:&lt;br /&gt;
* Instructor Login: &lt;br /&gt;
        Username: Instructor6&lt;br /&gt;
        Password: password&lt;br /&gt;
* Student login:&lt;br /&gt;
        Username: Student6384&lt;br /&gt;
        Password: password&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101550</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101550"/>
		<updated>2016-03-31T05:17:06Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Wiki write up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Testing UI'''===&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101333</id>
		<title>CSC/ECE 517 Spring 2016/Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101333"/>
		<updated>2016-03-24T03:41:04Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Code Improvements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1615. Refactoring the Review Mapping Controller==&lt;br /&gt;
&lt;br /&gt;
This page provides details about the OSS project which was based on refactoring one of controllers related to peer reviewing strategies used in Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''About Review mapping controller'''==&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the team for a submission , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
=='''Code Improvements'''==&lt;br /&gt;
&lt;br /&gt;
==='''Unused variables and arguments'''===&lt;br /&gt;
&lt;br /&gt;
There are unused variables in the methods which use the stack unnecessarily. So, it is better to remove the unused variables or at the least indicate that a variable is unused.&lt;br /&gt;
&lt;br /&gt;
For suppose when both keys and values are not used in a hash but are given as arguments, then the unused variables can be indicated by adding a &amp;quot;_&amp;quot; infront of the name or replace the unused variable with &amp;quot;_&amp;quot; to represent it as unused variable but allow them in arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above case teams_hash should consist of a hash with both keys and values but the sorting is done based on values. So the key is replaced with a &amp;quot;_&amp;quot; so that the user may deem it unused in the implementation of the process.&lt;br /&gt;
&lt;br /&gt;
==='''Use sample instead of shuffle'''===&lt;br /&gt;
&lt;br /&gt;
When sample is used, the elements in an array are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle. Also by using shuffle[0] we are shuffling all the elements in the array and then picking the first element instead of picking a single element randomly which is more efficient. The following are the couple of places where shuffle[0] was used and is replaced by sample.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Cyclomatic complexity of automatic_review_mapping_strategy method'''===&lt;br /&gt;
&lt;br /&gt;
The method automatic_review_mapping_strategy handles the number of reviews assigned to a individual and also the number of reviews that can be done with in a team. The method is very long and has many nested if statements due to which the complexity of the method is very high. Instead of a single method handling all the parts of the strategy, it is divided into several parts due to which the code is more readable and also the complexity of code is shared by each method.&lt;br /&gt;
&lt;br /&gt;
The method first checks the number of participants that are in an assignment and the number of teams that are present. It then sets the values for the maximum number of reviews that are possible and also the minimum number that are required. Then it assigns the reviews to each of the teams randomly when a request for review is made by a participant. At last it checks if the participant has the minimum number of reviews required after allotting the reviews. If not, it assigns more reviews to valid teams so that the minimum requirement is met.&lt;br /&gt;
&lt;br /&gt;
The part of the code that is moved out of automatic_review_mapping_strategy as peer_review_strategy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private&lt;br /&gt;
	def peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
		iterator = 0&lt;br /&gt;
		teams.each do |team|&lt;br /&gt;
		  selected_participants = Array.new&lt;br /&gt;
		  if !team.equal? teams.last&lt;br /&gt;
			#need to even out the # of reviews for teams&lt;br /&gt;
			while selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
			  num_participants_this_team = TeamsUser.where(team_id: team.id).size&lt;br /&gt;
			  #If there are some submitters or reviewers in this team, they are not treated as normal participants.&lt;br /&gt;
			  #They should be removed from 'num_participants_this_team'&lt;br /&gt;
			  TeamsUser.where(team_id: team.id).each do |team_user|&lt;br /&gt;
				temp_participant = Participant.where(user_id: team_user.user_id, parent_id: assignment_id).first&lt;br /&gt;
				num_participants_this_team -= 1 if temp_participant.can_review == false or temp_participant.can_submit == false&lt;br /&gt;
			  end&lt;br /&gt;
			  #if all outstanding participants are already in selected_participants, just break the loop.&lt;br /&gt;
			  break if selected_participants.size == participants.size - num_participants_this_team&lt;br /&gt;
&lt;br /&gt;
			  # generate random number&lt;br /&gt;
			  if iterator == 0&lt;br /&gt;
				rand_num = rand(0..num_participants-1)&lt;br /&gt;
			  else&lt;br /&gt;
				min_value = participants_hash.values.min&lt;br /&gt;
				#get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
				participants_with_min_assigned_reviews = Array.new&lt;br /&gt;
				participants.each do |participant|&lt;br /&gt;
				  participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
				end&lt;br /&gt;
				#if participants_with_min_assigned_reviews is blank &lt;br /&gt;
				if_condition_1 = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
				#or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
				if_condition_2 = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
				if if_condition_1 or if_condition_2&lt;br /&gt;
				  #use original method to get random number&lt;br /&gt;
				  rand_num = rand(0..num_participants-1)&lt;br /&gt;
				else&lt;br /&gt;
				  #rand_num should be the position of this participant in original array&lt;br /&gt;
				  rand_num = participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size-1)]&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			  # prohibit one student to review his/her own artifact&lt;br /&gt;
			  next if TeamsUser.exists?(team_id: team.id, user_id: participants[rand_num].user_id)&lt;br /&gt;
&lt;br /&gt;
			  if_condition_1 = (participants_hash[participants[rand_num].id] &amp;lt; student_review_num)&lt;br /&gt;
			  if_condition_2 = (!selected_participants.include? participants[rand_num].id)&lt;br /&gt;
			  if if_condition_1 and if_condition_2&lt;br /&gt;
				# selected_participants cannot include duplicate num&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participants[rand_num].id&lt;br /&gt;
				participants_hash[participants[rand_num].id] += 1&lt;br /&gt;
			  end &lt;br /&gt;
			  # remove students who have already been assigned enough num of reviews out of participants array&lt;br /&gt;
			  participants.each do |participant|&lt;br /&gt;
				if participants_hash[participant.id] == student_review_num&lt;br /&gt;
				  participants.delete_at(rand_num)&lt;br /&gt;
				  num_participants -= 1&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  else&lt;br /&gt;
			#review num for last team can be different from other teams.&lt;br /&gt;
			#prohibit one student to review his/her own artifact and selected_participants cannot include duplicate num&lt;br /&gt;
			participants.each do |participant| &lt;br /&gt;
			  # avoid last team receives too many peer reviews&lt;br /&gt;
			  if !TeamsUser.exists?(team_id: team.id, user_id: participant.user_id) and selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participant.id &lt;br /&gt;
				participants_hash[participant.id] += 1&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  end&lt;br /&gt;
&lt;br /&gt;
		  begin&lt;br /&gt;
			selected_participants.each {|index| ReviewResponseMap.where(:reviewee_id =&amp;gt; team.id, :reviewer_id =&amp;gt; index, :reviewed_object_id =&amp;gt; assignment_id).first_or_create}&lt;br /&gt;
		  rescue&lt;br /&gt;
			flash[:error] = &amp;quot;Automatic assignment of reviewer failed.&amp;quot;&lt;br /&gt;
		  end&lt;br /&gt;
		  iterator += 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The method is made private so that it can only be called with in the controller and cannot directly be called through a view.&lt;br /&gt;
&lt;br /&gt;
The complexity of the original method reduced after breaking it and can be easily readable now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def automatic_review_mapping_strategy(assignment_id, participants, teams, student_review_num=0, submission_review_num=0)&lt;br /&gt;
    participants_hash = {}&lt;br /&gt;
    participants.each { |participant| participants_hash[participant.id] = 0 }&lt;br /&gt;
    #calculate reviewers for each team&lt;br /&gt;
    num_participants = participants.size&lt;br /&gt;
    if student_review_num != 0 and submission_review_num == 0&lt;br /&gt;
      num_reviews_per_team = (participants.size * student_review_num * 1.0 / teams.size).round&lt;br /&gt;
      exact_num_of_review_needed = participants.size * student_review_num&lt;br /&gt;
    elsif student_review_num == 0 and submission_review_num != 0&lt;br /&gt;
      num_reviews_per_team = submission_review_num&lt;br /&gt;
      student_review_num = (teams.size * submission_review_num * 1.0 / participants.size).round&lt;br /&gt;
      exact_num_of_review_needed = teams.size * submission_review_num&lt;br /&gt;
    end&lt;br /&gt;
    #Exception detection: If instructor want to assign too many reviews done by each student, there will be an error msg.&lt;br /&gt;
    if student_review_num &amp;gt;= teams.size&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done by each student to be greater than or equal to total number of teams [or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
&lt;br /&gt;
    # after assigning peer reviews for each team, if there are still some peer reviewers not obtain enough peer review, just assign them to valid teams&lt;br /&gt;
    if ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and created_at &amp;gt; ? and calibrate_to = ?&amp;quot;, assignment_id, @@time_create_last_review_mapping_record, 0]).size &amp;lt; exact_num_of_review_needed&lt;br /&gt;
      participants_with_insufficient_review_num = Array.new&lt;br /&gt;
      participants_hash.each do |participant_id, review_num|&lt;br /&gt;
        participants_with_insufficient_review_num &amp;lt;&amp;lt; participant_id if review_num &amp;lt; student_review_num&lt;br /&gt;
      end&lt;br /&gt;
      unsorted_teams_hash = {}&lt;br /&gt;
      ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and calibrate_to = ?&amp;quot;, assignment_id, 0]).each do |response_map|&lt;br /&gt;
        unless unsorted_teams_hash.has_key? (response_map.reviewee_id)&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] = 1 &lt;br /&gt;
        else&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] += 1&lt;br /&gt;
        end&lt;br /&gt;
      end &lt;br /&gt;
      teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
      participants_with_insufficient_review_num.each do |participant_id|&lt;br /&gt;
        teams_hash.each do |team_id, num_review_received|&lt;br /&gt;
          unless TeamsUser.exists?(team_id: team_id, user_id: Participant.find(participant_id).user_id)&lt;br /&gt;
            ReviewResponseMap.where(:reviewee_id =&amp;gt; team_id, :reviewer_id =&amp;gt; participant_id, :reviewed_object_id =&amp;gt; assignment_id).first_or_create&lt;br /&gt;
            teams_hash[team_id] += 1&lt;br /&gt;
            teams_hash = teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
            break&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @@time_create_last_review_mapping_record = ReviewResponseMap.where(reviewed_object_id: assignment_id).last.created_at&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4. Moving code specific to models to models instead of controller'''&lt;br /&gt;
&lt;br /&gt;
The method response_report contains code which generates reports based on the input of one of the three of 'ReviewResponseMap', 'FeedbackResponseMap', 'TeammateReviewResponseMap' and 'Calibration'. Calibration is a special case and should be handled in the controller itself. But the other three are models that are subclasses of ResponseMap model. The report is generated for each of the three by calling the ResponseMap model and obtaining the values by querying the database. Moving the code to the models and calling the methods in the model through the controller makes more sense than writing the code in controller.&lt;br /&gt;
&lt;br /&gt;
The following is the code snippet from the original method which contains the calls to ResponseMap model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
      if params[:user].nil?&lt;br /&gt;
        # This is not a search, so find all reviewers for this assignment&lt;br /&gt;
        response_maps_with_distinct_participant_id = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ? and calibrate_to = ?&amp;quot;, @id, @type, 0])&lt;br /&gt;
        @reviewers = []&lt;br /&gt;
        response_maps_with_distinct_participant_id.each do |reviewer_id_from_response_map|&lt;br /&gt;
          @reviewers &amp;lt;&amp;lt; (AssignmentParticipant.find(reviewer_id_from_response_map.reviewer_id))&lt;br /&gt;
        end&lt;br /&gt;
        @reviewers = Participant.sort_by_name(@reviewers)&lt;br /&gt;
      else&lt;br /&gt;
        # This is a search, so find reviewers by user's full name&lt;br /&gt;
        user = User.select(&amp;quot;DISTINCT id&amp;quot;).where([&amp;quot;fullname LIKE ?&amp;quot;, '%'+params[:user][:fullname]+'%'])&lt;br /&gt;
        @reviewers = AssignmentParticipant.where([&amp;quot;user_id IN (?) and parent_id = ?&amp;quot;, user, @assignment.id])&lt;br /&gt;
      end&lt;br /&gt;
      #  @review_scores[reveiwer_id][reviewee_id] = score for assignments not using vary_rubric_by_rounds feature&lt;br /&gt;
      # @review_scores[reviewer_id][round][reviewee_id] = score for assignments using vary_rubric_by_rounds feature&lt;br /&gt;
      @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
      @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
    when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'FeedbackResponseMap' and &lt;br /&gt;
      #reviewed_object_id in (select id from responses where &lt;br /&gt;
      #map_id in (select id from response_maps where reviewed_object_id = 722 and type = 'ReviewResponseMap'))&lt;br /&gt;
      @review_response_map_ids = ResponseMap.select(&amp;quot;id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'ReviewResponseMap'])&lt;br /&gt;
      @response_ids = Response.select(&amp;quot;id&amp;quot;).where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id IN (?) and type = ?&amp;quot;, @response_ids, @type])&lt;br /&gt;
    when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'TeammateReviewResponseMap' and reviewed_object_id = 711&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'TeammateReviewResponseMap'])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same code after moving the methods to their respective models looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
      when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
        @review_user= params[:user]&lt;br /&gt;
        #If review response is required call review_response_report method in review_response_map model&lt;br /&gt;
        @reviewers = ReviewResponseMap.review_response_report(@id, @assignment,@type, @review_user)&lt;br /&gt;
        @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
        @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
      when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
        #If review report for feedback is required call feedback_response_report method in feedback_review_response_map model&lt;br /&gt;
        @reviewers = FeedbackResponseMap.feedback_response_report(@id, @type)&lt;br /&gt;
      when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
        #If review report for teammate is required call teammate_response_report method in teammate_review_response_map model&lt;br /&gt;
        @reviewers = TeammateReviewResponseMap.teammate_response_report(@id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/harsha1007/expertiza Forked repository for the project]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Expertiza Main Page]&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101332</id>
		<title>CSC/ECE 517 Spring 2016/Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101332"/>
		<updated>2016-03-24T03:36:50Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* 1. Unused variables and arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1615. Refactoring the Review Mapping Controller==&lt;br /&gt;
&lt;br /&gt;
This page provides details about the OSS project which was based on refactoring one of controllers related to peer reviewing strategies used in Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''About Review mapping controller'''==&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the team for a submission , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
=='''Code Improvements'''==&lt;br /&gt;
&lt;br /&gt;
==='''1. Unused variables and arguments'''===&lt;br /&gt;
&lt;br /&gt;
There are unused variables in the methods which use the stack unnecessarily. So, it is better to remove the unused variables or at the least indicate that a variable is unused.&lt;br /&gt;
&lt;br /&gt;
For suppose when both keys and values are not used in a hash but are given as arguments, then the unused variables can be indicated by adding a &amp;quot;_&amp;quot; infront of the name or replace the unused variable with &amp;quot;_&amp;quot; to represent it as unused variable but allow them in arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above case teams_hash should consist of a hash with both keys and values but the sorting is done based on values. So the key is replaced with a &amp;quot;_&amp;quot; so that the user may deem it unused in the implementation of the process.&lt;br /&gt;
&lt;br /&gt;
==='''2. Use sample instead of shuffle'''===&lt;br /&gt;
&lt;br /&gt;
When sample is used, the elements in an array are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle. Also by using shuffle[0] we are shuffling all the elements in the array and then picking the first element instead of picking a single element randomly which is more efficient. The following are the couple of places where shuffle[0] was used and is replaced by sample.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''3. Cyclomatic complexity of automatic_review_mapping_strategy method'''===&lt;br /&gt;
&lt;br /&gt;
The method automatic_review_mapping_strategy handles the number of reviews assigned to a individual and also the number of reviews that can be done with in a team. The method is very long and has many nested if statements due to which the complexity of the method is very high. Instead of a single method handling all the parts of the strategy, it is divided into several parts due to which the code is more readable and also the complexity of code is shared by each method.&lt;br /&gt;
&lt;br /&gt;
The method first checks the number of participants that are in an assignment and the number of teams that are present. It then sets the values for the maximum number of reviews that are possible and also the minimum number that are required. Then it assigns the reviews to each of the teams randomly when a request for review is made by a participant. At last it checks if the participant has the minimum number of reviews required after allotting the reviews. If not, it assigns more reviews to valid teams so that the minimum requirement is met.&lt;br /&gt;
&lt;br /&gt;
The part of the code that is moved out of automatic_review_mapping_strategy as peer_review_strategy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private&lt;br /&gt;
	def peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
		iterator = 0&lt;br /&gt;
		teams.each do |team|&lt;br /&gt;
		  selected_participants = Array.new&lt;br /&gt;
		  if !team.equal? teams.last&lt;br /&gt;
			#need to even out the # of reviews for teams&lt;br /&gt;
			while selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
			  num_participants_this_team = TeamsUser.where(team_id: team.id).size&lt;br /&gt;
			  #If there are some submitters or reviewers in this team, they are not treated as normal participants.&lt;br /&gt;
			  #They should be removed from 'num_participants_this_team'&lt;br /&gt;
			  TeamsUser.where(team_id: team.id).each do |team_user|&lt;br /&gt;
				temp_participant = Participant.where(user_id: team_user.user_id, parent_id: assignment_id).first&lt;br /&gt;
				num_participants_this_team -= 1 if temp_participant.can_review == false or temp_participant.can_submit == false&lt;br /&gt;
			  end&lt;br /&gt;
			  #if all outstanding participants are already in selected_participants, just break the loop.&lt;br /&gt;
			  break if selected_participants.size == participants.size - num_participants_this_team&lt;br /&gt;
&lt;br /&gt;
			  # generate random number&lt;br /&gt;
			  if iterator == 0&lt;br /&gt;
				rand_num = rand(0..num_participants-1)&lt;br /&gt;
			  else&lt;br /&gt;
				min_value = participants_hash.values.min&lt;br /&gt;
				#get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
				participants_with_min_assigned_reviews = Array.new&lt;br /&gt;
				participants.each do |participant|&lt;br /&gt;
				  participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
				end&lt;br /&gt;
				#if participants_with_min_assigned_reviews is blank &lt;br /&gt;
				if_condition_1 = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
				#or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
				if_condition_2 = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
				if if_condition_1 or if_condition_2&lt;br /&gt;
				  #use original method to get random number&lt;br /&gt;
				  rand_num = rand(0..num_participants-1)&lt;br /&gt;
				else&lt;br /&gt;
				  #rand_num should be the position of this participant in original array&lt;br /&gt;
				  rand_num = participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size-1)]&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			  # prohibit one student to review his/her own artifact&lt;br /&gt;
			  next if TeamsUser.exists?(team_id: team.id, user_id: participants[rand_num].user_id)&lt;br /&gt;
&lt;br /&gt;
			  if_condition_1 = (participants_hash[participants[rand_num].id] &amp;lt; student_review_num)&lt;br /&gt;
			  if_condition_2 = (!selected_participants.include? participants[rand_num].id)&lt;br /&gt;
			  if if_condition_1 and if_condition_2&lt;br /&gt;
				# selected_participants cannot include duplicate num&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participants[rand_num].id&lt;br /&gt;
				participants_hash[participants[rand_num].id] += 1&lt;br /&gt;
			  end &lt;br /&gt;
			  # remove students who have already been assigned enough num of reviews out of participants array&lt;br /&gt;
			  participants.each do |participant|&lt;br /&gt;
				if participants_hash[participant.id] == student_review_num&lt;br /&gt;
				  participants.delete_at(rand_num)&lt;br /&gt;
				  num_participants -= 1&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  else&lt;br /&gt;
			#review num for last team can be different from other teams.&lt;br /&gt;
			#prohibit one student to review his/her own artifact and selected_participants cannot include duplicate num&lt;br /&gt;
			participants.each do |participant| &lt;br /&gt;
			  # avoid last team receives too many peer reviews&lt;br /&gt;
			  if !TeamsUser.exists?(team_id: team.id, user_id: participant.user_id) and selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participant.id &lt;br /&gt;
				participants_hash[participant.id] += 1&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  end&lt;br /&gt;
&lt;br /&gt;
		  begin&lt;br /&gt;
			selected_participants.each {|index| ReviewResponseMap.where(:reviewee_id =&amp;gt; team.id, :reviewer_id =&amp;gt; index, :reviewed_object_id =&amp;gt; assignment_id).first_or_create}&lt;br /&gt;
		  rescue&lt;br /&gt;
			flash[:error] = &amp;quot;Automatic assignment of reviewer failed.&amp;quot;&lt;br /&gt;
		  end&lt;br /&gt;
		  iterator += 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The method is made private so that it can only be called with in the controller and cannot directly be called through a view.&lt;br /&gt;
&lt;br /&gt;
The complexity of the original method reduced after breaking it and can be easily readable now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def automatic_review_mapping_strategy(assignment_id, participants, teams, student_review_num=0, submission_review_num=0)&lt;br /&gt;
    participants_hash = {}&lt;br /&gt;
    participants.each { |participant| participants_hash[participant.id] = 0 }&lt;br /&gt;
    #calculate reviewers for each team&lt;br /&gt;
    num_participants = participants.size&lt;br /&gt;
    if student_review_num != 0 and submission_review_num == 0&lt;br /&gt;
      num_reviews_per_team = (participants.size * student_review_num * 1.0 / teams.size).round&lt;br /&gt;
      exact_num_of_review_needed = participants.size * student_review_num&lt;br /&gt;
    elsif student_review_num == 0 and submission_review_num != 0&lt;br /&gt;
      num_reviews_per_team = submission_review_num&lt;br /&gt;
      student_review_num = (teams.size * submission_review_num * 1.0 / participants.size).round&lt;br /&gt;
      exact_num_of_review_needed = teams.size * submission_review_num&lt;br /&gt;
    end&lt;br /&gt;
    #Exception detection: If instructor want to assign too many reviews done by each student, there will be an error msg.&lt;br /&gt;
    if student_review_num &amp;gt;= teams.size&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done by each student to be greater than or equal to total number of teams [or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
&lt;br /&gt;
    # after assigning peer reviews for each team, if there are still some peer reviewers not obtain enough peer review, just assign them to valid teams&lt;br /&gt;
    if ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and created_at &amp;gt; ? and calibrate_to = ?&amp;quot;, assignment_id, @@time_create_last_review_mapping_record, 0]).size &amp;lt; exact_num_of_review_needed&lt;br /&gt;
      participants_with_insufficient_review_num = Array.new&lt;br /&gt;
      participants_hash.each do |participant_id, review_num|&lt;br /&gt;
        participants_with_insufficient_review_num &amp;lt;&amp;lt; participant_id if review_num &amp;lt; student_review_num&lt;br /&gt;
      end&lt;br /&gt;
      unsorted_teams_hash = {}&lt;br /&gt;
      ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and calibrate_to = ?&amp;quot;, assignment_id, 0]).each do |response_map|&lt;br /&gt;
        unless unsorted_teams_hash.has_key? (response_map.reviewee_id)&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] = 1 &lt;br /&gt;
        else&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] += 1&lt;br /&gt;
        end&lt;br /&gt;
      end &lt;br /&gt;
      teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
      participants_with_insufficient_review_num.each do |participant_id|&lt;br /&gt;
        teams_hash.each do |team_id, num_review_received|&lt;br /&gt;
          unless TeamsUser.exists?(team_id: team_id, user_id: Participant.find(participant_id).user_id)&lt;br /&gt;
            ReviewResponseMap.where(:reviewee_id =&amp;gt; team_id, :reviewer_id =&amp;gt; participant_id, :reviewed_object_id =&amp;gt; assignment_id).first_or_create&lt;br /&gt;
            teams_hash[team_id] += 1&lt;br /&gt;
            teams_hash = teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
            break&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @@time_create_last_review_mapping_record = ReviewResponseMap.where(reviewed_object_id: assignment_id).last.created_at&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4. Moving code specific to models to models instead of controller'''&lt;br /&gt;
&lt;br /&gt;
The method response_report contains code which generates reports based on the input of one of the three of 'ReviewResponseMap', 'FeedbackResponseMap', 'TeammateReviewResponseMap' and 'Calibration'. Calibration is a special case and should be handled in the controller itself. But the other three are models that are subclasses of ResponseMap model. The report is generated for each of the three by calling the ResponseMap model and obtaining the values by querying the database. Moving the code to the models and calling the methods in the model through the controller makes more sense than writing the code in controller.&lt;br /&gt;
&lt;br /&gt;
The following is the code snippet from the original method which contains the calls to ResponseMap model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
      if params[:user].nil?&lt;br /&gt;
        # This is not a search, so find all reviewers for this assignment&lt;br /&gt;
        response_maps_with_distinct_participant_id = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ? and calibrate_to = ?&amp;quot;, @id, @type, 0])&lt;br /&gt;
        @reviewers = []&lt;br /&gt;
        response_maps_with_distinct_participant_id.each do |reviewer_id_from_response_map|&lt;br /&gt;
          @reviewers &amp;lt;&amp;lt; (AssignmentParticipant.find(reviewer_id_from_response_map.reviewer_id))&lt;br /&gt;
        end&lt;br /&gt;
        @reviewers = Participant.sort_by_name(@reviewers)&lt;br /&gt;
      else&lt;br /&gt;
        # This is a search, so find reviewers by user's full name&lt;br /&gt;
        user = User.select(&amp;quot;DISTINCT id&amp;quot;).where([&amp;quot;fullname LIKE ?&amp;quot;, '%'+params[:user][:fullname]+'%'])&lt;br /&gt;
        @reviewers = AssignmentParticipant.where([&amp;quot;user_id IN (?) and parent_id = ?&amp;quot;, user, @assignment.id])&lt;br /&gt;
      end&lt;br /&gt;
      #  @review_scores[reveiwer_id][reviewee_id] = score for assignments not using vary_rubric_by_rounds feature&lt;br /&gt;
      # @review_scores[reviewer_id][round][reviewee_id] = score for assignments using vary_rubric_by_rounds feature&lt;br /&gt;
      @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
      @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
    when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'FeedbackResponseMap' and &lt;br /&gt;
      #reviewed_object_id in (select id from responses where &lt;br /&gt;
      #map_id in (select id from response_maps where reviewed_object_id = 722 and type = 'ReviewResponseMap'))&lt;br /&gt;
      @review_response_map_ids = ResponseMap.select(&amp;quot;id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'ReviewResponseMap'])&lt;br /&gt;
      @response_ids = Response.select(&amp;quot;id&amp;quot;).where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id IN (?) and type = ?&amp;quot;, @response_ids, @type])&lt;br /&gt;
    when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'TeammateReviewResponseMap' and reviewed_object_id = 711&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'TeammateReviewResponseMap'])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same code after moving the methods to their respective models looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
      when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
        @review_user= params[:user]&lt;br /&gt;
        #If review response is required call review_response_report method in review_response_map model&lt;br /&gt;
        @reviewers = ReviewResponseMap.review_response_report(@id, @assignment,@type, @review_user)&lt;br /&gt;
        @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
        @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
      when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
        #If review report for feedback is required call feedback_response_report method in feedback_review_response_map model&lt;br /&gt;
        @reviewers = FeedbackResponseMap.feedback_response_report(@id, @type)&lt;br /&gt;
      when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
        #If review report for teammate is required call teammate_response_report method in teammate_review_response_map model&lt;br /&gt;
        @reviewers = TeammateReviewResponseMap.teammate_response_report(@id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/harsha1007/expertiza Forked repository for the project]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Expertiza Main Page]&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101329</id>
		<title>CSC/ECE 517 Spring 2016/Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101329"/>
		<updated>2016-03-24T03:35:46Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1615. Refactoring the Review Mapping Controller==&lt;br /&gt;
&lt;br /&gt;
This page provides details about the OSS project which was based on refactoring one of controllers related to peer reviewing strategies used in Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''About Review mapping controller'''==&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the team for a submission , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
=='''Code Improvements'''==&lt;br /&gt;
&lt;br /&gt;
==='''1. Unused variables and arguments'''===&lt;br /&gt;
&lt;br /&gt;
There are unused variables in the methods which use the stack unnecessarily. So, it is better to remove the unused variables or at the least indicate that a variable is unused.&lt;br /&gt;
&lt;br /&gt;
For suppose when both keys and values are not used in a hash but are given as arguments, then the unused variables can be indicated by adding a &amp;quot;_&amp;quot; infront of the name or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allow them arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above case teams_hash should consist of a hash with both keys and values but the sorting is done based on values. So the key is replaced with a &amp;quot;_&amp;quot; so that the user may deem it unused in the implementation of the process.&lt;br /&gt;
&lt;br /&gt;
==='''2. Use sample instead of shuffle'''===&lt;br /&gt;
&lt;br /&gt;
When sample is used, the elements in an array are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle. Also by using shuffle[0] we are shuffling all the elements in the array and then picking the first element instead of picking a single element randomly which is more efficient. The following are the couple of places where shuffle[0] was used and is replaced by sample.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''3. Cyclomatic complexity of automatic_review_mapping_strategy method'''===&lt;br /&gt;
&lt;br /&gt;
The method automatic_review_mapping_strategy handles the number of reviews assigned to a individual and also the number of reviews that can be done with in a team. The method is very long and has many nested if statements due to which the complexity of the method is very high. Instead of a single method handling all the parts of the strategy, it is divided into several parts due to which the code is more readable and also the complexity of code is shared by each method.&lt;br /&gt;
&lt;br /&gt;
The method first checks the number of participants that are in an assignment and the number of teams that are present. It then sets the values for the maximum number of reviews that are possible and also the minimum number that are required. Then it assigns the reviews to each of the teams randomly when a request for review is made by a participant. At last it checks if the participant has the minimum number of reviews required after allotting the reviews. If not, it assigns more reviews to valid teams so that the minimum requirement is met.&lt;br /&gt;
&lt;br /&gt;
The part of the code that is moved out of automatic_review_mapping_strategy as peer_review_strategy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private&lt;br /&gt;
	def peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
		iterator = 0&lt;br /&gt;
		teams.each do |team|&lt;br /&gt;
		  selected_participants = Array.new&lt;br /&gt;
		  if !team.equal? teams.last&lt;br /&gt;
			#need to even out the # of reviews for teams&lt;br /&gt;
			while selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
			  num_participants_this_team = TeamsUser.where(team_id: team.id).size&lt;br /&gt;
			  #If there are some submitters or reviewers in this team, they are not treated as normal participants.&lt;br /&gt;
			  #They should be removed from 'num_participants_this_team'&lt;br /&gt;
			  TeamsUser.where(team_id: team.id).each do |team_user|&lt;br /&gt;
				temp_participant = Participant.where(user_id: team_user.user_id, parent_id: assignment_id).first&lt;br /&gt;
				num_participants_this_team -= 1 if temp_participant.can_review == false or temp_participant.can_submit == false&lt;br /&gt;
			  end&lt;br /&gt;
			  #if all outstanding participants are already in selected_participants, just break the loop.&lt;br /&gt;
			  break if selected_participants.size == participants.size - num_participants_this_team&lt;br /&gt;
&lt;br /&gt;
			  # generate random number&lt;br /&gt;
			  if iterator == 0&lt;br /&gt;
				rand_num = rand(0..num_participants-1)&lt;br /&gt;
			  else&lt;br /&gt;
				min_value = participants_hash.values.min&lt;br /&gt;
				#get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
				participants_with_min_assigned_reviews = Array.new&lt;br /&gt;
				participants.each do |participant|&lt;br /&gt;
				  participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
				end&lt;br /&gt;
				#if participants_with_min_assigned_reviews is blank &lt;br /&gt;
				if_condition_1 = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
				#or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
				if_condition_2 = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
				if if_condition_1 or if_condition_2&lt;br /&gt;
				  #use original method to get random number&lt;br /&gt;
				  rand_num = rand(0..num_participants-1)&lt;br /&gt;
				else&lt;br /&gt;
				  #rand_num should be the position of this participant in original array&lt;br /&gt;
				  rand_num = participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size-1)]&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			  # prohibit one student to review his/her own artifact&lt;br /&gt;
			  next if TeamsUser.exists?(team_id: team.id, user_id: participants[rand_num].user_id)&lt;br /&gt;
&lt;br /&gt;
			  if_condition_1 = (participants_hash[participants[rand_num].id] &amp;lt; student_review_num)&lt;br /&gt;
			  if_condition_2 = (!selected_participants.include? participants[rand_num].id)&lt;br /&gt;
			  if if_condition_1 and if_condition_2&lt;br /&gt;
				# selected_participants cannot include duplicate num&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participants[rand_num].id&lt;br /&gt;
				participants_hash[participants[rand_num].id] += 1&lt;br /&gt;
			  end &lt;br /&gt;
			  # remove students who have already been assigned enough num of reviews out of participants array&lt;br /&gt;
			  participants.each do |participant|&lt;br /&gt;
				if participants_hash[participant.id] == student_review_num&lt;br /&gt;
				  participants.delete_at(rand_num)&lt;br /&gt;
				  num_participants -= 1&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  else&lt;br /&gt;
			#review num for last team can be different from other teams.&lt;br /&gt;
			#prohibit one student to review his/her own artifact and selected_participants cannot include duplicate num&lt;br /&gt;
			participants.each do |participant| &lt;br /&gt;
			  # avoid last team receives too many peer reviews&lt;br /&gt;
			  if !TeamsUser.exists?(team_id: team.id, user_id: participant.user_id) and selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participant.id &lt;br /&gt;
				participants_hash[participant.id] += 1&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  end&lt;br /&gt;
&lt;br /&gt;
		  begin&lt;br /&gt;
			selected_participants.each {|index| ReviewResponseMap.where(:reviewee_id =&amp;gt; team.id, :reviewer_id =&amp;gt; index, :reviewed_object_id =&amp;gt; assignment_id).first_or_create}&lt;br /&gt;
		  rescue&lt;br /&gt;
			flash[:error] = &amp;quot;Automatic assignment of reviewer failed.&amp;quot;&lt;br /&gt;
		  end&lt;br /&gt;
		  iterator += 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The method is made private so that it can only be called with in the controller and cannot directly be called through a view.&lt;br /&gt;
&lt;br /&gt;
The complexity of the original method reduced after breaking it and can be easily readable now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def automatic_review_mapping_strategy(assignment_id, participants, teams, student_review_num=0, submission_review_num=0)&lt;br /&gt;
    participants_hash = {}&lt;br /&gt;
    participants.each { |participant| participants_hash[participant.id] = 0 }&lt;br /&gt;
    #calculate reviewers for each team&lt;br /&gt;
    num_participants = participants.size&lt;br /&gt;
    if student_review_num != 0 and submission_review_num == 0&lt;br /&gt;
      num_reviews_per_team = (participants.size * student_review_num * 1.0 / teams.size).round&lt;br /&gt;
      exact_num_of_review_needed = participants.size * student_review_num&lt;br /&gt;
    elsif student_review_num == 0 and submission_review_num != 0&lt;br /&gt;
      num_reviews_per_team = submission_review_num&lt;br /&gt;
      student_review_num = (teams.size * submission_review_num * 1.0 / participants.size).round&lt;br /&gt;
      exact_num_of_review_needed = teams.size * submission_review_num&lt;br /&gt;
    end&lt;br /&gt;
    #Exception detection: If instructor want to assign too many reviews done by each student, there will be an error msg.&lt;br /&gt;
    if student_review_num &amp;gt;= teams.size&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done by each student to be greater than or equal to total number of teams [or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
&lt;br /&gt;
    # after assigning peer reviews for each team, if there are still some peer reviewers not obtain enough peer review, just assign them to valid teams&lt;br /&gt;
    if ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and created_at &amp;gt; ? and calibrate_to = ?&amp;quot;, assignment_id, @@time_create_last_review_mapping_record, 0]).size &amp;lt; exact_num_of_review_needed&lt;br /&gt;
      participants_with_insufficient_review_num = Array.new&lt;br /&gt;
      participants_hash.each do |participant_id, review_num|&lt;br /&gt;
        participants_with_insufficient_review_num &amp;lt;&amp;lt; participant_id if review_num &amp;lt; student_review_num&lt;br /&gt;
      end&lt;br /&gt;
      unsorted_teams_hash = {}&lt;br /&gt;
      ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and calibrate_to = ?&amp;quot;, assignment_id, 0]).each do |response_map|&lt;br /&gt;
        unless unsorted_teams_hash.has_key? (response_map.reviewee_id)&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] = 1 &lt;br /&gt;
        else&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] += 1&lt;br /&gt;
        end&lt;br /&gt;
      end &lt;br /&gt;
      teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
      participants_with_insufficient_review_num.each do |participant_id|&lt;br /&gt;
        teams_hash.each do |team_id, num_review_received|&lt;br /&gt;
          unless TeamsUser.exists?(team_id: team_id, user_id: Participant.find(participant_id).user_id)&lt;br /&gt;
            ReviewResponseMap.where(:reviewee_id =&amp;gt; team_id, :reviewer_id =&amp;gt; participant_id, :reviewed_object_id =&amp;gt; assignment_id).first_or_create&lt;br /&gt;
            teams_hash[team_id] += 1&lt;br /&gt;
            teams_hash = teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
            break&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @@time_create_last_review_mapping_record = ReviewResponseMap.where(reviewed_object_id: assignment_id).last.created_at&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4. Moving code specific to models to models instead of controller'''&lt;br /&gt;
&lt;br /&gt;
The method response_report contains code which generates reports based on the input of one of the three of 'ReviewResponseMap', 'FeedbackResponseMap', 'TeammateReviewResponseMap' and 'Calibration'. Calibration is a special case and should be handled in the controller itself. But the other three are models that are subclasses of ResponseMap model. The report is generated for each of the three by calling the ResponseMap model and obtaining the values by querying the database. Moving the code to the models and calling the methods in the model through the controller makes more sense than writing the code in controller.&lt;br /&gt;
&lt;br /&gt;
The following is the code snippet from the original method which contains the calls to ResponseMap model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
      if params[:user].nil?&lt;br /&gt;
        # This is not a search, so find all reviewers for this assignment&lt;br /&gt;
        response_maps_with_distinct_participant_id = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ? and calibrate_to = ?&amp;quot;, @id, @type, 0])&lt;br /&gt;
        @reviewers = []&lt;br /&gt;
        response_maps_with_distinct_participant_id.each do |reviewer_id_from_response_map|&lt;br /&gt;
          @reviewers &amp;lt;&amp;lt; (AssignmentParticipant.find(reviewer_id_from_response_map.reviewer_id))&lt;br /&gt;
        end&lt;br /&gt;
        @reviewers = Participant.sort_by_name(@reviewers)&lt;br /&gt;
      else&lt;br /&gt;
        # This is a search, so find reviewers by user's full name&lt;br /&gt;
        user = User.select(&amp;quot;DISTINCT id&amp;quot;).where([&amp;quot;fullname LIKE ?&amp;quot;, '%'+params[:user][:fullname]+'%'])&lt;br /&gt;
        @reviewers = AssignmentParticipant.where([&amp;quot;user_id IN (?) and parent_id = ?&amp;quot;, user, @assignment.id])&lt;br /&gt;
      end&lt;br /&gt;
      #  @review_scores[reveiwer_id][reviewee_id] = score for assignments not using vary_rubric_by_rounds feature&lt;br /&gt;
      # @review_scores[reviewer_id][round][reviewee_id] = score for assignments using vary_rubric_by_rounds feature&lt;br /&gt;
      @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
      @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
    when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'FeedbackResponseMap' and &lt;br /&gt;
      #reviewed_object_id in (select id from responses where &lt;br /&gt;
      #map_id in (select id from response_maps where reviewed_object_id = 722 and type = 'ReviewResponseMap'))&lt;br /&gt;
      @review_response_map_ids = ResponseMap.select(&amp;quot;id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'ReviewResponseMap'])&lt;br /&gt;
      @response_ids = Response.select(&amp;quot;id&amp;quot;).where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id IN (?) and type = ?&amp;quot;, @response_ids, @type])&lt;br /&gt;
    when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'TeammateReviewResponseMap' and reviewed_object_id = 711&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'TeammateReviewResponseMap'])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same code after moving the methods to their respective models looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
      when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
        @review_user= params[:user]&lt;br /&gt;
        #If review response is required call review_response_report method in review_response_map model&lt;br /&gt;
        @reviewers = ReviewResponseMap.review_response_report(@id, @assignment,@type, @review_user)&lt;br /&gt;
        @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
        @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
      when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
        #If review report for feedback is required call feedback_response_report method in feedback_review_response_map model&lt;br /&gt;
        @reviewers = FeedbackResponseMap.feedback_response_report(@id, @type)&lt;br /&gt;
      when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
        #If review report for teammate is required call teammate_response_report method in teammate_review_response_map model&lt;br /&gt;
        @reviewers = TeammateReviewResponseMap.teammate_response_report(@id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/harsha1007/expertiza Forked repository for the project]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Expertiza Main Page]&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101328</id>
		<title>CSC/ECE 517 Spring 2016/Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101328"/>
		<updated>2016-03-24T03:35:05Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* E1615. Refactoring the Review Mapping Controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1615. Refactoring the Review Mapping Controller==&lt;br /&gt;
&lt;br /&gt;
This page provides details about the OSS project which was based on refactoring one of controllers related to peer reviewing strategies used in Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''About Review mapping controller'''==&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the team for a submission , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
=='''Code Improvements'''==&lt;br /&gt;
&lt;br /&gt;
==='''1. Unused variables and arguments'''===&lt;br /&gt;
&lt;br /&gt;
There are unused variables in the methods which use the stack unnecessarily. So, it is better to remove the unused variables or at the least indicate that a variable is unused.&lt;br /&gt;
&lt;br /&gt;
For suppose when both keys and values are not used in a hash but are given as arguments, then the unused variables can be indicated by adding a &amp;quot;_&amp;quot; infront of the name or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allow them arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above case teams_hash should consist of a hash with both keys and values but the sorting is done based on values. So the key is replaced with a &amp;quot;_&amp;quot; so that the user may deem it unused in the implementation of the process.&lt;br /&gt;
&lt;br /&gt;
==='''2. Use sample instead of shuffle'''===&lt;br /&gt;
&lt;br /&gt;
When sample is used, the elements in an array are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle. Also by using shuffle[0] we are shuffling all the elements in the array and then picking the first element instead of picking a single element randomly which is more efficient. The following are the couple of places where shuffle[0] was used and is replaced by sample.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Previous Code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''3. Cyclomatic complexity of automatic_review_mapping_strategy method'''===&lt;br /&gt;
&lt;br /&gt;
The method automatic_review_mapping_strategy handles the number of reviews assigned to a individual and also the number of reviews that can be done with in a team. The method is very long and has many nested if statements due to which the complexity of the method is very high. Instead of a single method handling all the parts of the strategy, it is divided into several parts due to which the code is more readable and also the complexity of code is shared by each method.&lt;br /&gt;
&lt;br /&gt;
The method first checks the number of participants that are in an assignment and the number of teams that are present. It then sets the values for the maximum number of reviews that are possible and also the minimum number that are required. Then it assigns the reviews to each of the teams randomly when a request for review is made by a participant. At last it checks if the participant has the minimum number of reviews required after allotting the reviews. If not, it assigns more reviews to valid teams so that the minimum requirement is met.&lt;br /&gt;
&lt;br /&gt;
The part of the code that is moved out of automatic_review_mapping_strategy as peer_review_strategy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
private&lt;br /&gt;
	def peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
		iterator = 0&lt;br /&gt;
		teams.each do |team|&lt;br /&gt;
		  selected_participants = Array.new&lt;br /&gt;
		  if !team.equal? teams.last&lt;br /&gt;
			#need to even out the # of reviews for teams&lt;br /&gt;
			while selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
			  num_participants_this_team = TeamsUser.where(team_id: team.id).size&lt;br /&gt;
			  #If there are some submitters or reviewers in this team, they are not treated as normal participants.&lt;br /&gt;
			  #They should be removed from 'num_participants_this_team'&lt;br /&gt;
			  TeamsUser.where(team_id: team.id).each do |team_user|&lt;br /&gt;
				temp_participant = Participant.where(user_id: team_user.user_id, parent_id: assignment_id).first&lt;br /&gt;
				num_participants_this_team -= 1 if temp_participant.can_review == false or temp_participant.can_submit == false&lt;br /&gt;
			  end&lt;br /&gt;
			  #if all outstanding participants are already in selected_participants, just break the loop.&lt;br /&gt;
			  break if selected_participants.size == participants.size - num_participants_this_team&lt;br /&gt;
&lt;br /&gt;
			  # generate random number&lt;br /&gt;
			  if iterator == 0&lt;br /&gt;
				rand_num = rand(0..num_participants-1)&lt;br /&gt;
			  else&lt;br /&gt;
				min_value = participants_hash.values.min&lt;br /&gt;
				#get the temp array including indices of participants, each participant has minimum review number in hash table.&lt;br /&gt;
				participants_with_min_assigned_reviews = Array.new&lt;br /&gt;
				participants.each do |participant|&lt;br /&gt;
				  participants_with_min_assigned_reviews &amp;lt;&amp;lt; participants.index(participant) if participants_hash[participant.id] == min_value&lt;br /&gt;
				end&lt;br /&gt;
				#if participants_with_min_assigned_reviews is blank &lt;br /&gt;
				if_condition_1 = participants_with_min_assigned_reviews.empty?&lt;br /&gt;
				#or only one element in participants_with_min_assigned_reviews, prohibit one student to review his/her own artifact&lt;br /&gt;
				if_condition_2 = (participants_with_min_assigned_reviews.size == 1 and TeamsUser.exists?(team_id: team.id, user_id: participants[participants_with_min_assigned_reviews[0]].user_id))&lt;br /&gt;
				if if_condition_1 or if_condition_2&lt;br /&gt;
				  #use original method to get random number&lt;br /&gt;
				  rand_num = rand(0..num_participants-1)&lt;br /&gt;
				else&lt;br /&gt;
				  #rand_num should be the position of this participant in original array&lt;br /&gt;
				  rand_num = participants_with_min_assigned_reviews[rand(0..participants_with_min_assigned_reviews.size-1)]&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			  # prohibit one student to review his/her own artifact&lt;br /&gt;
			  next if TeamsUser.exists?(team_id: team.id, user_id: participants[rand_num].user_id)&lt;br /&gt;
&lt;br /&gt;
			  if_condition_1 = (participants_hash[participants[rand_num].id] &amp;lt; student_review_num)&lt;br /&gt;
			  if_condition_2 = (!selected_participants.include? participants[rand_num].id)&lt;br /&gt;
			  if if_condition_1 and if_condition_2&lt;br /&gt;
				# selected_participants cannot include duplicate num&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participants[rand_num].id&lt;br /&gt;
				participants_hash[participants[rand_num].id] += 1&lt;br /&gt;
			  end &lt;br /&gt;
			  # remove students who have already been assigned enough num of reviews out of participants array&lt;br /&gt;
			  participants.each do |participant|&lt;br /&gt;
				if participants_hash[participant.id] == student_review_num&lt;br /&gt;
				  participants.delete_at(rand_num)&lt;br /&gt;
				  num_participants -= 1&lt;br /&gt;
				end&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  else&lt;br /&gt;
			#review num for last team can be different from other teams.&lt;br /&gt;
			#prohibit one student to review his/her own artifact and selected_participants cannot include duplicate num&lt;br /&gt;
			participants.each do |participant| &lt;br /&gt;
			  # avoid last team receives too many peer reviews&lt;br /&gt;
			  if !TeamsUser.exists?(team_id: team.id, user_id: participant.user_id) and selected_participants.size &amp;lt; num_reviews_per_team&lt;br /&gt;
				selected_participants &amp;lt;&amp;lt; participant.id &lt;br /&gt;
				participants_hash[participant.id] += 1&lt;br /&gt;
			  end&lt;br /&gt;
			end&lt;br /&gt;
		  end&lt;br /&gt;
&lt;br /&gt;
		  begin&lt;br /&gt;
			selected_participants.each {|index| ReviewResponseMap.where(:reviewee_id =&amp;gt; team.id, :reviewer_id =&amp;gt; index, :reviewed_object_id =&amp;gt; assignment_id).first_or_create}&lt;br /&gt;
		  rescue&lt;br /&gt;
			flash[:error] = &amp;quot;Automatic assignment of reviewer failed.&amp;quot;&lt;br /&gt;
		  end&lt;br /&gt;
		  iterator += 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The method is made private so that it can only be called with in the controller and cannot directly be called through a view.&lt;br /&gt;
&lt;br /&gt;
The complexity of the original method reduced after breaking it and can be easily readable now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def automatic_review_mapping_strategy(assignment_id, participants, teams, student_review_num=0, submission_review_num=0)&lt;br /&gt;
    participants_hash = {}&lt;br /&gt;
    participants.each { |participant| participants_hash[participant.id] = 0 }&lt;br /&gt;
    #calculate reviewers for each team&lt;br /&gt;
    num_participants = participants.size&lt;br /&gt;
    if student_review_num != 0 and submission_review_num == 0&lt;br /&gt;
      num_reviews_per_team = (participants.size * student_review_num * 1.0 / teams.size).round&lt;br /&gt;
      exact_num_of_review_needed = participants.size * student_review_num&lt;br /&gt;
    elsif student_review_num == 0 and submission_review_num != 0&lt;br /&gt;
      num_reviews_per_team = submission_review_num&lt;br /&gt;
      student_review_num = (teams.size * submission_review_num * 1.0 / participants.size).round&lt;br /&gt;
      exact_num_of_review_needed = teams.size * submission_review_num&lt;br /&gt;
    end&lt;br /&gt;
    #Exception detection: If instructor want to assign too many reviews done by each student, there will be an error msg.&lt;br /&gt;
    if student_review_num &amp;gt;= teams.size&lt;br /&gt;
      flash[:error] = 'You cannot set the number of reviews done by each student to be greater than or equal to total number of teams [or &amp;quot;participants&amp;quot; if it is an individual assignment].'&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    peer_review_strategy(teams, num_participants, student_review_num, participants, participants_hash)&lt;br /&gt;
&lt;br /&gt;
    # after assigning peer reviews for each team, if there are still some peer reviewers not obtain enough peer review, just assign them to valid teams&lt;br /&gt;
    if ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and created_at &amp;gt; ? and calibrate_to = ?&amp;quot;, assignment_id, @@time_create_last_review_mapping_record, 0]).size &amp;lt; exact_num_of_review_needed&lt;br /&gt;
      participants_with_insufficient_review_num = Array.new&lt;br /&gt;
      participants_hash.each do |participant_id, review_num|&lt;br /&gt;
        participants_with_insufficient_review_num &amp;lt;&amp;lt; participant_id if review_num &amp;lt; student_review_num&lt;br /&gt;
      end&lt;br /&gt;
      unsorted_teams_hash = {}&lt;br /&gt;
      ReviewResponseMap.where([&amp;quot;reviewed_object_id = ? and calibrate_to = ?&amp;quot;, assignment_id, 0]).each do |response_map|&lt;br /&gt;
        unless unsorted_teams_hash.has_key? (response_map.reviewee_id)&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] = 1 &lt;br /&gt;
        else&lt;br /&gt;
          unsorted_teams_hash[response_map.reviewee_id] += 1&lt;br /&gt;
        end&lt;br /&gt;
      end &lt;br /&gt;
      teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
      participants_with_insufficient_review_num.each do |participant_id|&lt;br /&gt;
        teams_hash.each do |team_id, num_review_received|&lt;br /&gt;
          unless TeamsUser.exists?(team_id: team_id, user_id: Participant.find(participant_id).user_id)&lt;br /&gt;
            ReviewResponseMap.where(:reviewee_id =&amp;gt; team_id, :reviewer_id =&amp;gt; participant_id, :reviewed_object_id =&amp;gt; assignment_id).first_or_create&lt;br /&gt;
            teams_hash[team_id] += 1&lt;br /&gt;
            teams_hash = teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
            break&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @@time_create_last_review_mapping_record = ReviewResponseMap.where(reviewed_object_id: assignment_id).last.created_at&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''4. Moving code specific to models to models instead of controller'''&lt;br /&gt;
&lt;br /&gt;
The method response_report contains code which generates reports based on the input of one of the three of 'ReviewResponseMap', 'FeedbackResponseMap', 'TeammateReviewResponseMap' and 'Calibration'. Calibration is a special case and should be handled in the controller itself. But the other three are models that are subclasses of ResponseMap model. The report is generated for each of the three by calling the ResponseMap model and obtaining the values by querying the database. Moving the code to the models and calling the methods in the model through the controller makes more sense than writing the code in controller.&lt;br /&gt;
&lt;br /&gt;
The following is the code snippet from the original method which contains the calls to ResponseMap model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
    when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
      if params[:user].nil?&lt;br /&gt;
        # This is not a search, so find all reviewers for this assignment&lt;br /&gt;
        response_maps_with_distinct_participant_id = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ? and calibrate_to = ?&amp;quot;, @id, @type, 0])&lt;br /&gt;
        @reviewers = []&lt;br /&gt;
        response_maps_with_distinct_participant_id.each do |reviewer_id_from_response_map|&lt;br /&gt;
          @reviewers &amp;lt;&amp;lt; (AssignmentParticipant.find(reviewer_id_from_response_map.reviewer_id))&lt;br /&gt;
        end&lt;br /&gt;
        @reviewers = Participant.sort_by_name(@reviewers)&lt;br /&gt;
      else&lt;br /&gt;
        # This is a search, so find reviewers by user's full name&lt;br /&gt;
        user = User.select(&amp;quot;DISTINCT id&amp;quot;).where([&amp;quot;fullname LIKE ?&amp;quot;, '%'+params[:user][:fullname]+'%'])&lt;br /&gt;
        @reviewers = AssignmentParticipant.where([&amp;quot;user_id IN (?) and parent_id = ?&amp;quot;, user, @assignment.id])&lt;br /&gt;
      end&lt;br /&gt;
      #  @review_scores[reveiwer_id][reviewee_id] = score for assignments not using vary_rubric_by_rounds feature&lt;br /&gt;
      # @review_scores[reviewer_id][round][reviewee_id] = score for assignments using vary_rubric_by_rounds feature&lt;br /&gt;
      @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
      @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
    when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'FeedbackResponseMap' and &lt;br /&gt;
      #reviewed_object_id in (select id from responses where &lt;br /&gt;
      #map_id in (select id from response_maps where reviewed_object_id = 722 and type = 'ReviewResponseMap'))&lt;br /&gt;
      @review_response_map_ids = ResponseMap.select(&amp;quot;id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'ReviewResponseMap'])&lt;br /&gt;
      @response_ids = Response.select(&amp;quot;id&amp;quot;).where([&amp;quot;map_id IN (?)&amp;quot;, @review_response_map_ids])&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id IN (?) and type = ?&amp;quot;, @response_ids, @type])&lt;br /&gt;
    when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
      #Example query&lt;br /&gt;
      #SELECT distinct reviewer_id FROM response_maps where type = 'TeammateReviewResponseMap' and reviewed_object_id = 711&lt;br /&gt;
      @reviewers = ResponseMap.select(&amp;quot;DISTINCT reviewer_id&amp;quot;).where([&amp;quot;reviewed_object_id = ? and type = ?&amp;quot;, @id, 'TeammateReviewResponseMap'])&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same code after moving the methods to their respective models looks as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
case @type&lt;br /&gt;
      when &amp;quot;ReviewResponseMap&amp;quot;&lt;br /&gt;
        @review_user= params[:user]&lt;br /&gt;
        #If review response is required call review_response_report method in review_response_map model&lt;br /&gt;
        @reviewers = ReviewResponseMap.review_response_report(@id, @assignment,@type, @review_user)&lt;br /&gt;
        @review_scores = @assignment.compute_reviews_hash&lt;br /&gt;
        @avg_and_ranges= @assignment.compute_avg_and_ranges_hash&lt;br /&gt;
      when &amp;quot;FeedbackResponseMap&amp;quot;&lt;br /&gt;
        #If review report for feedback is required call feedback_response_report method in feedback_review_response_map model&lt;br /&gt;
        @reviewers = FeedbackResponseMap.feedback_response_report(@id, @type)&lt;br /&gt;
      when &amp;quot;TeammateReviewResponseMap&amp;quot;&lt;br /&gt;
        #If review report for teammate is required call teammate_response_report method in teammate_review_response_map model&lt;br /&gt;
        @reviewers = TeammateReviewResponseMap.teammate_response_report(@id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/harsha1007/expertiza Forked repository for the project]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Expertiza Main Page]&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101209</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101209"/>
		<updated>2016-03-24T00:53:27Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Wiki write up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/* When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101208</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101208"/>
		<updated>2016-03-24T00:52:32Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Wiki write up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
/*Review mapping controller contains methods related to peer reviewing strategies. When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically*/ Ignore this&lt;br /&gt;
&lt;br /&gt;
It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101206</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101206"/>
		<updated>2016-03-24T00:52:03Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Wiki write up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically&lt;br /&gt;
&lt;br /&gt;
It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101203</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101203"/>
		<updated>2016-03-24T00:51:26Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Code Improvements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically&lt;br /&gt;
&lt;br /&gt;
It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Use sample instead of shuffle&lt;br /&gt;
When sample is used, the elements are chosen by using random and unique indices in the array so that the elements doesn't repeat in the array. This cannot be guaranteed in shuffle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Previous Code:&lt;br /&gt;
assignment_team = assignment_teams.to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.shuffle[0] rescue nil&lt;br /&gt;
&lt;br /&gt;
After Changing the code:&lt;br /&gt;
&lt;br /&gt;
topic = assignment.candidate_topics_to_review(reviewer).to_a.sample rescue nil&lt;br /&gt;
&lt;br /&gt;
assignment_team = assignment_teams.to_a.sample rescue nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101199</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101199"/>
		<updated>2016-03-24T00:41:58Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Code Improvements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically&lt;br /&gt;
&lt;br /&gt;
It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
==='''Code Improvements'''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; or replaced with &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
At line 533 and line 539&lt;br /&gt;
Previous Code: teams_hash = unsorted_teams_hash.sort_by{|k, v| v}.to_h&lt;br /&gt;
After Changing the code: teams_hash = unsorted_teams_hash.sort_by{|_, v| v}.to_h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101197</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101197"/>
		<updated>2016-03-24T00:39:31Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Code Improvements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically&lt;br /&gt;
&lt;br /&gt;
It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
===''Code Improvements''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101195</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101195"/>
		<updated>2016-03-24T00:38:14Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Wiki write up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically&lt;br /&gt;
&lt;br /&gt;
It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;br /&gt;
&lt;br /&gt;
===''Code Improvements''===&lt;br /&gt;
&lt;br /&gt;
1. Unused variables and arguments: There are unused variables in the methods. If there are unused variables in the methods, it uses stack unnecessarily. So, it is better to remove the unused variables.&lt;br /&gt;
&lt;br /&gt;
When both keys and values are not used, but given as arguments, then the used variables can be added &amp;quot;_&amp;quot; to represent it as unused variable but allowed in the arguments.&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101174</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101174"/>
		<updated>2016-03-23T23:56:48Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Wiki write up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically&lt;br /&gt;
&lt;br /&gt;
It contains methods to add a reviewer, delete a reviewer, selecting a reviewer. Depending on the number of students and number of submissions, the topics to be reviewed are assigned to the students automatically. If a user wants to look for the submission team , it returns the team by comparing the submission id's with the team id's. Also, it assigns quizzes dynamically. Generation of review report, feedback report and teammate review is done.&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101171</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101171"/>
		<updated>2016-03-23T23:30:19Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Wiki write up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;br /&gt;
&lt;br /&gt;
About Review mapping controller&lt;br /&gt;
&lt;br /&gt;
Review mapping controller contains methods related to peer reviewing strategies. When a reviewerreport reviews, assigning reviews and quizzes to teams. It also contains methods to assign reviews to participants automatically&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101155</id>
		<title>CSC/ECE 517 Spring 2016/Refactor review mapping controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2016/Refactor_review_mapping_controller.rb&amp;diff=101155"/>
		<updated>2016-03-23T22:25:54Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1615. Refactoring the Review Mapping Controller==&lt;br /&gt;
&lt;br /&gt;
This page provides details about the OSS project which was based on refactoring one of controllers related to peer reviewing strategies used in Expertiza.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Introduction to Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
* Improved the clarity of code by improving the variable and parameter names.&lt;br /&gt;
* Long character strings were taken and given appropriate names.&lt;br /&gt;
* Handled pagination by a separate helper module, which can be used by multiple controllers.&lt;br /&gt;
* Implemented action_allowed for access_control  to prevent unauthorized access of methods.&lt;br /&gt;
* Prevented displaying of all versions for all users and tables when a user views the index page.&lt;br /&gt;
* Added missing CRUD methods to Versions Controller&lt;br /&gt;
* Added RSPEC testcases for testing changes done in Versions Controller&lt;br /&gt;
&lt;br /&gt;
===About Versions Controller===&lt;br /&gt;
This class manages different versions of reviews.  If a reviewer reviews a submission, and after that, the author revises the submission, the next time the reviewer does a review (s)he will create a new version.  Sometimes it’s necessary to find the current version of a review; sometimes it’s necessary to find all versions.  Similarly, a user may want to delete the current version of a review, or all versions of a review.&lt;br /&gt;
Pagination of versions helps the user to view a subset of versions at a time. Considering the huge number of versions in the system, it is very useful to have a pagination mechanism and a filtering mechanism which can be applied on the whole set of versions. The idea is to display the versions in an ordered, comprehensible and logical manner. In Expertiza the gem ‘will_paginate’ is used to achieve pagination.&lt;br /&gt;
&lt;br /&gt;
===Current Implementation===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Functionality=====&lt;br /&gt;
* Any user irrespective of his/ her privileges can view all the versions.&lt;br /&gt;
::The versions which a particular user can view should be restricted based on the privileges of the user. For instance, only a user with Administrator privileges should be able to view all the versions in the system. However, that is not the case now. Every user can view all the versions irrespective of whether the user is a student or an administrator.&lt;br /&gt;
* Any user can delete any version&lt;br /&gt;
::The versions which a particular user can delete should be restricted based on the privileges of the user. For instance, a student should not be allowed to delete any version. According to the current implementation any user can delete any version in the system.&lt;br /&gt;
* Filtering of versions were restricted to the current user&lt;br /&gt;
::The filtering options on versions were restricted to the current user. Sometimes a user might want to view versions associated with other users. For instance, an instructor might want to view the list of versions created by a particular student. This is not possible with the current implementation.&lt;br /&gt;
&lt;br /&gt;
=====Drawbacks and Solutions=====&lt;br /&gt;
* '''Problem 1''': The method paginate_list is doing more than one thing.&lt;br /&gt;
::The method paginate_list was building a complex search criteria based on the input params, getting the list of versions from the Database matching this search criteria and then calling the Page API. All these tasks in a single method made it difficult to understand.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# For filtering the versions list with proper search and pagination.&lt;br /&gt;
  def paginate_list(id, user_id, item_type, event, datetime)&lt;br /&gt;
    # Set up the search criteria&lt;br /&gt;
    criteria = ''&lt;br /&gt;
    criteria = criteria + &amp;quot;id = #{id} AND &amp;quot; if id &amp;amp;&amp;amp; id.to_i &amp;gt; 0&lt;br /&gt;
    if current_user_role? == 'Super-Administrator'&lt;br /&gt;
      criteria = criteria + &amp;quot;whodunnit = #{user_id} AND &amp;quot; if user_id &amp;amp;&amp;amp; user_id.to_i &amp;gt; 0&lt;br /&gt;
    end&lt;br /&gt;
    criteria = criteria + &amp;quot;whodunnit = #{current_user.try(:id)} AND &amp;quot; if current_user.try(:id) &amp;amp;&amp;amp; current_user.try(:id).to_i &amp;gt; 0&lt;br /&gt;
    criteria = criteria + &amp;quot;item_type = '#{item_type}' AND &amp;quot; if item_type &amp;amp;&amp;amp; !(item_type.eql? 'Any')&lt;br /&gt;
    criteria = criteria + &amp;quot;event = '#{event}' AND &amp;quot; if event &amp;amp;&amp;amp; !(event.eql? 'Any')&lt;br /&gt;
    criteria = criteria + &amp;quot;created_at &amp;gt;= '#{time_to_string(params[:start_time])}' AND &amp;quot;&lt;br /&gt;
    criteria = criteria + &amp;quot;created_at &amp;lt;= '#{time_to_string(params[:end_time])}' AND &amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if current_role == 'Instructor' || current_role == 'Administrator'&lt;br /&gt;
&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Remove the last ' AND '&lt;br /&gt;
    criteria = criteria[0..-5]&lt;br /&gt;
&lt;br /&gt;
    versions = Version.page(params[:page]).order('id').per_page(25).where(criteria)&lt;br /&gt;
    versions&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* '''Solution''': The implementation has been changed in such a way that the versions which a user is allowed to see depends on the privileges of the user. The approach we have taken is as follows:&lt;br /&gt;
**An administrator can see all the versions&lt;br /&gt;
**An instructor can see all the versions created by him and other users who are in his course or are participants in the assignments he creates.&lt;br /&gt;
**A TA can see all the versions created by him and other users who are in the course for which he/ she assists.&lt;br /&gt;
**A Student can see all the versions created by him/ her.&lt;br /&gt;
* '''Problem 2''': The search criteria created in the method paginate_list was difficult to comprehend.&lt;br /&gt;
::The code which builds the search criteria in the method paginate_list uses many string literals and conditions and is hardly intuitive. The programmer will have to spend some time to understand what the code is really doing.&lt;br /&gt;
* '''Solution''': The implementation has been changed. A student is not allowed to delete any versions now. Other types of users, for instance administrators, instructors and TAs are allowed to delete only the versions they are authorized to view.&lt;br /&gt;
* '''Problem 3''': The paginate method can be moved to a helper class.&lt;br /&gt;
::VersionsController is not the only component which require to paginate items. There are other components too. For instance, the UsersController has to paginate the list of users. Hence the Paginate method can be moved to a helper class which can be accessed by other components as well.&lt;br /&gt;
* '''Solution''': The filtering options has also been enhanced. The current user can now choose as part of the version search filter any user from a list of users if the current user is authorized to see the versions created by that user.&lt;br /&gt;
&lt;br /&gt;
===New Implementation===&lt;br /&gt;
*The method paginate_list has been split into 2 methods now. &lt;br /&gt;
** BuildSearchCriteria – as the name suggests the sole purpose of this method is to build a search criteria based on the input search filters when the current user initiates a search in versions.&lt;br /&gt;
** paginate_list – this method will call the paginate API.&lt;br /&gt;
:First the search criteria is built, then the criteria is applied to versions in the database to get all versions which matches the criteria and then the retrieved versions are paginated.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # pagination.&lt;br /&gt;
  def paginate_list(versions)&lt;br /&gt;
    paginate(versions, VERSIONS_PER_PAGE);&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def BuildSearchCriteria(id, user_id, item_type, event)&lt;br /&gt;
    # Set up the search criteria&lt;br /&gt;
    search_criteria = ''&lt;br /&gt;
    search_criteria = search_criteria + add_id_filter_if_valid(id).to_s&lt;br /&gt;
    if current_user_role? == 'Super-Administrator'&lt;br /&gt;
      search_criteria = search_criteria + add_user_filter_for_super_admin(user_id).to_s&lt;br /&gt;
    end&lt;br /&gt;
    search_criteria = search_criteria + add_user_filter&lt;br /&gt;
    search_criteria = search_criteria + add_version_type_filter(item_type).to_s&lt;br /&gt;
    search_criteria = search_criteria + add_event_filter(event).to_s&lt;br /&gt;
    search_criteria = search_criteria + add_date_time_filter&lt;br /&gt;
    search_criteria&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* The string literals and conditions in the method paginate_list were replaced with methods with intuitive names so that the programmer can understand the code more easily. We also removed an empty if clause and a redundant statement.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def add_id_filter_if_valid (id)&lt;br /&gt;
    &amp;quot;id = #{id} AND &amp;quot; if id &amp;amp;&amp;amp; id.to_i &amp;gt; 0&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def add_user_filter_for_super_admin (user_id)&lt;br /&gt;
    &amp;quot;whodunnit = #{user_id} AND &amp;quot; if user_id &amp;amp;&amp;amp; user_id.to_i &amp;gt; 0&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def add_user_filter&lt;br /&gt;
    &amp;quot;whodunnit = #{current_user.try(:id)} AND &amp;quot; if current_user.try(:id) &amp;amp;&amp;amp; current_user.try(:id).to_i &amp;gt; 0&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def add_event_filter (event)&lt;br /&gt;
    &amp;quot;event = '#{event}' AND &amp;quot; if event &amp;amp;&amp;amp; !(event.eql? 'Any')&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def add_date_time_filter&lt;br /&gt;
    &amp;quot;created_at &amp;gt;= '#{time_to_string(params[:start_time])}' AND &amp;quot; +&lt;br /&gt;
        &amp;quot;created_at &amp;lt;= '#{time_to_string(params[:end_time])}'&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def add_version_type_filter (version_type)&lt;br /&gt;
    &amp;quot;item_type = '#{version_type}' AND &amp;quot; if version_type &amp;amp;&amp;amp; !(version_type.eql? 'Any')&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* The paginate method has been moved to the helper class Pagination_Helper. This new method can be now reused by the different components like UsersController etc. The method receives two parameters, first the list to paginate and second the number of items to be displayed in a page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module PaginationHelper&lt;br /&gt;
&lt;br /&gt;
  def paginate (items, number_of_items_per_page)&lt;br /&gt;
    items.page(params[:page]).per_page(number_of_items_per_page)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Code improvements===&lt;br /&gt;
* Introduced a constant VERSIONS_PER_PAGE and assigned the value 25 to it. The pagination algorithm for VersionsController displays at most 25 versions in a page. The existing implementation uses the value 25 straight in the code and there are few problems associated with such an approach.&lt;br /&gt;
** It is not easy to understand what 25 is unless the programmer takes a close look at the code.&lt;br /&gt;
** In case if the value 25 is used at more than one places and in future a new requirement comes to show at most 30 versions in a page, all the values will have to be modified. It is not very DRY.&lt;br /&gt;
* The VersionsController was overriding AccessHelper - action_allowed? method to return true in all the cases. This was violating the whole purpose of the method action_allowed?. The purpose of this method is to determine whether the user who is triggering a CRUD operation is allowed to do so. So when the current user invokes a CRUD operation, the action_allowed? method is invoked first and if the method returns true the CRUD operation is triggered or else the user is intimated with a message and gracefully exited. Hence, when the action_allowed? method is overridden to return true always, it results in providing unauthorized access to certain users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def action_allowed?&lt;br /&gt;
    true&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:With the new implementation the AccessHelper - action_allowed? method has been modified in such a way that unauthorized access is prevented. As per the new algorithm, 'new', 'create', 'edit', 'update' cannot be invoked by any user. These operations can be accessed only by ‘papertrail’ gem. Only an ‘Administrator’ or ‘Super-Administrator’ can call 'destroy_all' method. All the other methods are accessible to ‘Administrator’,  ‘Super-Administrator’, ‘Instructor’, ‘Teaching Assistant’ and ‘Student’.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    case params[:action]&lt;br /&gt;
    when 'new', 'create', 'edit', 'update'&lt;br /&gt;
    #Modifications can only be done by papertrail&lt;br /&gt;
      return false&lt;br /&gt;
    when 'destroy_all'&lt;br /&gt;
      ['Super-Administrator',&lt;br /&gt;
       'Administrator'].include? current_role_name&lt;br /&gt;
    else&lt;br /&gt;
      #Allow all others&lt;br /&gt;
      ['Super-Administrator',&lt;br /&gt;
       'Administrator',&lt;br /&gt;
       'Instructor',&lt;br /&gt;
       'Teaching Assistant',&lt;br /&gt;
       'Student'].include? current_role_name&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Automated Testing using RSPEC===&lt;br /&gt;
The current version of expertiza did not have any test for VersionsController. Using the test driven development(TDD) approach, we have added an exhaustive set of RSPEC tests for VersionsController, to test all the modifications we have done to the code of the controller class. The tests use double and stub features of rspec-rails gem, to fake the log in by different users - Administrator, Instructor, Student etc. The tests can be executed &amp;quot;rpec spec&amp;quot; command as shown below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
user-expertiza $rspec spec&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
Finished in 5.39 seconds (files took 25.33 seconds to load)&lt;br /&gt;
66 examples, 0 failures&lt;br /&gt;
&lt;br /&gt;
Randomized with seed 19254&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing from UI===&lt;br /&gt;
Following are a few testcases with respectto our code changes that can be tried from UI:&lt;br /&gt;
1. To go to versions index page, type in the following url after logging in:&lt;br /&gt;
   http://152.46.16.81:3000/versions&lt;br /&gt;
&lt;br /&gt;
2. After logging in as student/instructor or admin : Try accessing the  new, create, edit, update actions. These actions are not allowed to any of the users.&lt;br /&gt;
   http://152.46.16.81:3000/versions/new&lt;br /&gt;
   This calls the new action. In the current production version of expertiza, it is unhandled and application gives a default 404 page.&lt;br /&gt;
&lt;br /&gt;
3. Another feature that can be tested from UI is Pagination. Try searching for a user's versions and see if the results are paginated or not. Search here:&lt;br /&gt;
   http://152.46.16.81:3000/versions/search&lt;br /&gt;
&lt;br /&gt;
4. Visit the same URL as step 3, you should see only the students under that instructor in the users dropdown.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/WintersLt/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://bit.ly/myexpertiza  Demo link] &lt;br /&gt;
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
#Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101154</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=101154"/>
		<updated>2016-03-23T22:23:30Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Wiki write up'''==&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100947</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100947"/>
		<updated>2016-02-17T21:48:51Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{db-multiple|U5|G11}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = web.py official website|url = http://webpy.org/|website = web.py}}&amp;lt;/ref&amp;gt;. The goal of web.py is to build the ideal way to make web apps. web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]] objects. In web.py, [[database]] can be accessed easily as the framework makes database look like an [[object (computer science)|object]]. Also, the template system in web.py helps the user to bring Python into [[HTML]]&amp;lt;ref&amp;gt;{{Cite web|title = web.py philosophy|url = http://webpy.org/philosophy|website = web.py philosophy}}&amp;lt;/ref&amp;gt;. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [[websites]] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
web.py was originally published while [[Aaron swartz]] worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views&amp;lt;ref&amp;gt;{{Cite web|title = Aaron swartz about web.py|url = http://www.aaronsw.com/weblog/rewritingreddit}}&amp;lt;/ref&amp;gt;. The site was rewritten using other tools after being acquired by Condé Nast.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''&amp;lt;ref&amp;gt;{{Cite web|title = Python development story, Why web.py?|url = http://faruk.akgul.org/blog/python-development-story-why-webpy/|website = why web.py}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py Installation|url = http://webpy.org/|website = Installation of web.py in linux}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''&amp;lt;ref&amp;gt;{{Cite web|title = web.py GitHub|url = https://github.com/webpy/webpy|website = web.py github}}&amp;lt;/ref&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: These are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains [[URL]]'s of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases&amp;lt;ref&amp;gt;{{Cite web|title = web.py Databases|url = http://webpy.org/cookbook/select|website = web.py Database db.select}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [[ORM]]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [[Django]] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [[PostgreSQL]], MySQLdb for [[MySQL]] and sqlite3 for [[SQLite]]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms&amp;lt;ref&amp;gt;{{Cite web|title = web.py Forms|url = http://webpy.org/cookbook/forms|website = Usage of forms in web.py}}&amp;lt;/ref&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's the user create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [[CSRF]]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [[regular expressions]] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of the regular expression; any remaining captures get passed to function.&amp;lt;ref&amp;gt;{{Cite web|title = web.py Hello world example|url = http://webpy.org/docs/0.3/tutorial|website = Web.py example tutorial}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top of each application, the user usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing [http://www.w3schools.com/tags/ref_httpmethods.asp HTTP GET] function handlers directly&amp;lt;ref&amp;gt;{{Cite web|title = comparison of frameworks|url = http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2|website = Comparison of different python web frameworks}}&amp;lt;/ref&amp;gt;. Likewise, the web.py database system does not abstract away [[SQL]] rather than hide the fact that the user is querying a database. It hides the details of working with different databases. The framework of web.py is light, photonic when compared to frameworks like [[flask (web_framework) | flask]].&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
[[Django]]&lt;br /&gt;
&lt;br /&gt;
[[Bottle (web framework) | Bottle]]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Yrathor&amp;diff=100946</id>
		<title>User:Yrathor</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Yrathor&amp;diff=100946"/>
		<updated>2016-02-16T01:08:46Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Databases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Web.py Introduction'''&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_application_framework web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [https://en.wikipedia.org/wiki/Python_(programming_language) Python] objects, it allows you to build HTTP responses. Instead of trying to make the database look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [https://en.wikipedia.org/wiki/HTML HTML], the web.py template system tries to bring Python into HTML.&lt;br /&gt;
&lt;br /&gt;
Some of the sites which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to Alexa and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* writing clean code&lt;br /&gt;
* minimalism&lt;br /&gt;
* a solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py on Linux based operating system, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets you access various different databases. Accessing different databases refers to connecting multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. It is similar to sqlite3 package which doesn't use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework). web.py has flexible modules which allow the user to wipe it out completely and use with another web framework. &lt;br /&gt;
Before creating database object, the user must install appropriate database library like psycopg2 for [https://en.wikipedia.org/wiki/PostgreSQL PostgreSQL], MySQLdb for [https://en.wikipedia.org/wiki/MySQL MySQL] and sqlite3 for [https://en.wikipedia.org/wiki/SQLite SQLite]. Working with more databases is not at all difficult with web.py which is explained by the following example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
db1 = web.database(dbn='postgres', db='dbname1', user='username1', pw='password2')&lt;br /&gt;
db2 = web.database(dbn='postgres', db='dbname2', user='username2', pw='password2')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A sample login form is as follows: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the above example is considered, then we start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your function.&lt;br /&gt;
&lt;br /&gt;
Web.py's URL handling scheme is simple yet powerful and flexible. At the top of each application, you usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
web.py is a minimalist framework whose aim is not to abstract away the details of interacting with the Web, but to make that interaction easier. It is designed in such a way that user will get started quickly with web.py and find writing HTTP GET function handlers directly. Likewise, the web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100945</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100945"/>
		<updated>2016-02-15T22:06:57Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;&amp;lt;ref&amp;gt;{{Cite web|title = Linking to another record|url = http://webpy.org/|website = web.py|access-date = 2016-02-06}}&amp;lt;/ref&amp;gt;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the [[database]] easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy]. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. The site was rewritten using other tools after being acquired by Condé Nast. [http://webpy.org/]&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.[http://faruk.akgul.org/blog/python-development-story-why-webpy/]&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_epython/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100926</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100926"/>
		<updated>2016-02-13T07:40:53Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [[free and open source]] [[Web application framework]] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the [[database]] easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy]. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. The site was rewritten using other tools after being acquired by Condé Nast. [http://webpy.org/]&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.[http://faruk.akgul.org/blog/python-development-story-why-webpy/]&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_epython/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100925</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100925"/>
		<updated>2016-02-13T07:36:47Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the [[database]] easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy]. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. The site was rewritten using other tools after being acquired by Condé Nast. [http://webpy.org/]&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.[http://faruk.akgul.org/blog/python-development-story-why-webpy/]&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your funct just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100924</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100924"/>
		<updated>2016-02-13T07:36:17Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* History */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the [[database]] easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. The site was rewritten using other tools after being acquired by Condé Nast. [http://webpy.org/]&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.[http://faruk.akgul.org/blog/python-development-story-why-webpy/]&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your funct just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100923</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100923"/>
		<updated>2016-02-13T07:33:40Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Web.py skeleton */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the [[database]] easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.[http://faruk.akgul.org/blog/python-development-story-why-webpy/]&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your funct just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100922</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100922"/>
		<updated>2016-02-13T07:18:00Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Web.py skeleton */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the [[database]] easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ models]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your funct just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100921</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100921"/>
		<updated>2016-02-13T07:17:11Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Web.py skeleton */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the [[database]] easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [http://stackoverflow.com/questions/1015813/what-goes-into-the-controller-in-mvc controllers]: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** [http://betterexplained.com/articles/intermediate-rails-understanding-models-views-and-controllers/ views]]: Template files.&lt;br /&gt;
*** [[models]]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your funct just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100920</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100920"/>
		<updated>2016-02-13T07:11:55Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Web.py skeleton */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the [[database]] easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* [[www]]: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** [[controllers]]: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** [[views]]: Template files.&lt;br /&gt;
*** [[models]]: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled [[CSS]], [[Javascript]], [[CoffeeScript]] files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your funct just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100919</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100919"/>
		<updated>2016-02-13T07:08:10Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the [[database]] easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your funct just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100918</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100918"/>
		<updated>2016-02-13T07:06:53Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. Web.py allows the user to build [[HTTP]] responses instead of exposing [[Python]]] objects. Web.py allows the user to access the database easily without making the database look like an object. Also, the web.py template system tries to bring Python into [[HTML]][http://webpy.org/philosophy].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your funct just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100917</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100917"/>
		<updated>2016-02-13T06:56:15Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].[http://webpy.org/philosophy]&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your funct just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100916</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100916"/>
		<updated>2016-02-13T06:37:31Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Hello world example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;[http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your function.&lt;br /&gt;
&lt;br /&gt;
Web.py's URL handling scheme is simple yet powerful and flexible[http://webpy.org/cookbook/url_handling]. At the top of each application, you usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
===GET and POST methods===&lt;br /&gt;
&lt;br /&gt;
While most people don't notice it just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100915</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100915"/>
		<updated>2016-02-13T06:36:02Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, [[Bottle]], Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your function.&lt;br /&gt;
&lt;br /&gt;
Web.py's URL handling scheme is simple yet powerful and flexible[http://webpy.org/cookbook/url_handling]. At the top of each application, you usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
===GET and POST methods===&lt;br /&gt;
&lt;br /&gt;
While most people don't notice it just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100914</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100914"/>
		<updated>2016-02-13T06:35:21Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. [[Django]], [[Flask]], [[Pyramid]], Tornado, Bottle, Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your function.&lt;br /&gt;
&lt;br /&gt;
Web.py's URL handling scheme is simple yet powerful and flexible[http://webpy.org/cookbook/url_handling]. At the top of each application, you usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
===GET and POST methods===&lt;br /&gt;
&lt;br /&gt;
While most people don't notice it just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100913</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100913"/>
		<updated>2016-02-13T06:28:18Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Hello world example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. Django, Flask, Pyramid, Tornado, Bottle, Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your function.&lt;br /&gt;
&lt;br /&gt;
Web.py's URL handling scheme is simple yet powerful and flexible[http://webpy.org/cookbook/url_handling]. At the top of each application, you usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
===GET and POST methods===&lt;br /&gt;
&lt;br /&gt;
While most people don't notice it just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100912</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100912"/>
		<updated>2016-02-13T06:16:02Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Forms */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. Django, Flask, Pyramid, Tornado, Bottle, Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your function.&lt;br /&gt;
&lt;br /&gt;
Web.py's URL handling scheme is simple yet powerful and flexible. At the top of each application, you usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
===GET and POST methods===&lt;br /&gt;
&lt;br /&gt;
While most people don't notice it just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100911</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100911"/>
		<updated>2016-02-13T06:15:36Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Forms */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. Django, Flask, Pyramid, Tornado, Bottle, Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A simple login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your function.&lt;br /&gt;
&lt;br /&gt;
Web.py's URL handling scheme is simple yet powerful and flexible. At the top of each application, you usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
===GET and POST methods===&lt;br /&gt;
&lt;br /&gt;
While most people don't notice it just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100910</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100910"/>
		<updated>2016-02-13T06:12:59Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Features of web.py */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. Django, Flask, Pyramid, Tornado, Bottle, Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two unique features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A basic login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your function.&lt;br /&gt;
&lt;br /&gt;
Web.py's URL handling scheme is simple yet powerful and flexible. At the top of each application, you usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
===GET and POST methods===&lt;br /&gt;
&lt;br /&gt;
While most people don't notice it just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100909</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100909"/>
		<updated>2016-02-13T06:09:15Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. Django, Flask, Pyramid, Tornado, Bottle, Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two interesting features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A basic login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expressions] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome, hello (which gets the hello ECE517 of the welcome module), or get_\1. \1 is replaced by the first capture of your regular expression; any remaining captures get passed to your function.&lt;br /&gt;
&lt;br /&gt;
Web.py's URL handling scheme is simple yet powerful and flexible. At the top of each application, you usually see the full URL dispatching scheme defined as a tuple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
    &amp;quot;/tasks/?&amp;quot;, &amp;quot;signin&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/list&amp;quot;, &amp;quot;listing&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/post&amp;quot;, &amp;quot;post&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/act&amp;quot;, &amp;quot;actions&amp;quot;,&lt;br /&gt;
    &amp;quot;/tasks/signup&amp;quot;, &amp;quot;signup&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The format of this tuple is: url-path-pattern, handler-class this pattern will repeat as more url patterns are defined.&lt;br /&gt;
&lt;br /&gt;
===GET and POST methods===&lt;br /&gt;
&lt;br /&gt;
While most people don't notice it just browsing around, your browser uses a language known as HTTP for communicating with the World Wide Web. The details aren't important, but the basic idea is that Web visitors ask web servers to perform certain functions (like GET or POST) on URLs (like / or /foo?f=1).&lt;br /&gt;
&lt;br /&gt;
GET is the one we're all familiar with, the one used to request the text of a web page. When you type harvard.edu into your web browser, it literally asks the Harvard web server to GET /. The second-most famous, POST, is often used when submitting certain kinds of forms, like a request to purchase something. You use POST whenever the act of submitting a request does something (like charge your credit card and process an order). This is key, because GET URLs can be passed around and indexed by search engines, which you definitely want for most of your pages but definitely don't want for things like processing orders (imagine if Google tried to buy everything on your site!).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class index:&lt;br /&gt;
    def GET(self):&lt;br /&gt;
        return &amp;quot;Hello, world!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This GET function will now get called by web.py anytime someone makes a GET request for /.&lt;br /&gt;
&lt;br /&gt;
Now we need to create an application specifying the urls and a way to tell web.py to start serving web pages:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;: &lt;br /&gt;
    app = web.application(urls, globals())&lt;br /&gt;
    app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First we tell web.py to create an application with the URLs we listed above, looking up the classes in the global namespace of this file. And finally we make sure that web.py serves the application we created above.&lt;br /&gt;
&lt;br /&gt;
=='''Conclusion'''==&lt;br /&gt;
&lt;br /&gt;
The philosophy of Web.py, a minimalist framework, is not to abstract away the details of interacting with the Web, but to make that interaction easier. It gives you freedom and does what you say. You will find yourself writing HTTP GET function handlers directly. Likewise, the Web.py database system does not abstract away SQL rather than hide the fact that you're querying a database. It hides the details of working with different databases. Web.py defines a template language and lets you embed arbitrary Python code in a Web page. Web.py is ideal if you're already familiar with building Web applications. You'll get started quickly with Web.py and is recommended for simple Web applications.&lt;br /&gt;
&lt;br /&gt;
=='''See Also'''==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Django_(web_framework) Django]&lt;br /&gt;
&lt;br /&gt;
[http://www.web2py.com/init/default/what Web2py]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Pylons_project Pyramid]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Flask_(web_framework) Flask]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bottle_(web_framework) Bottle]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
[[#References|[1]]] web.py official website: http://webpy.org/&lt;br /&gt;
&lt;br /&gt;
[[#References|[2]]] python development story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100908</id>
		<title>User:Ndhanir</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=User:Ndhanir&amp;diff=100908"/>
		<updated>2016-02-13T05:58:14Z</updated>

		<summary type="html">&lt;p&gt;Ndhanir: /* Databases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = &lt;br /&gt;
| logo                   = &amp;lt;!-- Image name is enough --&amp;gt;&lt;br /&gt;
| Author                 = [https://en.wikipedia.org/wiki/Aaron_Swartz Aaron swartz]&lt;br /&gt;
| released               = &amp;lt;!-- {{May-2005 and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| latest release version = web.py-0.37&lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --&amp;gt;&lt;br /&gt;
| size                   = {{nowrap|88 [[kilobyte|KB]]}}&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| Type                   = Web application Framework&lt;br /&gt;
| website                = {{webpy.org}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Web.py is a [https://en.wikipedia.org/wiki/Free_and_open_source free and open source] [https://en.wikipedia.org/wiki/Web_framework Web application framework] that is as simple as it is powerful.&lt;br /&gt;
&lt;br /&gt;
The web.py slogan is: &amp;quot;Think about the ideal way to write a web app. Write the code to make it happen.&amp;quot;[http://webpy.org/]. The goal of web.py is to build the ideal way to make web apps. In web.py, Instead of exposing [[Python]] objects, it allows you to build [[HTTP]] responses. Instead of trying to make the [[database]] look like an object, web.py makes the database easier to use. And instead of coming up with yet another way to write [[HTML]], the web.py template system tries to bring Python into [[HTML]].&lt;br /&gt;
&lt;br /&gt;
Some of the [https://en.wikipedia.org/wiki/Website websites] which uses web.py are&lt;br /&gt;
* [http://frinki.com/ Frinki], a new social network in spanish.&lt;br /&gt;
* [http://www.oyster.com/ oyster.com], a website that reviews hotels uses web.py for the entire website.&lt;br /&gt;
* [http://makehistory.national911memorial.org/ Make History], a project of the 9/11 memorial museum.&lt;br /&gt;
&lt;br /&gt;
=='''History'''==&lt;br /&gt;
&lt;br /&gt;
Web.py was originally published while Aaron swartz worked at [http://reddit.com/ reddit.com], where the site used it as it grew to become one of the top 1000 sites according to [http://www.alexa.com/topsites/global;1 Alexa] and served millions of daily page views. &amp;quot;It's the anti-framework framework. web.py doesn't get in your way.&amp;quot; explained founder Steve Huffman.&lt;br /&gt;
&lt;br /&gt;
=='''Python'''==&lt;br /&gt;
&lt;br /&gt;
Python is a [https://en.wikipedia.org/wiki/Multi-paradigm_programming_language multi-paradigm programming language]: object-oriented programming and [https://en.wikipedia.org/wiki/Structured_programming structured programming] are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by [https://en.wikipedia.org/wiki/Metaprogramming metaprogramming]). Python uses [https://en.wikipedia.org/wiki/Dynamic_typing dynamic typing] and a combination of reference counting and a cycle-detecting garbage collector for [https://en.wikipedia.org/wiki/Memory_management memory management]. An important feature of Python is dynamic [https://en.wikipedia.org/wiki/Name_resolution_(programming_languages) name resolution], which binds method and variable names during program execution.&lt;br /&gt;
&lt;br /&gt;
Ruby's creator, Yukihiro Matsumoto, has said: &amp;quot;I wanted a scripting language that was more powerful than Perl, and more object-oriented than [https://en.wikipedia.org/wiki/Python_(programming_language) '''Python''']. That's why I decided to design my own language.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The world of Python web frameworks is full of choices. Django, Flask, Pyramid, Tornado, Bottle, Diesel, Pecan, Falcon, web.py, web2py and many more are competing for developer mindshare. The developer needs to cut the options down to one framework depending on the type of application.&lt;br /&gt;
&lt;br /&gt;
=='''Why Web.py?'''==&lt;br /&gt;
&lt;br /&gt;
The reasons for using web.py are&lt;br /&gt;
* Simplicity&lt;br /&gt;
* Freedom&lt;br /&gt;
* Writing clean code&lt;br /&gt;
* Minimalism&lt;br /&gt;
* A solid web framework&lt;br /&gt;
&lt;br /&gt;
=='''Installation'''==&lt;br /&gt;
To install web.py, &lt;br /&gt;
* Firstly, download the following tar file:&lt;br /&gt;
 wget http://webpy.org/static/web.py-0.37.tar.gz&lt;br /&gt;
* Extract the downloaded tar file:&lt;br /&gt;
 tar -zxvf web.py-0.37.tar.gz&lt;br /&gt;
* Go to web.py-0.37 directory:&lt;br /&gt;
 cd web.py-0.37/&lt;br /&gt;
* Install and make it accessible to all the applications:&lt;br /&gt;
 sudo python setup.py install&lt;br /&gt;
&lt;br /&gt;
=='''Web.py skeleton'''==&lt;br /&gt;
&lt;br /&gt;
Every web application needs a skeleton. A sample skeleton of web.py application looks as follows.&lt;br /&gt;
&lt;br /&gt;
* doc: Documentation of all the files.&lt;br /&gt;
* licenses: All the licenses of the project and the libraries used in the application.&lt;br /&gt;
* requirements: Specifying the third party libraries.&lt;br /&gt;
* sh: bash script files of the project.&lt;br /&gt;
* www: The required web application itself.&lt;br /&gt;
** app: contains the application modules.&lt;br /&gt;
*** controllers: This module contains the handler modules of controller package.&lt;br /&gt;
*** Tools: Tools that are used for the project.&lt;br /&gt;
*** views: Template files.&lt;br /&gt;
*** models: Database models of the application.&lt;br /&gt;
*** bridge: It is used to communicate with the server which is written in another language.&lt;br /&gt;
** lib: The library files developed for the project. These are different from the tools mentioned in the app. Libraries can be used in other projects where as tools are limited to the project itself.&lt;br /&gt;
** public: This folder contains the minimized compiled CSS, Javascript, CoffeeScript files and images so the files in this folder are production ready and can't be used in development.&lt;br /&gt;
** static: Contains the development CSS, CoffeeScript, Javascript, and images files of the project.&lt;br /&gt;
** test: As you can guess easily, these are the test files.&lt;br /&gt;
** tmp: Garbage files.&lt;br /&gt;
** main.py: These are the only files that are directly executed by the server.&lt;br /&gt;
** main_development.py: Main executable file in development mode.&lt;br /&gt;
** settings.py: Global constants and settings of the application.&lt;br /&gt;
** urls.py: Contains URL's of the application&lt;br /&gt;
&lt;br /&gt;
=='''Features of web.py'''==&lt;br /&gt;
&lt;br /&gt;
''web.py has two interesting features''&lt;br /&gt;
&lt;br /&gt;
===Databases===&lt;br /&gt;
&lt;br /&gt;
The database package lets the user access different databases. Accessing different databases refers to connecting to multiple databases. However, its not an [https://en.wikipedia.org/wiki/Object-relational_mapping ORM]. &lt;br /&gt;
The databases in ruby benefit the people who are good at SQL and don't like to use ORM. This feature is missing in [https://en.wikipedia.org/wiki/Django_(web_framework) Django] (another web framework based on python). [http://webpy.org/docs/0.3/tutorial]&lt;br /&gt;
&lt;br /&gt;
===Forms===&lt;br /&gt;
&lt;br /&gt;
A forms package is present in web.py which let's us create forms and [https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation validators]. The form module of web.py allows the ability to generate html forms, get user input, and validate it before processing it or adding it to a database. But it doesn't have built-in protection against [https://en.wikipedia.org/wiki/Cross-site_request_forgery CSRF]. A basic login form would look as given below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
login = form.Form(&lt;br /&gt;
    form.Textbox('username'),&lt;br /&gt;
    form.Password('password'),&lt;br /&gt;
    form.Button('Login'),&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another interesting feature about web.py is its flexibility. It has flexible modules which can be used with another framework.&lt;br /&gt;
&lt;br /&gt;
=='''Hello world example'''==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import web&lt;br /&gt;
urls = (&lt;br /&gt;
	'/', 'index'&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
class index:&lt;br /&gt;
	def GET(self):&lt;br /&gt;
		return &amp;quot;Hello, ECE517!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
	app = web.application(urls, globals())&lt;br /&gt;
	app.run()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the given example, the user start the application by importing the web.py module using the following command&lt;br /&gt;
 import web&lt;br /&gt;
&lt;br /&gt;
The most important part of the website is its URL structure. web.py makes it easy to make great URLs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
urls = (&lt;br /&gt;
  '/', 'index'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part is a [https://en.wikipedia.org/wiki/Regular_expression regular expression] that matches a URL, like /, /help/faq, /item/, etc. The parentheses say to capture that piece of the matched data for use later on. The second part is the name of a class to send the request to, like index, view, welcome,t story: http://faruk.akgul.org/blog/python-development-story-why-webpy/&lt;br /&gt;
&lt;br /&gt;
[[#References|[3]]] pillars of python-six web frameworks: http://www.infoworld.com/article/2622836/application-development/pillars-of-python--six-python-web-frameworks-compared.html?page=2&lt;br /&gt;
&lt;br /&gt;
[[#References|[4]]] Django vs flash vs pyramid https://www.airpair.com/python/posts/django-flask-pyramid&lt;br /&gt;
&lt;br /&gt;
[[#References|[5]]] Form Validation: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation&lt;br /&gt;
&lt;br /&gt;
[[#References|[6]]] Aaron swartz about web.py http://www.aaronsw.com/weblog/rewritingreddit&lt;br /&gt;
&lt;br /&gt;
[[#References|[7]]] https://www.wikipedia.org/&lt;/div&gt;</summary>
		<author><name>Ndhanir</name></author>
	</entry>
</feed>