Al Nyveldt

Adventures in Code and Other Stories

Over the past few weeks, I've received a bunch of questions on using the Quote of the Day widget so I had been planning to put together a quick walk through screencast to show you how to use since I really didn't cover usage very thoroughly in my earlier post.

QuotesInstall Since I was working on a new theme earlier this week, it seemed like the right time to do this, but I also find a minor bug with the control when previewing themes so I made a small change to correct this.  It was a minor fix, but if you are starting fresh or feel like upgrading, I'll include the updated control at the end of this post.

The screencast walks you through adding the widget from download to theme update.  I don't cover making changes to your CSS to make it look the way you want in your theme, but I've tried in in 4 themes already and haven't needed to do anything special to make the widget look right.  I'll include the register and usage line below so you can see them more clearly and don't have to copy notes while watching the screencast.

<%@ Register src="QuoteOfTheDay.ascx" TagName="quote" TagPrefix="uc2" %>


<uc2:quote ID="QotD" runat="server" />

Again, this widget works fine in 1.2 and 1.3.  I'll make an updated version when 1.4 gets closer.  You can download the QuotesWidget 1.0.1 here.

Podcast Review - February 2008

Since I changed jobs this past summer, I've had less time on the road and therefore less time to listen to audiobooks and podcasts.  With my commute time cut so dramatically, I've had to make some choices about which podcasts are going to get my attention and which I'm even going to continue to bother downloading.

If you have spend time commuting to work, I strongly recommend checking out some of these podcasts.  If you can learn a thing or two on the way to and from work, it is worth it.  Anyway, here is my current podcast list.

Must Listen to Group

Hanselminutes

This is still my favorite podcast.  Scott Hanselman is a gifted communicator and his passion for technology comes through in each show.  I listen to just about every episode, although I have turned it off in mid episode if I'm just not interested in the topic of the week.  This is very rare.  The production quality is usually great and the length is perfect for my commute most of the time.  The topics are varied but usually are the type of things a Microsoft-centric developer would find interesting.

Polymorphic Podcast

Craig Shoemaker has really done a great job with Polymorphic Podcast.  I've found myself listening to Craig's show almost as faithfully as Hanselminutes over the past few months.  The topics and guests have interested me recently, and each show is informative and I feel like I pick up something from most every show.

Pick and Choose

.NET Rocks

There isn't much left to say about the original .NET podcast.  Carl and Richard put together a great program twice a week on topics of general interest to .NET developers.  The audio quality of each show is superb.  Easily the best of the podcasts on the list.  However, between the amount of shows being pumped out, the varied topics, the longer length, and occasional disappointment, I listen to very few of these.  I listen only when the speaker or topic is particularly interesting to me.

Grammar Girl: Quick and Dirty Tips for Better Writing

These short podcasts aren't something I'm hugely into, but I listen to them frequently because they are short and I usually learn something.  I can listen to a months worth in 15 to 20 minutes, but usually will start my trip with one before I jump into an audiobook if that was my planned listening for the morning.  While it is hard to pick these based on topic, I usually just choose these randomly.

ThoughtWorks - IT Matters Podcast

There have only been 3 episodes since it appeared in November 2007 and I've listened to the first two.  It is interesting and I'm sure I'll listen to the 3rd episode soon.  The quality is not as good as the others on the list.  The presentation seems a bit dry, but the material is interesting so far.  The podcast is a tougher to follow then the others on the list.  I'm guessing this was a combination of slightly poorer quality and each episode having a 4 or 5 people sharing.  I'm guessing it will end up in this category, so I'm putting it here.

Wild Chronicles

This is a video podcast I keep in my podcast list as my kids just love it.  It is not something I listen to during the commute, I watch about 75% of shows with my kids.

When the mood strikes

APM: Marketplace

I used to just love this show in the days before I got into podcasts.  It is 30 minutes every day on business news and I used to catch it on National Public Radio (NPR) on the way home from work.  Now, I just don't have the time and with other options it just isn't too high on my list.  I still listen to them every now and again, but it has been less and less.

Key Life with Steve Brown

A daily Bible teaching program that I occasionally listen to. 

NPR: Technology

This fits in the same category as Marketplace.  I used to really enjoy these segments of technology news on NPR.  I find I listen to these more often than Marketplace, but again not consistently.

SDCounter A few months back, I made a file download counter for my blog.  I've been planning to make it available forever and tonight I was asked for a copy of the code so I figured I might as well make it available to everyone.  It is not too exciting and could likely use some code cleanup, but here is what has been running on my blog and on the main BlogEngine.NET site for a while.

The download counter is very simple.  It is all stored in a single cs file that you add to your App_Code\Extensions folder.  Once you place the file there, you are done and it will start recording file downloads that go through the BlogEngine.NET file handler. 

It is important to note that I wrote it counts files downloaded through file handler and not just any file you link to.  If you upload files to BlogEngine.NET through the Admin panel, they are stored in the App_Data\files folder.  (Yes, you can add folders like Windows Live Writer does to organize things a bit, but I'm going to keep this explanation simple.)  When files are upload there, you can access them through the file handler with a link in this format:

http://mysite.com/blog/file.axd?file=filename.ext

For those unaware, if you upload a file while writing a post, it will make the correct link for you and you really don't need to worry about any of this.

Ok, now that we have that explained, let me tell you a bit more about how this works.  Each time a file is served, an xml file is parsed.  (This xml will be created the first time a file is downloaded and be stored in your App_Data folder.  This will change in BlogEngine.NET 1.4 when this is provider based.)  It looks through it to see if the file downloaded is already there and if it is, it increments the download count.  If it is not in the file, it just adds it to the file with a count of 1.

SDCounterCloseupThe site visitor will not see the count anywhere on the site, but once you login to your blog, you will see the download links with a file counter on them.  Here is a close up of the screen shot above.  This is what I saw when I logged in tonight.  If you go and check out the NonZero Theme post, you'll notice the link doesn't include the download count.

This is just one download counter option for you.  Ruslan Tur has another download counter option available for you to check out as well.  I renamed my extension SimpleDownloadCounter so as not to conflict with Ruslan's fine counter.

Download: SimpleDownloadCounter.zip

About

BioPic Hi. My name is Al Nyveldt and I'm a software developer from central Pennsylvania, USA.

I'm on the BlogEngine.NET development team and write on a variety of development related topics. More...

Follow me on Twitter
Contact me via email

Recent Comments

Quote of the Day

"And remember, no matter where you go, there you are."

- Earl Mac Rauch

Sponsor


Recommended Books



Archives


Disclaimer

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

© Copyright 2008

Sign in