Thoughts from Dan Miser RSS 2.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
 Friday, November 06, 2009
I've never been happier that I chose a technology after today. I have a production web application built using ASP.NET MVC, and it has been working with almost no issues for over a year now. As a matter of fact, it is the cornerstone used to run our business. I've had the default blue skin in use since day 1 (ya, ya, I know, I know. I've been so lazy, I haven't even switched out to pre-built templates), and we run the app on the iPhone. It works, but there's always pinching, zooming and scrolling going on. I finally bit the bullet after thinking to myself "Why not create a view tailored to the iPhone to enhance the experience?" one too many times. About 12 hours later, the entire application was done with an auto-detected, optimized look and feel for the iPhone. I am now convinced that I've just been paid back with the technical dividends for investing in ASP.NET MVC. :)

To help the next guy out who walks down this path, here are all of the links that I used during this process:

Friday, November 06, 2009 5:44:02 PM (Central Standard Time, UTC-06:00)  #    Comments [1] -
ASP.NET | ASP.NET MVC
 Thursday, November 05, 2009
It looks like the blog shut down on 10/20/09. The problem turned out to be that I had exceeded the quota for the user account that hosts dasBlog. I bumped up the quota for that user, and now we should be good to go again. Until the next post...
Thursday, November 05, 2009 10:01:22 AM (Central Standard Time, UTC-06:00)  #    Comments [0] -

 Friday, October 16, 2009
Given a collection of players that were constructed like this:

private static IList<Player> LoadPlayers()
{
	Player favre = new Player { Id = 1, Name = "Favre", Team = new Team { Id = 1, Name = "Vikings" } };
	Player peterson = new Player { Id = 2, Name = "Peterson", Team = new Team { Id = 1, Name = "Vikings" } };
	Player rodgers = new Player { Id = 3, Name = "Rodgers", Team = new Team { Id = 2, Name = "Packers" } };
	Player driver = new Player { Id = 4, Name = "Driver", Team = new Team { Id = 2, Name = "Packers" } };

	List<Player> players = new List<Player> {favre, peterson, rodgers, driver};
	return players;
}

And the following LINQ query:


var query = 
	from p in LoadPlayers()
	group p by p.Team into g
	select g;

We will see the following output:


Vikings
Vikings
Packers
Packers

The reason this is happening is that we created new Team objects for each and every Player, and when LINQ tries to group, it does so based on object equality. The solution to this is to override the Equals() and GetHashCode() methods in the Team class. After doing that, the LINQ query will be able to group the objects up properly and just display each team name once. Resharper has a nice code generation template to create solid implementations of these methods (press Alt+Ins to bring up the code generation menu).

The example here is obviously contrived. We could create each team object once, and then use the same instance during the property assignment, and if we did that, things would work just fine. However, I ran into a more generalized version of this problem when using WCF and a lot of custom code generation. The underlying lesson is still the same: LINQ and GroupBy need to have object equality defined properly in order to make things work as you would expect.

Friday, October 16, 2009 12:14:18 PM (Central Standard Time, UTC-06:00)  #    Comments [2] -
.NET | LINQ
 Monday, October 12, 2009
Since my last post, the date has changed from October 9th to October 12th. The reason this is important is that the functions that needed to calculate the date based on the current date are now coming through a different code path. Before, everything worked great. As of October 10th, not so much. The fix is simple - the getDate function was missing the parentheses to make it a method call. The fix is quite simple and is listed below:

var day = (now.getDate() < 10) ? "0" + now.getDate() : now.getDate();
Monday, October 12, 2009 10:11:13 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
ASP.NET | ASP.NET MVC
 Thursday, October 08, 2009
I have several reports in my ASP.NET MVC application that are date-oriented. I had start date and end date text boxes, and things worked fine. What I really wanted was something that would allow those date boxes to be populated with a variety of canned date ranges (e.g. Year to Date, Last Month, etc.). I found just what I was looking for in a pure JavaScript implementation here.

The one problem I found was that "Last Month" was being calculated incorrectly. Below is the simple fix. Thanks to epalla for the original code.


// last month 
case "lastmo":
    // we need a new month variable for month-1, also formatted correctly
    var lastmonth = ((month - 1) < 10) ? "0" + (month - 1) : (month - 1);
    startbox.value = lastmonth + "/01/" + year;

    // now grab the last day of the month (30, 31? we don't know!)
    var moend = new Date(year, (month - 1), 0);
    endbox.value = lastmonth + "/" + moend.getDate() + "/" + year;

    break;
Thursday, October 08, 2009 7:44:07 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
ASP.NET | ASP.NET MVC
 Thursday, July 09, 2009
I posted about my iPhone experience in April, 2008. I just picked up a 3gs, and I have to say that I am incredibly pleased. Just about every complaint that I had in that original article has been addressed. In addition, the speed increase really is significant. It really is that noticeable. Add in the cool camera upgrades (better pixels, video, and cool touch to focus), and this is absolutely a winner.

The current complaints deal with lack of MMS and tethering, but that's hardly Apple's fault. (Nice workaround for tethering posted here.) The experience ordering business phones through AT&T sucked as bad as anything I've ever dealt with, so it's not shocking they don't care about their users enough to enable simple features such as these.

Now I just need to find an iPhone app to follow the Tour de France. Allez!

Thursday, July 09, 2009 8:39:39 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
Macintosh
Navigation
Archive
<December 2009>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
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)