Sex with robots is more common than most people think.

Spike ,'Lineage'


Buffistas Building a Better Board  

Do you have problems, concerns or recommendations about the technical side of the Phoenix? Air them here. Compliments also welcome.

To-do list


P.M. Marc - Nov 24, 2002 6:12:41 pm PST #1725 of 10000
So come, my friends, be not afraid/We are so lightly here/It is in love that we are made; In love we disappear

CRAP!

Okay, I broke it. Single quote/double quote.


P.M. Marc - Nov 24, 2002 6:13:13 pm PST #1726 of 10000
So come, my friends, be not afraid/We are so lightly here/It is in love that we are made; In love we disappear

Never mind, I seem to be able to delete.


John H - Nov 26, 2002 11:50:42 pm PST #1727 of 10000

Dudes. Finally got a moment: check out [link] which tests, in very mechanical fashion, for unclosed HTML tags.

For each start tag, there either is or isn't an end tag, found later in the text. That's all it does but after much messing around that seems to be what we need, really.

See if you can fool it, please?

And PHP gurus, what's the neat way to do:

$array2 = (all the values in $array1 which aren't empty strings)

once again I can't figure it out for myself.


§ ita § - Nov 27, 2002 12:02:15 am PST #1728 of 10000
Well not canonically, no, but this is transformative fiction.

You want array_filter used with a callback function:

Like

function notblank($val) { return ($val<>"")};

$array2 = array_filter($array1, "notblank");

Standard typo and thinko disclaimers apply.


John H - Nov 27, 2002 2:39:41 pm PST #1729 of 10000

array_filter used with a callback function

You know what, I used that, and tried to do it with the built-in "empty" function, but it didn't seem to work with that, only the way you did it, where you write your own.

Not to get all Perl about it, but it doesn't have the pure poetry of:

@newarray = grep {length($_)} @oldarray;

does it?


§ ita § - Nov 27, 2002 2:45:22 pm PST #1730 of 10000
Well not canonically, no, but this is transformative fiction.

Even ee might think your poetry a little opaque.


John H - Nov 27, 2002 2:50:38 pm PST #1731 of 10000

Even ee might think your poetry a little opaque.

I say "ee", you say "OO", let's call the whole thing off.

And of course like all Perl addicts I've realised I was way wordy above, goddamnit I'm Samuel Taylor Coleridge compared to the Japanese simplicity of this:

@newarray = grep {/./} @oldarray;


John H - Nov 27, 2002 3:00:06 pm PST #1732 of 10000

What was I thinking! If all I need is the output, I don't even need the new array:

print(grep(/./,@oldarray);


Rob - Nov 27, 2002 5:26:37 pm PST #1733 of 10000

I distinctly recall John promising to use his powers only for good. This is not for good.


John H - Nov 27, 2002 5:39:50 pm PST #1734 of 10000

All I'm saying is, when you're used to stuff like that, everything in PHP starts to seem overly prolix.

So, who's beta-tested the bloody HTML parser anyway? Did it work, did it fail, did it die, what? I'm sulking.

The next stage would presumably be to transform my code, which just looks like this:

$content = stuff in the form;
do something to it
do something else to it
[20 more lines of the same]
$output = required tags;

into that new Object-Oriented code you young whippersnappers love so much. Get off my lawn!

What's the right way to do it, something like:

$check = new htmlCheck();
if($check.parse(stuff in the form) == 'no probs'){everthing's fine}

kind of thing?

And then write an object that that does all that stuff with a parse method, and returns either 'no probs' or a list of tags?