IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New How ironic
This site is written in Python, and you cannot readily post Python without it losing the indentation and rendering the code unworkable.

Scott, would you mind implementing something like a code tag? Alternately you can also turn spaces at the start of lines into unbreakable spaces.

Unless these things happen, the easiest is to take the code, and hand-edit it to post correctly as HTML + get rid of returns so that it is not munged.

Cheers,
Ben
"Career politicians are inherently untrustworthy; if it spends its life buzzing around the outhouse, it\ufffds probably a fly."
- [link|http://www.nationalinterest.org/issues/58/Mead.html|Walter Mead]
New Re: How ironic
The <pre> tag works fine... the only artifact is the doubling of line breaks, which is not easy to fix. However, the code will be perfectly readable.

If you are anal enough to not want the doubling, simply use a pre tag and replace each linebreak with a br tag.

Like this
indent
indent
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New What do you mean not easy to fix?
Your Python parsing logic is based on your translation of some Perl that I wrote, right?

Well take a look at [link|http://www.perlmonks.org/index.pl?node_id=56210|this rewrite] and translate it. That rewrite added several useful features. Two biggies were the ability to have attribute validations within tags (for instance you could automatically catch if someone didn't specify a protocol that you liked at the start of an href), and the ability to have validation rules that behave differently depending on some current state (for instance only allow table tags within tables that you have opened - thus preventing people from messing up their tables and breaking the tables that you used for framing).

As I noted, modal handlers are also possible. However with reference counting (used in both Perl and Python I believe - but not a problem if you did a translation to Ruby, Scheme, or any other language with real gc) it is too darned easy for modal handlers to become memory leaks.

Furthermore even the original trivally allowed for an "escape mode" within which the parsing rules could be temporarily changed. An alternate advantage of such an escape mode is that it could set a flag if you noticed it when you parsed a document, and then you could add a link called something like "download code" that uses a very similar parser that sends back as plain text just the code part of your document. Which is convenient to do on a site where people may discuss code...

Now if you mean to say that you don't have the energy to fix it, that is a different story. One which I might discuss with you at Bill's next party...

Cheers,
Ben
"Career politicians are inherently untrustworthy; if it spends its life buzzing around the outhouse, it\ufffds probably a fly."
- [link|http://www.nationalinterest.org/issues/58/Mead.html|Walter Mead]
New Re: What do you mean not easy to fix?
Currently, the philosophy used here is that what you type in is what gets stored, apart from translation of filtered tags. Line breaks are turned into br tags at display time by Zope built-ins. In other words, if you go back to edit your post, it will look exactly like what you first typed in. One thing I disliked about ezBoard was its penchant for hopelessly mangling stuff that had ezcodes embedded.

In order to fix line breaks in pre tags, I would either need to filter line breaks out of pre tags upon display, or before the data is stored. Doing it at display time is a cpu hit; doing it before the data is stored breaks the previous assertion by changing what the user has typed in.

It is also likely to take me longer than five minutes, which is the threshold I typically use for "is this straightforward or not"... ;-)
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Ah. I would have used a different strategy
I would have done all of my mangling at one place, and then stored both the unedited original and the mangled display code in different fields. Then on display there would be no separate mangling that worked according to different rules.

Cheers,
Ben
"Career politicians are inherently untrustworthy; if it spends its life buzzing around the outhouse, it\ufffds probably a fly."
- [link|http://www.nationalinterest.org/issues/58/Mead.html|Walter Mead]
New That's one of the possible fixes.
As it was, I used the "simplest thing that works" strategy when I was building the site. :-)
But, adding an extra field, adding code for storing the originals, etc. would again take longer than my 5 minute threshold... Also, it would effectively double the amount of storage used for the posts.


Anyway, back to bearding the C++ dragon here at work. I find that C++ quickly saps my will to do any sort of other programming, no matter how fun.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Understood
I don't think that doubling the storage is a big issue. But taking time that you don't want to devote, that I know well. And I also understand intimately how doing something that you don't like can ruin the fun of doing anything vaguely similar...

Cheers,
Ben

PS You are working today? Hope this doesn't become a habit...
"Career politicians are inherently untrustworthy; if it spends its life buzzing around the outhouse, it\ufffds probably a fly."
- [link|http://www.nationalinterest.org/issues/58/Mead.html|Walter Mead]
New Re: Understood
There's a big production drop coming up soon, and I have jury duty in a week. So, I have to plan on not having the time necessary to get everything done.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Good luck then
I don't know how it is for you, but in New York the fastest way through jury duty is just to get on the first straightforward case that you can. (Note that grand juries are usually not straightforward.)

Barring that, well point out that you know what jury nullification is and are not afraid to use it - that is often good cause to get off of a jury. :-)

Cheers,
Ben
"Career politicians are inherently untrustworthy; if it spends its life buzzing around the outhouse, it\ufffds probably a fly."
- [link|http://www.nationalinterest.org/issues/58/Mead.html|Walter Mead]
New Addendum:
Note that the strategy that I employed certainly does not preclude moving to a double storage at a later date. Storing already mangled posts, however, would have made doing so nearly impossible.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Noted
"Career politicians are inherently untrustworthy; if it spends its life buzzing around the outhouse, it\ufffds probably a fly."
- [link|http://www.nationalinterest.org/issues/58/Mead.html|Walter Mead]
     What the hell... is Python broken? - (marlowe) - (15)
         Hmmm... I get the same error - (tjsinclair)
         dunno python but how does it know the diff between an - (boxley)
         How ironic - (ben_tilly) - (10)
             Re: How ironic - (admin) - (9)
                 What do you mean not easy to fix? - (ben_tilly) - (8)
                     Re: What do you mean not easy to fix? - (admin) - (7)
                         Ah. I would have used a different strategy - (ben_tilly) - (6)
                             That's one of the possible fixes. - (admin) - (3)
                                 Understood - (ben_tilly) - (2)
                                     Re: Understood - (admin) - (1)
                                         Good luck then - (ben_tilly)
                             Addendum: - (admin) - (1)
                                 Noted -NT - (ben_tilly)
         Re: What the hell... is Python broken? - (admin) - (1)
             That fixed it. Many thanks. -NT - (marlowe)

Rather in the way of gilding the lily, and not to be encouraged.
239 ms