Google Blogger Website Integration

Blog Integration on paulpepper.com

I’m currently working on a Java-based Content Management System (CMS) to integrate into my paulpepper.com website, but it’s very much a background task, taking second place to client work. I have a whole bunch of archived notes and articles and on-going technical notes (such as this one) that I would like to make available on my website.

When a prospective client recently enquired about getpepper creating a website for them, incorporating Google’s Blogger FTP publishing facility, it led me to learn more about Blogger’s publishing facilities. In less than a day of exploring what could be done with Blogger, I’d seamlessly integrated its FTP publishing facility into the paulpepper.com blog section, maintaining visual consistency with all other parts of the site.

Site Integration With Google Blogger

Google’s Blogger provides most of the features required to publish a blog on a domain, so long as a few basic administration features are available on the domain’s publishing server. Using Blogger’s FTP publishing facility, a set of static files is created. These include:

  • A main index page providing a chronological ordering of blog posts
  • A page for each label/tag containing all associated blog posts
  • A page per blog post
  • A file containing the blog RSS news feed data

All these files are pushed up to the HTTP server on which the blog will be published using FTP. After the initial files and directory structure have been created by Blogger using FTP, single posts are pushed up to the server as they are published. The whole blog can, however, refreshed from the Blogger dashboard.

Domain Server Set-Up

Firstly, you must have some degree of FTP configuration on the server that hosts your site. Here is an outline of the steps that you might follow in order to configure your server for integration with Google Blogger.

  1. Create a user that Blogger alone will use when publishing content to your site. On Debian-based Linux distributions the VSFTPD server allows creation of virtual users for use solely with the FTP server, avoiding the need to add a user to the system.
  2. Establish where abouts on the HTTP server the blog will be published from and permit FTP write access to that directory for the newly created user.
  3. If your FTP server permits, then be sure to jail the user to that directory in order to minimise any damage that might be done should the user’s FTP account be compromised.

Blogger Configuration

Here’s what you need to do within Blogger to publish to your FTP server.

  1. Choose the blog that is to be published from the Blogger dashboard.
  2. In Settings > Permissions, allow anyone to read the blog.
  3. In Layout > Edit HTML, click the link titled Revert to Classic Template – Google appears not to have enabled processing of their new Blogger tags for FTP publishing.
  4. After completing the previous two steps, the FTP Publishing option should become available on the Settings > Publishing section. You should now complete the following details:
  • FTP server address
  • Root URL of the published blog (e.g. in my case this is http://www.paulpepper.com/blog), not forgetting the http://, which Blogger seems to require.
  • Path to where the blog will be pushed by the Blogger FTP client – this will be relative to the directory in which the FTP user has been jailed.
  • Published blog’s main archive filename – index.html by default, though be careful not to overwrite any existing file if you wish to serve up your own, alternative blog default directory index page).
  • The filename that Blogger should use for your blog’s RSS feed.
  • FTP username and associated password (refer to server configuration, above).

You should now be able to publish to the server and view the published content.

Blog Visual Formatting

Visual formatting is performed by providing blog page layout using the Blogger classic template tags. Go to the section, Template > HTML, where you’ll find a rather mingy box in which you can write (or maybe paste) your HTML, CSS and template tags. The Blogger tags allow access to various parts of the the blog, such as; blog post content, author name, publication date, etc. Conditional tags are also available permitting different blog archive views (main chronological view, label view, etc) to be formatted in a single HTML file.

Blogger offers a default HTML file and you might find this helpful when learning about the Blogger template tags. I’d recommend making the following changes for improved integration with the remainder of your website.

  • Turn off the blogger navbar (the “off” option only becomes available once FTP publishing has been fully enabled).
  • Don’t use Blogger’s <$BlogMetaData$> tag if you want to use your own favicon – part of the output of the <$BlogMetaData$> tag references the Blogger favicon. If you omit this tag, then you should manually insert some of the HTML tags that this template tag would have included for you:
<meta http-equiv="Content-Type"
    content="text/html;
    charset=UTF-8"
/>
<link rel="icon"
    type="image/vnd.microsoft.icon"
    href="http://your-domain.com/favicon.ico"
/>
<link rel="alternate"
    type="application/atom+xml"
    title="Blog Title - Atom"
    href="http://your-domain.com/atom.xml"
/>
<link rel="stylesheet"
    type="text/css"
    href="/css/mystylesheet.css"
/>
  • Don’t embed any blog-specific CSS in the head of the blog pages as the example theme demonstrates (I guess there are few other options for the default theme). Add any new CSS to your site’s CSS files and reference those files in your blog pages, just as you normally would. This gives you access to your site’s existing styling and of course allows browsers easily cache the CSS.
Tags:

Quality of Software Design

There are plenty of reasons why speedy delivery of a software product may be important to a business, and as a developer of software I have often found myself to be under pressure to quote and then deliver to over-optimistic time-scales. But if that software has to be maintained and developed further, as is often the case, then at least some thought should be given to the quality of the design.

Software quality has many concerns, with design quality being a tricky one to measure. I’m thinking here of those things that relate to the conceptual integrity of a system – cohesion and coupling amongst them.

Now, it’s difficult to address the conceptual integrity quality of a software product that has already been constructed with little regard for it throughout the development life-cycle. An engineer I used to work with tried to overcome the difficulties of explaining this to non-technical staff through the use of analogy. He would explain that addressing these qualities towards the end of the development phase is akin to trying to add eggs to a cake after it had been baked.

As another analogy consider trying to rework a badly written piece of prose (whether a business or technical article, story or novel); the quality of the piece is threaded throughout and within the text as a whole. In the same way, there are many features of software – most prominently in its structures and internal component/object inter-relations – which are threaded throughout the source code.

Returning to the prose analogy, there are features of badly written prose which are more easily addressed than others, such as bad spelling or grammar. But the structure of the prose is more difficult to address; rewriting sometimes being the only way forward since reworking can be more time-consuming than starting afresh and reworking is likely to leave remnants of the original poor structure. The point here is that quality and the intention to incorporate quality must, for the most part, be our purpose at the outset if we are to effectively achieve a quality result.

REST-based Web Services

REST is an acronym for the architectural style REpresentational State Transfer. Proponents of the style favour representing web service resources as URIs as opposed to using single URIs to represent the location of a whole set of services and resources. This flattened approach is in line with the architectural style of the web – the REST architectural style was described by Roy Fielding in his PhD dissertation.

The REST approach advocates the use of URIs to reference individual object instances.

The following shows how the HTTP methods, POST, GET, PUT and DELETE, can be used to provide all the actions of the CRUD (Create Retrieve Update Delete) pattern:

POST

CRUD action: CREATE

Description: Create a new resource.

GET

CRUD action: RETRIEVE

Description: Retrieve a representation of a resource.

PUT

CRUD action: UPDATE

Description: Update a resource.

DELETE

CRUD action: DELETE

Description: Delete a resource.

Of course other methods are available but those listed above are sufficient to build a complete set of web services. Note that the result of a GET action must be free of any side-effect. Consequently any action which does not create a side-effect should use the GET method.

Standards such as SOAP and XML-RPC differ from REST in their approach to web service development. Both SOAP and XML-RPC offer the ability to create new verbs for application across the network, whereas REST constrains developers to using the primitives of the web (HTTP methods listed above).

What isn’t obvious, nor talked about much in REST circles, is the issue of resource locking to overcome the issue of client update races. After posting a question, to the rest-discuss Yahoo group, enquiring about resolutions to this problem, I was pointed to the following two articles:

http://www.w3.org/1999/04/Editing/
http://www.zvon.org/tmRFC/RFC2518/Output/chapter6.html

The first of these articles describes four ways in which the update race (referred to as the Lost Update Problem in that document) can be resolved. These are:

  1. Out-of-band communication and social agreements
  2. Unreserved Checkout with Automatic Detection (UCAD)
  3. Early warning of potential future conflicts (EW)
  4. Reserved Checkout (RC)

The first of these doesn’t really work for web service development, as it really relies on personal communication of locks on resources.

UCAD, probably better known as optimistic locking, probably provides a good solution on systems that perform many reads, but only a small number of writes to a resource. Alternatively, if the client can perform a ‘merge’ operation, by obtaining and then incorporating the current state of a resource into the write operation (similar to the CVS merge feature), then this solution can also provide a good solution.

The third option, EW, doesn’t itself resolve the problem, but allows clients to determine when other reads have been performed in order to manage the problem by some other means.

Finally, RC, maybe better known as pessimistic locking, allows only one client to obtain a resource with write access; all other clients being granted read access only. This solution is probably best in situations where there is a great deal of contention for write privileges to resources.

Resources

A REST wiki, with very useful links, can be found here:
http://rest.blueoxen.net/cgi-bin/wiki.pl?FrontPage

In this very compact article you’ll find the author clearly describes the REST architecture and gives a few useful examples of a web services:
http://www.xfront.com/REST-Web-Services.html

You’ll find a thorough analysis of the rest pattern compared with the SOAP approach to developing web services here:
http://www.prescod.net/rest/rest_vs_soap_overview/#fromN1012

Here’s short article on the process of developing REST-based web services:
http://www.xml.com/pub/a/2004/12/01/restful-web.html

Another article you might find useful describes the common mistakes made when design REST web services:
http://www.prescod.net/rest/mistakes/

Windows-Based PVR

Hardware Background Information

In order for most Windows-based PVR software to control a TV card,?Broadcast Driver Architecture?(BDA) drivers must normally be available.

If you’re interested in knowing more about the low-level details of TV cards then you might want to have a look at the following links:

PVR Software

Microsoft’s Media Centre Edition?(MCE) appears to be their Windows XP Home Edition operating system with an enhanced Windows Media Player. Unfortunately MCE records video content to Microsoft’s proprietary format, DVR-MS, which they describe as an MPEG-2 format. The exclusive use of the DVR-MS format means that content can’t be edited and it can only be played on the machine that recorded it. Incidentally, MCE will respect any content protection issued within a broadcast stream, limiting the user’s ability to record broadcasts and replay recordings at any point in the future.

Another popular system is GB-PVR. Although some of the plug-ins for the system are open source, the core of the system is not. If your TV card is not supported by GB-PVR, then this post?may help you determine if and how support may be added for it.

Media Portal?appears to be a relative newcomer to the PVR scene, at the time of writing.

[Editor’s note – there’s currently a discussion thread regarding the use of
the Avermedia DVB-T 771 card on a hardware support forum: http://nolanparty.com/mediaportal.sourceforge.net/phpBB2/viewtopic.php?t=3920]

Build Your Own PVR?is a site that provides some good links and useful forums.

For comparison, or if you’re interested in paying for a system, here are some links to commercially available PVR systems:

Programme Guide

A major convenience of many PVR systems is the availability of an integrated program guide. XMLTV is both the name of a data format?in which programme guide data is stored and also the name of a set of software applications?used to manipulate programme guide data (in the XMLTV format).

If you require a UK programme guide and prefer a GUI-based application to configure and grab XMLTV programme guides, then XMLTV Radio Times Grabber?is for you.

Tags:

Widescreen SDTV Output using an NVidia Chipset

First off, the point of this blog entry is to work through some of the unresolved difficulties I’ve had in trying to output a correctly sized display to a widescreen Standard Definition TV (as I’m in the UK the TV is compatible with PAL-I).

Now here’s the specification for the video card that I currently have installed in my Windows XP Pro-based PVR system:

  • XpertVision GeForce4 MX4000.
  • NVidia’s own integrated MV chip for TV/s-video output.

I’ve also tried a video card with more recent, and higher specification, NVidia chipset:

  • XFX GeForce FX5200 AGP 8x Graphics Card with 128MB DDR memory and TV-Out.

Again, this card uses the same NVidia integrated MV chip for TV/S-Video out, with the exact same level of configurability and problems, which I discuss below.

Generally the problem I’ve experienced with these NVidia cards is one of outputting an image with the correct aspect ratio to a widescreen (16:9) Standard Definition (SD) TV, through the card’s S-Video output port. More specifically, the facility to create custom resolutions for display using any and all of the published NVidia drivers is buggy; at least when used with an NVidia MV chip.

All the built-in standard resolutions, provided by the NVidia drivers, produce a correctly sized standard 4:3 resolution. I can determine this because of the way my widescreen SDTV can almost perfectly zoom those standard 4:3 resolutions – the zoom function is provided by most widescreen TVs, to allow 4:3 broadcasts to fill the whole of the 16:9 screen. But custom resolutions that are created to give a natural fit on a widescreen SDTV display (i.e. without recourse to zooming) result in an incorrectly sized image – resulting in a scrolling/panning Windows desktop or the desktop being hugely oversized (far too much for the TV’s zoom control to correct). There are three possible causes that I am aware of:

  1. Custom resolutions just don’t create the correct timings to produce an appropriately sized image.
  2. The burst of widescreen data inserted at the start of scan line 23 for Wide Screen Signalling (WSS) transmissions is absent, creating an incorrectly sized image.
  3. Both 1. and 2.

Given what I’ve read about NVidia’s integrated MV chip, I’m inclined to believe there is a complete lack of support for widescreen SDTV. Before NVidia started integrating their own TV-out support into the main graphics chipset, card manufacturers had to use third party chips. A popular chip is the Connexant CX25871, which is considered to be amongst the best for have one of the best for TV output.

I’ve also tried using an ATI Radeon 9600SE with poor results. Problems with this cards included:

  • No resolution for widescreen SDTV (e.g. 720×400, 800×450). Only higher resolutions were catered for.
  • very poor TV picture quality, producing unreadable text on screen. The effects were blurred images and text with text particularly shaky. This even occured during computer start-up – something that was never an issue with the NVidia MX4000.

Here‘s a good article for geforce4mx video cards and tv. The 16:9 display ratio of widescreen provides a resolution of 1024×576 pixels. The horizontal refresh is an interlaced 60Hz.

Question – Widescreen TV

I’m having difficulties fitting the display correctly on my 28″ CRT widescreen TV (a Toshiba 28w93b). All of the resolutions I have tried, including 1024 x 576, either result in much of the picture being off the screen or the aspect ratio being wrong. My graphics card is a XpertVision GeForce4 MX4000 with its s-video output hooked up to my TV. I’m using the latest NVidia device drivers (version 71.84).

To make things worse the NVidia drivers appears to contain a number of bugs associated with setting the resolution on s-video output, as different dimentioning results from setting the resolution from the three different available locations!

Posted above question to alt.comp.periphs.videocards.nvidia with subject “widescreen tv”

Question – Aspect Ratio Problems

I’m using a NVidia GeForce4 MX 4000, with a custom resolution of 1024 x 576, to display to a TV (a widescreen CRT) through the S-Video port. Problem is, it displays using a 4:3 aspect ratio, giving black bands at either side of the 16:9 display! The full width of the display can be scrolled into view by moving the mouse cursor off to the left or the right of the screen.

Can anyone tell me how I can set up the NVidia driver with the correct display width, please? I suspect this is a timing issue, but don’t know enough to resolve the problem.

This question I posted to the usenet group alt.comp.periphs.videocards.nvidia and to the Media Portal Hardware Support forum: http://nolanparty.com/mediapo rtal.sourceforge.net/phpBB2/viewtopic.php?p=33148#33148

The Media Portal posting resulted in a number of suggestions from a friendly chap, leading to a pointer to information about digital video resolution and aspect ratio conversion.

Links

The TweakGuides site offers a useful article.

Here’s a forum in which the same question has arisen: http://www.thegreenbutt on.com/community/shwmessage.aspx?ForumID=47&MessageID=94536&TopicPage=1

A couple of sites that provide forums worth inspecting every now and again:

If you’re interested in understanding some of the technical details about WSS then Steven Hosgood’s PALPlus page is a good place to start.

Tags: