Your leaking thatched hut during the restoration of a pre-Enlightenment state.

 

Hello, my name is Judas Gutenberg and this is my blaag (pronounced as you would the vomit noise "hyroop-bleuach").



links

decay & ruin
Biosphere II
Chernobyl
dead malls
Detroit
Irving housing

got that wrong
Paleofuture.com

appropriate tech
Arduino μcontrollers
Backwoods Home
Fractal antenna

fun social media stuff


Like asecular.com
(nobody does!)

Like my brownhouse:
   a little to close to the foundation
Tuesday, November 9 2010
Regarding my greenhouse well expansion project: though I see no reason to ever limit its depth, I keep thinking I've reached the end of its horizontal expansion. But today I managed to remove an enormous quantity of rock as large slabs of bluestone broke loose. By the mid-afternoon I was endanger of undermining the east wall of the greenhouse itself. While it might be fun to tunnel out of the greenhouse at some point from some imaginable future (deeper) version of the well, such a tunnel would have to be run entirely inside the bedrock.
Today I finally got around to the job of building that concrete pier to support the floor that will one day form a walkable surface over this area. I usually slap together the most rudimentary of forms when pouring concrete, but this time I made a fairly elaborate form that conformed well to incident surfaces and restrained the concrete into a tight rectangular shape precisely where I wanted it.

This evening I took a bath, and before, during, and afterward, I found myself thinking about how to deal with a problem my friend David is having with the website I built for him. His is a content site, and he has to enter that content into a web form. This form has a handy Javascript-powered WYSIWYG editor, but such tools have their limitations. When, for example, he posts a document from Microsoft Word, the result is a mess of proprietary HTML specifically-designed to make web-based content management more difficult (because it conflicts with the Microsoft business model). I've figured out how to fix that HTML, but there are other HTML and even plaint-text formats that need to be considered. Sometimes tags have to be removed while other times they must be created in response to the few hints available (usually in the form of carriage returns). Tonight I figured out that if I parsed through a document, replaced all nonstandard characters with spaces, and then removed all multiple copies of spaces, it would be a fairly easy job to regularize leading (the spacing of lines). The result looked something like this:

function fw_textprocess($in)
{
$in =WeirdCharacterFix($in);
$in =FilterString($in, "32-126 13-13", " ");
$in=deMultiple($in, " ");
$in=cleanHTML($in);
$in = str_replace(" "," ",$in);
$in=RemoveFirstCharacterIfMatch($in,"<div> </div>");
$bwlDontExpandCRs=false;
$bwlOnlyExpandDoubleCRs=false;
$lowerin=strtolower($in);
if(contains($lowerin, "<br>") || contains($lowerin, "<p>") )
{
$bwlDontExpandCRs=true;
}
else if (contains($lowerin, chr(13) . ' ' . chr(13)))
{
$bwlOnlyExpandDoubleCRsWithSpace=true;
}
else if (contains($lowerin, chr(13) . chr(13)))
{
$bwlOnlyExpandDoubleCRs =true;
}
$in=str_ireplace( "[BR]", "<BR>", $in);
$in=str_ireplace( "[/BR]", "</BR>", $in);
$in=str_ireplace( "[P]", "<P>", $in);
$in=str_ireplace( "[/P]", "</P>", $in);
$in=str_ireplace( "[B]", "<B>", $in);
$in=str_ireplace( "[/B]", "</B>", $in);
$in=str_ireplace( "[I]", "<I>", $in);
$in=str_ireplace( "[/I]", "</I>", $in);
$in=str_replace( " ,", ", ", $in);
$in=str_replace( " .", ". ", $in);
$in=str_replace( " ,", ", ", $in);
$in=str_replace( " .", ". ", $in);
$in=str_replace( "#--cleaned:", "", $in);
if($bwlDontExpandCRs)
{
}
else if($bwlOnlyExpandDoubleCRsWithSpace)
{
$in=str_replace( chr(13) . ' '. chr(13), "<br>", $in);
}
else if($bwlOnlyExpandDoubleCRs)
{
$in=str_replace( chr(13) . chr(13), "<br>", $in);
}
else
{
$in=str_replace( chr(13), "<br>", $in);
$in=deMultiple( $in , " ");
}
$in=str_ireplace( "</p>", "<br>", $in);
$in=str_ireplace( chr(13), " ", $in);
$in=deMultiple( $in , " ");
$in=str_ireplace( "<em> </em>", "", $in);
$in=str_ireplace( "<strong> </strong>", "", $in);
$in=str_ireplace( "<b> </b>", "", $in);
$in=str_ireplace( "<i> </i>", "", $in);
$in=str_ireplace( "<p >", "<p>", $in);
$in=str_ireplace( "<p>", "<br><br>", $in);
while(stripos(" " . $in, "<br> <br>")>0)
{
$in=str_ireplace( "<br> <br>", "<br><br>", $in);
}
while(stripos(" " . $in, "<br><br>")>0)
{
$in=str_ireplace( "<br><br>", "<br>", $in);
}
$in=str_ireplace( "<br>", "<br><br>", $in);
return $in;
}

function WeirdCharacterFix($in)
{
//fucking smart quotes:
$in=str_replace( chr(147), "'", $in);
$in=str_replace( chr(148), "'", $in);
$in=str_replace( chr(145), chr(39), $in);
$in=str_replace( chr(146),chr(39), $in);
$in=str_replace( chr(151), "--", $in);
$in=str_replace( chr(246), "o", $in);
return $in; }

function cleanHTML($html) {
$html = ereg_replace("<(/)?(font|span|del|ins)[^>]*>","",$html);
$html = ereg_replace("<(/)?(div)[^>]*>","<p>",$html);
$html = ereg_replace("<([^>]*)(class|lang|style|size|face)=(\"[^\"]*\"|'[^']*'|[^>]+)([^>]*)>","<\\1>",$html);
$html = ereg_replace("<([^>]*)(class|lang|style|size|face)=(\"[^\"]*\"|'[^']*'|[^>]+)([^>]*)>","<\\1>",$html);
$html=str_replace( "StartFragment", "", $html);
$html=ReplaceTag($html, "div", "br");
$html=ReplaceTag($html, "h1", "br");
$html=ReplaceTag($html, "h2", "br");
$html=ReplaceTag($html, "h3", "br");
$html=ReplaceTag($html, "h4", "br");
$html=ReplaceTag($html, "h5", "br");
$html=ReplaceTag($html, "h6", "br");
return $html;
}


For linking purposes this article's URL is:
http://asecular.com/blog.php?101109

feedback
previous | next