Thoughts from Dan Miser RSS 2.0
 Monday, August 09, 2010
I needed to find all of the files that I had changed and checked in to support a specific change I implemented. There were multiple files in multiple directories that were checked in as one atomic operation (changeset). The best way I could find in VSS was to select the root project ($/), right-click on it and select "Show History". Be sure to select the "Recursive" and "Include file histories" options before pressing Ok. You can also specify a date range (if you don't, be prepared to wait!).

It would have been nice to filter a date range here, or show the changeset and let me drill down to the files that make up that changeset, but maybe I'm just too used to SVN. But at least I could identify the changed files and go to each and every one to find out what I had to do with them.

Monday, August 09, 2010 12:27:30 PM (Central Standard Time, UTC-06:00)  #    Comments [1] -

 Tuesday, February 23, 2010
I use list binding in my ASP.NET MVC applications in several places. When it works, it is truly magnificent. When it doesn't, it's just maddening. Here's a quick heads up for those of you that use list binding in MVC. You would expect the following 2 lines to render the same HTML, but they don't. To get list binding to work, you need the HTML to read something like this (I'm just listing the attributes in question here):


<input name="Results[0].Score" />

The old TextBox helper works fine, since you're assigning the name attribute:


Html.TextBox("Results["+id+"].Score", Model.Score)

This code, however:


Html.TextBoxFor(r => r.Score, new { name = "Results[" + id + "].Score" })

produces the following output, which means the Score property won't get bound properly.


<input name="Score" />

The problem is that in the TextBoxFor code, the name attribute is ignored. To be more precise, the custom name is added, but the attribute is then replaced by the name derived from the model.

Tuesday, February 23, 2010 10:12:13 PM (Central Standard Time, UTC-06:00)  #    Comments [4] -
.NET | ALT.NET | ASP.NET MVC
 Thursday, February 04, 2010
It’s that time of year again. Time to reflect on the last year. Time to start planning what will get accomplished in the year to come. And time to start training hard now in order to enjoy the warmer months!

I’ve decided to join up with Team in Training again this year. I’ll be training for a 100 mile ride through the mountains of Lake Tahoe, but I need your help to do it! I need to raise a minimum of $4,400 for the Leukemia Society. By donating your money, you get a tax deductible donation, and also help an organization to provide support to patients and research a cure. Many strides have been made trying to find a cure for this disease - thanks in no small part to the $1 billion raised by Team in Training - but there is more to be done. That’s where you come in. The easiest way to donate is to donate online by going to my fund-raising web page.

I am riding to help people who are currently battling Leukemia and Lymphoma, like this year’s honored patient for Milwaukee, Aidan. Aidan is 6 years old and has been undergoing treatment for 3 years. I’m also riding in memory of my best friend’s dad, Lewis Challoner, who passed away from Leukemia.

If you want to send a check, you can make it out to the Leukemia Lymphoma Society (or LLS) and mail it to me. If you have any other questions, please feel free to contact me by phone or email. Thanks for your time, and I look forward to your donation. Don’t forget to ask if your employer has a matching gift program - that will really help maximize the impact of your donation. Remember, every little bit helps!

Dan Miser
1153 Four Winds Way
Hartland, WI 53029
dmiser@wi.rr.com

Thursday, February 04, 2010 10:44:04 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -

 Monday, January 18, 2010
I just updated my ASP.NET MVC 1.0 application to use ASP.NET MVC 2 RC. It was a pretty painless process. Be sure to follow the Release Notes on the download page, and many applications will be ready to go. Here are some extra things that might help get you unstuck:
  • If you're using the ASP.NET MVC Futures (Microsoft.Web.Mvc) assembly, be sure to download the new one that works with ASP.NET MVC 2.
  • If you're using the Telerik ASP.NET MVC components, be sure to download version BETA 2009.3.1218 or later.
  • Way, way, way back in the ASP.NET MVC 1.0 beta days, they had a very nice mechanism to update lists of items by tying UI fields to index numbers, so you could use primary key identifiers to help keep track of what fields were modified where. In the 1.0 RC release, Microsoft changed how it worked to do things sequentially instead. I was using the IndexModelBinder found in that thread with great success ever since then. However, Microsoft added back in the index support to ASP.NET MVC 2 RC. This means that you will have to delete the old IndexModelBinder since it won't compile anymore. Thankfully, I didn't have to change a line of my code. Nice job of code compatibility!!
Monday, January 18, 2010 8:52:39 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ASP.NET MVC
 Tuesday, January 05, 2010
Consider this code fragment:
var list =
from tx in Transactions
group tx by new {tx.TransactionType, tx.ClientTypeID};

foreach (var item in list)
{
Console.WriteLine(item.Key.TransactionType);
Console.WriteLine(item.Sum(tx => tx.Amount));
foreach (var item2 in item)
Console.WriteLine(item2.TransactionID);
}

After executing the query, we now have an IGrouping<AnonymousType, Transaction> that lets us run through all of the grouped objects, while still having access to the original objects in the inner loop. We can accomplish the exact same thing with this alternative LINQ statement, but the first version seems cleaner to me:

var list =
from tx in Transactions
group tx by new {tx.TransactionType, tx.ClientTypeID} into g
select g;
Tuesday, January 05, 2010 10:30:01 AM (Central Standard Time, UTC-06:00)  #    Comments [0] -
.NET | LINQ
 Sunday, December 27, 2009
I recently purchased a HP EX490 1TB Mediasmart Home Server (Black). So far, I really like it. Here are some of the things I came across during the first few days.

Initial setup

If you install the client software from the provided CD, Windows Home Server (WHS) will report that there are critical network errors. To prevent this, just install directly from the WHS network share instead of the CD. If you have to fix it manually, be sure to Restart the Home Server! You'll definitely want to install power pack 3 on the WHS, especially if you use Windows 7.

iTunes Streaming

In order to move an existing iTunes library to the home server, just do this. Beware, that after you're done, info on the tracks in the library are read only, some tracks lose tag information, and you can't sync to ipod devices from this server. But it does stream quite nicely.

Remote Access

I've been using dyndns.org for my DDNS needs for several years, and it has been fantastic. My router supports it. It was free. The bad news: WHS only supports very limited DDNS options using their setup wizards. My choices were to abandon dyndns.org and have things set up easily, or customize my router myself and pay no attention to the warning messages in WHS. In the end, I decided to use the WHS provided experience to avoid working against the product. The end result is that my new domain name is just as easy as my old one.

iPhone Access

For the iPhone application, if you bump into the "The operation could not be completed because the server provided invalid data" error, be sure to check that you enabled Remote Access for the user you're logging in with. You may very well need to reboot the Home Server and the iPhone in order to get the settings to stick. Also, in the iPhone app, just specify the server name with no protocol (e.g. use my.homeserver.com and not http://my.homeserver.com). Even after all that, I don't know that I'll use this app. It works great when using wifi at home, but the 3g connection is unreliable. I got warning messages saying it couldn't play a music file because the connection speed was to slow and then it would play 5 seconds of a song, buffer for a minute, play 5 seconds, and reapeat. But then later, it worked so quickly that it was just like streaming from home.

Media Collector

The Media Collector is a giant steaming pile of FAIL. Well, at least my knowledge of it is; it's quite possible this experience is due to my ignorance. After enabling the iTunes server above, it copied all of my music to the Music share - which is good. I then enabled the Media Collector and it proceeded to obliterate my local iTunes library, marking all of the files as missing. It also locked my login account out on the WHS. I had to Remote Desktop in to the WHS and unlock the user account. Then I completely deleted my iTunes library, re-added all of the files from my local drive, consolidated the library back to the WHS, and finally was able to resync my iPhone successfully again, after a previous sync decided to delete all of the applications on my phone. Following this, I promptly disabled the Media Collector. Maybe I'll look into this more after the next WHS upgrade. It was extremely an disappointing experience, and now I'll have to manually manage music/videos/photos by syncing to the WHS from each PC.

Subversion

You can use this link to set up VisualSVN Server on WHS. However, if you use the information from this support article from VisualSVN, you can store the repository directly on the share and not resort to writing directly to the D: drive. I added NETWORK SERVICE permissions as I followed the directions, and everything is working perfectly.

Update, 1/17/10: I've had a few requests to be more specific about the setup above. For both of these steps, you need to RDP into the WHS server.

  • For the sharing: Go to d:\shares and right-click on the folder you store your repositories in (e.g. Repositories). Select Sharing and Security (which takes you to the Sharing tab). Add NETWORK SERVICE with Full Control here.
  • For the permissions: Go to the Security tab, and then add NETWORK SERVICE with Full Control.

Other observations

  • Backups are awesome
  • It works great with TimeMachine on the Mac
  • It doesn't redundantly store all data like a drobo does (you have to specify which files you really care about enough to mirror across drives).
  • Windows 7 support is very nicely done. I now use the Windows User Documents storage location for the first time ever. Couple that with Libraries and it's quite cool
  • iPhoto support is lacking. It would be nice to have a "Server for iPhoto", much like the "Server for iTunes". That way I could share/access the photos between multiple computers, regardless of platform.
  • I really want to take all of the condensed and shared files and do an online backup to like Mozy, Carbonite, or the like. VaultKeeper is WAY too expensive. Amazon S3 is too expensive. Mozy and Carbonite don't work with WHS. We desperately need a solution in this space. I'm thinking along the lines of $100 per year would be what I'm willing to pay.

Bottom Line

I like this unit a lot, despite some glaring issues. I'm backing up for the first time ever in my life. How I made it this long without disaster striking is a testament to my luck, and nothing more. The bottom line for me is I can't imagine being without this kind of solution from now on.
Sunday, December 27, 2009 11:33:14 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -

 Tuesday, December 15, 2009
I'm using Evernote more to capture information. I had 2 major complaints about usability, and just stumbled across solutions to them, so thought I'd share them. These tips apply to the web version of the product.

  1. The default behavior when pressing the Enter key is to create a new paragraph, with extra spacing. If you just want a line break, use Shift + Enter.
  2. To create a bulleted list within a note, be sure to start it on a new paragraph and then click one of the bullet icons. So you can't have a bulleted list start after a line break. Oh well.

Now if we could just get the iPhone application the ability to edit pre-existing notes as opposed to appending to them. It's been "coming soon" for almost as long as gmail was in beta!

Tuesday, December 15, 2009 11:12:02 AM (Central Standard Time, UTC-06:00)  #    Comments [0] -

 Saturday, November 07, 2009
Telerik just released an extremely impressive library of components (Grid, Menu, TabStrip, and MenuBar), written for MVC. They are truly first-class, from the architecture, to the development experience, to the finished screens that your user sees. They released them as open-source, and even better, these controls are written from the ground up to support ASP.NET MVC.

Be sure to check out this awesome write up on how to Use the grid in a CRUD scenario. Very nicely done.

I'm not a fan of the whole "Edit/Delete" action column. I'd much rather just have a link on the column to take me to the detail screen. Here's the way I solved that:


    <% Html.Telerik().Grid(Model)
        .Name("Grid")
        .PrefixUrlParameters(false)
        .Columns(columns =>
        {
            columns.Add(o => o.CollectionDate).Template(c => { %>
                <%= Html.ActionLink(c.CollectionDate.ToShortDateString(), "View", new { Id = c.Id })%> <%
            }).Width(40);
            columns.Add(o => o.Location.Name).Width(40);
        })
        .Scrollable()
        .Sortable()
        .Pageable()
        .Filterable()
        .Render();
    %>
Saturday, November 07, 2009 9:00:21 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
.NET | ALT.NET | ASP.NET MVC
Navigation
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Dan Miser
Sign In
Statistics
Total Posts: 339
This Year: 5
This Month: 0
This Week: 0
Comments: 618
All Content © 2010, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)