Search

just show me the code

Friday, November 7, 2008

css styles (success, notice, and error div styles)

here are some nice looking css div styles for messages

this is success

this is notice

this is error

<div class="success">this is success </div>
<div class="notice">this is notice </div>
<div class="error">this is error</div>

.label { font-weight: bold; }
.error, .notice, .success, .help { padding: .8em; margin-bottom: 1em; border: 2px solid #ddd; }
.error { background: #FBE3E4; color: #D12F19; border-color: #FBC2C4; }
.notice { background: #FFF6BF; color: #817134; border-color: #FFD324; }
.success, .help { background: #E6EFC2; color: #529214; border-color: #C6D880; }

.error a { color: #D12F19; }
.notice a { color: #817134; }
.success a, .help a { color: #529214; }
 
.error ul { margin:10px; padding:10px;}
.notice ul { margin:10px; padding:10px;}
.success ul  { margin:10px; padding:10px;}
.help ul { margin:10px; padding:10px;}

http://drycodepages.googlepages.com/cssdivstylespart2

The Science of a Great User Experience

dnrTV (Dot Net Rocks TV) presents Mark Miller on The Science of a Great User Experience

Mark Miller on The Science of a Great User Experience Part 1
  and here is Part 2

Thursday, November 6, 2008

Halloween ladybug

here is elli as a ladybug

silverlight deep zoom

http://memorabilia.hardrock.com/
hardrock memorabilia
press the 'v' key and zoom out from there

Wednesday, November 5, 2008

asp.net handlers serving xml

your handler code
namespace XXXX.TourAdmin.Web.Admin
{
    /// 
    /// Summary description for $codebehindclassname$
    /// 
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class VideoHandler : IHttpHandler
    {
 
        public void ProcessRequest(HttpContext context)
        {
            //context.Response.ContentType = "text/plain";
            context.Response.ContentType = "UTF-8";
            context.Response.Write(this.GetVideoXml());
        }
 
        protected string GetVideoXml()
        {
            VideoContext vc = new VideoContext();
            var videos = from v in vc.Videos
                         select new 
                         {
                             VideoClip = v.FileLocation,
                             Title = v.Title,
                             Date = v.VideoDate,
 
                         };
 
            XDocument xmlDoc = new XDocument();
            XElement xEleVideos = new XElement("videos");
            xmlDoc.Add(xEleVideos); 
            foreach (var v in videos)
            {
                xEleVideos.Add(new XElement("video",  new XAttribute("VideoClip", v.VideoClip),
                    new XAttribute("Title", v.Title), new XAttribute("Copy", v.Date)));
            }
            string s = xmlDoc.ToString();
            return s;
        }
 
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
here is the data:



TitleFileLocationVideoDateactive
Miami, Florida200809142009-02-12 00:00:001

now put the url in the address bar
http://localhost/XXXX.TourAdmin.Web/Admin/VideoHandler.ashx
<videos>
  <video VideoClip="20080914" Title="Miami, Florida" copy="2009-02-12T00:00:00" />
<videos>
Props to Lewis

populating a database in ruby

Ruby in has a ton of cool database processes. There are Gems you can include that will randomly populate your database with test data. This free screencast shows how it is done.
http://railscasts.com/episodes/126-populating-a-database

Tuesday, November 4, 2008

Linq to xml

Linq (Language Integrated Query) works on xml too

<content>
  <gallery Name="All Videos">
    <video VideoClip="20081014.flv" Title="Orlando, Florida" Copy="Feb 12, 2009"/>
    <video VideoClip="20081121.flv" Title="Atlanta, Georgia" Copy="Feb 12, 2009"/>
  </gallery>
</content>



protected void LoadGallaryList()
{
    string xmlFile = this.Server.MapPath("~/Flash/_xml/video.xml"); 
    XDocument xmlDoc = XDocument.Load(xmlFile); 
    var videos = from v in xmlDoc.Descendants("video") // .Elements("video")
                 select new 
                 {
                     VideoClip = v.Attribute("VideoClip").Value,
                     Title = v.Attribute("Title").Value,
                     Date = v.Attribute("Copy").Value,
                 }; 
    foreach (var v in videos)
    {
        lblCurrent.Text += "title:" + v.Title + " VideoClip:" + v.VideoClip + " Date:" + v.Date + "<br/>";
    }
}

output:
title:Orlando, Florida VideoClip:20080914.flv Date:Feb 12, 2009
title:Atlanta, Georgia VideoClip:20081121.flv Date:Feb 12, 2009

Monday, November 3, 2008

jQuery in ASP.NET on Alt.NET

Alt.Net podcast is now on my regular playlist. This one episode gives a pretty good insight on how microsoft is changing with the times. Listen here.

Sunday, November 2, 2008

ASP.NET MVC Storefront Starter Kit Videos

I have been watching these videos on asp.net presented by Rob Conery. Rob does an awesome job of showing you his thought process. You can check them out here.
The videos cover
  • ASP.Net MVC framework
  • The Repository Pattern (sort of)
  • Pipes and Filters
  • Linq To Sql
  • Routing
  • TDD (test driven development)
  • Mocking
  • Dependency Injection

Saturday, November 1, 2008

TableMaker

http://www.bagism.com/tablemaker/
copy sql results to this page to create an html table like this
142 BISMARCK, ND BIS 3 Central States
66 CEDAR RAPIDS, IA CDR 3 Central States
129 COLUMBIA, MO CBM 3 Central States
15 Denver, CO DEN 3 Central States
114 DES MOINES, IA DSM 3 Central States
143 FARGO, ND FAR 3 Central States
104 FORT SMITH, AR FSM 3 Central States
59 GRAND ISLAND, NE GDI 3 Central States
138 GREAT BEND, KS GRB 3 Central States
16 Kansas City, KS KCY 3 Central States
133 LA CROSSE, WI LAC 3 Central States
105 LITTLE ROCK, AR LRA 3 Central States
139 MASON CITY, IA MAC 3 Central States
92 MILWAUKEE, WI MWK 3 Central States
17 Minneapolis - St. Paul, MN MSP 3 Central States
113 AUSTIN, TX AUS 4 Gulf-States

Contributors