<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>SitePoint » Learn CSS &#124; HTML5 &#124; JavaScript &#124; Wordpress &#124; Tutorials-Web Development &#124; Reference &#124; Books and More &#187; .NET</title> <atom:link href="http://www.sitepoint.com/category/tech/net/feed/" rel="self" type="application/rss+xml" /><link>http://www.sitepoint.com</link> <description></description> <lastBuildDate>Sun, 27 May 2012 15:59:16 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Combining LESS with ASP.NET</title><link>http://www.sitepoint.com/combining-less-with-asp-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=combining-less-with-asp-net</link> <comments>http://www.sitepoint.com/combining-less-with-asp-net/#comments</comments> <pubDate>Thu, 29 Mar 2012 16:00:01 +0000</pubDate> <dc:creator>Malcolm Sheridan</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Visual Studio 2010]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=53028</guid> <description><![CDATA[<img
width="50" height="33" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/small-50x33.jpg" class="attachment-thumbnail wp-post-image" alt="small" title="small" />Everyone knows how cool LESS is. If you&#8217;re not, then here&#8217;s the elevator speech. LESS extends CSS with dynamic behavious such as variables, mixins, namespaces and functions, it makes CSS easy to work with. Now, it&#8217;s important to remember it doesn&#8217;t code your CSS for you &#8211; it isn&#8217;t a magic CSS editor. You still [...]]]></description> <content:encoded><![CDATA[<img
width="50" height="33" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/small-50x33.jpg" class="attachment-thumbnail wp-post-image" alt="small" title="small" /><p></p><p>Everyone knows how cool LESS is. If you&#8217;re not, then here&#8217;s the elevator speech. LESS extends CSS with dynamic behavious such as variables, mixins, namespaces and functions, it makes CSS easy to work with. Now, it&#8217;s important to remember it doesn&#8217;t code your CSS for you &#8211; it isn&#8217;t a magic CSS editor. You still need to know how to work with CSS. It allows you to write CSS once and use it in multiple places. This is something I&#8217;ve wanted for a long time and now it&#8217;s here.</p><p>There are other libraries which perform similar functions, such as SASS, but I&#8217;ll focus on LESS as that&#8217;s what I&#8217;m familiar with. I&#8217;m going to be concentrating on how to use this with ASP.NET.</p><p>I&#8217;m going to be using Visual Studio 2010 for this demonstration, as I had a few issues using LESS with Visual Studio 11.</p><h3>Running LESS On the Client</h3><p>LESS can be run purely on the client or from the server. To run it on the client is a simple three step process.</p><ol><li>Add a reference to the <a
href="http://lesscss.googlecode.com/files/less-1.3.0.min.js">LESS JavaScript file</a></li><li>Update the <i>rel</i> value in the LINK tag to rel=&#8221;stylesheet/less&#8221;</li><li>Add a new .less file to your project and reference that in your LINK tag</li></ol><p>Updating the <a
href="http://www.w3schools.com/tags/att_link_rel.asp" title="LINK rel Attribute" target="_blank">rel</a> value to <i>stylesheet/less</i> is necessary because the LESS library looks for this value. Once it&#8217;s found it processes that file. Your page should look like this now.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><pre>
<code>
&lt;link href="styles/my.less" rel="stylesheet/less" /&gt;
&lt;script src="http://lesscss.googlecode.com/files/less-1.3.0.min.js"&gt;&lt;/script&gt;
</code>
</pre><p>I&#8217;m referencing a file called my.less, so let&#8217;s define some LESS code to ensure this is working.</p><pre>
<code>
@back-color: #000;
@font-color: #fff;
body {
  background-color: @back-color;
  font-size: .85em;
  font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif;
  margin: 0;
  padding: 0;
  color: @font-color;
}
</code>
</pre><p>I&#8217;ll skip over the syntax for now, but if you run the website and look in the developer tools, you&#8217;ll see that LESS code is being served as valid CSS.</p><p><a
href="http://www.sitepoint.com/?attachment_id=53120" rel="attachment wp-att-53120"><img
src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/28-03-2012-1-54-10-PM.png" alt="" width="698" height="235" class="alignnone size-full wp-image-53120" /></a></p><h3>Running LESS On the Server</h3><p>There are several ways to install LESS on the server. The easiest approach is via <a
href="http://nuget.org/" title="NuGet" target="_blank">NuGet</a>. There&#8217;s a package called <a
href="http://nuget.org/packages/dotless" title="dotless" target="_blank">dotless</a>. Install it with the following command inside Visual Studio.</p><p><a
href="http://www.sitepoint.com/?attachment_id=53046" rel="attachment wp-att-53046"><img
src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/18-03-2012-11-11-45-PM.png" alt="" width="746" height="72" class="alignnone size-full wp-image-53046" /></a></p><p>Once installed, you can remove the JavaScript reference from your page. Also make sure you update the LINK tag and remove the <i>/less</i> from the rel attribute.</p><pre>
<code>
&lt;link href="styles/my.less" rel="stylesheet" /&gt;
</code>
</pre><p>The package has also added some entries to your web.config file. There&#8217;s a new configSection defined.</p><pre><code>
&lt;configSections&gt;
  &lt;section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" /&gt;
&lt;/configSections/&gt;
&lt;dotless minifyCss="false" cache="true" web="false" /&gt;
</code></pre><p>And a new HTTP handler has been added to cater for .less requests.</p><pre><code>
&lt;system.webServer&gt;
  &lt;handlers&gt;
   &lt;add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" /&gt;
  &lt;/handlers&gt;
&lt;/system.webServer&gt;
</code></pre><p>The nice feature about dotless is that it can automatically minify the CSS for you via the minifyCss attribute. If you update that to true and run the website now, you&#8217;ll see the minified CSS.</p><p><a
href="http://www.sitepoint.com/?attachment_id=53053" rel="attachment wp-att-53053"><img
src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/18-03-2012-11-37-11-PM1.png" alt="" width="909" height="199" class="alignnone size-full wp-image-53053" /></a></p><p>That&#8217;s it. LESS is now running on the server.</p><h3>When To Use It?</h3><p>I think LESS is great for development, but when you need your site to run as fast as possible, you don&#8217;t want to transform each .less request on the fly. This is why I&#8217;d recommend using this only during development. The good news is when you install dotless, it installs the dotless compiler. This can be in the packages\dotless1.3.0.0\Tool folder in your website folder.</p><p>You can add this to your pre-build event from the build properties tab.</p><p>“$(SolutionDir)packages\dotless.1.3.0.0\tool\dotless.Compiler.exe” “$(ProjectDir)content\my.less” “$(ProjectDir)content\my.css”</p><p><a
href="http://www.sitepoint.com/?attachment_id=53090" rel="attachment wp-att-53090"><img
src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/19-03-2012-10-01-33-PM.png" alt="" width="708" height="452" class="alignnone size-full wp-image-53090" /></a></p><p>This way you get the best of both worlds.</p><p>Before moving away from Visual Studio, there are extensions you can install that gives you the familiar syntax highlighting. <a
href="http://visualstudiogallery.msdn.microsoft.com/e646c6ec-87a7-45ea-81e8-d655a3d3e73e" title="LessExtension" target="_blank">LessExtension</a> seems like one of the better ones.</p><h3>LESS Syntax</h3><p>I haven&#8217;t covered any of the syntax in this article. I wanted to focus on LESS with ASP.NET. <a
href="http://www.sitepoint.com/author/igerchev/" target="_blank">Ivaylo Gerchev</a> has a good article on the syntax and that can be found <a
href="http://www.sitepoint.com/a-comprehensive-introduction-to-less/" title="LESS Syntax" target="_blank">here</a>.</p><p>I think LESS is a must tool to have during development. It will make your life easier when coding CSS.</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/combining-less-with-asp-net/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>ASP.NET 4.5 Bundling and Minification Update</title><link>http://www.sitepoint.com/asp-net-4-5-bundling-and-minification-update/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asp-net-4-5-bundling-and-minification-update</link> <comments>http://www.sitepoint.com/asp-net-4-5-bundling-and-minification-update/#comments</comments> <pubDate>Tue, 20 Mar 2012 16:00:51 +0000</pubDate> <dc:creator>Malcolm Sheridan</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[Web Tech]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=52515</guid> <description><![CDATA[<img
width="50" height="36" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/ASPNET_vNext11-50x36.png" class="attachment-thumbnail wp-post-image" alt="ASPNET_vNext1[1]" title="ASPNET_vNext1[1]" />Recently I wrote an article on the new bundling and minification features in ASP.NET 4.5. Out of the box, you get bundling and minifincation without really needing to do anything. If you missed it you can find it here. Since that article, there have been some changes to ASP.NET 4.5. Previously you needed to manually [...]]]></description> <content:encoded><![CDATA[<img
width="50" height="36" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/ASPNET_vNext11-50x36.png" class="attachment-thumbnail wp-post-image" alt="ASPNET_vNext1[1]" title="ASPNET_vNext1[1]" /><p></p><p>Recently I wrote an article on the new bundling and minification features in ASP.NET 4.5. Out of the box, you get bundling and minifincation without really needing to do anything. If you missed it you can find it <a
title="ASP.NET 4.5 Bundling and Minification Support" href="http://bit.ly/x8lZqc" target="_blank">here</a>.</p><p>Since that article, there have been some changes to ASP.NET 4.5. Previously you needed to manually add the following line of code in the Global.asax file:</p><pre><code>protected void Application_Start()
{
    BundleTable.Bundles.EnableDefaultBundles();
}
</code></pre><p>Since the update to ASP.NET 4.5, you no longer need to manually add that line of code. It&#8217;s automatically there when you begin a new project.</p><pre><code>protected void Application_Start()
{
    BundleTable.Bundles.RegisterTemplateBundles();
}
</code></pre><p>The code for referencing the bundled and minified CSS and JavaScript files has been updated too.  Previously to reference a bundle, you&#8217;d add the following code:</p><pre>
<code>
&lt;script src="scripts/js"&gt;&lt;/script&gt;
&lt;link href="content/css" rel="stylesheet" /&gt;
</code>
</pre><p>This is assuming you have your JavaScript files in a folder called <i>scripts</i>, and your style sheets are in a folder called <i>content</i>. This still works with this new release. The problem with referencing the files this way is when you update the files, the old versions will still be cached either by your browser, or by a web proxy. By default the files are cached for 1 year, this is great if you never update them! Microsoft has addressed this issue by allowing you to reference the bundled and minified files via <a
href="http://bit.ly/zLWTNY" title="ResolveBundleUrl" target="_blank">ResolveBundleUrl</a>.</p><pre>
<code>
&lt;script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Scripts/js")"&gt;&lt;/script&gt;
&lt;link href="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Content/css")" rel="stylesheet" type="text/css" /&gt;
</code></pre><p>The benefit of using <a
href="http://bit.ly/zLWTNY" title="ResolveBundleUrl" target="_blank">ResolveBundleUrl</a> is that it appends a magic string at the end of the file name. This magic string only changes when the file changes, meaning the files will be cached for 1 year or until they change. If you inspect the page through the developer tools in Google Chrome, you&#8217;ll see the magic string.</p><p><a
href="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/asprequesturl.png"><img
src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/asprequesturl.png" alt="" title="asprequesturl" width="700" height="175" class="aligncenter size-full wp-image-52722" /></a></p><p>You can include a <i>@using</i> keyword to remove the need to fully qualify the System.Web.Optimization assembly.</p><pre>
<code>
@using System.Web.Optimization
</code>
</pre><p>Be certain to remember the use of this feature when developing with ASP.NET 4.5.</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/asp-net-4-5-bundling-and-minification-update/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>ASP.NET MVC 4 &#8211; Web API</title><link>http://www.sitepoint.com/asp-net-mvc-4-web-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asp-net-mvc-4-web-api</link> <comments>http://www.sitepoint.com/asp-net-mvc-4-web-api/#comments</comments> <pubDate>Tue, 06 Mar 2012 23:50:27 +0000</pubDate> <dc:creator>Malcolm Sheridan</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[Web Tech]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=52229</guid> <description><![CDATA[<img
width="50" height="36" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/ASPNET_vNext1-50x36.png" class="attachment-thumbnail wp-post-image" alt="ASPNET_vNext[1]" title="ASPNET_vNext[1]" />A beta version of ASP.NET 4 has just been released, and ASP Aficionado Malcolm Sheridan is here to take us through one of the fantastic new features, the Web API Framework.]]></description> <content:encoded><![CDATA[<img
width="50" height="36" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/03/ASPNET_vNext1-50x36.png" class="attachment-thumbnail wp-post-image" alt="ASPNET_vNext[1]" title="ASPNET_vNext[1]" /><p></p><p>A beta version has just been released for ASP.NET 4. Among the many new features included in this release is the Web API framework, but what is it? Basically, it allows you to create services that can be exposed over HTTP rather than through a formal service such as WCF or SOAP. If you&#8217;ve ever used the Facebook or Twiiter API, you&#8217;re already familiar with them. For me, this is one of the most exciting new features!</p><p>Web API was originally the <a
title="WCF Web API" href="http://bit.ly/xLiQPL" target="_blank">WCF Web API</a> project. Developing an API this way meant you followed the rules governed by WCF; starting with an interface, creating classes to derive from the interface, and then decorating the interface with the WCF attributes to form the endpoints. This was not a fluent process. WCF is tough and people like the ease that ASP.NET allows, Microsoft saw this and created Web API. They took the best pieces from WCF Web API and the ease of development that ASP.NET MVC allows.</p><h3>Installation</h3><p>Right now you can install MVC 4 beta for Visual Studio 2010 via the We Platform Installer. This requires ASP.NET 4 if you haven&#8217;t previously installed it, and can be downloaded from <a
title="Web Platform Installer" href="http://go.microsoft.com/fwlink/?LinkId=243392" target="_blank">here</a>.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><p>Visual Studio 2011 Developer Preview has also just been released to the public. As an <a
title="ASPInsiders" href="http://aspinsiders.com/" target="_blank">ASPInsider</a>, we&#8217;ve had access to the release for quite some time, and I&#8217;m very happy with the new metro look and feel. If you&#8217;d like to install it, it can be downloaded <a
title="Visual Studio 2011 Installer" href="http://bit.ly/xj4hub" target="_blank">here</a>. All of the code and screen shots are from the new version.</p><h3>Getting Started</h3><p>To get started writing your first Web API, open Studio 2011 and choose ASP.NET MVC 4 Web Application. The Project Template dialog will pop up next. There&#8217;s a couple of new choices, such as <em>Mobile Application</em> and <em>Single Page Application (SPA)</em>, but for now choose Web API.</p><p><a
href="http://www.sitepoint.com/asp-net-mvc-4-web-api/sheridan_001-4/" rel="attachment wp-att-52234"><img
class="alignnone size-medium wp-image-52234" src="http://cdn.sitepoint.com/wp-content/uploads/2012/03/Sheridan_001.png" alt="" /></a></p><p>Before looking at any code, open the global.asax file and take a look at the default route.</p><pre><code>public static void RegisterApis(HttpConfiguration config) {
 config.Routes.MapHttpRoute(
  "Default", // Route name
  "{controller}/{id}", // URL with parameters
  new { id = RouteParameter.Optional } // Parameter defaults
 );
}
protected void Application_Start() {
 RegisterApis(GlobalConfiguration.Configuration);
} </code></pre><p>The main difference bewteen MVC routes and Web API routes is there&#8217;s no route defined for an action. That&#8217;s because Web API uses the HTTP method, not the URI path, to select the action.</p><p>I&#8217;ve created a simple <em>Product</em> class to represent the model and added that to the <em>Models</em> folder.</p><pre><code>public class Product {
 public int ID { get; set; }
 public double Price { get; set; }
 public string Name { get; set; }
}</code></pre><p>Now I&#8217;m going to add a new controller called ProductController. There&#8217;s some new additions you can choose in this dialog for scaffolding options, but for now I&#8217;m going to generate an empty controller.</p><p><a
href="http://www.sitepoint.com/asp-net-mvc-4-web-api/sheridan_002-3/" rel="attachment wp-att-52245"><img
class="alignnone size-medium wp-image-52245" src="http://cdn.sitepoint.com/wp-content/uploads/2012/03/Sheridan_002.png" alt="" /></a></p><p>The controller looks the same, but Web API controllers derive from ApiController.</p><pre><code>public class ProductController : ApiController {
 // GET: /Product/
 public ActionResult Index() {
  return View();
 }
}</code></pre><p>Remember Web API uses HTTP methods, so we can map out the following HTTP methods:</p><table
width="60%"><tbody><tr><th>Action</th><th>HTTP method</th><th>Relative URI</th></tr><tr><td>Get a list of all products</td><td>GET</td><td>/products</td></tr><tr><td>Get a product by id</td><td>GET</td><td>/products/id</td></tr><tr><td>Create a new product</td><td>POST</td><td>/products</td></tr><tr><td>Update a product</td><td>PUT</td><td>/products/id</td></tr><tr><td>Delete a product</td><td>DELETE</td><td>/products/id</td></tr></tbody></table><p>The naming conventions in Web API follow the names of the HTTP methods, GET/POST/PUT/DELETE.  You&#8217;ll see how these are mapped to the code in the following sections.</p><h3>GET Actions</h3><pre><code>public List&lt;Product&gt; Get() { 
 return _productsRepository.ToList(); 
} 
public Product Get(int id) { 
 return _productsRepository.First(p =&gt; p.ID == id); 
}</code></pre><p>Notice how I&#8217;ve defined two Get actions?  This is because when the user invokes the API, they&#8217;ll pass in the HTTP method. If an incoming request is a GET request, and it doesn&#8217;t have an ID, it will call the Get action to return a list of products. If an ID is there, it invokes the Get action for a specific product. Nice and simple. And how can you test this code? I&#8217;m going to use <a
title="Fiddler" href="http://bit.ly/yDi6K1" target="_blank">Fiddler</a> for this. If you&#8217;ve never used it, you should get it now.</p><p>Using Fiddler I can create a GET request in the Composer builder. Calling <em>http://localhost:1717/Product</em> will return the list of products.</p><p><a
href="http://www.sitepoint.com/asp-net-mvc-4-web-api/sheridan_003-2/" rel="attachment wp-att-52266"><img
class="alignnone size-medium wp-image-52266" src="http://cdn.sitepoint.com/wp-content/uploads/2012/03/Sheridan_003.png" alt="" /></a></p><p>If I want only one product, I can pass in an ID; <em>http://localhost:1717/Product/1.  </em>By default JSON is returned from all action methods. If you want a different format, like XML, just add in the <a
title="HTTP Accept Header" href="http://bit.ly/zYaYSL" target="_blank">Accept</a> request head application/xml:</p><p><a
href="http://www.sitepoint.com/asp-net-mvc-4-web-api/sheridan_004-2/" rel="attachment wp-att-52267"><img
class="alignnone size-medium wp-image-52267" src="http://cdn.sitepoint.com/wp-content/uploads/2012/03/Sheridan_004.png" alt="" /></a><br
/> Without changing any code, it returns the result in XML.</p><h3>POST Actions</h3><pre><code>public void Post(Product product) { 
 _productsRepository.Add(product)
}</code></pre><p>Following on from the GET requests are POST requests. This is where data will be created. Again I&#8217;ve named the action the same as the HTTP verb, so all I need to change is to add the Content-Type to application/json, and send up the JSON object. I can add the following request headers in Fiddler to post the new product.</p><p><a
href="http://www.sitepoint.com/asp-net-mvc-4-web-api/sheridan_005-4/" rel="attachment wp-att-52315"><img
class="alignnone size-medium wp-image-52315" src="http://cdn.sitepoint.com/wp-content/uploads/2012/03/Sheridan_0051.png" alt="" /></a></p><p>If you check the HTTP response code, you&#8217;ll see it returns 200, which is OK, but for a POST it should ideally return a 201 status code.  This will indicate to the user that the product was successful.  Also 201&#8242;s are supposed to have a Location value, so we&#8217;ll add that also.</p><pre><code>public HttpResponseMessage&lt;Product&gt; Post(Product product) {    
 _productsRepository.Add(product);    
 var response = new HttpResponseMessage&lt;Product&gt;(product, HttpStatusCode.Created);    
 string uri = Url.Route("http://localhost:1717/", new { id = contact.Id });    
 response.Headers.Location = new Uri(Request.RequestUri, uri);    
 return response;
}</code></pre><p>Instead of returning void, we&#8217;re returning a new type <a
title="HttpResponseMessage" href="http://bit.ly/xbFCFX" target="_blank">HttpResponseMessage</a>&lt;T&gt;. This gives you the flexibility of changing the returned status code as well as the response headers. Now if you run this through Fiddler, you&#8217;ll see a 201 returned plus the <em>Location</em> header.</p><p><a
href="http://www.sitepoint.com/asp-net-mvc-4-web-api/sheridan_006/" rel="attachment wp-att-52309"><img
class="alignnone size-medium wp-image-52309" src="http://www.sitepoint.com/wp-content/uploads/2012/03/Sheridan_006.png" alt="" /></a></p><h3>PUT Actions</h3><pre><code>public void Put(Product product) { 
 _productsRepository.Update(product)
}</code></pre><p>Put actions update resources, so returning a 200 or 204 is fine. By default, 200 is returned, so for this reason we don&#8217;t have to do anything to the action.</p><p><a
href="http://www.sitepoint.com/asp-net-mvc-4-web-api/sheridan_007/" rel="attachment wp-att-52312"><img
class="alignnone size-medium wp-image-52312" src="http://www.sitepoint.com/wp-content/uploads/2012/03/Sheridan_007.png" alt="" /></a></p><p>It&#8217;s worth noting that for the post and put actions I&#8217;m sending JSON. If I change the content-type to XML, I could easily send XML instead of JSON without having to change any code in the API. Web API automatically breaks the incoming request to strongly typed objects and maps the name properties.</p><h3>DELETE Actions</h3><pre><code>public void Delete(Product product) { 
 _productsRepository.Delete(product)
}</code></pre><p>Delete actions delete resources, so depending if the resource is deleted immediately or at a later stage can determine the status code.  If the resource is deleted immediately, the status code should be 200.  If the deletion is for a later stage, then a 202 status code should be returned.</p><pre><code>public HttpResponseMessage&lt;Product&gt; Delete(Product product) { 
 _productsRepository.Delete(product);
 var response = new HttpResponseMessage&lt;Product&gt;(product, HttpStatusCode.Deleted);
 return response;
}</code></pre><p>I&#8217;ve only scratched the surface of Web API, over the coming weeks I&#8217;ll explore different ways to use it.</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/asp-net-mvc-4-web-api/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>ASP.NET 4.5 Strongly Typed Data Controls &amp; Model Binding</title><link>http://www.sitepoint.com/asp-net-4-5-strongly-typed-data-controls-model-binding/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asp-net-4-5-strongly-typed-data-controls-model-binding</link> <comments>http://www.sitepoint.com/asp-net-4-5-strongly-typed-data-controls-model-binding/#comments</comments> <pubDate>Mon, 13 Feb 2012 00:25:57 +0000</pubDate> <dc:creator>Malcolm Sheridan</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[ASP.NET 4.5]]></category> <category><![CDATA[MVC4]]></category> <category><![CDATA[Visual Studio 2011]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=50308</guid> <description><![CDATA[<img
width="50" height="36" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/ASPNET_vNext-50x36.png" class="attachment-thumbnail wp-post-image" alt="ASPNET_vNext" title="ASPNET_vNext" />Continuing his exploration of ASP.NET 4.5, Malcolm Sheridan looks at the new strongly typed data controls that make error prevention and catching much easier.]]></description> <content:encoded><![CDATA[<img
width="50" height="36" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/ASPNET_vNext-50x36.png" class="attachment-thumbnail wp-post-image" alt="ASPNET_vNext" title="ASPNET_vNext" /><p></p><p>I&#8217;m continuing on these series of articles about what&#8217;s new in ASP.NET 4.5.</p><p>One pain point that&#8217;s dogged WebForm developers for some time is the fact that there haven&#8217;t been any strongly typed data controls.  Some of the data controls I&#8217;m speaking of include the Repeater, FormView and GridView controls.  They all used templates, which could allow you to specify a view for different operations, such as when you&#8217;re editing data compared to adding new data.</p><p>When you use these templates today, they&#8217;re using late bound expressions to bind the data.  If you&#8217;re using the GridView control, or any of the other data controls, you&#8217;ll be familiar with the Bind or Eval syntax:</p><pre>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"&gt;
      &lt;Columns&gt;
           &lt;asp:TemplateField HeaderText="Name"&gt;
                    &lt;ItemTemplate&gt;
                        &lt;asp:Label ID="lblName" runat="server" Text='&lt;%# Bind("Name") %&gt;'&gt;&lt;/asp:Label&gt;
                    &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
                &lt;asp:TemplateField HeaderText="City"&gt;
                     &lt;ItemTemplate&gt;
                        &lt;asp:Label ID="lblCity" runat="server" Text='&lt;%# Bind("Address.City") %&gt;'&gt;&lt;/asp:Label&gt;
                     &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
 &lt;/asp:GridView&gt;</pre><p>One of the problems with late-bound data controls is you&#8217;re using a string to represent a property name.  If you make a mistake typing the name, you won&#8217;t see the exception until runtime.  It&#8217;s much better to catch these errors at compile time.  Thankfully Microsoft has addressed this in ASP.NET 4.5 by implementing strongly typed data controls.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><h3>Installation</h3><p>Before starting any development, you’ll need to install ASP.NET 4.5.  The simplest way to do this is via the Web Platform Installer.  All of the ASP.NET 4.5 articles I’m authoring are developed in Visual Studio 2011 Developer Preview. Here&#8217;s the link to get started.</p><ul><li><a
href="http://www.microsoft.com/web/gallery/install.aspx?appid=MVC4VS11&amp;prerelease=true">ASP.NET MVC 4 for Visual Studio 2011 Developer Preview</a></li></ul><h3>Strongly Typed Data Controls</h3><p>ASP.NET 4.5 introduces strongly typed data controls in the templates.  A new ModelType property has been added to the data controls, and this allows you to specify the type of object that is bound to the control.</p><p>Setting this property will add that type to the data controls Intellisense (an autocomplete function), which means no more typing mistakes!  This removes the need to run the website to see if you&#8217;ve made any typing mistakes during development.</p><p>In this example, I&#8217;ve connected to a Northwind web service.  Using ASP.NET 4.5, I can set the ModelType to Northwind.  If the requirement is for one-way data binding, you can use the <em>Item</em> expression.  <code>Bind("Name") </code>becomes <code>Item.Name</code>.  The same goes for the City property.  Replace <code>Bind("Address.City")</code> with <code>Item.Address.City</code>.</p><pre>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
            ModelType="WebApplication2.NorthwindService.Supplier"&gt;
        &lt;Columns&gt;
            &lt;asp:TemplateField HeaderText="Name"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:Label ID="lblName" runat="server" Text='&lt;%# Item.Name %&gt;'&gt;&lt;/asp:Label&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="City"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:Label ID="lblCity" runat="server" Text='&lt;%# Item.Address.City %&gt;'&gt;&lt;/asp:Label&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
        &lt;/Columns&gt;
    &lt;/asp:GridView&gt;</pre><p>For two-way data binding, use <em>Binditem</em>.  So using the example above, data binding to a text box would be like this:</p><pre>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
            ModelType="WebApplication2.NorthwindService.Supplier"&gt;
        &lt;Columns&gt;
            &lt;asp:TemplateField HeaderText="Name"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:TextBox ID="txtName" runat="server" Text='&lt;%# Binditem.Name %&gt;'&gt;&lt;/asp:TextBox&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="City"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:TextBox ID="txtCity" runat="server" Text='&lt;%# Binditem.Address.City %&gt;'&gt;&lt;/asp:TextBox&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
        &lt;/Columns&gt;
    &lt;/asp:GridView&gt;</pre><p>Intellisense is available, so there&#8217;ll be no more mistyped properties you only find out about at runtime.</p><p><img
class="alignnone size-full wp-image-51263" title="Sheridan_001" src="http://www.sitepoint.com/wp-content/uploads/2012/02/Sheridan_001.png" alt="A typographical error in code" width="661" height="158" /></p><h3>Model Binding</h3><p>Model binding focuses on coded data access logic.  Previously if you wanted to display data in the GridView control, you either had to explicitly set the DataSource property and call its DataBind method from the code behind.  Like this example:</p><pre>protected void Page_Load(object sender, EventArgs e)
{
     var products = GetProducts();
     GridView1.DataSource = products;
     GridView1.DataBind();
}</pre><p>Alternatively you could use one of the many data source controls to bind the data to the GridView.  Now that model binding is part of ASP.NET, you can explicitly tell the GridView which method to call to retrieve its data by using the SelectMethod property.  Here&#8217;s the updated GridView.</p><pre>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
            ModelType="WebApplication2.NorthwindService.Supplier"
            SelectMethod="GetProducts"&gt;
        &lt;Columns&gt;
            &lt;asp:TemplateField HeaderText="Name"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:Label ID="lblName" runat="server" Text='&lt;%# Item.Name %&gt;'&gt;&lt;/asp:Label&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
            &lt;asp:TemplateField HeaderText="City"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:Label ID="lblCity" runat="server" Text='&lt;%# Item.Address.City %&gt;'&gt;&lt;/asp:Label&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
        &lt;/Columns&gt;
    &lt;/asp:GridView&gt;</pre><p>And in the code behind, here&#8217;s the GetProducts method:</p><pre>public IQueryable&lt;NorthwindService.Supplier&gt; GetProducts()
{
    var service = new NorthwindService.DemoService(new Uri(@"http://services.odata.org/OData/OData.svc/"));
    var suppliers = (from p in service.Suppliers
                             select p);
    return suppliers;
}</pre><p>This method doesn&#8217;t need to be in the code behind. It could live in another class or assembly.  The benefit of returning <code>IQueryable</code>  is that it enables deferred execution on the query, and allows a data-bound control to further modify the query before executing it.  This is useful when you need to implement sorting and paging methods.</p><p>I&#8217;m excited by the model binding and strongly bound data controls in ASP.NET 4.5.  It has certainly borrowed these ideas and concepts from MVC, so fingers crossed more of them are implemented in upcoming versions.  </p><p>The code for this article can be downloaded from <a
title="Github" href="http://bit.ly/zlHsPg" target="_blank">here</a>.</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/asp-net-4-5-strongly-typed-data-controls-model-binding/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item><div><div
class="post_box two_ads" style="float:left;padding-left:2px;"><div
id='div-gpt-ad-1328645237920-0' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328645237920-0'); });</script> </div></div></div><div
class="clear">&nbsp;</div> <item><title>PHPMaster: How I Chose My Programming Editor</title><link>http://feedproxy.google.com/~r/PHPMaster_feed/~3/y6hnYOzYB8U/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=phpmaster-how-i-chose-my-programming-editor</link> <comments>http://feedproxy.google.com/~r/PHPMaster_feed/~3/y6hnYOzYB8U/#comments</comments> <pubDate>Fri, 13 Jan 2012 23:32:42 +0000</pubDate> <dc:creator>J Armando Jeronymo</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[Color]]></category> <category><![CDATA[Community]]></category> <category><![CDATA[debug]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[DR]]></category> <category><![CDATA[frameworks]]></category> <category><![CDATA[HTML5]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[S3]]></category> <category><![CDATA[UX]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[Windows]]></category> <category><![CDATA[netbeans]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=50239</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/aebc63699691-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /> For many years I used a code editor that is now discontinued by its developers, and the introduction of HTML5 and CSS3 led me to look for an editor that supports the new tags and properties. In this article I’ll share the criteria and process I used to find an editor suitable for making quick fixes and a development environment for large-scale projects. My initial candidate list contained over 30 popular Linux, Java, Windows and XUL software packages which had at least one stable release after January 1, 2010: Arachnophilia, Bluefish, Bluegriffon, CoffeeCup HTML Editor, Dreamweaver, Eclipse PDT, Emacs, Expression Web, Geany, gedit, HTML-Kit, jEdit, Kate, KDevelop, Komodo Edit, KWrite, Netbeans, Notepad++, Notepad2, OpenBEXI, PHPEdit, PHPEd Pro, PHPStorm, Programmer’s Notepad, PSPad, RadPHP, Scite, SeaMonkey, Vim, WebDev, WebMatrix, and Zend Studio. You can google each program for their specific details]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/aebc63699691-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /><p></p><p><img
src="http://www.sitepoint.com/wp-content/uploads/2012/01/aebc63699691-150x150-50x50.jpg" alt="" /> For many years I used a code editor that is now discontinued by its developers, and the introduction of HTML5 and CSS3 led me to look for an editor that supports the new tags and properties. In this article I’ll share the criteria and process I used to find an editor suitable for making quick fixes and a development environment for large-scale projects. My initial candidate list contained over 30 popular Linux, Java, Windows and XUL software packages which had at least one stable release after January 1, 2010: Arachnophilia, Bluefish, Bluegriffon, CoffeeCup HTML Editor, Dreamweaver, Eclipse PDT, Emacs, Expression Web, Geany, gedit, HTML-Kit, jEdit, Kate, KDevelop, Komodo Edit, KWrite, Netbeans, Notepad++, Notepad2, OpenBEXI, PHPEdit, PHPEd Pro, PHPStorm, Programmer’s Notepad, PSPad, RadPHP, Scite, SeaMonkey, Vim, WebDev, WebMatrix, and Zend Studio. You can google each program for their specific details</p><p>Read More:<br
/> <a
title="PHPMaster: How I Chose My Programming Editor" href="http://feedproxy.google.com/~r/PHPMaster_feed/~3/y6hnYOzYB8U/" target="_blank">PHPMaster: How I Chose My Programming Editor</a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://feedproxy.google.com/~r/PHPMaster_feed/~3/y6hnYOzYB8U/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>RubySource: Smelly Cucumbers</title><link>http://rubysource.com/smelly-cucumbers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rubysource-smelly-cucumbers</link> <comments>http://rubysource.com/smelly-cucumbers/#comments</comments> <pubDate>Fri, 13 Jan 2012 21:31:16 +0000</pubDate> <dc:creator>Dave Kennedy</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[BDD]]></category> <category><![CDATA[Best Practices]]></category> <category><![CDATA[CGI & Perl Tutorials]]></category> <category><![CDATA[Cucumber]]></category> <category><![CDATA[DR]]></category> <category><![CDATA[Flash]]></category> <category><![CDATA[Gems]]></category> <category><![CDATA[iOS]]></category> <category><![CDATA[News & Trends]]></category> <category><![CDATA[rails]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[Ruby Testing]]></category> <category><![CDATA[Tech]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[best practices]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=50238</guid> <description><![CDATA[ It was such a cliche of a title, I just had to use it. I’m sure you have heard of the great BDD tool Cucumber , but what you may not know about is how smelly cukes can be. I have recently been revising and refactoring my cucumber features in absolute disgust. In my defense, I started writing cucumber in earnest 6-7 months ago]]></description> <content:encoded><![CDATA[<p></p><p>It was such a cliche of a title, I just had to use it. I’m sure you have heard of the great BDD tool Cucumber , but what you may not know about is how smelly cukes can be. I have recently been revising and refactoring my cucumber features in absolute disgust. In my defense, I started writing cucumber in earnest 6-7 months ago</p><p>See more here:<br
/> <a
title="RubySource: Smelly Cucumbers" href="http://rubysource.com/smelly-cucumbers/" target="_blank">RubySource: Smelly Cucumbers</a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://rubysource.com/smelly-cucumbers/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>ASP.NET 4.5 Bundling and Minification Support</title><link>http://www.sitepoint.com/asp-net-4-5-bundling-and-minification-support/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asp-net-4-5-bundling-and-minification-support</link> <comments>http://www.sitepoint.com/asp-net-4-5-bundling-and-minification-support/#comments</comments> <pubDate>Fri, 13 Jan 2012 14:07:31 +0000</pubDate> <dc:creator>Malcolm Sheridan</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[ASP.NET]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[ASP.NET 4.5]]></category> <category><![CDATA[MVC4]]></category> <category><![CDATA[Visual Studio 2011]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=49930</guid> <description><![CDATA[<img
width="50" height="36" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/ASPNET_vNext-50x36.png" class="attachment-thumbnail wp-post-image" alt="ASPNET_vNext" title="ASPNET_vNext" />In ASP.NET 4.5, bundling and minification come out-of-the-box, significantly enhancing website performance by reducing the number of HTTP requests. Malcolm Sheridan explains.]]></description> <content:encoded><![CDATA[<img
width="50" height="36" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/ASPNET_vNext-50x36.png" class="attachment-thumbnail wp-post-image" alt="ASPNET_vNext" title="ASPNET_vNext" /><p></p><p>If you&#8217;re serious about web development, you strive for a fast website.  Nothing beats the feeling of sitting back and viewing a great website that&#8217;s fast.  Speed matters.  Your customers expect it.  If you don&#8217;t think they do, you&#8217;re living in a different world to mine.  With a growing trend of consumers buying online in 2011, developers have to cope with the extra devices customers will use to browse your website.</p><p>There are many ways to increase the performance of a website, but the way with the biggest impact by far is to decrease the number of HTTP requests.  Every time you reference an image, CSS file, JavaScript file, video, audio or a flash file, that adds an extra HTTP request.  That is time that could be used elsewhere, such as taking customer orders!</p><p>One way of reducing the number of HTTP requests is to combine the files.  If you have three style sheets sitting in your web page, that&#8217;s three separate HTTP requests.  Combining them into one file means there&#8217;s only one HTTP request.</p><p>You can take this one step further and add minification to this process.  Minification is the process of stripping out all of the white-space and comments from your CSS and JavaScript files.<div
id='div-gpt-ad-1328644474660-10' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328644474660-10'); });</script> </div></p><p>If you&#8217;re familiar with ASP.NET, bundling and minification was always a job for your build process.  With the advent of Visual Studio 2011 and ASP.NET 4.5, Microsoft has added bundling and minification out of the box, which in my opinion has been long overdue.  This process happens at run-time and is available to ASP.NET WinForms, MVC and Web Pages.</p><h3>Installation</h3><p>Before starting any development, you’ll need to install ASP.NET 4.5.  The simplest way to do this is via the Web Platform Installer.  All of the ASP.NET 4.5 articles I’m authoring are developed in Visual Studio 2011 Developer Preview. Below are the links to get started.</p><ul><li><a
href="http://www.microsoft.com/web/gallery/install.aspx?appid=MVC4VS2010&amp;prerelease=true">ASP.NET MVC 4 for Visual Studio 2010</a></li><li><a
href="http://www.microsoft.com/web/gallery/install.aspx?appid=MVC4VS11&amp;prerelease=true">ASP.NET MVC 4 for Visual Studio 2011 Developer Preview</a></li></ul><h3>Why Do This?</h3><p>The answer is simple; to reduce the number of HTTP requests that go between the client and server.  The result is a faster website.  By default when you create a new MVC 4 website, the following JavaScript files are loaded into the page.</p><pre>&lt;script type="text/javascript" src="../../Scripts/jquery-1.6.2.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="../../Scripts/jquery-ui-1.8.11.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="../../Scripts/modernizr-2.0.6-development-only.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="../../Scripts/AjaxLogin.js"&gt;&lt;/script&gt;</pre><p>Looking at this through Chrome you can see the 4 separate HTTP requests.</p><pre><a href="http://www.sitepoint.com/asp-net-4-5-bundling-and-minification-support/sheridan_001-2/" rel="attachment wp-att-49964"><img class="alignnone size-medium wp-image-49964" src="http://www.sitepoint.com/wp-content/uploads/2012/01/Sheridan_001-115x54.png" alt="" width="115" height="54" /></a></pre><p>We can do better that that! After you bundle it, you&#8217;ll see one request.</p><pre><a href="http://www.sitepoint.com/asp-net-4-5-bundling-and-minification-support/sheridan_002-2/" rel="attachment wp-att-49967"><img class="alignnone size-medium wp-image-49967" src="http://www.sitepoint.com/wp-content/uploads/2012/01/Sheridan_002-115x35.png" alt="" width="115" height="35" /></a></pre><h3>Where&#8217;s the Magic?</h3><p>The magic happens at runtime in ASP.NET 4.5.  Instead of referencing each JavaScript file separately, you can replace them all with this:</p><pre>&lt;script src="scripts/js"&gt;&lt;/script&gt;</pre><p>And you can also bundle and minify your CSS files too by adding this line of code:</p><pre>&lt;link href="content/css" rel="stylesheet" /&gt;</pre><p>This is assuming you have your JavaScript files in a folder called <em>scripts</em>, and your style sheets are in a folder called <em>content</em>.  This is configurable, of course &#8211; as you&#8217;ll soon see.</p><p>Before this will work, you need to add one line of code to the <em>global.asax</em> file in the <em>Application Start</em> event.</p><pre>Bundle.Bundles.EnableDefaultBundles();</pre><p>The need for this line of code will be removed when ASP.NET 4.5 is released.  When the website is running, if ASP.NET encounters either of these tags, it will automatically bundle and minify each file in the given folder and send back a single HTTP response for the JavaScript file and a single response for the CSS.  Out of the box you don&#8217;t need to do anything else.  This is a welcome feature.</p><p>By default, when the files are bundled by ASP.NET they are in alphabetical order.  If there are known libraries such as jQuery, jQuery UI and Dojo, they are loaded first.  For the CSS files, they are also bundled in alphabetical order.  The results can be seen in the image below.</p><p><a
href="http://www.sitepoint.com/asp-net-4-5-bundling-and-minification-support/sheridan_fig003/" rel="attachment wp-att-50197"><img
class="alignnone size-medium wp-image-50197" src="http://www.sitepoint.com/wp-content/uploads/2012/01/Sheridan_Fig003-115x38.png" alt="" width="115" height="38" /></a></p><p><span
class="Apple-style-span" style="font-size: 15px; font-weight: bold;">Custom Rules</span></p><p>If the default bundling rules don&#8217;t give you the control that you need, you can always create your own bundling rules.  A common reason for doing this is to group common libraries.  There aren&#8217;t too many occasions when you need to bundle your entire JavaScript or CSS files into the one file.  To create a custom rule you create a new <a
href="http://bit.ly/zt2IAA" target="_blank">Bundle</a> object.  Then you add files individually or an entire directory.</p><pre>var jSBundle = new Bundle("~/CustomJs", typeof(JsMinify));
jSBundle.AddFile("~/Scripts/CustomFunction.js");
jSBundle.AddFile("~/Scripts/jquery-1.4.1-vsdoc.js");
jSBundle.AddFile("~/Scripts/jquery-1.4.1.js");
jSBundle.AddFile("~/Scripts/JSONCreate.js");</pre><p>Notice the type <a
href="http://bit.ly/xGMnls" target="_blank">JsMinify</a> above?  That&#8217;s the default object that bundles and minifies the JavaScript files.  For CSS, you use <a
href="http://bit.ly/x94MaL" target="_blank">CssMinify</a> like the example below.</p><pre>var cssBundle = new Bundle("~/CustomCss", typeof(CssMinify));
cssBundle.AddFile("~/Content/Collection.css");
cssBundle.AddFile("~/Content/GlobalSupport.css");
cssBundle.AddFile("~/Content/MasterStyle.css");
cssBundle.AddFile("~/Styles/MenuStyle.css");</pre><p>To reference these custom rules, you put the name of each bundle in your HTML.</p><pre>&lt;script src="CustomJs"&gt;&lt;/script&gt; or &lt;link href="CustomCss" rel="stylesheet" /&gt;</pre><h3>Custom Processing</h3><p>If you want total control, you can override the default CSS and JavaScript bundling support and replace it with a custom process.  An easy way to do this is to create a class that implements the <a
href="http://bit.ly/xN47nV" target="_blank">IBundleTransform</a> interface.  The following example is trivial but it demonstrates how to do this.  The example inserts a company copyright into each JavaScript files and sets the default cache for the file.</p><pre>public class AddCopyrightToFiles : IBundleTransform
{
    public void Process(BundleResponse bundle)
    {
        StringBuilder sb = new StringBuilder();
        sb.AppendLine("// Copyright your company");
        sb.AppendLine(bundle.Content);
        bundle.Content = sb.ToString();
        bundle.Cacheability = HttpCacheability.ServerAndNoCache;
    }
}</pre><p>And to use this custom process, create a new Bundle and reference the custom class.</p><pre>BundleTable.Bundles.EnableDefaultBundles();
Bundle customBundle = new Bundle("~/CustomBundle", typeof(AddCopyrightToFiles));
customBundle.AddFile("~/Scripts/CustomTypes.js");
BundleTable.Bundles.Add(customBundle);</pre><p>And in the HTML, just reference the bundle by its name.</p><pre>&lt;script src="CustomBundle"&gt;&lt;/script&gt;</pre><h3>Unbundle JavaScript Files</h3><p>It&#8217;s worth noting that there are services that will unbundle your files, or beautify them.  The one I love to use is <a
title="jsbeautifier" href="http://jsbeautifier.org/" target="_blank">jsbeautifier</a>.  This flattens the file.  One of the biggest drawbacks of bundling and minification is readability.</p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://www.sitepoint.com/asp-net-4-5-bundling-and-minification-support/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>PHPMaster: Zend Job Queue</title><link>http://feedproxy.google.com/~r/PHPMaster_feed/~3/geE_wnRVORE/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=phpmaster-zend-job-queue</link> <comments>http://feedproxy.google.com/~r/PHPMaster_feed/~3/geE_wnRVORE/#comments</comments> <pubDate>Wed, 11 Jan 2012 23:48:32 +0000</pubDate> <dc:creator>Alex Stetsenko</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[Cloud]]></category> <category><![CDATA[Community]]></category> <category><![CDATA[cron]]></category> <category><![CDATA[DR]]></category> <category><![CDATA[headers]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[Mobile]]></category> <category><![CDATA[node]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[PHP & MySQL Tutorials]]></category> <category><![CDATA[queues]]></category> <category><![CDATA[RoR]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[tutorial]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=50119</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/b938zendqueue_600007-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /> Web applications usually follow a synchronous communication model. However, non-interactive and long-running tasks (such as report generation) are better suited for asynchronous execution. One way to off-load tasks to run at a later time, or even on a different server, is use the Job Queue module available as a part of Zend Server 5 (though not as part of the Community Edition). Job Queue allows job scheduling based on time, priority, and even dependencies. ]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/b938zendqueue_600007-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /><p></p><p><img
src="http://www.sitepoint.com/wp-content/uploads/2012/01/b938zendqueue_600007-150x150-50x50.jpg" /> Web applications usually follow a synchronous communication model. However, non-interactive and long-running tasks (such as report generation) are better suited for asynchronous execution. One way to off-load tasks to run at a later time, or even on a different server, is use the Job Queue module available as a part of Zend Server 5 (though not as part of the Community Edition). Job Queue allows job scheduling based on time, priority, and even dependencies.</p><p>See the article here:<br
/> <a
target="_blank" href="http://feedproxy.google.com/~r/PHPMaster_feed/~3/geE_wnRVORE/" title="PHPMaster: Zend Job Queue">PHPMaster: Zend Job Queue</a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://feedproxy.google.com/~r/PHPMaster_feed/~3/geE_wnRVORE/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item><div><div
class="post_box two_ads" style="float:left;padding-left:2px;"><div
id='div-gpt-ad-1328645237920-1' style='width:728px; height:90px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1328645237920-1'); });</script> </div></div></div><div
class="clear">&nbsp;</div> <item><title>PHPMaster: Introduction to PhpDoc</title><link>http://feedproxy.google.com/~r/PHPMaster_feed/~3/nPdwdHGxgHA/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=phpmaster-introduction-to-phpdoc</link> <comments>http://feedproxy.google.com/~r/PHPMaster_feed/~3/nPdwdHGxgHA/#comments</comments> <pubDate>Mon, 09 Jan 2012 22:00:30 +0000</pubDate> <dc:creator>Moshe Teutsch</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[CGI & Perl Tutorials]]></category> <category><![CDATA[Content]]></category> <category><![CDATA[DR]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[PHP & MySQL Tutorials]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[Web Tech]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=49951</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/cc1189011087-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /> If you’ve ever tried to read code written by someone other than yourself (who hasn’t?), you know it can be a daunting task. A jumble of “spaghetti code” mixed with numerous oddly named variables makes your head spin. Does this function expect a string or an array? Does this variable store an integer or an object? ]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/cc1189011087-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /><p></p><p><img
src="http://www.sitepoint.com/wp-content/uploads/2012/01/cc1189011087-150x150-50x50.jpg" /> If you’ve ever tried to read code written by someone other than yourself (who hasn’t?), you know it can be a daunting task. A jumble of “spaghetti code” mixed with numerous oddly named variables makes your head spin. Does this function expect a string or an array? Does this variable store an integer or an object?</p><p>Taken from:<br
/> <a
target="_blank" href="http://feedproxy.google.com/~r/PHPMaster_feed/~3/nPdwdHGxgHA/" title="PHPMaster: Introduction to PhpDoc">PHPMaster: Introduction to PhpDoc</a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://feedproxy.google.com/~r/PHPMaster_feed/~3/nPdwdHGxgHA/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>PHPMaster: ClamAV as a Validation Filter in Zend Framework</title><link>http://phpmaster.com/zf-clamav/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zf-clamav&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=phpmaster-clamav-as-a-validation-filter-in-zend-framework</link> <comments>http://phpmaster.com/zf-clamav/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zf-clamav#comments</comments> <pubDate>Sat, 07 Jan 2012 05:56:26 +0000</pubDate> <dc:creator>Matthew Setter</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Content]]></category> <category><![CDATA[DR]]></category> <category><![CDATA[modules]]></category> <category><![CDATA[namespaces]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[PHP & MySQL Tutorials]]></category> <category><![CDATA[RoR]]></category> <category><![CDATA[UX]]></category> <category><![CDATA[Windows]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=49885</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/86f188481113-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /> Ok, so you’re pretty comfortable with using the Zend Framework, specifically the use of Forms. Along with that, you have a good working knowledge of how to combine a host of standard validators such as CreditCard , EmailAddress , Db_RecordExists , and Hex , and standard filters such as Compress/Decompress , BaseName , Encrypt , and RealPath . But what do you do when a situation arises that’s outside the scope of the pre-packaged validators and filters? Let’s say you want to guard against users uploading files that contain viruses, for example. ]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/86f188481113-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /><p></p><p><img
src="http://www.sitepoint.com/wp-content/uploads/2012/01/86f188481113-150x150-50x50.jpg" alt="" /> Ok, so you’re pretty comfortable with using the Zend Framework, specifically the use of Forms. Along with that, you have a good working knowledge of how to combine a host of standard validators such as CreditCard , EmailAddress , Db_RecordExists , and Hex , and standard filters such as Compress/Decompress , BaseName , Encrypt , and RealPath . But what do you do when a situation arises that’s outside the scope of the pre-packaged validators and filters? Let’s say you want to guard against users uploading files that contain viruses, for example.</p><p>More here:<br
/> <a
title="PHPMaster: ClamAV as a Validation Filter in Zend Framework" href="http://phpmaster.com/zf-clamav/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=zf-clamav" target="_blank">PHPMaster: ClamAV as a Validation Filter in Zend Framework</a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://phpmaster.com/zf-clamav/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zf-clamav/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Hadoop 1.0 Release – Big Data for everyone</title><link>http://feedproxy.google.com/~r/cloudspring/~3/D3jYc9o0qY0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hadoop-1-0-release-%25e2%2580%2593-big-data-for-everyone</link> <comments>http://feedproxy.google.com/~r/cloudspring/~3/D3jYc9o0qY0/#comments</comments> <pubDate>Thu, 05 Jan 2012 22:24:47 +0000</pubDate> <dc:creator>Toby Tremayne</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Big Data]]></category> <category><![CDATA[Cloud]]></category> <category><![CDATA[Content]]></category> <category><![CDATA[DR]]></category> <category><![CDATA[Hadoop]]></category> <category><![CDATA[links]]></category> <category><![CDATA[News & Trends]]></category> <category><![CDATA[node]]></category> <category><![CDATA[Web Tech]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=49858</guid> <description><![CDATA[ Apparently 90% of the data in the world was produced in the last 2 years – which should give you some idea of just exactly how much data is being accumulated the world around, especially by large companies like Google. The data field is so enormous that traditional methods of linking, searching and retrieving data don’t work any more. This is Big Data. Big Data The term “Big Data” was popularized by Roger Magoulas from O’Reilly in 2005, although avid net trawlers have found evidence of the term being used occasionally as far back as 2001]]></description> <content:encoded><![CDATA[<p></p><p>CloudSpring: Apparently 90% of the data in the world was produced in the last two years – which should give you some idea of just exactly how much data is being accumulated the world around, especially by large companies like Google. The data field is so enormous that traditional methods of linking, searching and retrieving data don’t work any more. This is Big Data. Big Data The term “Big Data” was popularized by Roger Magoulas from O’Reilly in 2005, although avid net trawlers have found evidence of the term being used occasionally as far back as 2001</p><p>Continued here:<br
/> <a
title="Hadoop 1.0 Release – Big Data for everyone" href="http://feedproxy.google.com/~r/cloudspring/~3/D3jYc9o0qY0/" target="_blank">Hadoop 1.0 Release – Big Data for everyone</a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://feedproxy.google.com/~r/cloudspring/~3/D3jYc9o0qY0/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>RubySource: Cooking with Chef Solo</title><link>http://rubysource.com/cooking-with-chef-solo/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rubysource-cooking-with-chef-solo-2</link> <comments>http://rubysource.com/cooking-with-chef-solo/#comments</comments> <pubDate>Tue, 03 Jan 2012 21:50:28 +0000</pubDate> <dc:creator>Dave Kennedy</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[Business]]></category> <category><![CDATA[DR]]></category> <category><![CDATA[Gems]]></category> <category><![CDATA[News & Trends]]></category> <category><![CDATA[node]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[Resources]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[Ruby Tutorials]]></category> <category><![CDATA[RVM]]></category> <category><![CDATA[Snapshot]]></category> <category><![CDATA[theory]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[UX]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[chef]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=49817</guid> <description><![CDATA[ Chef is billed as “A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure”. It doesn’t matter how many times I read that, I still hear a ‘whoosh’ over my head. Put simply, we can manage server configurations through good old familiar Ruby. The gist of Chef is we create cookbooks, these cookbooks use the Chef DSL to install and configure packages we require for our servers]]></description> <content:encoded><![CDATA[<p></p><p> Chef is billed as “A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure”. It doesn’t matter how many times I read that, I still hear a ‘whoosh’ over my head. Put simply, we can manage server configurations through good old familiar Ruby. The gist of Chef is we create cookbooks, these cookbooks use the Chef DSL to install and configure packages we require for our servers</p><p>Read the article:<br
/> <a
target="_blank" href="http://rubysource.com/cooking-with-chef-solo/" title="RubySource: Cooking with Chef Solo">RubySource: Cooking with Chef Solo</a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://rubysource.com/cooking-with-chef-solo/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>PHPMaster: Watermarking Images</title><link>http://phpmaster.com/watermarking-images/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=watermarking-images&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=phpmaster-watermarking-images-2</link> <comments>http://phpmaster.com/watermarking-images/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=watermarking-images#comments</comments> <pubDate>Sat, 31 Dec 2011 05:48:09 +0000</pubDate> <dc:creator>Timothy Boronczyk</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[CGI & Perl Tutorials]]></category> <category><![CDATA[Content]]></category> <category><![CDATA[Get Started]]></category> <category><![CDATA[headers]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[PHP & MySQL Tutorials]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[get started]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=49893</guid> <description><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/82d037419154s-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /> Imagine a friend of yours approaches you one day and would like you to build her a website so she can showcase her photography. She wants to be able to easily upload her photographs and have them watermarked so that people can’t easily steal them. “Don’t worry!” you tell her, because you know there are functions provided by the Imagick extension that makes watermarking images a breeze in PHP. This article shares a few pointers on what makes an effective watermark, and then shows you how to use the Imagick functions to add a watermark to your image. ]]></description> <content:encoded><![CDATA[<img
width="50" height="50" src="http://www.sitepoint.com/wp-content/uploads/1/files/2012/01/82d037419154s-150x150-50x50.jpg" class="attachment-thumbnail wp-post-image" alt="Thumbnail" title="Thumbnail" /><p></p><p><img
src="http://www.sitepoint.com/wp-content/uploads/2012/01/82d037419154s-150x150-50x50.jpg" alt="" /> Imagine a friend of yours approaches you one day and would like you to build her a website so she can showcase her photography. She wants to be able to easily upload her photographs and have them watermarked so that people can’t easily steal them. “Don’t worry!” you tell her, because you know there are functions provided by the Imagick extension that makes watermarking images a breeze in PHP. This article shares a few pointers on what makes an effective watermark, and then shows you how to use the Imagick functions to add a watermark to your image.</p><p>See the article here:<br
/> <a
title="PHPMaster: Watermarking Images" href="http://phpmaster.com/watermarking-images/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=watermarking-images" target="_blank">PHPMaster: Watermarking Images</a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://phpmaster.com/watermarking-images/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=watermarking-images/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>RubySource: Rubylutions for 2012</title><link>http://rubysource.com/rubylutions-for-2012/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rubysource-rubylutions-for-2012</link> <comments>http://rubysource.com/rubylutions-for-2012/#comments</comments> <pubDate>Fri, 30 Dec 2011 22:53:59 +0000</pubDate> <dc:creator>Glenn Goodrich</dc:creator> <category><![CDATA[.NET]]></category> <category><![CDATA[Community]]></category> <category><![CDATA[Content]]></category> <category><![CDATA[Design]]></category> <category><![CDATA[DR]]></category> <category><![CDATA[Gems]]></category> <category><![CDATA[General]]></category> <category><![CDATA[Misc]]></category> <category><![CDATA[node]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Opinion]]></category> <category><![CDATA[Outside Ruby]]></category> <category><![CDATA[rails]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[Tech]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[Web Tech]]></category> <category><![CDATA[misc]]></category> <guid
isPermaLink="false">http://www.sitepoint.com/?p=49782</guid> <description><![CDATA[ Sometimes the idea for an article strikes me out-of-the-blue, like a lightning bolt or an airborne toxin. The quality of these sudden onset ideas varies greatly, and it usually directly proportional with the number of beers I’ve had pre-idea strike. My most recent attack hit me in bed as I was drifting off. It said: “Write a post about Ruby resolutions for the new year. ]]></description> <content:encoded><![CDATA[<p></p><p> Sometimes the idea for an article strikes me out-of-the-blue, like a lightning bolt or an airborne toxin. The quality of these sudden onset ideas varies greatly, and it usually directly proportional with the number of beers I’ve had pre-idea strike. My most recent attack hit me in bed as I was drifting off. It said: “Write a post about Ruby resolutions for the new year.</p><p>More here:<br
/> <a
target="_blank" href="http://rubysource.com/rubylutions-for-2012/" title="RubySource: Rubylutions for 2012">RubySource: Rubylutions for 2012</a></p> <span
id="pty_trigger"></span><div
style='padding:20px 0px 50px 0px;'><div
style='float:left;padding-left:40px;'><div
id='div-gpt-ad-1335489406190-0' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-0'); });</script> </div></div><div
style='float:right;padding-right:40px;'><div
id='div-gpt-ad-1335489406190-1' style='width:300px; height:100px;'> <script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1335489406190-1'); });</script> </div></div><div
style='clear:both'></div></div><div
style='clear:both'></div>]]></content:encoded> <wfw:commentRss>http://rubysource.com/rubylutions-for-2012/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 43/58 queries in 0.074 seconds using memcached
Object Caching 3001/3003 objects using memcached

Served from: www.sitepoint.com @ 2012-05-27 10:08:24 -->
