Freeware Projects and other Updates

“So who is the real Mr. Tines? The monster who'd smash a world, or the nice guy I'm hearing now?”
—— The Blabber, Vernor Vinge.

S I T E   M A P

XPP

XPP 1.0.1708.27390 — An X(HT)ML preprocessor for helping handle repetitive bits in static web pages e.g. geocities siteslike this one.

Usage: xpp "directives" in-filename out-location

Example: "+local -remote include *replace" ..\..\New.html ..\..\bin

out-location may be a file or a directory. If the latter, the file-name of the in-filename is used to create the new file. The directives indicate which parts of the file to change.

The in-file has to be valid XML; and in most cases it can be valid XHTML. Each element tag is inspected for a "class" attribute.

  1. If/else sections of the file

    If the class value is one of the strings marked with a '+' in the directive, the attribute is just removed.

    If the class value is one of the strings marked with a '-' in the directive, the whole element and all it contains is removed.

  2. Including text

    These are more complicated. Class attributes are of the form

    directive facet1 facet2 ... facetN

    where facet1/facet2/.../facetN is the filespec (typically a relative one) from in-filename to the file to include.

    If the directive matches a *-ed value, replace the element with the contents of the file; if the match is with an un-tagged name, replace the contents of the element with the contents of the file.

    If the included file isn't a valid XML fragment, then the process will fail.

    Note that the evaluation carries on through the included XML, recursively, so an included fragment can have If/else sections.

There isn't any fancy error handling. If you choose a bad file location, or the XML isn't well formed, it will just fail with a traceback.

Neither will it perform any validation against DOCTYPE elements.

Example

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
       "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>No title</title>
  <meta class="replace .. xpp header.ihtml" />
</head>

<body>
<p class="local">Local&nbsp;text</p>

<p class="remote">Remote text</p>

<p class="display">styled text</p>

<p class="include .. xpp other.ihtml">Insertion point</p>
</body>
</html>

When processed as above, will become

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>No title</title>
    <meta name="keywords" content="Java Freeware XHTML CSS validator FTP GWT" />
  <meta name="description" content="Java Freeware" />
  <meta name="author" content="Mr. Tines" />
  <meta name="copyright" content="Material Copyright © 2000-2003 Mr. Tines" />
  <meta name="robots" content="all" />
  <meta name="language" content="en" />

</head>

<body>
<p>Local&nbsp;text</p>



<p class="display">styled text</p>

<p>Test <span>local text to</span> insert</p>
</body>
</html>

if header.ihtml contains

 <meta name="keywords" content="Java Freeware XHTML CSS validator FTP GWT" />
  <meta name="description" content="Java Freeware" />
  <meta name="author" content="Mr. Tines" />
  <meta name="copyright" content="Material Copyright © 2000-2003 Mr. Tines" />
  <meta name="robots" content="all" />
  <meta name="language" content="en" />

and other.ihtml contains

Test <span class="local">local text to</span><span class="remote">remote text to</span> insert

Use it to actor out common bits of headers, repeated modules like page footers, and make the bits visible by applying CSS styles to the affected tags (doesn't work so well on <head /> tags).

Janus/.NET

Janus/.NET — A re-implementation of my Janus program using the .NET framework's asynchronous I/O facilities that make writing an industrial strength server a trivial exercise.

Validator

My first .NET project release — an XHTML validator that will check a document against 1.0 Transitional, 1.0 Strict and 1.1, all without needing to edit your DOCTYPE. Useful for polishing before sending to the W3C validator. New version 1.1 (17-May-03) also checks for invalid characters in the 0x80-0x9F range that cp1252, the usual Microsoft character encoding, uses and are often included in the belief that they are part of utf-8 (ISO Latin-1). The characters involved are shown in the following conversion chart.

Version 2.1 also available which performs CSS level 2 validation and will validate all the XHTML files in a folder (optionally in all sub-folders too). This uses the Java code from the W3C validator built under J#, so you'll need to have the J# redistributables as well as the .Net framework from Microsoft installed to make use of this. The archive also contains my C# source, the Java files I changed, and tools sufficient to take the W3C 19-May-01 archive, patch it, and build the CSS2 support DLL.

SHLoad — old-style skinning

Customize your Win9x/Me/NT4/2k/ start button and menu banner with SHLoad — source and installer provided gratis and public domain. Source archive is installed to the program directory. But if you want to do that job properly, or for try Window Blinds, a skinning application for Windows from Stardock.com.

Drop and Hash

Drophash — just an executable and source in a .zip file — drag and drop files on, and get their MD5 and SHA-1 hashes, which you can cut and paste. Freely redistributable.

Passive FTP

PassiveFTP 1.11 — build 1.11.2971.37821 — mitigates the upload rate problem I've been having, by doing some unexpectedly effective tweaks to socket parameters (the boost came by sending only small packets and disabling Nagle coalescence). Default upload rate is 128kb/s (1ms sleep between successful sends of 128-byte packets), which gave the best rate for me.

PassiveFTP 1.10 — build 1.10.2734.38706 — squeezes in an up-one-level button into the remote site list, for FTP sites that manage to conceal their ".." directories. Or for people who'd prefer it anyway.

PassiveFTP 1.9 — build 1.9.2360.19246 — is a minor usability tweak, moving status indications from dialogs to the main screen — progress at the lower-left, errors in the scrolling text at top right.

PassiveFTP 1.8 — build 1.8.2127.30224 — minor bug-fix release — only treats client-side executables as possibly having unique icons, so does not get icon creation failures when scanning client-side folders with very many files. Also set default upload to dial-up compatible 2kb/s for best observed stability.

PassiveFTP 1.7 — build 1.7.1955.38236 — minor enhancement release — allows the upload rate to be reduced so as not to overwhelm fussy servers.

PassiveFTP 1.6 — build 1.6.1701.15662 — minor bug-fix release — works with other than 32-bit screen depth on Windows. Tested only on 16-bit default case on XP. Should handle 16, 24 and 32 bit screen depths.

PassiveFTP 1.5 — minor bug-fix release — this fixes an issue whereby after some use, screen corruption would occur, with a "Could not create icon" message box. This turned out to be GDI exhaustion by putting server-side icons in the client icon cache, and thus having to regenerate individual icons for each file on the server, each time the view changed!

PassiveFTP 1.4 — minor bug-fix release — if a logon to a new server was abandoned by terminating the program, the current server would be set to the new one — but on restart this would cause an out-of-range error, as there would be no stored server details.

PassiveFTP 1.3 — Has improved file icon display for files on the client (using a couple of encapsulation-busting getting at the internals of library classes) for Win32 to show the actual file icon, and the facility to localize all the messages through text files by using a patched version of FOX 1.1.41 in which all user-facing strings are exposed to application code for modification.

Because of the possible changes to the strings at later releases, this and all later builds of PassiveFTP stick to 1.1.41. The patches to allow L10N are to make every hard-coded string or icon a static member of the class, instead of being in-line, then extracting all the initializations so they can be re-done with localized strings/icons.

Skinning code (obsolete)

PassiveFTP 1.2 PassiveFTP 1.2 — A simple FTP client for passive mode (firewall friendly - compatible with e.g. ZoneAlarm, the free personal firewall from www.zonelabs.com) use. Now with proxy support. It's GPL'd freeware, and there's a pre-built Native Windows executable. GUI programming is done using FOX toolkit, including VC++.NET and C++Builder5 projects, and automake stuff for building on Linux or Cygwin. One zip archive (simpler for me to freshen). The previous version's skinning code is not compiled in as I've not updated it to follow changes in the detailed internals. Unfortunately the FOX toolkit doesn't have a clean MVC structure, nor a consistent separation of interface and inheritance, which means that skinning and localization and other View modifications require changes to the base library, or at the very least encapsulation-busting hacks.

The skinning code is present in the archive to give an idea about how one might go about tackling the issue — in essence, rewriting the static OnPaint handler table. The main drawback is that not all painting goes through these handlers (the progress dial on the progress dialog, for example).


Made with Cascading Style Sheets

This document maintained by domain webmaster — tines at ravna and tines dot com.

Material Copyright © 2000-2003 Mr. Tines

S I T E   M A P
1