CAT | Web Development
4
Migrating project from ASP.NET MVC 2.0 to 3.0 Preview 1
No comments · Posted by A.K. in Software, Web Development
I just downloaded ASP.NET MVC 3.0 to test out the new Razor view engine. The problem is that the previous project created in MVC 2.0 needed to be changed as well. This step is nearly identical to the process in migrating from 1.0 to 2.0. The following content is blatant plagiarism with a few details modified,
To manually upgrade an existing ASP.NET MVC 1.0 application to version 2, follow these steps:
- Make a backup of the existing project.
- In a text editor, open the project file (the file with the .csproj or .vbproj file extension) and find the ProjectTypeGuid element. As the value of that element, replace the GUID {F85E285D-A4E0-4152-9332-AB1D724D3325} with {E53F8FEA-EAE0-44A6-8774-FFD645390401}. When you are done, the value of that element should be as follows:
{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
- In the Web application root folder, edit the Web.config file. Search for System.Web.Mvc, Version=2.0.0.0 and replace all instances with System.Web.Mvc, Version=3.0.0.0.
- Repeat the previous step for the Web.config file located in the Views folder. (Additional note: There are 4 places that you need to change to 3.0.0.0 in this file.)
- Open the project using Visual Studio, and in Solution Explorer, expand the References node. Delete the reference to System.Web.Mvc (which points to the version 1.0 assembly). Add a reference to System.Web.Mvc (v3.0.0.0).
- Add the following bindingRedirect element to the Web.config file in the application root under the configuraton section:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>(Additional note: I just replaced this entire section in my old Web.Config. Unless you have other elements, I would recommend doing the same thing.)
- Create a new empty ASP.NET MVC 2 application. Copy the files from the Scripts folder of the new application into the Scripts folder of the existing application.
- Update the existing application’s CSS file with the CSS style definitions in the Site.css file.
- Good luck!
One of my friends (bwilliam) pointed out to me this webpage "Python vs PHP, Python runs slower?" It intrigued me since I already did something similar to this before here. It has been said that Python is faster than PHP, but why in this case, is Python clearly slower than PHP? I was hoping that the user comments on that page would have an answer, but most people just posted a better implementation of finding prime numbers. So I took a little bit of time out of my hectic schedule to find the cause.
Here are the two scripts written by Teifion in PHP and Python:
PHP:
$primeNumbers = array();
$output = ”;
for ($i = 2; $i < 100000; $i++)
{
$divisible = false;
foreach ($primeNumbers as $number)
{
if ($i % $number == 0)
{
$divisible = true;
}
}
if ($divisible == false)
{
$primeNumbers[] = $i;
$output .= $i;
}
}
echo $output;
?>
array · hectic schedule · implementation · little bit · prime numbers · primenumbers · python · scripts
I recently found a post on this one particular blog that was doing benchmark for PHP vs Ruby. The author of the blog wrote merge sort in PHP, Ruby, Perl, Python and C++, then proceeded to test the speed at which they ran. I found it interesting that this particular merge script written in Ruby took only 3/4 of the a time to run. So I downloaded his exact scripts that he used and tested on one of my server machines. The only one I didn’t run was the C++ version of this merge sort.
I recently took a databases class here at my school, and this argument came up rather heatedly in the class. The teacher really likes the idea of a char while a few students see no point in it and that varchar are a lot better. This came up during the group’s presentation to the class on how they were going to design their database. It really got me thinking which one is better since they both had good arguments behind it. First, why varchar?
One of the servers we’ve had for a while was running a bit slow. After a few hours of searching, I’ve found out that one of the PHP scripts was running a mailer and it was just dragging the system down. Although most of the load was through exim, our mailer, I found that apache was hogging up a bit of resources as well. Since our server load was high and we were getting a decent number of visitors hitting on our vBulletin as well as a PHP lyrics script that I partially wrote for our Vietnamese lyrics website. I went to search on how to optimize PHP scripts and I came up with eAccelerator. (more…)
php · php optimization · speed up php · speed up php and apache · web development
31
Displaying Drupal subpages on Parent Pages
No comments · Posted by A.K. in Blog, Web Development
I am the webmaster of WSU’s ACM Chapter. Since past webpages for our ACM site has been done by hand in HTML, it is hard to update or add information. It is even harder to teach a future webmaster the ropes, and what will eventually happens it that it gets neglected. It is for also many other reasons that the ACM Club at our school isn’t doing so well, but that’s information for another post. Since I am the "official" webmaster for our new website, I have decided that it is a lot wiser to use some sort of CMS (Content Management System). Due to a variety of reasons, I’ve opted to use Drupal. (more…)
drupal · drupal code · drupal subpages · php · php code for drupal · web development
