Showing entries 11 to 19
« 10 Newer Entries
Displaying posts with tag: html (reset)
Best practices for escaping HTML

I am working on Wordcraft, trying to get the last annoying HTML validation errors worked out.  Thinks like ampersands in URLs.  In doing so, I am asking myself where the escaping should take place. In the case of Wordcraft, there are several parts to it.

  1. The code that pulls data from the database.  Obviously not the right place.
  2. The code that formats data like dates and such.  It also organizes data from several data sources into one nice tidy array.  Hmm, maybe
  3. The parts of the code that set up the output data for the templates.
  4. The templates themselves.

Now, I am sure 1 is not the place.  And I really would not want 4 to be the place.  That would make for some ugly templating.  Plus, the templates, IMO, should assume the data is ready to be output.  So, that …

[Read more]
Open Source Web Design

So, my wife told me that my site design was boring.  Yeah, she was right.  I am no designer.  I just don't have that gene.  But, during my work on Wordcraft, I came across some cool places to find designs that are relased under Open Source licenses.

  • Open Designs - This is arguably the the prettiest of the three. The search, however, is painfully slow because all results return on one page.  I guess if you can wait, this is a plus as browsing is easier.  Also, you can pick multiple colors and choose by license.  They only list XHTML templates (at least as search options).  That could be a turn off if you like HTML 4 like me.
  • Open Web Design - The site itself could use a design overhaul.  But, the content is good.  The search lets …
[Read more]
My editor of choice


O?Reilly Open Source Conference Day One

A is hiring

From our jobs page:

As a dealnews web developer, you will help maintain our current stable of deal and price-tracking web sites, and build new features and new web sites as we continue to grow. You’ll be part of a small, fast-moving team of developers that are involved at every stage of product development, from concept to rollout.

We use Gentoo, Apache, PHP and MySQL.   While that does not need to be your expertise, it is a plus.  We have a little Perl and Python thrown in as well.  You will need to code on a non-Windows system as we run our development environment on our local machines.  Currently, we all use Macs.

A big plus, however, is disc golf.  We play weekly as an um, team building excercise. Yeah, team …

[Read more]
PHP - Populate HTML Select Element

There is many ways to populate vales into a HTML select element. Here is one example I’ve come up with.

PHP Code Example

      <select size="1" name="szFooBar[]" multiple="multiple">
< ?php
while($obResults = mysql_fetch_row($saResults))
    if ($_POST['szFooBar'] == $obResults[0])
    { $szSelectedValue[$i] = " selected=\"selected\""; }
    else { $szSelectedValue[$i] = ""; }
    printf("<option value=\"%s\"%s>%s\n",$obResults[0], $szSelectedValue[$i], $obResults[1]);

[Read more]
Docbook XHTML generation with tidy, chapter the third

In chapter the first, I presented a way to install HTML tidy.

In chapter the second, I created a script to install the most recent version of tidy with a single command.

In this chapter, I will show you how to run tidy in a way that cleans up the HTML that was generated by Office™.

Docbook XHTML generation with tidy, chapter the second

In Chapter the First, we presented a set of commands you could run to install HTML Tidy on your system.

In this chapter, we will present a script that you may run on your Linux or OS X system to install the most recent version of HTML tidy.

You may use subversion, wget, or your favorite browser to retrieve the most recent version of this tidy installer.

I'm writing a perl script using Commands::Guarded to automate what I did in the first article.

You may retrieve the source with wget, so:

$ wget -r

Or subversion, so:

$ svn co svn://

You may also get the most recent version of the individual files in the distribution using …

[Read more]
Docbook XHTML generation with tidy, chapter the first

So I'm getting the new version of the MaxDB FAQ ready for production. We used Microsoft Word to create the document and manage corrections. And then I exported to HTML. Word did a terrific (note that the root word here is "terror") job of translating to HTML, and Tidy won't touch it unless I fix some issues manually.

So here I go.

Getting most recent build from cvs:

$ cd ~/src/
$ cvs login
$ cvs co tidy

Building said code:

$ cd tidy/build/gmake
$ make

ld: archive: ../../lib/libtidy.a has no table of contents, add one with ranlib(1) (can't load from it)
make: *** [../../bin/tidy] Error 1

$ ranlib ../../lib/libtidy.a
$ make

Running code:

$ cd ../../bin
$ ./tidy -h
$ open ../htmldoc/faq.html …
[Read more]
Showing entries 11 to 19
« 10 Newer Entries