Subscribe: Travis.Net.Blog
http://weblogs.asp.net/thigley/rss.aspx
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
color  csharpcode  format  items  listformat  listtype  new  nhibernate  public static  public  static  string format  string  web 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Travis.Net.Blog

Travis.Net.Blog



Oh my beloved Time, where art thou?



 



Wrap Your EditorTemplates

Fri, 23 Sep 2011 14:51:00 GMT

A really cool feature in Razor is the EditorTemplate's ability to use Layouts. Just like regular Views, you can apply the a Layout. For example, a regular Textbox template:




NHibernate Talk 8/20/09

Thu, 20 Aug 2009 22:30:00 GMT




NHibernate Talk 8/14/09

Fri, 14 Aug 2009 21:02:00 GMT




Nhibernate Talk 8/12/09

Wed, 12 Aug 2009 21:10:00 GMT




NHibernate Talk 8/11/09

Tue, 11 Aug 2009 22:24:00 GMT




HTML ListFormatter

Thu, 18 Jun 2009 21:10:00 GMT

My version of the ListFormatter(s) posted here. Based off the code posted by Joe Chung in the comments. The only real modification was I added overloads for params Func and in inline format string.  This allows strongly typed code like this: <%=Model.Contacts.ToFormattedList(ListType.Unordered, "{0} - {1}", x => x.FirstName,x => x.LastName)%>  Useful? Maybe, maybe not.  public enum ListType { Ordered, Unordered, TableCell, TableRow } public static class ListFormatter { public class ListFormats { public string ItemFormat { get; set; } public string ListFormat { get; set; } } private static readonly IDictionary Formatters = new Dictionary(); static ListFormatter() { Formatters.Add(ListType.Ordered, new ListFormats { ItemFormat = "
  • {0}
  • ", ListFormat = "
      {0}
    " }); Formatters.Add(ListType.Unordered, new ListFormats { ItemFormat = "
  • {0}
  • ", ListFormat = "
      {0}
    " }); Formatters.Add(ListType.TableCell, new ListFormats { ItemFormat = "{0}", ListFormat = "{0}" }); Formatters.Add(ListType.TableRow, new ListFormats { ItemFormat = "{0}", ListFormat = "{0}
    " }); } public static string ToFormattedList(this IEnumerable items, ListType type) { return FormattedList(items, type); } public static string ToFormattedList(this IEnumerable items, ListType type, Func toString) { return FormattedList(items, type, toString); } public static string ToFormattedList(this IEnumerable items, ListType type, string format, params Func[] toString) { return FormattedList(items, type, format, toString); } public static string FormattedList(IEnumerable items, ListType type) { return FormattedList(items, type, s => s.ToString()); } public static string FormattedList(IEnumerable items, ListType type, Func toString) { var listFormat = Formatters[type].ListFormat; var itemFormat = Formatters[type].ItemFormat; var itemsProjected = items.Select(item => string.Format(itemFormat, toString(item))); return string.Format(listFormat, string.Join(string.Empty, itemsProjected.ToArray())); } public static string FormattedList(IEnumerable items, ListType type, string format, params Func[] toStrings) { var listFormat = Formatters[type].ListFormat; var itemFormat = Formatters[type].ItemFormat; var sb = new StringBuilder(); foreach (var item in items) sb.AppendFormat(itemFormat, InvokeOnItem(item, format, toStrings)); return string.Format(listFormat, sb); } public static string InvokeOnItem(T item, string format, Func[] toStrings) { var projected = new object[toStrings.Length]; for (var i = 0; i < projected.Length; i++) projected[i] = toStrings[i].Invoke(item); return string.Format(format, projected); } } [...]



    InModel OutModel

    Fri, 24 Apr 2009 14:22:00 GMT

    These sure make life easier, create an InModel and OutModel for your MVC views.




    Entity Framework 2.0

    Tue, 08 Jul 2008 13:57:00 GMT

    I'd be interested in hearing the Ayende take on the new features possibly coming to EF 2.0.




    http://weblogs.asp.net/delicious/

    Thu, 29 May 2008 18:35:00 GMT

    Anyone else getting this guy's delicious articles in the main feed?

     

    UPDATE: nvm, must have been something up with Google Reader, I removed the feed and re-added it and now it looks back on track. 




    Ghetto ASP.NET Debugging - Useful Extensions

    Fri, 11 Apr 2008 17:22:00 GMT

            public static void Write(this System.Web.HttpResponse response, string formatString, params object[] args)
    {
    System.Web.HttpContext.Current.Response.Write(string.Format(formatString, args));
    }

    public static void WriteLine(this System.Web.HttpResponse response, string s)
    {
    System.Web.HttpContext.Current.Response.Write(s);
    System.Web.HttpContext.Current.Response.Write("
    "
    );
    }

    public static void WriteLine(this System.Web.HttpResponse response, string formatString, params object[] args)
    {
    System.Web.HttpContext.Current.Response.WriteLine(string.Format(formatString, args));
    }



    NHibernate 2.0 alpha

    Mon, 31 Mar 2008 15:12:00 GMT

    Ayende has announced the release on his blog.  Interesting features to note:

    • join mapping element to map one class to several tables
    • tables and inheritance strategy
    • added support for paging in sub queries 

     Warning: there are some breaking changes.  Check out the post for more info.

     




    Heroes Happen

    Fri, 11 Jan 2008 15:58:00 GMT

     It looks like a lot of cities have registration enabled.




    HTML Output Abstraction and SubSonic

    Wed, 31 Oct 2007 21:50:00 GMT

    Jason has a posted a good read on the topic here. 

    On the topic of SS, I'm still on the fence.  I grew up with WORM and have since migrated to NHibernate.  I'm just not sure about the "Generate my domain from the database schema." idea.  Unfortunately I mostly work with an older legacy db where I can't really redefine the schema (legacy apps are still in use) to match my domain model.  Using a mapping file based mapper allow me to use my own naming convention versus a convention created 10+ years ago.  With new projects I would *never* let my db schema dictate my domain, its not worth the stranglehold, but I cant start from scratch all the time.

     




    Slashdot's Hardware Infrastructure

    Fri, 19 Oct 2007 16:31:00 GMT

     Interesting read on Slashdot's hardware infrastructure.




    New Home?

    Tue, 18 Sep 2007 19:10:00 GMT

    Its been a couple days since the last update, I wonder if Jim has found a new home.




    Enough...

    Fri, 01 Jun 2007 20:27:00 GMT

    To much comment FUD is going around right now. Stop it please!  TDD is still possible with the Express versions of VS.NET! TestDriven.Net is *Not* required to utilize TDD.  For example: NUnit is just one of the many tools that work just fine alongside Express.  Maybe not as convenient, but it works just the same.  I dont like it when people act like this is the end of TDD using Express. 

     

    ...must get the green light!




    HttpPostedFile.SaveAs

    Thu, 24 May 2007 15:45:00 GMT

    So I'm building a simple app that allows users to upload photos to our public website.  I'm using the FileUpload control that is built into ASP.NET.  It has worked like a charm before in other apps, but today I started having a problem with it, in place of the files that get uploaded are a little text file (with the same name specified in the HttpPostedFile.SaveAs method) with these contents: 

    The original file is in the temp folder. Full path of the file: C:\Temp\597fb3e5-542d-48ba-9b61-08bf9f6ddc42.tmp

    So I go checkout the Temp folder and sure enough, albeit renamed, my .JPG's are there.  After googling, I found a post on the ASP.NET forums, but alas no answers.  Absolutely nothing else.

    I've tried using IIS on Vista, Visual Studio Development Server, and even pushed it to a staging server, they all produce the same behavior. I have given the ASP.NET process Modify access rights to the folder, but I think if it was a security issue it would throw an "Access Denied" exception. I'm going to revisit some old apps where I have used this control and see if I can spot anything that stands out.

    UPDATE: I figured it out, the culprit was a 3rd party component installed previously.




    Speak Your Mind!

    Mon, 21 May 2007 17:42:00 GMT

    Looks like one of my favorite sites is being updated again, and with a redesign to boot!  Check out Jonathon Goodyear's site.




    New Post Test

    Wed, 16 May 2007 20:01:00 GMT

    CS 2007 Test, this better not show up in the main feed... :-)

     Update: Well it did, sorry all, I did not use any of the "follwing tags", not sure whats up.




    Hiring!

    Sat, 17 Mar 2007 01:09:00 GMT

    We are hiring a full time ASP.NET Developer!

    Location: Salt Lake City, UT 84121

    Status: Full Time, Employee Or Contract

    Job Category: Computers, Software Relevant Work Experience: 1+ to 2 Years

    Career Level: Experienced (Non-Manager)

    Education Level: High School or equivalent

    Environment: Totally laid back! Cool company. (I can't express this enough :)

    Over tech'ed description: :-)
    Job Purpose: Enhances user capabilities and satisfaction by planning, developing, and testing web-based applications. Duties:

    * Confirms site objectives by analyzing and validating user requirements; identifying new features and functionality and the streamlining and upgrading of existing features.

    * Develops Web applications by studying existing technology architecture; analyzing browser compatibility techniques; evaluating solution alternatives; developing prototypes; building n-tier, scalable, and multimedia applications; programming objects, events, functions, error trapping, data verification, animations, interactions, and dynamic updating; designing, installing, and configuring databases; completing documentation.

    * Develops user interfaces by preparing a workflow chart and diagram based on subject matter, human factors, and logic; writing queries involving table alterations, views, selects, inner and outer joins, and optimized queries.

    * Integrates applications by studying and establishing connectivity with network systems, databases, search engines, and information servers. * Confirms Web applications by planning and conducting tests; modifying program sequence and/or debugging codes; resolving problems.

    * Maintains team accomplishments by communicating essential information; coordinating actions; obtaining expert input; reviewing open issues and action items; contributing information to team meetings and reports. * Reduces costs and improves serviceability by preparing reusable component design.

    * Updates job knowledge by researching new web technologies; participating in educational opportunities; reading professional publications; maintaining personal networks; participating in professional organizations.

    * Accomplishes organization goals by accepting ownership for accomplishing new and different requests; exploring opportunities to add value to job accomplishments.

    Required Skills: C#, ASP.NET, Microsoft SQL Server

    Helpful Skills/Qualifications: Analyzing Information , Problem Solving, Verbal Communication, Customer Focus, Customer Service, Web User Interface Design, Functional and Technical Skills, Problem Solving, Quality Focus, Web Programming Skills, Written Communication

    Bonus Skills: Domain Driven Design, Agile!

    If your in the SLC valley and interested, please dont hesitate to contact me.  travis@cycleutah.com