The Code Style site has evolved by gradual refinement and accumulation of features and content. This review is part of a fully backdated site log and archive that sheds light on when, why and how particular features were implemented.
This log is sometimes updated several times per week, sometimes with a long overdue backlog of items. Many log entries refer to the Code Style Java package that delivers the servlet services and utilities used to manage this site.
Subscribe to the news feed for this log:
Created a new LatestQuotesDemo servlet class based on the RSSDemo and XSL to convert Google finance page data into a simple table format. Servlet has XML validation disabled to overcome source markup problems that cannot be cleaned up by JTidy and only supports POST method requests. Copied the master Metacentric version of the Code Style XHTML 1 transitional "Lax" DTD to the Code Style project to test validation.
Updated Apache Ant properties and filters to include Log4J in the Code Style servlet container configuration, and to define the LatestQuotesDemo servlet. Also disabled XML validation in the JAXP servlet to test Google transformation.
Ran a style check on the Code Style code base and made adjustments to various classes:
IPMap, PingManager, ConnectionPool, FaqCategory, FaqQuestion, FaqSection.
Client class: private static final long serialVersionUID = 5371066808988175905L;
implements TreeModel declaration from FaqTreeModel, which extends DefaultTreeModel.
implements WindowListener declaration from WindowClosingListener, which is also implicit by extension.
ImageSample and BufferAppender to use a fresh StringBuffer instances, rather than reset the length of existing buffers.
Also refined the server.xml output format of the ServiceLogClientParser to support direct copy and paste.
IPMap class, 22th March 2008
Re-wrote the countSiblings(String) method of the IPMap class to improve performance using the SortedMap subMap(Object, Object) method to select all the IP addresses under a particular node and simply return the size of the set. Added explicit initial capacity arguments to Vector types in the IPMap class. Substituted constants in place of magic numbers. Adjusted the unit test class to account for the new line settings.
Refactored the main method of the ServiceLogClientParser class to separate the main steps in the process to printParserOutput(ServiceLogClientParser, File String), parseInput(ServiceLogClientParser, File), deleteInput(File). The new structure optimises the order, logic and error handling of each step. With the changes to the IPMap class, this resulted in about a 66% improvement in the performance of the class. Adjusted the new line settings and the message formats for existing output methods. Replaced various magic numbers with class constants.
Added a redirect for the path /fonts to the root level .htaccess configuration pointing to the font sampler section index page.
Redirect seeother /fonts http://www.codestyle.org/css/font-family/index.shtml
Put FontStats.dtd into the public DTD virtual directory to publish with the font survey XML files, with links via a new FAQ: Are the results available in other formats?.
onclick tracking for external links, 19th March 2008
Switched all Anchor Points external links to use direct URLs with Google Analytics event handler tracking instead of servlet redirection. Using direct links should be better for search engine indexing purposes and more useful for users. Used a Search and Replace replacement expression to match the URL in existing links as %1, plus zero or more characters before a close angle bracket, >. Then match the text between the open and close a tags as %3:
<a href="/servlets/AnchorPoints\?+[]"*>+[]</a>
The backslash before the question mark in the URL escapes its special meaning in the regular expression. The +[] matches any characters up to the closing quote mark. The matched text is then used to replace the whole expression with a standard href attribute, absolute URL and original link text:
<a href="%1" onclick="urchinTracker('%1');" class="External">%3\</a>
The 1% token represents the contents of the first regular expression match, the absolute URL. The 3% token represents the link text between the open and close a tags in the original text. The backslash before the close tag escapes the special meaning of the angle bracket, <.
Added 18 further Linux fonts to the Unix family font survey, including the DejaVu, Liberation, MgOpen and Vera font sets:
Following feedback from users, increased the height of the applet by 100 pixels to make the message input field and font listing easier to read. Users wanted to be able to select and copy the installed font list for their own purposes. Only required a change to the height attribute of the object element to 500 pixels. The applet interface reflows to fill the available space.
Also set the font size for the font survey input fields to 14 points, which is displayed closer to a comfortable 12 points, and applied word wrapping to the message input TextArea by setting vertical scrollbars only:
TextArea commentArea = new TextArea("",
ROWS,
COLS,
TextArea.SCROLLBARS_VERTICAL_ONLY);
Added the Media style sheets FAQ, Java objects FAQ and Servlet lifecycle FAQ to the mailing list subscription page. Applied the the same SQL file output template used for font survey feedback to mailing lists submissions, with output directed to the same file. This means that subscription change requests from either form will feed into the standard mailing list update process. Amended the PSFTP upload script for the mailing lists to include the form configuration files, page and email and templates as part of the standard update process.
Corrected a number Dublin Core test case document links to .htm files. The file format had been changed some time ago, but some link element URLs had been omitted.
Added more explicit rule to child elements to prevent the new background logo in #Header div being inherited into the h1 element.
/*
Lots of selectors are blue!
Transparent background necessary to override
image background in #Header
*/
blockquote, caption, code, dt,
h1, h2, h3, h4, h5, h6, th,
.MenuBox th, Q, .Q, .A,
.Box label, legend {
color: #039;
background: transparent;
}
Created an SQL query script to produce a simple text table of cursive font survey results. The script uses the same query format as the other generic font types to rank the frequency of cursive fonts for mailing list updates.
Created an SQL script to replace 7 lowest ranking fonts in the Unix survey sample with new fonts more common on recent Linux platform distributions:
Latest updates to the Code Style font survey results:
Generated the latest font survey results tables with new set of Mac screen shots. Amended FontSurveyTemplate to include all fonts in the fontfamily database table in the CSS output, not just those included in the results. Thereby added the 7 new Unix fonts to Sampler.css. Also updated the font survey applet submission templates with latest fonts.
Adjusted the layout of print stylesheet, CSPrint.css to place new Code Style logo above title heading.
#Header {
background-position: 0 0;
}
#Header {
padding-top: 60px;
margin-top: 0;
}
Updated the font survey archive SQL script to archive survey submissions before 1 January 2004. Older submissions are moved to an archive_submission table, so that survey results are calculated with only the past 4 years' submissions. Applied script to the master database and re-generated survey results to test.
Updated the Code Style server side scripting code base to be directly compatible with the LightTPD Web server. Mainly affected references to global server variables in server side includes. Took the opportunity to standardise and optimise the syntax of many script elements. The changes are also compatible with the current Apache Web server.
Added a site sponsorship promotional banner to the AbstractSample font sampler class through a protected getSponsor() method. Added calls to the getSponsor() method at the appropriate points in the ImageSample and TextSample servlet classes. This also required adjustments to the CSWideImport.css file to make the right hand margin wide enough to take a 180 pixel banner and make text ads the same width.
#Sidebar, #Content p,
h1, h2, h3, h4, h5,
#Content dl, .Box, .Feedback,
#Header p, #Header h1,
#SiteSearch, .MenuBox {
margin-right: 21%;
margin-left: 16.6%;
}
.TextAd {
float: right;
width: 16.4%;
}
.Sponsor {
width: 17%;
}
Completed site sponsorship banner images and added to all high and medium traffic pages and many low traffic pages. Adjusted the sponsor output of the FaqMenuGenerator class to take these banners and re-generated all FAQ section pages.
Created a new PSFTP script to upload FAQ section pages only. Re-ordered the existing PSFTP FAQ update script to put the premium content pages up before the sections that link to them.
Brought CodeStyleTemplate class up to date with recent side bar menu markup changes.
These backdated pages record detailed changes to the Code Style Web site since July 2000, when development first got underway. Some pages may refer to documents or features that have since changed or are no longer part of the site, but the archive is checked to ensure there are no dead links.
For a summary overview, see the annotated site log contents.