Catfood: PdfScan 1.40

Updated on Wednesday, June 2, 2021

Catfood: PdfScan 1.40

Catfood PdfScan 1.40 is a small bug fix release. PdfScan converts documents to PDFs with the help of a flatbed or automatic document feeder (ADF) scanner.

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

Upgrading to BlogEngine.NET 2.5

Updated on Sunday, November 6, 2022

Today I upgraded this blog to the latest and greatest version of BlogEngine.NET. Not entirely smooth sailing, so here are my notes for others (and the next time I have to do it):

The IsCommentsEnabled property BlogEngine.Core.Post has changed to HasCommentsEnabled. Not sure why this was worth changing but easy enough to fix.

BlogSettings.Instance.StorageLocation doesn't exist any more. After some digging it turns out that you need to use Blog.CurrentInstance.StorageLocation instead.

WidgetBase and WidgetEditBase in a couple of custom widgets complained that the type or namespace could not be found. This is fixed by adding a using statement for App_Code.Controls.

Updated 2012-03-11:

Getting the blog running locally was as usual only half the hassle. The next step is deploying to my hosting provider, Server Intellect. Things always start going wrong at this point. Luckily Server Intellect has some really great support staff and they respond quickly even on a Saturday night.

The first problem is that my backups were broken. Backups always succeed, restores always fail. After restoring my App_Data folder the last month of posts were missing. After digging for a bit it turned out that recent files were invisible over FTP but present in the control panel for the domain. My server had been migrated and some sort of permissions issue had broken access to new files. Not specifically a BlogEngine.net issue, but took a while to figure out and then for Server Intellect to fix.

Once the files were all there I uploaded and the blog itself was working fine, but the admin pages were screwy. It turns out that my server doesn't have ASP.NET MVC 3 installed. Server Intellect offered to migrate the server, but instead I copied System.Web.Mvc.dll to the Bin folder after finding a post on MVC 3 deployment from Scott Hanselman. I also needed to add a MIME type for .cshtml (text/html). With this in place the fancy new admin pages are up and running. 

Updated again, 2012-03-11:

Another namespace issue, ExtensionSettings in an extension doesn't resolve any more. Need to add a using statement for BlogEngine.Core.Web.Extensions. There are also some changes required to make an extension support multiple blogs.

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

Catfood.Shapefile 1.50

Updated on Sunday, May 23, 2021

I've just released a small update to my C# Shapefile library on Codeplex. Catfood.Shapefile 1.50 fixes a couple of bugs related to metadata and adds the ability to access metadata records directly via IDataRecord. 

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

Moon on a Wire

Updated on Saturday, June 23, 2018

Moon on a Wire

Testing posting by email with a picture of the moon from last night...

I've extended BlogEngine.NET to post by email. Not horrible for the very specific case of this blog and a short list of email clients. I shudder to think of extending it to the general emails and different templates.

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

(Published to the Fediverse as: Moon on a Wire #code #blogengine.net Picture of the Moon close to a wire. This is actually a test of posting by email from blogengine.net. )

Catfood.Shapefile 1.40

Updated on Monday, September 19, 2022

I’ve just released a small update to Catfood.Shapefile. Stephan Stapel, who implemented PolyLineM support, has contributed a patch that improves the class hierarchy. CodePlex user originSH suggested supporting the ACE driver for 64-bit systems. I’ve added a constructor overload that allows you to use predefined Jet and ACE connection strings or provide your own templates if necessary. Thanks to Stephan and originSH.

Catfood.Shapefile is a .NET library for enumerating ESRI shapefiles. I originally wrote the library to help me build some complex layers in Catfood Earth. Since then it’s picked up thousands of users and some really valuable suggestions and patches from the CodePlex community. I’m very glad a took a couple of hours to open source the library back in 2009.

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

Catfood: Cleat

Updated on Saturday, October 1, 2022

PolyLineM support in Catfood.Shapefile

Updated on Sunday, May 23, 2021

I’ve just updated Catfood.Shapefile, my ESRI Shapefile parser for .NET, with PolyLineM support thanks to a contribution from Stephan Stapel. The solution for the new version has also been updated to Visual Studio 2010.

Download Catfood.Shapefile.dll 1.30 from CodePlex.

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

Catfood: Klout and Follower

Updated on Sunday, November 6, 2022

Klout is building PageRank for people. You get a score between 0-100 based on how large your social graph is and how much you influence it. They also have a simple API and have been kind enough to let me use it as part of Follower so I’ve just released Follower 1.40 with Klout integration.

Follower automates the chore of following new friends on Twitter. It also somewhat automates removing traitors who don’t follow you back – as much as Twitter would let me get away with. One problem with following promiscuously is that you do end up following a lot of spammy and scammy accounts. Adding Klout helps with this as you can now say ‘follow everyone who follows me as long as their Klout score is higher than 15’. This keeps some of the riff raff out. And if a follower’s score rises above the threshold then they’ll be admitted into the club.

You can also use Klout to weed out existing follows with a low Klout. In this mode anyone below a configurable score will be added to the remove list even if they are following you back.

The only snag I hit with API is that while you can lookup a user by Twitter ID the ID isn’t returned in the response. If you query multiple IDs at a time you don’t always get a full set of results so without the ID you can’t reliably tell which result is associated with each ID. For this reason I’m only looking up one score at a time. Twitter has nice bulk methods to grab IDs for up to 5,000 friends or followers, it would nice if Klout could match this or at least fix the ID issue. This is a small problem though and having an automated way of detecting the quality of Twitter accounts is a great addition to Follower. If you use Twitter check it out.

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

Debugging Treasure Trove

Updated on Saturday, September 24, 2022

Mark Jackson, my co-founder at Cucku, is blogging re-mastered debugging tips from StackHash. StackHash is now an open source project and all of the great content from the original site has been taken offline. This new project is a great resource for debugging on the Windows platform, especially post-mortem crash dump analysis. If that’s your thing do yourself a favor and subscribe to Mark’s blog.

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

Basic HTTP auth for an IIS hosted WCF 4 RESTful service

Updated on Sunday, May 16, 2021

Wasted far too long on trying to get WCF to work with custom basic authentication this week. Custom in the sense that I need to look up the username and password in a database and not have IIS attempt to match the credentials to a Windows account. Given how well WCF 4.0 supports RESTful services in general it’s a bit shocking that basic auth over SSL isn’t supported out of the box. It seems like you should be able to derive and hook up a class from UserNamePasswordValidator, set the transport clientCredentialType to Basic and be ready to go. I’ve heard that this works for self-hosted services, but no dice in IIS.

Basic access authentication is a simple protocol and so in the end I added a helper method that checks for access (and in my case returns the user information for later use) at the start of each call into the service. It’s very simple:

  1. Check WebOperationContext.Current.IncomingRequest.Headers for an ‘Authorization’ header. If it’s there decode and validate the credentials.
  2. If the header is missing or the credentials are incorrect add the WWW-Authenticate header to the response - WebOperationContext.Current.OutgoingResponse.Headers.Add("WWW-Authenticate: Basic realm=\"myrealm\""); – and then throw a WebFaultException with a 401 Unauthorized status code.

This triggers a browser to prompt for your username and password and then try the request again. When calling the service in code you can add the ‘Authorization’ header preemptively and skip the 401 response entirely.

Add your comment...

Related Posts

You Might Also Like

(All Code Posts)

(Published to the Fediverse as: Basic HTTP auth for an IIS hosted WCF 4 RESTful service #code #wcf #iis #rest How to implement .NET Basic HTTP auth for an IIS hosted WCF 4 REST API. )