April 30, 2008

links for 2008-04-30

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 29, 2008

links for 2008-04-29

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 28, 2008

links for 2008-04-28

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 27, 2008

links for 2008-04-27

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 26, 2008

links for 2008-04-26

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 25, 2008

Dreamhost’s 500GB hosting really is a dream

Filed under: Web Survival, General Geekiness | Lindsay @ 11:26 pm

Lesson reinforced this week: If something sounds too good to be true, it probably is. Case in point: Dreamhost’s supposed 500GB hosting plans entice you with the promise of lots of space for cheap (about $11/mo) but you can’t use that space for file storage.

I have been trying to make up my mind about an off-site backup service for more than a year now. I kept looking at Amazon S3 but, as cheap as it is, it still seemed expensive, especially because I have around 350GB of data I need to backup. Most file backup/storage sites only give you a tiny amount of space (who only has 5GB worth of data to back up these days??) or charge you hundreds of dollars a month for as much storage as I needed. The main options that were even partially affordable were hosting by Dreamhost or GoDaddy, or Amazon S3.

We have had an account with Dreamhost now for a few years and while it hasn’t been 100% uptime we hadn’t had many other problems with them in general. We have 5 live websites on the Dreamhost account but we’re only using a tiny fraction of the almost 540GB (growing weekly) of available space. I couldn’t justify paying for S3 if we were already paying for the space on Dreamhost.

So I uploaded about 80GB worth of pictures. Within a few days I got a notice that the files weren’t directly related to website hosting and I had 3 options: remove all the files, change the account to a file storage account for $0.20/mo/GB or do nothing and have the account suspended. Doing a bit of research turned up that there was some fine print in the ToS that says they have the option to charge you extra for files that are hosted and not related to website hosting.

I rolled my eyes and started the week-long process of ftping up to my Amazon S3 account instead. It’s actually cheaper by $0.05/mo for storage than Dreamhost’s rate. But it was a busy week and I forgot to remove my files from the Dreamhost account until about 10pm on the deadline day…

Dreamhost suspended our account, cutting off the live websites we were hosting. Now maybe we deserved that for not making the deadline but their reply system for the support emails kept bouncing back our requests to delete the files and restore our account. We supposedly had call-support with the plan we were on but there’s no phone number on the site for you to get in touch with anyone. We were scrambling till we finally thought of submitting a ticket on the website instead of trying to reply to the original suspension email again. Our sites were down for about 24 hours and we are not happy campers.

I’m disgruntled with Dreamhost for several reasons:

  • Not making it completely clear on their hosting plan description pages that you can’t use the space for file storage, which resulted in me wasting my time uploading all those files in the first place. Who the hell has 500+GB of files related to their website to host?? Are they really going to let you do something like your own YouTube on a $11/mo web hosting account? I’m tempted to try it just to see if they suspend me for “legitimate” web hosting of that much material.
  • Not having some kind of way to contact them by phone in an emergency, especially when we were supposed to have call support on our plan. We found out that it’s really “call back support” meaning you email or submit a ticket and they’ll call you when they get to it. That doesn’t cut it when your sites are down.
  • Not having their email support system working for replies. It was barfing on the format of the subject line that was generated, not something we would know how to fix to make sure the email got through. When email is the only means of contact it’s important that the system be robust enough not to bounce back replies to your support tickets!!
  • And, as a side issue, I’m still upset that they consolidated all their hosting plans into one option that is half as expensive as the plan we were on but with only minor differences in features, but they didn’t bother to notify us of those differences or that we could be saving money by switching. Since we just always go directly to panel.dreamhost.com and don’t bother to go look at the plan options on the main site, we didn’t know about the changes. We were paying double what we needed to for almost a year.

It’s frustrating because when we’re actually able to GET support from Dreamhost they’re always nice and helpful. It’s just too hard to get someone to respond in a reasonable timeframe from an email or when the email system is not working.

I’m using S3 for backup and after this experience we’ll be looking for a new host soon as well. For all those people who have debated about whether you should use Dreamhost or S3 for backup, the answer lies in a new take on another old addage: “You don’t get what you don’t pay for”. Amazon S3 is the way to go.

» »
,

links for 2008-04-25

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 24, 2008

links for 2008-04-24

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 23, 2008

links for 2008-04-23

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 20, 2008

links for 2008-04-20

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 19, 2008

Creating Partial Views in ASP.Net MVC

Filed under: HowTo, DotNet, Development, ASP.Net MVC | Lindsay @ 6:56 pm

I have been coming up to speed with ASP.Net MVC recently and I have to say that it makes me very happy, warm and fuzzy. I had been out of the Microsoft camp of web development for almost a year and a half and using Ruby on Rails in the mean time. Now that I’m “back in the saddle again” with Microsoft technologies, I’m ecstatic that I can use ASP.Net without WebForms, Postbacks and ViewState. The MVC framework is so much cleaner and easier to follow in my opinion. Yeah, it might not be popular with a lot of ASP.Net developers because you have to do more HTML from “scratch” and don’t have the crutch of server controls but that gives you so much more control over what’s going on and takes the “magic” out of it. And it’s also much easier to test (TDD, baby!) and debug when you really understand what’s going on under the hood because you wrote the engine.

So anyway, I’m playing with ASP.Net MVC which is still only in a “Preview 2“, meaning there’s lots more to come. But I want to use it now and there was some functionality missing that I really wanted: the ability to render a view in a view, basically to have the ability to do a Rails-style partial view. I figured out a way to do it by creating an extension on the ViewPage class, though there’s a bit of a hack involving getting the view directory route.

using System;
using System.Linq.Expressions;
using System.Web.Mvc;

namespace Lindsay
{
        public static class Extensions
        {
                public static void RenderPartial<T>(this ViewPage vwp, Expression<Action<T>> action) where T : Controller
                {
                    T controller = Activator.CreateInstance<T>();
                    System.Web.Routing.RouteData rd = new System.Web.Routing.RouteData();
                    // must include the controller name without "Controller" to match
                    // the Views subfolder name there has to be a cleaner way to do this…
                    string viewFolderName = controller.GetType().Name.Replace(“Controller”, “”);
                    rd.Values.Add(“Controller”,viewFolderName);
                    controller.ControllerContext = new ControllerContext(new RequestContext(vwp.ViewContext.HttpContext, rd), controller) ;
                    var ex = action.Compile();
                    ex.Invoke(controller);
                }
        }
}

I know there’s probably a way to use ViewLocator, or maybe some way to figure out which route to use and avoid the controller name hack but I haven’t been able to do that yet and this works for my standard circumstances. If anyone knows a better way please let me know!

To use this, put the code above in it’s own class and then use the namespace in your view to call it from. The call should look similar to this:

<% @Import Namespace=“Lindsay” %>
<% @Import Namespace=“MyMVCApp.Controllers” %>

<div>
         <% this.RenderPartial<MyController>((mc => mc.MyAction(myData))); %>
</div>

Partials are a hotly debated topic, but personally, I don’t see how you can really create an Ajax website without them. There is an implementation of “View Components” using ComponentControllers in the current ASP.Net MVC, but it requires you to use a specialized controller and also put your views in a special folder structure. I want to keep my controller code for an entity in one controller as well as all my views in one place and be able to use them as pieces of a page (through Ajax) or a whole page if I prefer. Creating the RenderPartial extension does that for me. Maybe someone else will find it useful as well.

In the spirit of full disclosure: I had the idea to create this extension when I found this solution to fix a bug with RenderComponent. Ironically, modifying that for RenderPartial allowed me to no longer have to use my view components!

» » » »
, , ,

April 17, 2008

links for 2008-04-17

Filed under: Bookmarks | Lindsay @ 12:30 pm

April 16, 2008

links for 2008-04-16

Filed under: Bookmarks | Lindsay @ 12:30 pm

Apri