Out of town for the rest of the week

Tue, Mar 11, 2003

I'm heading to sunny Seattle for the rest of the week so no updates until then.

FTP Upstreamer a go

Tue, Mar 11, 2003

I've gotten some nibbles from at least 4 people on the upstreamer. That isn't all 7 of you out there but I guess this will do :)

I'll start on it this weekend or sometime early next week. Hopefully it will go fast as I already have the FTP code.

Gary Burd suggested a combo of ssh, rsync and a crontab entry. It looks like you can install RSync on windows if you try hard enough. However, I don't have that much control over all of the machines that I want to upload to, so this looks like a non-starter -- at least for me. Getting a more secure connection would be nice, though.

I also was thinking about taking advantage of the shadow copy stuff in XP but it looks like you need to sign an NDA to get at that SDK. Oh well.

FTP Upstreamer project

Tue, Mar 11, 2003

I want to gauge interest in a new project. How many of you out there (and I know there are something like 7 of you :) would actually use a utility that did the following:

  • Had a list of local directories and FTP servers/paths
  • Monitored those dirs (timer or file change notifications) for changes.
  • Upstream new files (based on file times) to the FTP server. This wouldn't be a full sync but would rather be a copy. It would never delete anything from the server.
  • Has a tray icon to let you know what is going on.

BTW, this is a feature stolen almost verbatim from Radio. I think that it would be useful to break it out into its own utility.

The real reason I would want this is that frickin' VS.Net doesn't have a way to deply an ASP.Net application to an FTP server. You can copy it or use FP extentions, but you can't FTP that guy up there.

I would include source and an installer for this guy.

If you are interested, email me at eightypercent at bedafamily.com and I'll think about putting something together.

The three B's

Sun, Mar 9, 2003

Rachel and I hit the Boise trifecta last night: Bowling, Bud Light and Butt Rock. All Van Halen all the time.

Stupid XSLT tricks

Sun, Mar 9, 2003

In talking with Jorge about how he does his site, he pointed me to his XSLT source. I'll let him post links to those on his own site ifi he wants to. However, he knows some advanced moves that I haven't discovered yet. Here is one of them: http://www.w3.org/TR/xslt#dt-attribute-value-template. This is a huge keystroke saver. It lets me go from this:

<A class="ArchiveLink">
    <xsl:attribute name="href">
        <xsl:value-of select="$SiteRoot"/><xsl:value-of 
            select="user:FormatArchiveLink(LocalPubDate)"/>#a<xsl:value-of 
            select="BlogEntryNumber"/>
    </xsl:attribute>
    <!--....-->
</A>

To this:

<A class="ArchiveLink" href="{$SiteRoot}{user:FormatArchiveLink(LocalPubDate)}#a{BlogentryNumber}">
    <!--....-->
</A>

Very cool!

More on RSS dates

Sun, Mar 9, 2003

Jorge Curioso posted on his blog some comments around dealing with dates in RSS and the .Net framework. I figure I'd put some more detail up here on how I handle dates in JoeBlogger.

  1. I store both GMT and local time when creating an entry. I should probably keep a "last updated" time too but I haven't done that yet. From these two you can either output absolute time (for RSS) or you can output local time so that everyone can know your state of mind when you made that post. It makes a difference if you are posting at 5 am in the morning vs. 10 am.
  2. I used C# to do all of my date processing. Here is the code for my properites for these things:
            // The PubDate here is in universal time -- UTC
            [XmlIgnore]
            public DateTime PubDate;
    
            [XmlElement(ElementName="PubDate")]
            public string PubDateString 
            {
                get
                {
                    return PubDate.ToString("r");
                }
                set
                {
                    PubDate = DateTime.ParseExact(value,"r", null);
                }
            }
    
            [XmlIgnore]
            public DateTime LocalPubDate;
    
            [XmlElement(ElementName="LocalPubDate")]
            public string LocalPubDateString 
            {
                get
                {
                    return LocalPubDate.ToString("ddd, dd MMM yyyy HH':'mm':'ss");
                }
                set
                {
                    try
                    {
                        LocalPubDate = DateTime.ParseExact(value,"ddd, dd MMM yyyy HH':'mm':'ss", null);
                    }
                    catch (FormatException)
                    {
                        LocalPubDate = DateTime.MinValue;
                    }
                }
            }
    
  3. Finially, I do all of the massaging from these times into my display times in the stylesheet itself. Here is an example of a source XML document for my main page and here is my XSLT template for transforming that. If you can assume the .Net implementation of XSLT, you can use some MS specific extensions like this:
        <msxsl:script implements-prefix='user' language='CSharp'>
            <![CDATA[
            public string FormatTime(string input)
            {
                DateTime dt = DateTime.ParseExact(input, "ddd, dd MMM yyyy HH':'mm':'ss", null);
                return dt.ToString("h':'mm':'ss tt");
            }
            public string FormatArchiveLink(string input)
            {
                DateTime dt = DateTime.ParseExact(input, "ddd, dd MMM yyyy HH':'mm':'ss", null);
                return String.Format(@"/Archive/{0:D4}/{1:D2}/{2:D2}.html", dt.Date.Year, dt.Date.Month, dt.Date.Day);
            }
            ]]>
        </msxsl:script>
    
    And then use that in the output like this:
    <xsl:value-of select="user:FormatTime(LocalPubDate)"/>
    

It might be a good thing if we someone came up with a namespaced extension for RSS to speicfy local time along with GMT. Having "First published" and "Last changed" times might be interesting also. Perhaps I'll write something up at some point.

Shiggity Shiggity Shwa

Fri, Mar 7, 2003 Bubba got all the mad links.

MichaelW's RSS feed

Fri, Mar 7, 2003 MichaelW does have an RSS feed -- he just makes it really hard to find:
http://michaelw.net/Articles/YesIhaveanRSSfeed.html

And the latest version of Syndirella can eat his dates but he still has it all screwed up. I think that he is outputting GMT for when he started the post but marking the date with EST. Then, when displaying it on his HTML site, he is outputting true EST for the last change of the post. Times zones and weblogs are hard. It sounds like they are even harder in CityDesk. Dates and times are something that everyone stumbles on wrt weblog software.. I know that ChrisAn has had some problems too.

Code Blue

Fri, Mar 7, 2003

My wife, Rachel, has her blog up and running. It has absolutely nothing whatsoever to do with computers or code. Instead of being a computer dork, she is going to be a medical dork! She is going to tell funny stories from the hospital.

http://www.eightypercent.net/codeblue

Happy Math

Thu, Mar 6, 2003 How To Lead a Rich Life from Bubba. I particularly like the happiness price list.