Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reply wasn't posted; will test new post

168 views
Skip to first unread message

"Peña, Botp"

unread,
Jun 2, 2004, 9:23:23 PM6/2/04
to
Hi ALL:

Pls forgive me in advance.

I posted a reply today but did not see it.

I'll like to see if new post will get posted (diff reply).

I'm on the mailing list.

I just noticed this problem just today.

kind regards -botp


daz

unread,
Jun 2, 2004, 10:48:42 PM6/2/04
to

You're right,
www.ruby-talk.org/102230

... and not alone


Can anyone see this on their News reader?
I see it in ML mail only - No In-Reply-To: or References:, but valid mail.
www.ruby-talk.org/102074

Date: Wed, 2 Jun 2004 11:40:36 +0900
Posted: Wed, 2 Jun 2004 12:40:27 +1000
From: "Mehr, Assaph (Assaph)" <ass...@avaya.com>
Reply-To: ruby...@ruby-lang.org
Subject: Re: A newbie question about path
To: ruby...@ruby-lang.org (ruby-talk ML)
Message-Id: <338366A6D2E2CA4C9DA...@au3010avexu1.global.avaya.com>
X-ML-Name: ruby-talk
X-Mail-Count: 102074


daz

David A. Black

unread,
Jun 2, 2004, 10:56:11 PM6/2/04
to
Hi --

On Thu, 3 Jun 2004, daz wrote:

>
> Peña, Botp wrote:
> > Hi ALL:
> >
> > Pls forgive me in advance.
> >
> > I posted a reply today but did not see it.
> >
> > I'll like to see if new post will get posted (diff reply).
> >
> > I'm on the mailing list.
> >
> > I just noticed this problem just today.
> >
> > kind regards -botp
> >
> >
>
> You're right,
> www.ruby-talk.org/102230
>

> .... and not alone


>
>
> Can anyone see this on their News reader?
> I see it in ML mail only - No In-Reply-To: or References:, but valid mail.
> www.ruby-talk.org/102074

The fix definitely hasn't fixed everything; Austin Ziegler's posts
still aren't going through either :-( It's night-time in Germany but
Dennis is aware of it and hopefully will have some time to work on in
tomorrow.


David

--
David A. Black
dbl...@wobblini.net

David A. Black

unread,
Jun 2, 2004, 11:39:32 PM6/2/04
to
Hi --

On Thu, 3 Jun 2004, daz wrote:

>
> Peña, Botp wrote:
> > Hi ALL:
> >
> > Pls forgive me in advance.
> >
> > I posted a reply today but did not see it.
> >
> > I'll like to see if new post will get posted (diff reply).
> >
> > I'm on the mailing list.
> >
> > I just noticed this problem just today.
> >
> > kind regards -botp
> >
> >
>
> You're right,
> www.ruby-talk.org/102230
>

> .... and not alone


>
>
> Can anyone see this on their News reader?
> I see it in ML mail only - No In-Reply-To: or References:, but valid mail.
> www.ruby-talk.org/102074

The remaining problem seems to be subject lines with "Re:" in them,
when there are no In-Reply-To and References: headers. This
apparently makes the NNTP server flag the message as a followup and
then be unhappy because there's no reference.

(See my subject-mangling of Botp's reply message, which resulted in
the message reaching comp.lang.ruby.)

Dennis has several messages from me, leading up to this conclusion,
for when he gets up tomorrow :-) So hopefully a fix will be
forthcoming soon.

gabriele renzi

unread,
Jun 3, 2004, 5:40:16 AM6/3/04
to
il Thu, 3 Jun 2004 03:48:42 +0100, "daz" <do...@d10.karoo.co.uk> ha
scritto::


>You're right,
>www.ruby-talk.org/102230
>
>... and not alone
>
>
>Can anyone see this on their News reader?

seing this and previous msg from Botp on my newsserver.

But did not see the msg from Botp about String#% till dblack hacked
it.

Dennis Oelkers

unread,
Jun 3, 2004, 10:14:42 AM6/3/04
to
Hello David, ruby-talk, c.l.r.,

David A. Black wrote:
> The remaining problem seems to be subject lines with "Re:" in them,
> when there are no In-Reply-To and References: headers. This
> apparently makes the NNTP server flag the message as a followup and
> then be unhappy because there's no reference.

My further investigations proved that this is really the problem. The
symptoms are the same as with the first problem (I get a 441 - "Followup
without a reference" - when posting the mail to the newsgroup), but this
time the solution is non-trivial. The first case ("In-Reply-To" flag in
header but not "References" flag) was solved by adding the missing flag
by duplicating the message-id of the "In-Reply-To" flag. In this case
both flags are missing. The MUA which was used by Austin Ziegler adds
"Thread-Topic" / "Thread-Index" flags to the header which are supposed
to solve the threading, but this is not applicable to Usenet.

This leads to the conclusion that we have three possible solutions:
- Add an "In-Reply-To"/"References" flag to the header by using the
message-id of THAT mail => the message would appear on c.l.r., but
threading would be broken
- drop the message on the floor at the gateway => ruby-talk / c.l.r.
are inconsistent
- my solution: as mua's are more or less allowed to do whatever they
want my fear is that we get more and more of such borderline cases
so the only solution is that we establish identical posting policies
on both the mailing-list host and the gateway/nntp host we're posting
too. (ML-Maintainers? Any Comments on this one?)

Btw: I won't be able to re-feed the messages which were not posted to
c.l.r. because my suspicion that they get rejected because of their age
became true. Sorry for that, but DAB will probably put them on a http-
accessible location.

Kind regards,
Dennis Oelkers
--
Dennis Oelkers | Webadministration | Zentraleinrichtung Rechenzentrum
TU-Berlin | EN-Gebaeude, K042 | Telefon: 030-314-25029

Key Fingerprint:
A6 7A B6 90 09 56 E8 32 02 40 6B 27 80 17 00 89 61 E7 CA 6F

Robert Klemme

unread,
Jun 3, 2004, 10:32:53 AM6/3/04
to

"Dennis Oelkers" <oel...@zrz.TU-Berlin.DE> schrieb im Newsbeitrag
news:c9nbnn$p3v$1...@mamenchi.zrz.TU-Berlin.DE...

> Hello David, ruby-talk, c.l.r.,
>
> David A. Black wrote:
> > The remaining problem seems to be subject lines with "Re:" in them,
> > when there are no In-Reply-To and References: headers. This
> > apparently makes the NNTP server flag the message as a followup and
> > then be unhappy because there's no reference.
>
> My further investigations proved that this is really the problem. The
> symptoms are the same as with the first problem (I get a 441 - "Followup
> without a reference" - when posting the mail to the newsgroup), but this
> time the solution is non-trivial. The first case ("In-Reply-To" flag in
> header but not "References" flag) was solved by adding the missing flag
> by duplicating the message-id of the "In-Reply-To" flag. In this case
> both flags are missing. The MUA which was used by Austin Ziegler adds
> "Thread-Topic" / "Thread-Index" flags to the header which are supposed
> to solve the threading, but this is not applicable to Usenet.

This is bad news...

> This leads to the conclusion that we have three possible solutions:
> - Add an "In-Reply-To"/"References" flag to the header by using the
> message-id of THAT mail => the message would appear on c.l.r., but
> threading would be broken

That's my favorite. It would be even better if the GW could figure the
correct message id and insert that. But with these headers it seems quite
impractical.

> - drop the message on the floor at the gateway => ruby-talk / c.l.r.
> are inconsistent

Not really a solution, is it?

> - my solution: as mua's are more or less allowed to do whatever they
> want my fear is that we get more and more of such borderline cases
> so the only solution is that we establish identical posting policies
> on both the mailing-list host and the gateway/nntp host we're posting
> too. (ML-Maintainers? Any Comments on this one?)

I guess this is impractical since it sounds like this would rule out some
mail clients. People will not be happy about that.

> Btw: I won't be able to re-feed the messages which were not posted to
> c.l.r. because my suspicion that they get rejected because of their age
> became true. Sorry for that, but DAB will probably put them on a http-
> accessible location.

DAB as in http://www.dab.de/ :-)))

Regards

robert

Dennis Oelkers

unread,
Jun 3, 2004, 10:49:10 AM6/3/04
to
Hello Robert,

Robert Klemme wrote:
>>- Add an "In-Reply-To"/"References" flag to the header by using the
>> message-id of THAT mail => the message would appear on c.l.r., but
>> threading would be broken
>
>
> That's my favorite. It would be even better if the GW could figure the
> correct message id and insert that. But with these headers it seems quite
> impractical.

This is not possible because in cases like this there is no real clue to
which thread/posting this is a reply to (without utilising human
intelligence or complex algorithms of course).

>>- my solution: as mua's are more or less allowed to do whatever they
>> want my fear is that we get more and more of such borderline cases
>> so the only solution is that we establish identical posting policies
>> on both the mailing-list host and the gateway/nntp host we're posting
>> too. (ML-Maintainers? Any Comments on this one?)
>
>
> I guess this is impractical since it sounds like this would rule out some
> mail clients. People will not be happy about that.

The point is that the policy of ruby-talk is quite sleazy whilc
they're very strict for Usenet postings. People can send almost any
garbage to the mailing list if they're subscribed to it and allowed
to post. In my opinion it is the right behaviour to drop any mail
which is not well-formed as soon as possible.

This leads to the conclusion that we'll either have some sort of
inconsistency between those two medias, or we would have to synchronize
the policies up to a certain point where those inconsistencies converge
against 0.

Robert Klemme

unread,
Jun 3, 2004, 11:14:30 AM6/3/04
to

"Dennis Oelkers" <oel...@zrz.TU-Berlin.DE> schrieb im Newsbeitrag
news:c9ndoc$qa5$1...@mamenchi.zrz.TU-Berlin.DE...

> Hello Robert,
>
> Robert Klemme wrote:
> >>- Add an "In-Reply-To"/"References" flag to the header by using the
> >> message-id of THAT mail => the message would appear on c.l.r., but
> >> threading would be broken
> >
> >
> > That's my favorite. It would be even better if the GW could figure
the
> > correct message id and insert that. But with these headers it seems
quite
> > impractical.
>
> This is not possible because in cases like this there is no real clue to
> which thread/posting this is a reply to (without utilising human
> intelligence or complex algorithms of course).

That's what I figured.

> >>- my solution: as mua's are more or less allowed to do whatever they
> >> want my fear is that we get more and more of such borderline cases
> >> so the only solution is that we establish identical posting
policies
> >> on both the mailing-list host and the gateway/nntp host we're
posting
> >> too. (ML-Maintainers? Any Comments on this one?)
> >
> >
> > I guess this is impractical since it sounds like this would rule out
some
> > mail clients. People will not be happy about that.
>
> The point is that the policy of ruby-talk is quite sleazy whilc
> they're very strict for Usenet postings. People can send almost any
> garbage to the mailing list if they're subscribed to it and allowed
> to post. In my opinion it is the right behaviour to drop any mail
> which is not well-formed as soon as possible.

Well, but look at it from a user's perspective who is ignorant of the news
group: he has a mail client and obviously that mail client sends valid
mails (otherwise a whole lot other instances will reject his email). So
he's likely reluctant to change his MUA just because of ruby-talk. I know
people are peculiar when it comes to their favourite mail reader, news
reader, editor or whatever. Just look at the tons of
my-operating-system-is-better-than-yours flame wars...

> This leads to the conclusion that we'll either have some sort of
> inconsistency between those two medias, or we would have to synchronize
> the policies up to a certain point where those inconsistencies converge
> against 0.

I could live with thread inconsistencies. At least we have all messages
of a thread available - even if not properly sorted. As said, that's my
favorite solution.

Kind regards

robert

gabriele renzi

unread,
Jun 3, 2004, 11:34:41 AM6/3/04
to
il Thu, 3 Jun 2004 17:14:30 +0200, "Robert Klemme" <bob....@gmx.net>
ha scritto::

>
>
>I could live with thread inconsistencies. At least we have all messages
>of a thread available - even if not properly sorted. As said, that's my
>favorite solution.
>

fwiw: +1

Carlos

unread,
Jun 3, 2004, 11:26:46 AM6/3/04
to
[Dennis Oelkers <oel...@zrz.TU-Berlin.DE>, 2004-06-03 16.18 CEST]

> Hello David, ruby-talk, c.l.r.,
>
> David A. Black wrote:
> >The remaining problem seems to be subject lines with "Re:" in them,
> >when there are no In-Reply-To and References: headers. This
> >apparently makes the NNTP server flag the message as a followup and
> >then be unhappy because there's no reference.
>
> My further investigations proved that this is really the problem. The
> symptoms are the same as with the first problem (I get a 441 - "Followup
> without a reference" - when posting the mail to the newsgroup), but this
> time the solution is non-trivial. The first case ("In-Reply-To" flag in
> header but not "References" flag) was solved by adding the missing flag
> by duplicating the message-id of the "In-Reply-To" flag. In this case
> both flags are missing. The MUA which was used by Austin Ziegler adds
> "Thread-Topic" / "Thread-Index" flags to the header which are supposed
> to solve the threading, but this is not applicable to Usenet.
>
> This leads to the conclusion that we have three possible solutions:

I suggest another: if the message subject begins with "Re: " or "re: ", but
doesn't have a "References: " header, change the "Re: " to "RE: ".

If it has a "References: " header, but the subject doesn't begin with "Re: "
or "re: ", add "Re: " at the beginning.

I think that should satisfy RFC 850.

David A. Black

unread,
Jun 3, 2004, 2:17:42 PM6/3/04
to
Hi --

I (reluctantly) would opt for the first one, if it's the likeliest way
to get all messages through. Maybe for messages with "Re:" but no
References: you could add X-Missing-Reference header or
something... so that some day if someone figures out a way to fix it
we can easily find them :-)

Thomas Fini Hansen

unread,
Jun 3, 2004, 3:48:06 PM6/3/04
to
On Thu, Jun 03, 2004 at 11:18:38PM +0900, Dennis Oelkers wrote:
> Hello David, ruby-talk, c.l.r.,
>
> David A. Black wrote:
> >The remaining problem seems to be subject lines with "Re:" in them,
> >when there are no In-Reply-To and References: headers. This
> >apparently makes the NNTP server flag the message as a followup and
> >then be unhappy because there's no reference.
>
> My further investigations proved that this is really the problem. The
> symptoms are the same as with the first problem (I get a 441 - "Followup
> without a reference" - when posting the mail to the newsgroup), but this
> time the solution is non-trivial. The first case ("In-Reply-To" flag in
> header but not "References" flag) was solved by adding the missing flag
> by duplicating the message-id of the "In-Reply-To" flag. In this case
> both flags are missing. The MUA which was used by Austin Ziegler adds
> "Thread-Topic" / "Thread-Index" flags to the header which are supposed
> to solve the threading, but this is not applicable to Usenet.

Arg, *bleeping* Microsoft *bleeping* us all again, by ignoring an
established standard, and instead inventing their own...

If they at least had the courtesy to add in the normal headers too,
it's not like it's rocket science, but no..

If someone could figure out what the *bleep* Thread-Index is, it might
be possible, with a lot of state on the gateway, to make an educated
guess at where it was supposed to be in the thread and fake the
appropiate headers.

An alternative would be storing the last message-id for each 'topic',
and just pretend that the MS mails was replies to that. It's cheaper
and and should usually gets the message in the right region.

I'm afraid that the suggestion to remove the 'Re' might actually screw
the only defence we have against the problem, subject matching. I
don't know about other MUAs, but Mutt tries to put the messages
somewhere 'right' in the threads, by using subject matching and
ordering by date. I donno if the munging might pose problematic
there.

> This leads to the conclusion that we have three possible solutions:
> - Add an "In-Reply-To"/"References" flag to the header by using the
> message-id of THAT mail => the message would appear on c.l.r., but
> threading would be broken

I'm not sure how mutt would react to this. Or any other using the same
technique (I believe there is other clients doing the same thing).

> - drop the message on the floor at the gateway => ruby-talk / c.l.r.
> are inconsistent

Not an option, I'd say.

> - my solution: as mua's are more or less allowed to do whatever they
> want my fear is that we get more and more of such borderline cases
> so the only solution is that we establish identical posting policies
> on both the mailing-list host and the gateway/nntp host we're posting
> too. (ML-Maintainers? Any Comments on this one?)

Oh, a world without Outlook.. As much as I'd love to see that, it's
not an option either. Unless someone could come up with a gateway that
fixes posts from Outlook. Secondly, there's webmails out there that
has similar problems.

--
Thomas
be...@system-tnt.dk


Sean O'Dell

unread,
Jun 3, 2004, 4:01:37 PM6/3/04
to
On Thursday 03 June 2004 07:18, Dennis Oelkers wrote:
> David A. Black wrote:
> > The remaining problem seems to be subject lines with "Re:" in them,
> > when there are no In-Reply-To and References: headers. This
> > apparently makes the NNTP server flag the message as a followup and
> > then be unhappy because there's no reference.

Is it possible to mirror the References header item as another header item,
and when References is missing and there is a "Re:" in the subject,
re-construct it from the other header item? It could be Outlook is
deliberately stripping off References and In-Reply-To, but won't strip off
another custom header, such as "X-Gateway-References".

Sean O'Dell


daz

unread,
Jun 3, 2004, 4:08:08 PM6/3/04
to

From: "David A. Black" <dbl...@wobblini.net>

Couldn't it be solved simply by changing params.rb ...

module Params

# name of the news server
NEWS_SERVER = "news.zrz.tu-berlin.de"

# [...]

end

.. such that it refers to a Usenet server rather than an NNTP host
which links with a Usenet news server ?

Can Dennis plug straight into the German Research Network (DFN.DE)
or is that what's imposing the rigid restrictions ?

I'm repeating, but if mirroring works for me through my news service
and not for him then all of these different header permutations are
permissible within Usenet.

I notice that DFN runs a service http://news.individual.net/server.html
which necessarily has safeguards. I was going to see if it was
possible for me to mirror through them but rule one states that the
Sender cannot be anyone except the user. Fair enough.


daz

Thomas Fini Hansen

unread,
Jun 3, 2004, 4:35:24 PM6/3/04
to

When a MUA is replying, it doesn't take the original mail and strip
out stuff, it constructs a new mail.

It is possible to use unique sender addresses from the mailing list,
and then use a DB to look up what message a mail was reply to, and add
the right headers, but it's rather a lot of work for one bad MUA.

*thinks a bit*

Actually, a general solution might prove popular, it's not like
ruby-talk is the only place that has the thread fallout problem.

As a side note, and I'm baseing this on a very small sample, I think
Thunderbird drops the In-Reply-To and References headers if you delete
all quoted material. My theory is that it does that to combat the
people-that-just-replies-to-an-old-thread-to-start-a-new-one-problem,
which is just about as irritating.

I haven't confirmed this though, so if anyone has more data...

--
Thomas
be...@system-tnt.dk


daz

unread,
Jun 3, 2004, 9:04:57 PM6/3/04
to

I wrote:
>
> NEWS_SERVER = "news.zrz.tu-berlin.de"

>
> .. such that it refers to a Usenet server rather than an NNTP host
> which links with a Usenet news server ?
>

Yuurk, that's technical BS !!

What I mean is: is there access to any alternative host which
isn't as restrictive as (closer to Usenet than) the one in use ?

I'm wondering now what the "industry standard" software is
for news hosting and/or whether each service has OEM versions.
At the same time, I haven't the slightest interest :-?


daz

nobu....@softhome.net

unread,
Jun 3, 2004, 9:58:57 PM6/3/04
to
Hi,

At Thu, 3 Jun 2004 23:18:38 +0900,
Dennis Oelkers wrote in [ruby-talk:102281]:


> This leads to the conclusion that we have three possible solutions:
> - Add an "In-Reply-To"/"References" flag to the header by using the
> message-id of THAT mail => the message would appear on c.l.r., but
> threading would be broken
> - drop the message on the floor at the gateway => ruby-talk / c.l.r.
> are inconsistent
> - my solution: as mua's are more or less allowed to do whatever they
> want my fear is that we get more and more of such borderline cases
> so the only solution is that we establish identical posting policies
> on both the mailing-list host and the gateway/nntp host we're posting
> too. (ML-Maintainers? Any Comments on this one?)

Though I'm not a ML maintainer, one possible solution is:

(1) revive subject tag (e.g. [ruby-talk:102281]).

(2) add following hook (originally posted in [ruby-list:27934])
to fml to construct Refereces: from the subject if necessary.

$HEADER_ADD_HOOK = q{
if (!$Envelope{'in-reply-to:'} && !$Envelope{'references:'} &&
$Envelope{'subject:'} =~ /^re:\s*\[ruby-\w+:(d+)\]/i) {
if (open(REF, "$DIR/$1")) {
my $mid, $ref, $inref;
while (<REF>) {
if (/^message-id:\s*(.+)$/i) {
$mid = $1;
} elsif (/^references:\s*(.+)$/i) {
$ref = $1;
$inref = 1;
next;
} elsif ($inref && /^\s/) {
$ref .= $_;
next;
} elsif (/^$/) {
last;
}
$inref = 0;
}
close(REF);
if ($mid) {
($ref = "References: $ref $mid") =~ s/\s+/ /g;
$body .= "In-Reply-To: $mid\n$ref\n";
}
}
}
};

--
Nobu Nakada


Thomas Fini Hansen

unread,
Jun 4, 2004, 5:02:24 AM6/4/04
to
On Fri, Jun 04, 2004 at 10:58:57AM +0900, nobu....@softhome.net wrote:
> Hi,
>
> At Thu, 3 Jun 2004 23:18:38 +0900,
> Dennis Oelkers wrote in [ruby-talk:102281]:
> > This leads to the conclusion that we have three possible solutions:
> > - Add an "In-Reply-To"/"References" flag to the header by using the
> > message-id of THAT mail => the message would appear on c.l.r., but
> > threading would be broken
> > - drop the message on the floor at the gateway => ruby-talk / c.l.r.
> > are inconsistent
> > - my solution: as mua's are more or less allowed to do whatever they
> > want my fear is that we get more and more of such borderline cases
> > so the only solution is that we establish identical posting policies
> > on both the mailing-list host and the gateway/nntp host we're posting
> > too. (ML-Maintainers? Any Comments on this one?)
>
> Though I'm not a ML maintainer, one possible solution is:
>
> (1) revive subject tag (e.g. [ruby-talk:102281]).
>
> (2) add following hook (originally posted in [ruby-list:27934])
> to fml to construct Refereces: from the subject if necessary.

[snip perl]

Brilliant. Have the mailing list fix the messages. As far as I can
see, that should fix the problem, without bad sideeffects..

Now, you wouldn't happen to have a similar patch to Mailman. I could
use that. ;)

--
Thomas
be...@system-tnt.dk


Robert Klemme

unread,
Jun 4, 2004, 5:17:34 AM6/4/04
to

"Thomas Fini Hansen" <be...@system-tnt.dk> schrieb im Newsbeitrag
news:20040603194...@saber.xen.dk...

> Arg, *bleeping* Microsoft *bleeping* us all again, by ignoring an
> established standard, and instead inventing their own...
>
> If they at least had the courtesy to add in the normal headers too,
> it's not like it's rocket science, but no..
>
> If someone could figure out what the *bleep* Thread-Index is, it might
> be possible, with a lot of state on the gateway, to make an educated
> guess at where it was supposed to be in the thread and fake the
> appropiate headers.
>
> An alternative would be storing the last message-id for each 'topic',
> and just pretend that the MS mails was replies to that. It's cheaper
> and and should usually gets the message in the right region.

> > - my solution: as mua's are more or less allowed to do whatever they


> > want my fear is that we get more and more of such borderline cases
> > so the only solution is that we establish identical posting policies
> > on both the mailing-list host and the gateway/nntp host we're
posting
> > too. (ML-Maintainers? Any Comments on this one?)
>
> Oh, a world without Outlook.. As much as I'd love to see that, it's
> not an option either. Unless someone could come up with a gateway that
> fixes posts from Outlook. Secondly, there's webmails out there that
> has similar problems.

You're bashing the wrong pig here. "Outlook" itself does no news (at
least older versions, I'm not fully up to date). Instead it delegated
news handling to "Outlook Express" - a whole differnt piece of software
(which I am using btw). "Outlook Express" does a nice job inserting
"References" headers, which you can verify with this posting.

MS does a lot of evil, but they are not always the ones to blame.

Kind regards

robert

daz

unread,
Jun 5, 2004, 2:03:57 AM6/5/04
to

From: "Dennis Oelkers" <oel...@zrz.TU-Berlin.DE>
Newsgroups: comp.lang.ruby
Sent: Thursday, June 03, 2004 3:49 PM


>
> >>- my solution: as mua's are more or less allowed to do whatever they
> >> want my fear is that we get more and more of such borderline cases
> >> so the only solution is that we establish identical posting policies
> >> on both the mailing-list host and the gateway/nntp host we're posting
> >> too.
> >
> >
>

> The point is that the policy of ruby-talk is quite sleazy whilc
> they're very strict for Usenet postings. People can send almost any
> garbage to the mailing list if they're subscribed to it and allowed
> to post. In my opinion it is the right behaviour to drop any mail
> which is not well-formed as soon as possible.
>
> This leads to the conclusion that we'll either have some sort of
> inconsistency between those two medias, or we would have to synchronize
> the policies up to a certain point where those inconsistencies converge
> against 0.
>

Hi Dennis,

You present a strong defence but I bring some grim prosecution evidence :-|

A news posting[1] by Sean Russell to c.l.ruby via Google which has an
'In-Reply-To:' but no 'References:' header (i.e. "not well-formed")
which made the trip from Sean's den around Usenet through the gateway
and out to the ruby-talk ML[2] like a Ferrari round Nurburgring.

The accusation is that your server at news.zrz.tu-berlin.de is applying
a filter to outgoing news messages which is of no help to the gateway.


> I get a 441 - "Followup without a reference"

from http://www.w3.org/Protocols/rfc977/rfc977.html
---------------------------------------------------------------
RFC 977 - Network News Transfer Protocol
---------------------------------------------------------------

2.4.2. Status Responses

4xx - Command was correct, but couldn't be performed for
some reason.
[...]
x4x - Posting
[...]
x8x - Nonstandard (private implementation) extensions

[...]

4.7.2. Responses

441 posting failed
---------------------------------------------------------------

"Followup without a reference" looks like a private implementation
message and error code 48x is provided for use with such extensions.
IMHO, the missing postings don't fail - they're denied.

Is there any way the g/way can be made exempt from these non-RFC checks ?
(e.g. ignore errors_like_that if source == gateway)


Your endurance is much appreciated.


daz


[1] The headers (before mirroring to ML):
==================================================================================
Path: internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!
nntp.giganews.com!cyclone1.gnilink.net!gnilink.net!news.glorb.com!
postnews1.google.com!not-for-mail
From: "SER" <s...@germane-software.com>
Newsgroups: comp.lang.ruby
Subject: Re: CSV bug?
Date: 18 May 2004 06:51:12 -0700
Organization: http://groups.google.com
Lines: 9
Message-ID: <c8d4cg$q...@odah37.prod.google.com>
NNTP-Posting-Host: odah37.prod.google.com
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1084888273 29869 127.0.0.1 (18 May 2004 13:51:13 GMT)
X-Complaints-To: groups...@google.com
NNTP-Posting-Date: Tue, 18 May 2004 13:51:13 +0000 (UTC)
In-Reply-To: <40A9A7EB...@keynauts.com>
User-Agent: G2/0.1
Xref: number1.nntp.dca.giganews.com comp.lang.ruby:99924
==================================================================================

[2] After mirroring to ML http://blade.nagaokaut.ac.jp/ruby/ruby-talk/100614

Thomas Fini Hansen

unread,
Jun 5, 2004, 7:43:03 AM6/5/04
to
On Fri, Jun 04, 2004 at 06:18:43PM +0900, Robert Klemme wrote:
> "Thomas Fini Hansen" <be...@system-tnt.dk> schrieb im Newsbeitrag
> > Oh, a world without Outlook.. As much as I'd love to see that, it's
> > not an option either. Unless someone could come up with a gateway that
> > fixes posts from Outlook. Secondly, there's webmails out there that
> > has similar problems.
>
> You're bashing the wrong pig here.

Perhaps, but I'm not particularly convinced.

> "Outlook" itself does no news (at least older versions, I'm not
> fully up to date). Instead it delegated news handling to "Outlook
> Express" - a whole differnt piece of software (which I am using
> btw).

Sounds reasonble to me, I'm not entirely up on Outlook either.

> "Outlook Express" does a nice job inserting "References" headers,
> which you can verify with this posting.

Yes, that's OE as a newsreader, but all my ranting was in the context
of O(E) as a mail client. Actually I figure it does a decent job as a
newsreader, but that'a not how most people use it.

But I did a quick investigation, in a post by Austin Ziegler:
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
And it has no In-Reply-To or References.. But the Tread headers. OK,
that's general MS evilness, there's no reason that because Outlook is
attached to an Exchange server, that it can't make proper mails when
sending to external addresses.

Then theres daz
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
And it looks good, but again, he's using it as a mailreader.

Digging through some private mail, I see some more of the Exchange
problem, and some Outlook/OE mail that do have the In-Reply-To, but no
References.

Secondly, I'm suspecting that O/OE is both using the same component to
create the mails:
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165

> MS does a lot of evil, but they are not always the ones to blame.

No, but if the problem *is* related to the References header, then the
fact that Outlook forgets it in regular email, is an issue.

--
Thomas
be...@system-tnt.dk


Austin Ziegler

unread,
Jun 5, 2004, 7:31:37 PM6/5/04
to
Saturday, June 5, 2004, 7:43:03 AM, Thomas Fini Hansen wrote:
> On Fri, Jun 04, 2004 at 06:18:43PM +0900, Robert Klemme wrote:

>> "Outlook" itself does no news (at least older versions, I'm not
>> fully up to date). Instead it delegated news handling to "Outlook
>> Express" - a whole differnt piece of software (which I am using
>> btw).
> Sounds reasonble to me, I'm not entirely up on Outlook either.

There are plugins for Usenet/NNTP handling for Outlook, but it is not
default.

TFH> But I did a quick investigation, in a post by Austin Ziegler:
TFH> X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
TFH> And it has no In-Reply-To or References.. But the Tread headers. OK,
TFH> that's general MS evilness, there's no reason that because Outlook is
TFH> attached to an Exchange server, that it can't make proper mails when
TFH> sending to external addresses.

The problem could be the Exchange server, as its the one that has to
construct the outgoing Internet message from the Outlook format
object.

The problem is that if it is the Exchange server, then it does NOT
have the appropriate information to construct the In-Reply-To header
(References is a News header ONLY).

-austin
--
Best regards,
Austin mailto:aus...@halostatue.ca

Thomas Fini Hansen

unread,
Jun 5, 2004, 8:52:59 PM6/5/04
to
On Sun, Jun 06, 2004 at 08:31:37AM +0900, Austin Ziegler wrote:
> Saturday, June 5, 2004, 7:43:03 AM, Thomas Fini Hansen wrote:
> > Sounds reasonble to me, I'm not entirely up on Outlook either.
> There are plugins for Usenet/NNTP handling for Outlook, but it is not
> default.

And I wont pass any judgement on that's compliance either, as I'm not
exposed to it.

> TFH> But I did a quick investigation, in a post by Austin Ziegler:
> TFH> X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
> TFH> And it has no In-Reply-To or References.. But the Tread headers. OK,
> TFH> that's general MS evilness, there's no reason that because Outlook is
> TFH> attached to an Exchange server, that it can't make proper mails when
> TFH> sending to external addresses.
>
> The problem could be the Exchange server, as its the one that has to
> construct the outgoing Internet message from the Outlook format
> object.
>
> The problem is that if it is the Exchange server, then it does NOT
> have the appropriate information to construct the In-Reply-To header

Yet, it's able to construct the Thread-* headers? It must know
*something*.

> (References is a News header ONLY).

Wrong.

RFC 2822 - Internet Message Format:

# 3.6.4. Identification fields
#
# Though optional, every message SHOULD have a "Message-ID:" field.
# Furthermore, reply messages SHOULD have "In-Reply-To:" and
# "References:" fields as appropriate, as described below.

--
Thomas
be...@system-tnt.dk


Robert Klemme

unread,
Jun 6, 2004, 7:15:33 AM6/6/04
to

"Thomas Fini Hansen" <be...@system-tnt.dk> schrieb im Newsbeitrag
news:2004060511...@saber.xen.dk...

> On Fri, Jun 04, 2004 at 06:18:43PM +0900, Robert Klemme wrote:
> > "Thomas Fini Hansen" <be...@system-tnt.dk> schrieb im Newsbeitrag
> > > Oh, a world without Outlook.. As much as I'd love to see that, it's
> > > not an option either. Unless someone could come up with a gateway that
> > > fixes posts from Outlook. Secondly, there's webmails out there that
> > > has similar problems.
> >
> > You're bashing the wrong pig here.
>
> Perhaps, but I'm not particularly convinced.
>
> > "Outlook" itself does no news (at least older versions, I'm not
> > fully up to date). Instead it delegated news handling to "Outlook
> > Express" - a whole differnt piece of software (which I am using
> > btw).
>
> Sounds reasonble to me, I'm not entirely up on Outlook either.
>
> > "Outlook Express" does a nice job inserting "References" headers,
> > which you can verify with this posting.
>
> Yes, that's OE as a newsreader, but all my ranting was in the context
> of O(E) as a mail client. Actually I figure it does a decent job as a
> newsreader, but that'a not how most people use it.

Ah, ok, I missed that one. Thought you were talking about news.

> But I did a quick investigation, in a post by Austin Ziegler:
> X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
> And it has no In-Reply-To or References.. But the Tread headers. OK,
> that's general MS evilness, there's no reason that because Outlook is
> attached to an Exchange server, that it can't make proper mails when
> sending to external addresses.
>
> Then theres daz
> X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> And it looks good, but again, he's using it as a mailreader.

Sounds like OE is the more mature product for the big wide world of internet
communication. AFAIK Outlook started out as an Exchange Server client, so,
yeah, I'd expect Outlook to be less compliant than OE.

> Digging through some private mail, I see some more of the Exchange
> problem, and some Outlook/OE mail that do have the In-Reply-To, but no
> References.
>
> Secondly, I'm suspecting that O/OE is both using the same component to
> create the mails:
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165

Depends on which part of the message is done by this component. I'd guess
it's rather mime formatting only but no headers.

> > MS does a lot of evil, but they are not always the ones to blame.
>
> No, but if the problem *is* related to the References header, then the
> fact that Outlook forgets it in regular email, is an issue.

Indeed.

Thanks for clearing that up!

robert

daz

unread,
Jun 6, 2004, 1:52:48 PM6/6/04
to

Thomas Fini Hansen wrote:

> Austin Ziegler wrote:
>
> > (References is a News header ONLY).
>
> Wrong.
>
> RFC 2822 - Internet Message Format:
>

RFC 2822 is a not a standard, yet.

From http://www.ietf.org/iesg/1rfc_index.txt (long)

"""
2822 Internet Message Format. P. Resnick, Ed.. April 2001. (Format:
TXT=110695 bytes) (Obsoletes RFC0822) (Status: PROPOSED STANDARD)
"""


A References: header is accepted by:
RFC822: Standard for ARPA Internet Text Messages

and
RFC850: Standard for Interchange of USENET Messages

"... the rule is adopted that all USENET news articles
must be formatted as valid ARPANET mail messages,
according to the ARPANET standard RFC 822."

Our missing ML-> NG messages, after conversion from mail to news by rubygate,
are valid to RFC822/RFC850 standard regardless of the MUA used for posting.


daz

http://www.ruby-talk.org/102444

Thomas Fini Hansen

unread,
Jun 6, 2004, 3:14:58 PM6/6/04
to
On Mon, Jun 07, 2004 at 02:53:39AM +0900, daz wrote:
>
> Thomas Fini Hansen wrote:
> > Austin Ziegler wrote:
> >
> > > (References is a News header ONLY).
> >
> > Wrong.
> >
> > RFC 2822 - Internet Message Format:
> >
>
>
>
> RFC 2822 is a not a standard, yet.
>
> >From http://www.ietf.org/iesg/1rfc_index.txt (long)
>
> """
> 2822 Internet Message Format. P. Resnick, Ed.. April 2001. (Format:
> TXT=110695 bytes) (Obsoletes RFC0822) (Status: PROPOSED STANDARD)
> """
>
>
> A References: header is accepted by:
> RFC822: Standard for ARPA Internet Text Messages

August 13, 1982


# 4.6.3. REFERENCES
#
# The contents of this field identify other correspondence
# which this message references. Note that if message identif-
# iers are used, they must use the msg-id specification format.

The header is mentioned in a >20 year old spec, does contradict the
claim that it's a news header only, doesn't it? Yes, neither RFC says
that it is required, but the same goes for In-Reply-To. Both treat
them pretty much equal, so what anyone has to say about References,
goes for In-Reply-To as well.

> and
> RFC850: Standard for Interchange of USENET Messages
>
> "... the rule is adopted that all USENET news articles
> must be formatted as valid ARPANET mail messages,
> according to the ARPANET standard RFC 822."
>
> Our missing ML-> NG messages, after conversion from mail to news by rubygate,
> are valid to RFC822/RFC850 standard regardless of the MUA used for posting.

That's reverse logic, it only claims that all news messages is valid
mails, not that all mail is valid news. And RFC850 in section 2.1.6
tells us that the References header is *required* when the Subject
header starts with 'Re: '. There's no such requirement for mail
messagees, or Outlook would be in *violation* of the specs, not just
being annoying.

But of course, all of this is just good practice, as no spec requires
either References nor In-Reply-To to be used.

--
Thomas
be...@system-tnt.dk


daz

unread,
Jun 6, 2004, 3:52:57 PM6/6/04
to

Thomas Fini Hansen wrote:
> On Mon, Jun 07, 2004 at 02:53:39AM +0900, daz wrote:
> >
> >
> > A References: header is accepted by:
> > RFC822: Standard for ARPA Internet Text Messages
>
> August 13, 1982
>
>
> The header is mentioned in a >20 year old spec, does contradict the
> claim that it's a news header only, doesn't it?

I think so.


> > and
> > RFC850: Standard for Interchange of USENET Messages
> >
> > "... the rule is adopted that all USENET news articles
> > must be formatted as valid ARPANET mail messages,
> > according to the ARPANET standard RFC 822."
> >
> > Our missing ML-> NG messages, after conversion from mail to news by rubygate,
> > are valid to RFC822/RFC850 standard regardless of the MUA used for posting.
>
> That's reverse logic, it only claims that all news messages is valid
> mails, not that all mail is valid news.

The claim that ruby-talk mail is converted by rubygate to RFC850 news
comes from me, supported by my (and others') empirical evidence.


daz

Thomas Fini Hansen

unread,
Jun 7, 2004, 3:44:45 AM6/7/04
to
On Mon, Jun 07, 2004 at 04:53:40AM +0900, daz wrote:
> > > and
> > > RFC850: Standard for Interchange of USENET Messages
> > >
> > > "... the rule is adopted that all USENET news articles
> > > must be formatted as valid ARPANET mail messages,
> > > according to the ARPANET standard RFC 822."
> > >
> > > Our missing ML-> NG messages, after conversion from mail to news by rubygate,
> > > are valid to RFC822/RFC850 standard regardless of the MUA used for posting.
> >
> > That's reverse logic, it only claims that all news messages is valid
> > mails, not that all mail is valid news.
>
> The claim that ruby-talk mail is converted by rubygate to RFC850 news
> comes from me, supported by my (and others') empirical evidence.


OK, now you lost me. This whole subthread started out at someone
claiming that mails forwarded by rubygate got rejected because of
missing References headers (because they're not following RFC850).

So it's pretty clear (to me at least), that in order for your claim to
be true, rubygate must insert References headers on mails with a
'Re: ' subject which are missing it. Whether it's actually doing that
now, sorta got lost in the noise.

--
Thomas
be...@system-tnt.dk


daz

unread,
Jun 8, 2004, 12:49:46 AM6/8/04
to

Thomas Fini Hansen wrote <before heavy snippage>:

>
> OK, now you lost me.

If this summary helps, please re-read the rest of your message
and see why it would add to the confusion if I tried to
unravel that knot :-)

-----

The reason why some ML->NG messages were/are being dropped is
because the server at news.zrz.tu-berlin.de ("news.zrz") is
rejecting them as being invalid.

As I understand it, David and Dennis were able to reduce the
number of rejections by adding to the headers from within the
g/way software ("rubygate").
David's messages (and some others) are now getting through.
(Dennis had been careful to point out that he hadn't been
expecting 100% success from the change.)

Botp then found that one of his ruby-talk emails didn't get
to c.l.ruby. I noticed another.

- - -

All the various email apps (Mail User Agents - MUAs) around
produce their own sets of "correct" headers.

The gateway (ML->NG direction) converts mail from ruby-talk
to news by filtering out non-news headers and tries to post to
comp.lang.ruby using NNTP via "news.zrz" (the news host).

ruby-talk ML <--> rubygate <--> "news.zrz" <--> Usenet (c.l.ruby)


My observation is that "news.zrz" also has an opinion on which
combinations of outbound headers are "correct" and that the
criteria for "correctness" are stricter than RFC850 for Usenet.
My news host, for example, will accept the exact same
message that "news.zrz" rejects. It appears on Usenet.

- - -

To fix the problems, Dennis has suggested that we could try to
find a formal header structure to smooth over the anomalies.

Indeed, it might be possible to adapt the output from the
many MUAs into a normalised form.

My question is: Is this the best way to proceed ?

The manipulation of headers would be to overcome the "news.zrz"
restrictions; not to make them acceptable to Usenet.
(Usenet would accept them from rubygate *without change*).

- - -

I wouldn't want the gateway to be moved again because the
service at TU-Berlin has appeared to be stable and fast.

At the same time, we can't ask TU-Berlin to change the
software on their news host.

IMHO, we shouldn't be complicating the gateway or ruby-talk
mailer software to satisfy the requirements of our current
service which will not accept all RFC850 news posts.

Proof, from earlier, is on Google, Usenet and ruby-talk archive -
not a wild claim.


--
daz


If things are less clear, there may be some details in
previous postings on this subject which need to be unlearnt.

David A. Black

unread,
Jun 8, 2004, 6:26:28 AM6/8/04
to
Hi --

On Tue, 8 Jun 2004, daz wrote:

> To fix the problems, Dennis has suggested that we could try to
> find a formal header structure to smooth over the anomalies.
>
> Indeed, it might be possible to adapt the output from the
> many MUAs into a normalised form.
>
> My question is: Is this the best way to proceed ?

I think so, not because it is ideal or non-kludgy but because I want
to see all the messages make it through, and, in practical terms, I
think that's by far the highest-percentage way to make that happen.

daz

unread,
Jun 8, 2004, 2:51:29 PM6/8/04
to

By far the highest-percentage way to make that happen would be
to have a news host that doesn't locally filter outbound traffic :-)

It would be non-kludgy, require no changes to either g/w or
fml mailer software and allow 100% ML->NG mirroring -- like it
did before the end of January this year.

Do we know that it's not practical to achieve that, yet?

What software change/update was made on that server around Jan 28th ?

What protection is it trying to offer and to whom?
It can't be for security because day after day it's allowing the g/w
to "spoof with implicit permission" NG posts made up from ML members
emails. But if you try posting a reply without a References: header
... oh, no, sorry, we can't allow that, it might upset someone's
newsreader threading or something... and returns an NNTP error as if
it were an NNTP violation (which it isn't).

Could it have a bug which the authors might be grateful to know about?

Is there a possibility to register the g/w as a privileged user on it?

And other questions that we might ask before coming to a decision
about what would be the best way to proceed.


More cents,

daz

David A. Black

unread,
Jun 8, 2004, 4:01:41 PM6/8/04
to
Hi --

On Wed, 9 Jun 2004, daz wrote:

>
> David A. Black wrote:
> > Hi --
> >
> > On Tue, 8 Jun 2004, daz wrote:
> >
> > > To fix the problems, Dennis has suggested that we could try to
> > > find a formal header structure to smooth over the anomalies.
> > >
> > > Indeed, it might be possible to adapt the output from the
> > > many MUAs into a normalised form.
> > >
> > > My question is: Is this the best way to proceed ?
> >
> > I think so, not because it is ideal or non-kludgy but because I want
> > to see all the messages make it through, and, in practical terms, I
> > think that's by far the highest-percentage way to make that happen.
> >
>
> By far the highest-percentage way to make that happen would be
> to have a news host that doesn't locally filter outbound traffic :-)
>
> It would be non-kludgy, require no changes to either g/w or
> fml mailer software and allow 100% ML->NG mirroring -- like it
> did before the end of January this year.
>
> Do we know that it's not practical to achieve that, yet?
>
> What software change/update was made on that server around Jan 28th ?
>
> What protection is it trying to offer and to whom?
> It can't be for security because day after day it's allowing the g/w
> to "spoof with implicit permission" NG posts made up from ML members
> emails. But if you try posting a reply without a References: header

> .... oh, no, sorry, we can't allow that, it might upset someone's


> newsreader threading or something... and returns an NNTP error as if
> it were an NNTP violation (which it isn't).
>
> Could it have a bug which the authors might be grateful to know about?
>
> Is there a possibility to register the g/w as a privileged user on it?
>
> And other questions that we might ask before coming to a decision
> about what would be the best way to proceed.

All of your ideas and questions are fine. What I'm saing is I'd like
to see something done as quickly as possible -- and, in fact,
something seems to have been done, because I believe Austin Ziegler's
posts are now getting through. If it's just a stopgap measure, so be
it; it's important to stop the gap, and to get as many messages
through as possible while addressing the longer-term or more difficult
questions.

Thomas Fini Hansen

unread,
Jun 9, 2004, 3:20:35 PM6/9/04
to
On Wed, Jun 09, 2004 at 03:53:44AM +0900, daz wrote:
> What protection is it trying to offer and to whom?
> It can't be for security because day after day it's allowing the g/w
> to "spoof with implicit permission" NG posts made up from ML members
> emails. But if you try posting a reply without a References: header
> .... oh, no, sorry, we can't allow that, it might upset someone's

> newsreader threading or something... and returns an NNTP error as if
> it were an NNTP violation (which it isn't).

Doesn't seem much different than a SMTP server returning an SMTP error
when SpamAssassin fires off.

Indeed it's not stricktly a NNTP error, but they're rejecting posts
that violate the USENET RFC, so why doen't we just make the messages
meet the RFC?



> Could it have a bug which the authors might be grateful to know about?

Perhaps it's a feature?

And from your other mail:

> My observation is that "news.zrz" also has an opinion on which
> combinations of outbound headers are "correct" and that the
> criteria for "correctness" are stricter than RFC850 for Usenet.

No matter how many times I read RFC 850 section 2.1.6 (or RFC 1036 for
that matter), I cannot see how this should be 'stricter' in any
way. On the contrary, it's criteria seems to be compliance.

> My news host, for example, will accept the exact same
> message that "news.zrz" rejects. It appears on Usenet.

That just proves that your news host has more lax requirements, not
that the article is in fact valid. To pull the SMTP comparison again,
our mailserver routinely reject mails that violate the specs, yet
another mailserver didn't reject them.

Frankly, I can't see what the big fuzz is about, inject the damn
References header, it's the right thing to do, whether one considers
it 'klunky' or not.

--
Thomas
be...@system-tnt.dk


daz

unread,
Jun 9, 2004, 6:19:03 PM6/9/04
to

Thomas Fini Hansen wrote:
> On Wed, Jun 09, 2004 at 03:53:44AM +0900, daz wrote:
> > newsreader threading or something... and returns an NNTP error as if
> > it were an NNTP violation (which it isn't).
>
> Doesn't seem much different than a SMTP server returning an SMTP error
> when SpamAssassin fires off.

SMTP error or SMTP USER error ?
Does a SpamAssassin rejection get reported as a badly formatted message ?
BTW: I don't need to know.

>
> Indeed it's not stricktly a NNTP error, but they're rejecting posts
> that violate the USENET RFC, so why doen't we just make the messages
> meet the RFC?
>

THE MISSING MESSAGES DO *NOT* VIOLATE USENET RFC.

The *local* news host that we're using doesn't like them
and won't forward them to Usenet.

> > Could it have a bug which the authors might be grateful to know about?
>
> Perhaps it's a feature?
>

I think you're being contrary.
It /could/ be a feature, but it's not a very useful feature to us, is it?
There could be other services using that news host which are getting
their posts dumped and are not aware of it.

> And from your other mail:
>
> > My observation is that "news.zrz" also has an opinion on which
> > combinations of outbound headers are "correct" and that the
> > criteria for "correctness" are stricter than RFC850 for Usenet.
>
> No matter how many times I read RFC 850 section 2.1.6 (or RFC 1036 for
> that matter), I cannot see how this should be 'stricter' in any
> way. On the contrary, it's criteria seems to be compliance.
>

Our messages are already compliant !
"news.zrz" is stricter in that it insists on an RFC-optional header (References:).

> > My news host, for example, will accept the exact same
> > message that "news.zrz" rejects. It appears on Usenet.
>
> That just proves that your news host has more lax requirements, not
> that the article is in fact valid.

What proves validity is that it arrived on Google.
What proof are _you_ looking for ??

> To pull the SMTP comparison again {...}

It's unhelpful. We can talk about NNTP.

>
> Frankly, I can't see what the big fuzz is about, inject the damn
> References header, it's the right thing to do, whether one considers
> it 'klunky' or not.
>

That's been done.

> --
> Thomas
> be...@system-tnt.dk
>
>


If I'm wrong about this, I'm sure someone else will let me know.

daz

David A. Black

unread,
Jun 9, 2004, 11:32:56 PM6/9/04
to
Hi --

On Thu, 10 Jun 2004, daz wrote:

> THE MISSING MESSAGES DO *NOT* VIOLATE USENET RFC.

Here are some excerpts from RFC-1036 (which obsoleted RFC-850):


2.1.4. Subject

[...] If the message is submitted in response to another message
(e.g., is a follow-up) the default subject should begin with the
four characters "Re: ", and the "References" line is required.

[...]

2.2.5 References

[...] User interfaces need not make use of this header, but all
automatically generated follow-ups should generate the "References"
line for the benefit of systems that do use it, and manually
generated follow-ups (e.g., typed in well after the original message
has been printed by the machine) should be encouraged to include
them as well.

Based on this, I would definitely say that "Re: " messages without a
References header are in violation of this RFC.

I think the confusing thing is that the RFCs list References among
"optional headers", when it becomes clear from the more detailed
descriptions above that what they mean by "optional", at least for
this header, is "required for some, but not all, messages". (In other
cases I think it means "completely discretionary", as for example with
Organization.)

daz

unread,
Jun 10, 2004, 1:57:47 AM6/10/04
to


"Request For Comments" ? Makes me wonder if anyone did :-)
(comment, I mean)

Your interpretation, even if it's not correct, should be, IMHO.

References should be listed as "conditional", not "optional" ?

With that small revision, I could withdraw my CAPS-LOCKed statement.

Usenet itself doesn't consider them to be invalid. If "news.zrz"
were to send regardless, they would make it around the Usenet
servers.

-----

According to http://www.ietf.org/iesg/1rfc_index.txt (long),
850 & 1036 are both Status:UNKNOWN so perhaps there is no standard :-)

0850 Standard for interchange of USENET messages. M.R. Horton.
Jun-01-1983. (Format: TXT=43871 bytes) (Obsoleted by RFC1036)
(Status: UNKNOWN)

1036 Standard for interchange of USENET messages. M.R. Horton, R.
Adams. Dec-01-1987. (Format: TXT=46891 bytes) (Obsoletes RFC0850)
(Status: UNKNOWN)

-----

daz

David A. Black

unread,
Jun 10, 2004, 7:24:14 AM6/10/04
to
Hi --

On Thu, 10 Jun 2004, daz wrote:

> David A. Black wrote:
> >
> > Here are some excerpts from RFC-1036 (which obsoleted RFC-850):
> >
> >
> > 2.1.4. Subject
> >
> > [...] If the message is submitted in response to another message
> > (e.g., is a follow-up) the default subject should begin with the
> > four characters "Re: ", and the "References" line is required.
> >
> > [...]
> >
> > 2.2.5 References
> >
> > [...] User interfaces need not make use of this header, but all
> > automatically generated follow-ups should generate the "References"
> > line for the benefit of systems that do use it, and manually
> > generated follow-ups (e.g., typed in well after the original message
> > has been printed by the machine) should be encouraged to include
> > them as well.

[...]

> Usenet itself doesn't consider them to be invalid. If "news.zrz"
> were to send regardless, they would make it around the Usenet
> servers.

In practical terms, though, the spelling out of the requirement in the
RFC probably means that admins who have decided to comply with it are
not likely to be talked out of it, so there's probably not much point
pursuing that particular path. I'm not sure what that leaves us with.
Not much, I fear. I was thinking about maybe having a dummy message,
to which all these stranded messages could be sent as replies. It
would presumably take them out of the threads they were supposed to be
in, but at least it would get them through.

Austin Ziegler

unread,
Jun 10, 2004, 12:36:20 PM6/10/04
to
http://www.faqs.org/rfcs/rfc1036.html
http://www.faqs.org/rfcs/rfc2119.html

dbl...@wobblini.net:


> On Thu, 10 Jun 2004, daz wrote:

>> THE MISSING MESSAGES DO *NOT* VIOLATE USENET RFC.

> Here are some excerpts from RFC-1036 (which obsoleted RFC-850):

> 2.1.4. Subject
> [...] If the message is submitted in response to another message
> (e.g., is a follow-up) the default subject should begin with the
> four characters "Re: ", and the "References" line is required.
> [...]

> 2.2.5 References
> [...] User interfaces need not make use of this header, but all
> automatically generated follow-ups should generate the
> "References" line for the benefit of systems that do use it, and
> manually generated follow-ups (e.g., typed in well after the
> original message has been printed by the machine) should be
> encouraged to include them as well.

> Based on this, I would definitely say that "Re: " messages without


> a References header are in violation of this RFC.

EXCEPT that the statements are "should" (see RFC2119 noted above)
and the header itself is optional. No news software should reject
any message missing the References header, even if best practices
would indicate that the References header is strongly recommended
when "Re: " is present. Both In-Reply-To and References are
*optional* in RFC2822 (the successor to RFC822). The real problem
with RFC1036 is that it (1) requires English (e.g., "Re: ")
backreferences, and (2) attempts to codify usage rules with
technical rules.

So, no, technically, messages missing "References:" are not in
violation of RFC1036.

(And no, there's *nothing* that I can do to force them there in
Outlook.)

-austin
--
austin ziegler * austin....@evault.com


Robert Klemme

unread,
Jun 10, 2004, 12:55:47 PM6/10/04
to

"Austin Ziegler" <Austin....@evault.com> schrieb im Newsbeitrag
news:04232E9E93B2D54FB1D...@ev-exch01.corp.evault.com...

Somehow this thread reminds me of discussions about GPL and LGPL.
Apparently there's still too much room for interpretation in these texts
although they were meant to clarify things...

Regards

robert

David A. Black

unread,
Jun 10, 2004, 3:28:51 PM6/10/04
to
Hi --

According to the above, References is "required", not "strongly
recommended", for follow-ups. Also, this apparently applies to all
follow-ups, while the adding on of "Re: " is only at "should" level.

> So, no, technically, messages missing "References:" are not in
> violation of RFC1036.

They're certainly in violation of parts of it :-) Here's another one:

2.2.5. References

This field lists the Message-ID's of any messages prompting the
submission of this message. It is required for all follow-up
messages, and forbidden when a new subject is raised.

(part of the [...] in my earlier excerpt) If References is truly
optional (that is, can be put or not put on any message), then someone
went to an awful lot of trouble for nothing in writing this paragraph
:-) The "forbidden" part is interesting too, because it also
weighs in on the side of References not being truly optional.

Anyway, I'm not a big fan of this aspect of the document. At best,
burying a requirement inside a paragraph on a header you've already
declared to be optional is a low-percentage way to go about it.

Meanwhile, I think Dennis is implementing the dummy-message thing, so
that any messages without references will be sent through as answers
to a message that exists for that purpose. This is sub-optimal, from
the threading point of view, but at least gets the posts through.

> (And no, there's *nothing* that I can do to force them there in
> Outlook.)

(Don't worry, I wasn't holding my breath :-)

Hal Fulton

unread,
Jun 10, 2004, 7:03:42 PM6/10/04
to
Robert Klemme wrote:
>>
>>So, no, technically, messages missing "References:" are not in
>>violation of RFC1036.
>
>
> Somehow this thread reminds me of discussions about GPL and LGPL.
> Apparently there's still too much room for interpretation in these texts
> although they were meant to clarify things...
>

I think part of the issue is the use of these modal auxiliaries.
(Thanks, Mrs. Sharp, my elementary English teacher who died last
month at 84.)

Some RFCs use "must" for things that are mandatory and "should" for
things that are recommended or suggested. Or something like that.
They also use the terms "may" and "can" (I believe).

I don't know whether all RFCs do this. I don't think they do.

IIRC, the "technolegal" documents like this tend to capitalize
these: "The client MAY do this, it MUST do that..."

But anyway, I haven't a clue what this part of this RFC actually
means.


Hal

daz

unread,
Jun 10, 2004, 7:11:12 PM6/10/04
to

David A. Black wrote:
>
>
> Meanwhile, I think Dennis is implementing the dummy-message thing, so
> that any messages without references will be sent through as answers
> to a message that exists for that purpose. This is sub-optimal, from
> the threading point of view, but at least gets the posts through.
>

First evidence of that is Austin's post that you're replying to :-)

-----------------------------------------------------------------------------
From: "Austin Ziegler"
Newsgroups: comp.lang.ruby
Subject: Re: Reply wasn't posted; will test new post
Date: Fri, 11 Jun 2004 01:36:20 +0900
Message-ID: <04232E9E93B2D54FB1D...@ev-exch01.corp.evault.com>
References: <this_is_a_dummy_message-id@rubygate>
NNTP-Posting-Host: neutron.zrz.tu-berlin.de
X-received-from: This message has been automatically forwarded from ...
X-Mail-Count: 103103
In-Reply-To: <this_is_a_dummy_message-id@rubygate>
-----------------------------------------------------------------------------

I think it would still work without the "In-Reply-To:" duplicate
(if Dennis wants to try that next).

It didn't break my threading but I don't get much trouble with that, anyway.
It /does/ break out of the sub-thread, but that's no different to what
would have happened before the change.
It threaded by Subject:, then Date: which some people might find
/preferable/ on news when reading a complete thread ?


Good signs! -- Watching out for a reply from the OP (Botp Peña).


daz

-----
test reply - please ignore

kind regards -botp
-----


Mark Hubbart

unread,
Jun 10, 2004, 7:22:02 PM6/10/04
to

On Jun 10, 2004, at 4:03 PM, Hal Fulton wrote:

> I think part of the issue is the use of these modal auxiliaries.
> (Thanks, Mrs. Sharp, my elementary English teacher who died last
> month at 84.)
>
> Some RFCs use "must" for things that are mandatory and "should" for
> things that are recommended or suggested. Or something like that.
> They also use the terms "may" and "can" (I believe).
>
> I don't know whether all RFCs do this. I don't think they do.

There's an RFC for that :) Seriously, I'm pretty sure there's an RFC
that defines the meaning of "must", "should", "compliant", etc., that
some RFCs reference.

cheers,
Mark

daz

unread,
Jun 10, 2004, 7:33:02 PM6/10/04
to

Austin posted the link, today.
http://www.faqs.org/rfcs/rfc2119.html

I'm sure Mrs. Sharp didn't check it ;-)


daz

David A. Black

unread,
Jun 10, 2004, 7:36:40 PM6/10/04
to
Hi --

Yes, I think that's RFC2119, the one Austin mentioned. They don't
tell you how to resolve blatant contradictions, unfortunately :-)

"Peña, Botp"

unread,
Jun 13, 2004, 10:50:09 PM6/13/04
to
gabriele renzi [mailto:surren...@rc1.vip.ukl.yahoo.com] wrote:
>
> funny that the referenced page if from Pixel's merd web site,
> and near an year old. I mean, its funny cause I had not saw
> him on this list recently, I wonder wht is the next scripting
> language he moved to :)
>

you are correct. Maybe he is a language collector.

Note btw that Ruby 1.6.7 was compared w Perl 5.6 in the shootout :-))

kind regards -botp


Robert McGovern

unread,
Jun 14, 2004, 8:28:27 AM6/14/04
to
Just to follow up on myself.

The problem described below (i.e ruby segfaulting when running test.rb) has disappeared since I have updated from Cygwin dll version 1.5.9-1 to 1.5.10-3. Indeed I now have a test directory of 79 sub directories and test.rb works every time.

Just realised I had missed out the exclamation mark from my sort command in the examples, doh!

Rob

>>> r...@tarasis.net 05/28/04 02:00pm >>>
(repost of a message sent to ML as it appears to have not made it to
Newsgroup land)

Don't understand why the following segfaults under Cygwin when you
have a
directory of 21 (or more) entries (see example below)

$ cat test.rb
dirs = Dir.glob("*/")
dirs.sort { | x, y | File.new(x).ctime <=> File.new(y).ctime }
dirs.each { | x | puts x + " " + File.new(x).ctime.to_s }

but the following doesn't

$ cat test2.rb
dirs = Dir.glob("*/")
dirs.sort { | x, y | File.ctime(x) <=> File.ctime(y) }
dirs.each { | x | puts x + " " + File.ctime(x).to_s }

Also, why does test.rb produce the following using a native windows
compile.

C:\DEVELO~1\cygwin\home\robertm\test>ruby test.rb
test.rb:2:in `initialize': Permission denied - a/ (Errno::EACCES)
from test.rb:2:in `new'
from test.rb:2
from test.rb:2:in `sort'
from test.rb:2

I tried to capture a back trace but when I ran it through gdb it ran
perfectly.

Some further testing shows that test.rb works fine on Linux (Redhat
6.2 with 1.8.2 stable snapshot 2004-05-24 [i686-linux], unable to
build ruby 1.9.0 at the minute as autoconf to old)

Rob

--------------running test.rb in cygwin-------------------------

$ ruby test.rb
a/ Wed May 26 11:08:00 GMT0:00 2004
b/ Wed May 26 11:08:02 GMT0:00 2004
c/ Wed May 26 11:08:03 GMT0:00 2004
d/ Wed May 26 11:08:04 GMT0:00 2004
e/ Wed May 26 11:08:05 GMT0:00 2004
f/ Wed May 26 11:08:07 GMT0:00 2004
g/ Wed May 26 11:08:22 GMT0:00 2004
h/ Wed May 26 11:08:24 GMT0:00 2004
i/ Wed May 26 11:10:37 GMT0:00 2004
j/ Wed May 26 11:10:42 GMT0:00 2004
k/ Wed May 26 11:10:47 GMT0:00 2004
m/ Wed May 26 11:11:17 GMT0:00 2004
n/ Wed May 26 11:11:20 GMT0:00 2004
o/ Wed May 26 11:11:24 GMT0:00 2004
p/ Wed May 26 11:11:29 GMT0:00 2004
test.rb:3: [BUG] Segmentation fault
ruby 1.9.0 (2004-05-26) [i386-cygwin]

----------------running test2.rb in cygwin-------------------------

robertm@PC126 ~/test
$ ruby test2.rb
a/ Wed May 26 11:08:00 GMT0:00 2004
b/ Wed May 26 11:08:02 GMT0:00 2004
c/ Wed May 26 11:08:03 GMT0:00 2004
d/ Wed May 26 11:08:04 GMT0:00 2004
e/ Wed May 26 11:08:05 GMT0:00 2004
f/ Wed May 26 11:08:07 GMT0:00 2004
g/ Wed May 26 11:08:22 GMT0:00 2004
h/ Wed May 26 11:08:24 GMT0:00 2004
i/ Wed May 26 11:10:37 GMT0:00 2004
j/ Wed May 26 11:10:42 GMT0:00 2004
k/ Wed May 26 11:10:47 GMT0:00 2004
m/ Wed May 26 11:11:17 GMT0:00 2004
n/ Wed May 26 11:11:20 GMT0:00 2004
o/ Wed May 26 11:11:24 GMT0:00 2004
p/ Wed May 26 11:11:29 GMT0:00 2004
q/ Wed May 26 11:11:35 GMT0:00 2004
r/ Wed May 26 11:11:40 GMT0:00 2004
s/ Wed May 26 11:11:44 GMT0:00 2004
t/ Wed May 26 11:11:48 GMT0:00 2004
u/ Wed May 26 11:11:53 GMT0:00 2004
v/ Wed May 26 11:11:57 GMT0:00 2004

---------------Contents of ruby.exe.stackdump------------------

$ less ruby.exe.stackdump

Stack trace:
Frame Function Args
02409D28 77E7AC21 (00000000, F0C43524, 0240F098, 77E94809)
02409E28 6108A370 (000014C8, 02409E40, 02409E58, 610E8D26)
02409EE8 6108A64A (000014C8, 00000006, 02409F18, 6108AA1D)
02409EF8 6108A46C (00000006, 00000400, 02409F28, 0240A364)
02409F18 6108AA1D (61115378, 100102D9, 1009A4E0, 1009A4E6)
0240A358 610882AF (10085A02, 0240F140, 0240A398, 61027459)
0240A368 10085A32 (0000000B, 000000A4, 0240F098, 77E94809)
0240A398 61027459 (000004E8, 0000EA60, 000000A4, 0240A3D4)
0240A4A8 6108D282 (0240F098, 610252CD, 0240A990, 00000000)
0240A8A8 61025327 (0240A990, 0240F098, 0240A9AC, 0240A968)
0240A8CC 77FB172E (0240A990, 0240F098, 0240A9AC, 0240A968)
0240A978 77FB1700 (00000000, 0240A9AC, 0240A990, 0240A9AC)
0240AC78 77F75DBA (00000000, 00000000, 0240ACB8, 6101E154)
0240AC88 610317F4 (00000000, 006F0068, 0065006D, 0072005C)
0240ACB8 6101E154 (0240ACD0, 00000000, 00000000, 00000000)
0240B028 6101DEB8 (10148ED8, 00000000, 00000001, 00000000)
End of stack trace (more stack frames may be present)

----------------Attempt to get stack trace------------------

$ gdb ruby
GNU gdb 2003-09-20-cvs (cygwin-special)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run test.rb
Starting program: /usr/local/bin/ruby.exe test.rb
a/ Wed May 26 11:08:00 GMT0:00 2004
b/ Wed May 26 11:08:02 GMT0:00 2004
c/ Wed May 26 11:08:03 GMT0:00 2004
d/ Wed May 26 11:08:04 GMT0:00 2004
e/ Wed May 26 11:08:05 GMT0:00 2004
f/ Wed May 26 11:08:07 GMT0:00 2004
g/ Wed May 26 11:08:22 GMT0:00 2004
h/ Wed May 26 11:08:24 GMT0:00 2004
i/ Wed May 26 11:10:37 GMT0:00 2004
j/ Wed May 26 11:10:42 GMT0:00 2004
k/ Wed May 26 11:10:47 GMT0:00 2004
m/ Wed May 26 11:11:17 GMT0:00 2004
n/ Wed May 26 11:11:20 GMT0:00 2004
o/ Wed May 26 11:11:24 GMT0:00 2004
p/ Wed May 26 11:11:29 GMT0:00 2004
q/ Wed May 26 11:11:35 GMT0:00 2004
r/ Wed May 26 11:11:40 GMT0:00 2004
s/ Wed May 26 11:11:44 GMT0:00 2004
t/ Wed May 26 11:11:48 GMT0:00 2004
u/ Wed May 26 11:11:53 GMT0:00 2004
v/ Wed May 26 11:11:57 GMT0:00 2004

Program exited normally.
(gdb)


dr...@code-exec.net

unread,
Jul 1, 2004, 2:43:25 PM7/1/04
to
I will be creating very good documents for all of you to use later on.
Right
now I need to get this project done so I can get paid.

My original question was how could I get in the body of SOAP this..

<Getcustomer ..xml stuff>
<name ..xml stuff>High paying cusomters</name>
....122 entries..
<Getcustomer>

The answer to the problem was to implement a special array

myfile.rb --------------------------------------
require 'soap/marshal'

#licensed public domain
class GetCustomer; include SOAP::Marshallable
# must include to marshalize data

# multiple lines for readability
attr_accessor :name
attr_accessor :phoneNo
attr_accessor :otherEntry # wont show because I didn't set it

def initialize(setName,setPhoneNo)
@name, @phoneNo = setName, setPhoneNo
# must set instance variables or soap entries do not show
# the order of assignment matters.
# if @name, @phoneNo = setName, setPhoneNo then
#
# <phoneNo xsi:type="xsd:string">965-7516</phoneNo>
# <name xsi:type="xsd:string">Edward Sirg</name>
#
# if @phoneNo, @name = setPhoneNo, setName
#
# <name xsi:type="xsd:string">Edward Sirg</name>
# <phoneNo xsi:type="xsd:string">965-7516</phoneNo>
end
end

customer = [
GetCustomer.new("John Doe","555-555-555"),
GetCustomer.new("Edward Sirg","965-7516")
]

if $0 == __FILE__
customer.each do |cPerson|
print SOAP::Marshal.marshal(cPerson)
end
end
--------------------------------------------
Output:

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<GetCustomer xmlns:n1="http://www.ruby-lang.org/xmlns/ruby/type/custom"
xsi:type="n1:GetCustomer"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<name xsi:type="xsd:string">John Doe</name>
<phoneNo xsi:type="xsd:string">555-555-555</phoneNo>
</GetCustomer>
</env:Body>
</env:Envelope><?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<GetCustomer xmlns:n1="http://www.ruby-lang.org/xmlns/ruby/type/custom"
xsi:type="n1:GetCustomer"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<name xsi:type="xsd:string">Edward Sirg</name>
<phoneNo xsi:type="xsd:string">965-7516</phoneNo>
</GetCustomer>
</env:Body>

Of course this can be inserted into a SOAP service with ease. Well im out
to
finish my project. Talk later --David Ross


Original Message:
-----------------
From: Eric Schwartz emsc...@pobox.com
Date: Fri, 2 Jul 2004 02:57:49 +0900
To: ruby...@ruby-lang.org (ruby-talk ML)
Subject: Re: SOAP4R API question


"dr...@code-exec.net" <dr...@code-exec.net> writes:
> nm, problem solved :P

Er, how did you solve your problem? For the rest of us who are just
reading about this, can you be more specific?

-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

dr...@code-exec.net

unread,
Jul 4, 2004, 4:07:31 AM7/4/04
to
sorry but your syntax is wrong. Also.. value is a string, so when you eval
after my fix it does this.. $foo = this is a value . that is not right.
you need to put quotes around it like the example below.

id = 'foo'
value = 'This is the value.'
eval "$#{id} = \"#{value}\""
# $foo => "This is a value"
----David Ross

----------------
dross [at] code (-dash-) exec %dot% net

#############################33

irb(main):003:0> eval "$#{id} + ' = ' + #{value}" # -> $id = 'This is the
value.'
SyntaxError: (eval):1:in `irb_binding': compile error
(eval):1: syntax error
$foo + ' = ' + This is the value.
^
(eval):1: syntax error
$foo + ' = ' + This is the value.
^
from (irb):3
from (irb):3
irb(main):004:0> eval "$#{id} + ' = ' + #{value}"
SyntaxError: (eval):1:in `irb_binding': compile error
(eval):1: syntax error
$foo + ' = ' + This is the value.
^
(eval):1: syntax error
$foo + ' = ' + This is the value.
^
from (irb):4
from (irb):4
irb(main):005:0> eval "$#{id} = #{value}"
SyntaxError: (eval):1:in `irb_binding': compile error
(eval):1: syntax error
$foo = This is the value.
^
from (irb):5
from (irb):5
irb(main):006:0> eval "$#{id} = \"#{value}\""
=> "This is the value."
irb(main):007:0> $foo
=> "This is the value."


Original Message:
-----------------
From: Dirk Einecke dirk.e...@gmx.de
Date: Sun, 4 Jul 2004 16:57:44 +0900
To: ruby...@ruby-lang.org (ruby-talk ML)
Subject: Problem with "eval"


Hi.

I've a id and a value. Now I want a variable with id as name and the
content from value as value of this variable. I tryed like this:

id = 'foo'
value = 'This is the value.'
eval "$#{id} + ' = ' + #{value}" # -> $id = 'This is the value.'

But this is not working. What's wrong? Is there a better/faster way?

greetings
Dirk Einecke

Mehr, Assaph (Assaph)

unread,
Jul 9, 2004, 3:31:08 AM7/9/04
to
Take a look at win32-process:
http://raa.ruby-lang.org/project/win32-process/
(part of the win32-utils project).
Take a look also at the builtin Process class
(http://www.ruby-doc.org/docs/rdoc/1.9/classes/Process.html).


-----Original Message-----
From: "bru...@poczta.onet.pl"@80.48.246.196
[mailto:"bru...@poczta.onet.pl"@80.48.246.196] On Behalf Of olek
Sent: Thursday, 1 July 2004 5:13 PM
To: ruby-talk ML
Subject: How to close application on Windows?


Hi,
I need to open some application from ruby on WinXP, get some action
connected to that app. and close it.

thread= Thread.new(0) {
system("abt.exe") # opening my app.
}
sleep(20) # time for start abt.exe
#getting data from abt.exe
system("hptcmd export")
#closing abt.exe - it doesn't work!!!!
Thread.kill(thread)
#abt.exe still active

Maybe I should kill a procces connected to that application so the
application would be closed ....?

Thanks for every advice
Mariusz

David Ross

unread,
Jul 27, 2004, 1:51:14 PM7/27/04
to
>It's called "RPA", and is intended to be the Debian
>or ports of
>Ruby. I'm not sold on that one, either, because
>it's ?not a single
>installation mechanism that developers can use, but
>more of a
>process that also has an installation mechanism. The
>packagers
>aren't necessarily the developers.
You are welcomed to join in packaging. We listen to
the developers and go with what they are needing the
package to do. The point of using rpa is so developers
do not have to worry about packaging.


>I need to do a few things to it (e.g., look for
>collision detection and make sure that we're only
>installing on our ancestral versions if at
>all possible, as well as make an uninstall file).

RPA has collision detection.

> lib/ruby/gems/VERSION/gems/diff-lcs-1.0.1/...
> lib/ruby/gems/VERSION/gems/diff-lcs-1.0.2/...
>This is one of the things that I don't like about
>RubyGems and
>think that RPA will possibly handle better -- but
>I'm not sure.

When you upgrade any software installed, it uninstalls
the old one. It's atomic too cause a snapshot of the
old one is taken before you replace it. That way you
can rollback later if needed.

> I think that RubyGems has to do some work with
> respect to ri integration, but ri is the preferred
> way for handling
> this stuff at least right now. As far as
>manpage/help stuff is
>concerned, there are two ideal choices for option
>handling and.......

rpa-base has ri integration as well.


__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail


Chad Fowler

unread,
Jul 27, 2004, 10:08:44 PM7/27/04
to
On Wed, 28 Jul 2004 02:51:14 +0900, David Ross <dros...@yahoo.com> wrote:
>
> > I think that RubyGems has to do some work with
> > respect to ri integration, but ri is the preferred
> > way for handling
> > this stuff at least right now. As far as
> >manpage/help stuff is
> >concerned, there are two ideal choices for option
> >handling and.......
>
> rpa-base has ri integration as well.
>
>

RubyGems 1.0 will integrate with 'ri' cleanly. It's on the short TODO
list. We've been talking to Dave about how best to do it, and I think
it can be done seamlessly. Just has to bubble to the top of the list.
:)

Chad


Warren Brown

unread,
Jul 28, 2004, 7:37:14 PM7/28/04
to
Lennon,

> there appears to be no standard way of getting an identifier
> for the last row inserted.
> ...
> Does anyone have a general solution for this they've used
> (or seen described/mentioned) elsewhere?

Check out the "IdentifierType = SQL_BEST_ROWID" parameter of the
ODBC SQLSpecialColumns function. The MS reference is here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/ht
m/odbcsqlspecialcolumns.asp. This function returns the column or
columns that uniquely identify each row in a table. These columns are
guaranteed to work in a WHERE clause. If there are no columns that
uniquely identify a row in the table, the function returns an empty
"rowset". This was introduced in ODBC 1.0, so it should be available
everywhere.

I have never used it myself, but it sounds like exactly what you are
looking for.

I'm guessing this will help :o)

- Warren Brown

Robert McGovern

unread,
Aug 2, 2004, 5:35:13 AM8/2/04
to
> > You betcha! I just got my fancy Sony microphone hooked up, so the next
> > videos will also have a voice over. I'll be posting them to the newly
> > established Rails Academy at
> > http://www.rubyonrails.org/show/RailsAcademy
>
> What microphone did you get? I've been considering getting one for a
> while and didn't know which one to get. I have a 12" iBook which I
> don't think has a conventional input port.

Just to say I would be interested to know what the microphone is.

I have a friend that is interested in being all to record some lectures he is attending onto his laptop but wants a decent mike for the job.

Thanks

Rob

David Heinemeier Hansson

unread,
Aug 2, 2004, 5:54:51 AM8/2/04
to
>> What microphone did you get? I've been considering getting one for a
>> while and didn't know which one to get. I have a 12" iBook which I
>> don't think has a conventional input port.
>
> Just to say I would be interested to know what the microphone is.
>
> I have a friend that is interested in being all to record some
> lectures he is attending onto his laptop but wants a decent mike for
> the job.

Sorry to forget about this thred. I got a Sony ECM-MS907. It's not
really optimal for the purpose as it's a handheld mic, so I have to
tuck it into my shirt to hold it up while I use both hands at the
computer. It works better than it sounds, but I'd prefer having either
a headset with a good mic or a TV-mic (you know, one of those
clip-ons).

I've just been doing some tests last night (I promised to do a demo of
TextMate[1] as well) and the sound quality is pretty decent. For
recording lectures, though, you want a room mic. And a pretty strong
one at that. My mic is really meant for interviews, so it's extremely
good at blocking out all of the surrounding sounds. Or everything
coming from the audience.

P.S.: For Macs without audio-in, you want to get the Griffin iMic[2].

[1] http://www.macromates.com
[2] http://www.griffintechnology.com/products/imic/
--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services

Robert McGovern

unread,
Aug 6, 2004, 5:05:41 AM8/6/04
to
> Sorry to forget about this thred. I got a Sony ECM-MS907. It's not
> really optimal for the purpose as it's a handheld mic, so I have to
> tuck it into my shirt to hold it up while I use both hands at the
> computer. It works better than it sounds, but I'd prefer having either
> a headset with a good mic or a TV-mic (you know, one of those
> clip-ons).

+

> For recording lectures, though, you want a room mic.

Thats okay David (I just did the same till emptying my mail box), thanks for taking the time to answer.

Its interesting, I had someone else recommend that mic to me the other day but they thought it would be fine for doing lectures as it can work for either 90 or 120 degree angles. Just to clarify this is the mic you are talking about: http://www.sel.sony.com/SEL/consumer/ss5/home/accessories/microphonesfordigital/ecm-ms907.shtml

Rob


"Peña, Botp"

unread,
Aug 11, 2004, 10:03:57 PM8/11/04
to
From: Lothar Scholz [mailto:mailin...@scriptolutions.com] wrote:

> JL> Know of any more info on this? Is it going to be released free
> JL> online like the other one?
>
> No.
> Please use google to find the huge thread about the new edition.
>

But I really hope the book will be released free (later). Gone will be the
days when we'll just say "go, read the pickaxe"...


Dave Thomas

unread,
Aug 11, 2004, 10:07:14 PM8/11/04
to

On Aug 11, 2004, at 21:03, Peña, Botp wrote:
>
> But I really hope the book will be released free (later). Gone will be
> the
> days when we'll just say "go, read the pickaxe"...

Frankly, so do I. The plan is to release the previous version for free
when each new edition is produced. I'd love to just give it away, but
right now writing books (and publishing them) is paying for food... :)


Cheers

Dave


"Peña, Botp"

unread,
Aug 11, 2004, 11:16:56 PM8/11/04
to
Dave Thomas [mailto:da...@pragprog.com] wrote humbly:

> > But I really hope the book will be released free (later).
> Gone will be
> > the
> > days when we'll just say "go, read the pickaxe"...
>
> Frankly, so do I. The plan is to release the previous version
> for free
> when each new edition is produced. I'd love to just give it away, but
> right now writing books (and publishing them) is paying for food... :)
>

That is great news. Thank you in advance, sir Dave.
I will save to get 2 copies of your book. The other one I will give to my
friends :-)

Once ruby flourishes worldwide, so your book will, too... And money can
cater for everything (not just food)...

Thank you for your support to the ruby community.

>
> Cheers
> Dave
>

kind regards -botp


Warren Brown

unread,
Aug 26, 2004, 4:10:09 PM8/26/04
to
Henry,

> I have noticed that VIM cannot properly color the
> following construct in Ruby:
>
> module MyModule
> def my_method
> foo = [ [ 1, 2 ], [3, 4], [5, 6] ]
> until foo.empty?
> foo.shift.each do |element|
> puts element
> end # colored to match until
> end # colored to match def
> end # colored to match module
> end # not colorized
>
> In the syntax/ruby.vim file, the line after the
> comment "statement with optional *do*", the
> statements here exclude rubyDoBlocks and
> rubyCurlyBlocks from containment. I'm not
> entirely sure why it was set up this way. If I
> change the ruby.vim file to remove this exclusion,
> it still can't properly handle this construct:
>
> module MyModule
> def my_method
> foo = [ [ 1, 2 ], [3, 4], [5, 6] ]
> until foo.empty? do
> foo.shift.each do |element|
> puts element
> end
> end
> end
> end
>
> Does anyone familiar with vim syntax files have
> any idea how to properly correct this?

You were on the right track with removing the "rubyDoBlocks" from
the "contains" list, but the start patterns were not set up to exclude
the optional "do". Replace the line with this line to fix it (I've
broken the line down for sendmail, rebuild it into one line):

syn region rubyOptDoBlock
matchgroup=rubyControl
start="\<for\>"
start="^\s*\(while\|until\)\>\(.*\<do\s*$\)\@!"
start=";\s*\(while\|until\)\>\(.*\<do\s*$\)\@!"hs=s+1
end="\<end\>"
contains=ALLBUT,rubyExprSubst,rubyTodo,rubyCurlyBlock
fold


I hope this helps.

- Warren Brown

"Peña, Botp"

unread,
Aug 31, 2004, 10:49:12 PM8/31/04
to
Markus [mailto:mar...@reality.com] wrote:
[snip]
> Run the following script. It should produce no output (and
> occasionally this is what happens). But frequently, the
> values of a and b differ.
> This should not happen, but it does. I have reproduced the
> problem on several different machines, running several
> different flavors of linux.
>
> 10.times {
> (0x10000..0x20000).each { |i|
> a = (i*-12345) & 0xFFFFFFFF
> b = (i*-12345) & 0xFFFFFFFF
> print "#{i.to_s(2)} #{a.to_s(2)} #{b.to_s(2)}\n" if a != b
> }
> }

I _cannot_ reproduce the problem (running winxp). I have run it and even
looping it 10 times of your 10. Maybe I should loop more?

>
> A similar problem can b shown with bitwise-or
>
>
> 10.times {
> (0x10000..0x20000).each { |i|
> a = (i*-12345) | 0
> b = (i*-12345) | 0
> print "#{i.to_s(2)} #{a.to_s(2)} #{{b.to_s(2)}\n" if a != b

small typo here ^^^^


> }
> }
>
>
> But the problem does NOT occur with bitwise-xor:
>
> 10.times {
> (0x10000..0x20000).each { |i|
> a = (i*-12345) ^ 0
> b = (i*-12345) ^ 0
> print "#{i.to_s(2)} #{a.to_s(2)} #{{b.to_s(2)}\n" if a != b

small typo here ^^^^

> }
> }
> [snip]
> I used GCC 3.2.2 & 3.3.2 when compiling ruby, from otherwise
> unmodified 1.8.1 sources. I looked in CVS and saw no post
> 1.8.1 changes that appeared relevant.
>
> -- Markus (MQR) Roberts
>

kind regards -botp


Markus

unread,
Sep 1, 2004, 1:06:48 AM9/1/04
to
>From what we've been able to determine (and I believe this is the
correct explanation) the problem only arises when garbage collection
occurs in the middle of the Bignum::& operation. If you have more free
memory it may take many more passes for you to see the problem.

Another possibility: what version of Ruby are you running?

The doubled "{{" typo is very odd. It was a single "{" in the original,
but you are correct, the "{" is doubled in the mail as received.

-- Markus

Mehr, Assaph (Assaph)

unread,
Sep 8, 2004, 8:42:45 PM9/8/04
to

>Question: Should String.upcase! work on a segment of a string?
>
>We can assign to a sub-string, so I thought that a bang-method might
also work on a sub-string.
>
> s = 'AA11zz' # define a string
>
> > s[4..5].upcase! # try to change part of it
> => "ZZ" # yeah, ok, the new string is changed,
but...
>
> > s
> => "AA11zz" # the original string wasn't affected
>
> > s[4..5] = s[4..5].upcase # so, do it by-hand
> => "ZZ"
>
> > s # and it's ok
> => "AA11ZZ"
>
>Are there edge cases where this wouldn't be appropriate?

The String#[] method creates a new string object. Any method you send to
it (like upcase) will operatate on it and not on the original object.

Even if we disregard that a lot of existing code relies on it, how would
you differentiate between:
s[4..5].upcase # should that return 'AA11ZZ' as a new object?
s[4..5].upcase! # to match what is returned here?
How could you then get just the 'ZZ' part?


Mehr, Assaph (Assaph)

unread,
Sep 21, 2004, 1:48:17 AM9/21/04
to

> Most but not all bang methods modify the receiver in-place. But that
is
> not the "meaning" of the bang.

> The implication of the bang is that the method is more dangerous or
more of
> a special case. The exit! method, for example, exits without running
the
> exit handlers.

Another, hard learned, lesson is that bang methods may also return
something else than the reciever (e.g. nil to signify no change). This
is needed since you no longer have the original object to compare to.
The non-bang variants return something more appropriate (like a copy of
the reciever).

This effectively means you must never chain method calls past bang
methods.

array.select{|x| x>2 }.sort!.reverse! # very bad and may raise a
# "nil does not respond to
.."
# exception
array = array.select{|x| x>2 }.sort.reverse # the safer way to do this

trans. (T. Onoma)

unread,
Sep 21, 2004, 5:30:15 AM9/21/04
to
On Tuesday 21 September 2004 01:48 am, Mehr, Assaph (Assaph) wrote:
> Another, hard learned, lesson is that bang methods may also return
> something else than the reciever

It would seem to me that this *may* ought to be *must*, albeit it is not
enforced by the language, but I wonder if it could be?

--
( o _ カラチ
// trans.
/ \ tran...@runbox.com

I don't give a damn for a man that can only spell a word one way.
-Mark Twain

tad.b...@bnpparibas.com

unread,
Sep 22, 2004, 9:54:01 AM9/22/04
to

Has anyone been able to visit this site ?
I've been trying for a few days, but keep getting a Gateway Timeout.

http://www.polarhome.com:793/manual/ruby-docs-1.6.8/refm-ja/refm0392.html

Internet
kh...@perfnet.ca - 20/09/2004 02:14


Veuillez répondre à ruby...@ruby-lang.org

Pour : ruby-talk

cc :


Objet : Re: [Q] What does Ruby/DL do?


> of course the problem is the severely lacking documentation.

Found some detailed DL documentation here:

http://www.polarhome.com:793/manual/ruby-docs-1.6.8/refm-ja/refm0392.html


This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.

---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.


ts

unread,
Sep 22, 2004, 9:57:35 AM9/22/04
to

tad.b...@bnpparibas.com

unread,
Sep 22, 2004, 10:06:28 AM9/22/04
to

I still can't reach this site. Don't know what's the problem.

Could someone send me a copy of this doc by email ? Please ?

Thanks,

Tad.


Internet
dec...@moulon.inra.fr - 22/09/2004 15:57


Veuillez répondre à ruby...@ruby-lang.org

Pour : ruby-talk

cc : ruby-talk


Objet : Re: [Q] What does Ruby/DL do?

t>
http://www.polarhome.com:793/manual/ruby-docs-1.6.8/refm-ja/refm0392.html

Work fine.


Guy Decoux


"Peña, Botp"

unread,
Sep 22, 2004, 8:00:48 PM9/22/04
to
why the lucky stiff [mailto:ruby...@whytheluckystiff.net] wrote:
> I could really use some input. Is anyone actually learning
> Ruby through
> the book?

yes. me.
Your book induces my right brain.

> Also: got any ideas for getting it out to people
> who wouldn't
> normally read a manual?
>

maybe insert movies (or at least screenshots) like what mauricio does w his
instiki-based rpa page. Some people (notably non-english) loves to see it in
action first. As they say, action speaks louder than words. Hey, your
pics/cartoons are great too since a pic is worth a thousand.. ;-)

> _why

kind regards -botp


"Peña, Botp"

unread,
Oct 1, 2004, 4:04:20 AM10/1/04
to
Steve Brumbaugh [mailto:spb...@yahoo.com] wrote:

> Hello! I'd like to help translate some of the Japanese
> documentation to English, but am not sure where to begin. I
> found a list of pending translations at
> <http://www.rubygarden.org/ruby?TranslationsInProgress>, but
> the list is quite out of date. I've also searched ruby-talk
> and ruby-list, but didn't immediately find any current information.
>
> Does anybody have suggestions for getting started? I'd hate
> to duplicate the work of other people.

How about translating the japanese books in ruby? -see
http://www.rubycolor.org/maki/txt/rubybooks.html

It would be a noble task. Not only will you be aiding a lot of non-jp
programmers here, you will also be aiding yourself since you can sell these
books (count me as one buyer). I remember sir matz mention that jap books
are very cheap... so I hope you'll sell your translated book cheap too :-)


>
> Best,
> Steve
>

kind regards -botp


Warren Brown

unread,
Oct 4, 2004, 1:25:24 PM10/4/04
to
I *finally* had a chance to play with this. On the premise of "better
late than never"...

My solution is pretty bare-bones, but uses regular expressions to
"simplify" the deck manipulations. I didn't keep the suit/rank notation
of the description except for the jokers being A and B. The rest of the
cards are simply their numeric values. Of course this means that the
"deck" string contains a newline, so all regular expressions involving a
'.' have to be multiline.


module SolitaireCipher
class Keystream
ORDERED_DECK = (("\000".."\063").to_a + ['A','B']).join

def initialize(deck = ORDERED_DECK.dup)
@deck = deck
@original_deck = @deck.dup
end

def reset
@deck = @original_deck.dup
self
end

def next_key
case @deck
when /A\z/ then @deck.sub!(/(.*)A/m,'A\1')
else @deck.sub!(/A(.)/m,'\1A')
end
case @deck
when /B\z/ then @deck.sub!(/(..)(.*)B/m,'\1B\2')
when /B.\z/m then @deck.sub!(/(.)(.*)B/m,'\1B\2')
else @deck.sub!(/B(..)/m,'\1B')
end
@deck.sub!(/(.*)([AB].*[AB])(.*)/m,'\3\2\1')
count = if @deck =~ /[AB]\z/ then 53 else @deck[-1] + 1 end
@deck.sub!(/(.{#{count}})(.*)(.)/m,'\2\1\3')
count = if @deck =~ /\A[AB]/ then 53 else @deck[0] + 1 end
if @deck[count..count] =~ /[AB]/ then next_key else @deck[count] +
1 end
end
end

def self.text2intarray(text)
intarray = []
text.upcase.delete('^A-Z').each_byte { |letter| intarray << (letter
- ?A) }
intarray.fill((?X - ?A), intarray.length, (-intarray.length) % 5)
end

def self.intarray2text(intarray)
text = ''
intarray.each { |int| text += (int + ?A).chr }
text.gsub(/(.....)(?=.)/,'\1 ')
end

def self.encode(plaintext,keystream)
intarray2text(text2intarray(plaintext).map { |int| (int +
keystream.next_key) % 26 })
end

def self.decode(ciphertext,keystream)
intarray2text(text2intarray(ciphertext).map { |int| (int -
keystream.next_key) % 26 })
end
end

keystream = SolitaireCipher::Keystream.new
puts ciphertext = SolitaireCipher.encode("Code in Ruby, live
longer!",keystream)
puts SolitaireCipher.decode(ciphertext,keystream.reset)
puts SolitaireCipher.decode('CLEPK HHNIY CFPWH FDFEH',keystream.reset)
puts SolitaireCipher.decode('ABVAW LWZSY OORYK DUPVH',keystream.reset)


- Warren Brown


James Edward Gray II

unread,
Oct 4, 2004, 1:37:16 PM10/4/04
to
On Oct 4, 2004, at 12:25 PM, Warren Brown wrote:

> I *finally* had a chance to play with this. On the premise of "better
> late than never"...
>
> My solution is pretty bare-bones, but uses regular expressions to
> "simplify" the deck manipulations. I didn't keep the suit/rank
> notation
> of the description except for the jokers being A and B. The rest of
> the
> cards are simply their numeric values. Of course this means that the
> "deck" string contains a newline, so all regular expressions involving
> a
> '.' have to be multiline.

Clever trick. This is similar to how the Perl version works which you
can find on the official site I linked to in the summary. Thanks for
sending this in.

James Edward Gray II

Warren Brown

unread,
Oct 4, 2004, 1:40:07 PM10/4/04
to
Well, I originally was going to go down the "collect by family" road and
make the code deterministic, but for the intended data and intended use,
the nondeterministic approach seemed better. Also, this allows for more
"rules" to be added without changing the basic code. As an example, I
added a rule for "don't allow trades" (where two people are each other's
Santa).

For testing purposes, I added a "display results" flag and a "send
emails" flag. I also added an "override email" address/flag to send all
emails to a single email address (while keeping the "From" and "To"
headers correct).

# Required libraries
require 'net/smtp'


# Configuration settings
NO_FAMILIES = true
NO_TRADES = true
DISPLAY_RESULTS = true
SEND_EMAILS = true
SMTP_SERVER = 'yoursmtpserver.yourisp.com'
FROM_EMAIL = 'yourfr...@yourisp.com'
OVERRIDE_EMAIL = 'your...@yourisp.com' # nil to turn off
EMAIL_BODY = %{%{\
From: "Secret Santa Club" <\#{FROM_EMAIL}>
To: "\#{person.santa}" <\#{person.santa.email}>
Subject: Secret Santa

\#{person.santa.first_name},

You are Secret Santa for \#{person}.
You can email \#{person.first_name} at: mailto:\#{person.email}.
}}


# The Person structure
Person = Struct.new('Person',:first_name,:last_name,:email,:santa)
class Person; def to_s; "#{first_name} #{last_name}"; end; end


# Read people into array
people = []
while line = gets
first_name,last_name,email = line.scan(/(.*) (.*) <(.*)>/).flatten
people << Person.new(first_name,last_name,email,nil)
end

# Make sure a solution is possible
if people.length < (NO_TRADES ? 3 : 2)
puts "No solution possible. Not enough people."
exit(-1)
end
family = Hash.new(0)
people.each { |person| family[person.last_name] += 1 }
biggest_family = family.max { |a,b| a[1] <=> b[1] }
if biggest_family[1] > people.length / 2
puts "No solution possible. Family #{biggest_family[0]} is more than
half" +
" of the group (#{biggest_family[1]} out of #{people.length})."
exit(-1)
end

# Assign each person a random secret santa
pool = people.dup
people.each { |person| person.santa = pool.delete_at(rand(pool.length))
}

# For each person who has an illegal santa, switch with someone else
# Keep looping until no more illegal santas are found
begin
finished = true
people.each do |person|
if (person.santa == person) ||
(NO_FAMILIES && person.last_name == person.santa.last_name) ||
(NO_TRADES && person.santa.santa == person)
finished = false
new_person = people[rand(people.length)]
person.santa,new_person.santa = new_person.santa,person.santa
end
end
end until finished

# Output results
people.each do |person|
if DISPLAY_RESULTS
puts "#{person.santa} is secret santa for #{person}."
end
if SEND_EMAILS
Net::SMTP.start(SMTP_SERVER) do |smtp|
response = smtp.sendmail(
eval(EMAIL_BODY),
FROM_EMAIL,
OVERRIDE_EMAIL || person.santa.email
)
puts "Sent email to #{person.santa.email}, response =
'#{response.chomp}'"
end
end
end

- Warren Brown

Warren Brown

unread,
Oct 13, 2004, 1:39:38 PM10/13/04
to
Wow,

This quiz took a lot longer than an hour or two. I had to pare down
my solution a lot due to time constraints (I was at the Texas State Fair
on Friday, and then I was sick most of the weekend). It seems that the
real point of the puzzle - the routine to subdivide the triangles - was
a small portion of the "figure out where the Vector class is", "read all
of the triangles from the primitives", "call the subdivide routine for
each triangle", "normalize the resulting triangles" setup that had to go
around it. Perhaps future puzzles can try to limit the scope to the
important bits and provide any setup code that is needed. Just my
opinion...

Anyway, I took the approach of calculating the triangles from "top"
to "bottom" and "right" to "left" (directions chosen arbitrarily and
only for descriptive purposes) by calculating the vertices and then
creating the triangles from the vertices. One nice feature of this
approach is that it works for any triangle, not just equilateral ones.

To be a little more explicit, given a triangle ABC:

A
/ \
/ \
/ \
/ \
/ \
/ \
/ \
B---------------C

I find the vertices on the sides AB and AC by simply subdividing the
line segments:


A
/ \
X X
/ \
X X
/ \
X X
/ \
B---------------C


Then I start with the first two "horizontal" lines - the first
passing through A, and the second passing through the next "lower" pair
of vertices:


--------A--------
/ \
------X---X------
/ \
X X
/ \
X X
/ \
B---------------C

I know all of the vertices on both of these lines, so I create the
one and only triangle. Next I move down to the next line and subdivide
that line in half:

A
/ \
------X---X------
/ \
----X---X---X----
/ \
X X
/ \
B---------------C

This gives me all of the vertices for the next three triangles, so I
create them. Next I move down another line and subdivide that line into
thirds:

A
/ \
X---X
/ \ / \
----X---X---X----
/ \
--X---X---X---X--
/ \
B---------------C

This gives me all of the vertices for the next five triangles, so I
create them. I continue moving down one line and subdividing all the
way through the last line (i.e. the one running through BC):

A
/ \
X---X
/ \ / \
X---X---X
/ \ / \ / \
--X---X---X---X--
/ \
B---X---X---X---C

I create the triangles for each "row" by handling the first triangle
specially, then for each "middle" vertex (i.e. not the first or last) on
the bottom line, I create the triangle "above" it, then the triangle
"above and to the right" of it. I create the triangles in the same
"clockwiseness" as the original triangle, so as long as the original
triangles are all ordered correctly, the resulting ones will be too.
Note that the supplied primitives did NOT order the points in all of the
triangles the same. I wanted to write a routine to reorder the given
triangles to make them all clockwise, but I didn't have time.

The routine currently uses a simple algorithm to subdivide each line
segment. I wanted to change this routine to subdivide the *arc* defined
by the two endpoints, but I ran out of time. This would have made the
normalized triangles equal in size instead of being slightly larger
towards the middle.

I also wanted to move everything into spherical coordinates (think
three dimensional polar coordinates), but I didn't have time to do that
either. I think this would have simplified things in some ways (no
normalization required), but made things more complicated near the poles
and near 0/360 degrees.

I didn't have time to write a proper interface to the whole thing
either :o(

Anyway here it is:


require 'matrix'


# A wrapper for the supplied primitives.
module Primitives
SQRT2 = Math.sqrt(2)
SQRT3 = Math.sqrt(3)
TETRA_Q = SQRT2 / 3
TETRA_R = 1.0 / 3
TETRA_S = SQRT2 / SQRT3
TETRA_T = 2 * SQRT2 / 3
GOLDEN_MEAN = (Math.sqrt(5)+1)/2
PRIMITIVES = {
:tetrahedron => {
:points => {
'a' => Vector[ -TETRA_S, -TETRA_Q, -TETRA_R ],
'b' => Vector[ TETRA_S, -TETRA_Q, -TETRA_R ],
'c' => Vector[ 0, TETRA_T, -TETRA_R ],
'd' => Vector[ 0, 0, 1 ]
},
:faces => %w| acb abd adc dbc |
},
:octahedron => {
:points => {
'a' => Vector[ 0, 0, 1 ],
'b' => Vector[ 1, 0, 0 ],
'c' => Vector[ 0, -1, 0 ],
'd' => Vector[ -1, 0, 0 ],
'e' => Vector[ 0, 1, 0 ],
'f' => Vector[ 0, 0, -1 ]
},
:faces => %w| cba dca eda bea def ebf bcf cdf |
},
:icosahedron => {
:points => {
'a' => Vector[ 1, GOLDEN_MEAN, 0 ],
'b' => Vector[ 1, -GOLDEN_MEAN, 0 ],
'c' => Vector[ -1, -GOLDEN_MEAN, 0 ],
'd' => Vector[ -1, GOLDEN_MEAN, 0 ],
'e' => Vector[ GOLDEN_MEAN, 0, 1 ],
'f' => Vector[ -GOLDEN_MEAN, 0, 1 ],
'g' => Vector[ -GOLDEN_MEAN, 0, -1 ],
'h' => Vector[ GOLDEN_MEAN, 0, -1 ],
'i' => Vector[ 0, 1, GOLDEN_MEAN ],
'j' => Vector[ 0, 1, -GOLDEN_MEAN ],
'k' => Vector[ 0, -1, -GOLDEN_MEAN ],
'l' => Vector[ 0, -1, GOLDEN_MEAN ]
},
:faces => %w| iea iad idf ifl ile
eha ajd dgf fcl lbe
ebh ahj djg fgc lcb
khb kjh kgj kcg kbc |
}
}
# Get all triangles from a primitive.
def Primitives.triangles(solid)
hash = PRIMITIVES[solid]
if hash.nil?
puts "Unknown solid '#{solid}'"
exit(-1)
end
points = {}
hash[:points].each do |name,point|
points[name] = point.map { |coord| coord.to_f }
end
triangles = []
hash[:faces].each do |str|
triangles << [
points[str[0,1]],
points[str[1,1]],
points[str[2,1]],
]
end
triangles
end
end


# Subdivide a line into (frequency + 1) segments,
# distributing rounding errors across the line.
# This routine is for demonstration purposes.
# Although simple, it does not distribute
# rounding errors very evenly.
def subdivide_line(line,frequency)
result = [ line[0] ]
(frequency + 1).to_i.downto(2) do |step|
result << result[-1] + ((line[1] - result[-1]) * (1.0 / step.to_f))
end
result << line[1]
end


# Subdivide a triangle into (frequency + 1) ** 2
# congruent sub-triangles.
def subdivide_triangle(triangle,frequency)
steps = frequency.to_i + 1
# Pick two sides.
side_a = [triangle[0],triangle[1]]
side_b = [triangle[0],triangle[2]]
# Calculate the points along those two lines.
vertices_a = subdivide_line(side_a,frequency)
vertices_b = subdivide_line(side_b,frequency)
# Start with triangle closest to the AB intersection.
result = []
vertices_current = nil
vertices_next = [side_a[0]]
# For each step, create the next line closer to (and parallel to)
side_c.
(1..steps).each do |step|
line_next = [vertices_a[step],vertices_b[step]]
# Get all of the vertices along that line.
vertices_current = vertices_next
vertices_next = subdivide_line(line_next,step - 1)
# Add the first triangle.
result << [vertices_current[0],vertices_next[0],vertices_next[1]]
# Add the rest in pairs.
(1...step).each do |line_step|
result << [
vertices_current[line_step - 1],
vertices_next[line_step],
vertices_current[line_step],
]
result << [
vertices_current[line_step],
vertices_next[line_step],
vertices_next[line_step + 1],
]
end
end
result
end


# Normalize all points in the given triangles.
def normalize_triangles(triangles,norm)
triangles.map do |triangle|
triangle.map do |vertex|
vertex * (norm.to_f / vertex.r)
end
end
end


# Sample usage.
triangles = Primitives.triangles(:icosahedron).map do |triangle|
normalize_triangles(subdivide_triangle(triangle,3),1)
end.flatten
p *triangles


- Warren Brown

Dennis Ranke

unread,
Oct 14, 2004, 5:23:50 AM10/14/04
to
On Thu, 14 Oct 2004 02:39:38 +0900, Warren Brown <WBr...@isoft.com> wrote:

> The routine currently uses a simple algorithm to subdivide each line
> segment. I wanted to change this routine to subdivide the *arc* defined
> by the two endpoints, but I ran out of time. This would have made the
> normalized triangles equal in size instead of being slightly larger
> towards the middle.

I did this (see
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/116106)
thinking the same, but had to realise that the triangles are still larger
towards the middle (and have to on a spherical surface).

--
exoticorn/farbrausch

Warren Brown

unread,
Oct 15, 2004, 12:37:10 PM10/15/04
to
Dennis,

> ...but had to realise that the triangles are still larger

> towards the middle (and have to on a spherical surface).

Oh, of course. Subdividing the arc would give the same points as
subdividing the line and projecting the points onto the arc - the angles
formed by the radii would still be the same.

Thanks!

- Warren Brown

Warren Brown

unread,
Oct 18, 2004, 11:16:37 AM10/18/04
to
To me, the real challenge of this quiz was to specify ranges as REs.

I took the challenge of trying to find the smallest RE representation
of a range.

Since the algorithm is complex enough, I decided to ignore certain
issues to keep the algorithm as understandable as possible. For
instance, I decided to not allow leading zeros (although this would be
a simple matter of a "0*" near the front of the RE), not to allow
negative numbers, not to allow underscores in integers, not to allow
other representations of integers (e.g. "0x11", "0o11", "0b11", "?a").
I did decide to keep each parameter in its own capture, so that you
could tell which parameter caused the match.

The algorithm is pretty straight-forward, except for the idea of a
"largest, 'roundest' number in range". Basically, the algorithm works
in two halves. The first half starts at the ones digit and moves up
to higher digits creating bigger and bigger ranges, up to a point. I
named this point "roundest". As an example of this half of the
algorithm, consider how the range 123..999 is expanded into
"12[3-9]|1[3-9]\d|[4-9]\d\d".

After the "roundest" number is reached, the algorithm starts working
back down towards the ones digit creating smaller and smaller ranges.
As an example of this half of the algorithm, consider how the range
100..234 is expanded into "1\d\d|2[0-2]\d|23[0-4]".

There were a surprising number of nooks and crannies to this
algorithm, and I'm not sure I've worked out all of the edge cases, so
I may be posting an update if I find another one.

class Regexp

# Create a namespace for our subroutines.
module Build

# Return the digit at index places from the right for int.
def self.digit(int,index)
(int / 10 ** index) % 10
end

# Build the smallest RE for the digits in the given range.
def self.digit_re(first,last)
case (last - first)
when 0 then first.to_s
when 1 then "[#{first}#{last}]"
when 9 then '\d'
else "[#{first}-#{last}]"
end
end

# Build a RE for first, varying to last at digit index.
def self.int_re(first,last,index)
first.to_s[0...-(index + 1)] +
digit_re(digit(first,index),digit(last,index)) +
'\d' * index
end

# Build a RE for the integers in the given range.
def self.range_re(first,last)
# Find first difference.
res = []
last_len = last.to_s.length
first_diff = 0
last_len.downto(0) do |first_diff|
break if digit(first,first_diff) != digit(last,first_diff)
end
# Find (largest, "roundest" number in range) - 1.
roundest = (last / 10 ** first_diff) * 10 ** first_diff - 1
# Handle everything from first to roundest - 1.
(0...first_diff).each do |index|
next if index < first_diff - 1 &&
digit(roundest,index) - digit(first,index) == 9
res << int_re(first,roundest,index)
first = (first / 10 ** (index + 1) + 1) * 10 ** (index + 1)
break if first > roundest
end
# Handle everything from roundest to last, except last digit.
(first_diff - 1).downto(1) do |index|
next if digit(last,index) == 0
tmp_last = (last / 10 ** index) * 10 ** index - 1
res << int_re(first,tmp_last,index)
first = tmp_last + 1
end
# Last digit is special.
res << int_re(first,last,0)
res.join('|')
end

end

# Build a RE for each argument.
def Regexp.build(*args)
res = []
args.each do |arg|
# If it is an integer, just match it.
if arg.respond_to?(:to_i)
res << arg.to_i
# If it is a range, build the RE.
elsif arg.respond_to?(:exclude_end?)
last = arg.exclude_end? ? arg.last - 1 : arg.last
res << Build::range_re(arg.first,last)
# Otherwise, error
else
$stderr.puts "Unknown argument (#{arg.inspect})."
end
end
# Combine REs.
Regexp.new("\\A(#{res.join(')|(')})\\z")
end
end


# Run some test cases.
p Regexp.build(1..1000000)
p Regexp.build(12345...24680)
p Regexp.build(123..123)
p Regexp.build(10..19)
p Regexp.build(1..102)
p Regexp.build(100..234)
p Regexp.build(1990..2010)
p Regexp.build(1..10,20,30..40,50,60,70..80)


- Warren Brown

James Edward Gray II

unread,
Oct 18, 2004, 2:51:23 PM10/18/04
to
On Oct 18, 2004, at 10:16 AM, Warren Brown wrote:

> To me, the real challenge of this quiz was to specify ranges as
> REs.
>
> I took the challenge of trying to find the smallest RE representation
> of a range.

This brings up an interesting point. What is the smallest regex to
match 1..1_000_000?

^(1000000|[1-9]\d{0,5})$

That's my best guess.

James Edward Gray II

Patrick May

unread,
Oct 31, 2004, 4:56:03 PM10/31/04
to
Francis,

Change line 837 of cgi.rb:

buf = buf.sub(/\A((?:.|\n)*?)(?:#{EOL})?#{boundary}(#{EOL}|--)/n) do

to read:

buf =
buf.sub(/\A((?:.|\n)*?)(?:[\r\n]{1,2})?#{boundary}([\r\n]{1,2}|--)/n) do

and you should be good to go. What's going on is that EOL is
explicitly "\r\n" (as the rfc says it should be). Mac IE is passing
these with some other (MTV Spring?) break instead.

This is fixed in narf too. I should roll out a new release soon.

Cheers,

patrick

Bradley, Todd

unread,
Nov 1, 2004, 11:20:50 AM11/1/04
to
> It seems that the URI is redirected to invalid URI.

That's what I guessed at first, but when I open that URI in either
Firefox or IE, it works fine. Is this a case where the web browsers
interpret the invalid URI, but open-uri will not? When I open that URI
in Firefox, I get redirected to
http://www.infospace.com/home/white-pages/message.htm?kcfg=wpus&otmpl=%2
Fwhite-pages%2Fresults.htm&qfm=n&qk=10&top=1&qname=Bubba+Ray+Jackson&qf=
Bubba&qn=Ray&qs=co&searchtype=citystate&qn=Jackson&qf=Bubba%20Ray&qc=Bro
omfield&MessageType=NoResults which is a valid URI.


Todd.


>
> % ./ruby -ropen-uri -e '
> class << URI
> alias org_parse parse
> def parse(arg)
> p arg
> org_parse(arg)
> end
> end
> open("http://www.infospace.com/home/redirect.htm?formfrom=qsea
> rch&pgtarg=directory&wqhqn=2&qhqn=Bubba+Ray+Jackson&qc=Broomfi
> eld&qs=co")
> '
> "http://www.infospace.com/home/redirect.htm?formfrom=qsearch&p
> gtarg=directory&wqhqn=2&qhqn=Bubba+Ray+Jackson&qc=Broomfield&qs=co"
> "http://www.infospace.com/home/white-pages/validate.htm?kcfg=w
> pus&otmpl=%2Fwhite-pages%2Fresults.htm&qfm=n&qk=10&top=1&qname
> =Bubba+Ray+Jackson&qf=Bubba&qn=Ray&qc=Broomfield&qs=co"
> "http://kevdb.infospace.com/home/white-pages/kevdb?kcfg=wpus&o
> tmpl=%2Fwhite-pages%2Fresults.htm&qfm=n&qk=10&top=1&qname=Bubb
a+Ray+Jackson&qf=Bubba&qn=Ray&qs=co&searchtype=citystate&QN=Jackson&QF=B
ubba Ray&qc=Broomfield"
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/uri/common.rb:432:in
> `split': bad URI(is not URI?):
> http://kevdb.infospace.com/home/white-pages/kevdb?kcfg=wpus&ot
> mpl=%2Fwhite-pages%2Fresults.htm&qfm=n&qk=10&top=1&qname=Bubba
+Ray+Jackson&qf=Bubba&qn=Ray&qs=co&searchtype=citystate&QN=Jackson&QF=Bu
bba Ray&qc=Broomfield (URI::InvalidURIError)
> from
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/uri/common.rb:481:in
> `org_parse'
> from -e:6:in `parse'
> from
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/open-uri.rb:572:in
> `proxy_open'
> from
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/open-uri.rb:525:in
> `direct_open'
> from
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/open-uri.rb:169:in
> `open_loop'
> from
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/open-uri.rb:164:in `catch'
> from
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/open-uri.rb:164:in
> `open_loop'
> from
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/open-uri.rb:134:in `open_uri'
> from
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/open-uri.rb:424:in `open'
> from
> /home/akr/ruby/tmp-ruby/1.8/lib/ruby/1.8/open-uri.rb:85:in `open'
> from -e:9
>
> Since the last URI
>
> http://kevdb.infospace.com/home/white-pages/kevdb?kcfg=wpus&ot
> mpl=%2Fwhite-pages%2Fresults.htm&qfm=n&qk=10&top=1&qname=Bubba
+Ray+Jackson&qf=Bubba&qn=Ray&qs=co&searchtype=citystate&QN=Jackson&QF=Bu
bba Ray&qc=Broomfield contains a space, URI.parse > fails.
> --
> Tanaka Akira
>

"Peña, Botp"

unread,
Nov 2, 2004, 2:24:09 AM11/2/04
to
//From: djbe...@hotmail.com [mailto:djbe...@hotmail.com] wrote:

//
//The Win32Utils Team is happy to announce the release 0.3.0 of
//win32-eventlog.
//

yes! just in time I'm about to monitor the dreaded "allocation error" in
windows.

thank you win32 Team.

kind regards -botp


"Peña, Botp"

unread,
Nov 9, 2004, 7:26:51 PM11/9/04
to
Tobias Luetke [mailto:tobias...@gmail.com] wrote:
//I made some videos explaining how to set rails up on windows :
//
//http://blog.leetsoft.com/about/

cool. thank you for the very clean and comprehensive shots. very
informative.

//
//enjoy

kind regards -botp


Bradley, Todd

unread,
Nov 10, 2004, 10:43:44 AM11/10/04
to
> I'd really like to know more about the limitations that moved
> you off of FreeRIDE.

It was bug 963, which is the same root cause (according to
Laurent) as 946, 947, and 953.


> Amazingly (to me anyway), the One-Click Installer for Windows
> has averaged nearly 150 downloads a day for most of this
> year, and I often wonder who is using, and how its working
> out. Of course, I always hear about the problems, but its
> nice to hear from happy campers as well! :-)

It's working out pretty well for me. 3 or 4 of those down-
loads were from me, since I put it on every Windows PC I use
at work and at home. And for the stuff I've written so far,
using SciTE and running code from there (using F5) has worked
fine. Since I'm still learning, none of my play programs is
complex enough that I can't use poor man debugging (puts
statements).


Todd.


Ivan Vodopiviz

unread,
Nov 10, 2004, 11:08:30 AM11/10/04
to
> > Amazingly (to me anyway), the One-Click Installer for Windows
> > has averaged nearly 150 downloads a day for most of this
> > year, and I often wonder who is using, and how its working
> > out. Of course, I always hear about the problems, but its
> > nice to hear from happy campers as well! :-)

It's working great! I started with programming a few moths ago, but I
discovered Ruby just a week ago. Obviously, I haven't made anything
cool yet but...
The only thing I don't like is FreeRIDE, but it's not a real problem.

--
BlueSteel | | Merkoth


Curt Hibbs

unread,
Nov 10, 2004, 11:25:36 AM11/10/04
to
Bradley, Todd wrote:
>
> > I'd really like to know more about the limitations that moved
> > you off of FreeRIDE.
>
> It was bug 963, which is the same root cause (according to
> Laurent) as 946, 947, and 953.

FYI, these bugs are fix in FreeRIDE 0.8.0 (but the version in the one-click
installer is still FreeRIDE 0.7.0).

> > Amazingly (to me anyway), the One-Click Installer for Windows
> > has averaged nearly 150 downloads a day for most of this
> > year, and I often wonder who is using, and how its working
> > out. Of course, I always hear about the problems, but its
> > nice to hear from happy campers as well! :-)
>
> It's working out pretty well for me. 3 or 4 of those down-
> loads were from me, since I put it on every Windows PC I use
> at work and at home. And for the stuff I've written so far,
> using SciTE and running code from there (using F5) has worked
> fine. Since I'm still learning, none of my play programs is
> complex enough that I can't use poor man debugging (puts
> statements).

Very good... thanks for letting me know.

Curt

Williams, Chris

unread,
Dec 2, 2004, 1:52:01 PM12/2/04
to

> does your rails run on localhost ?

Yes it does.

> Maybe its a permission problem and IE only shows the SVG in its
> trusted localhost domain.

Well every way I'm accessing it, it's on my localhost. I tried lowering
security all the way, and it still doesn't work.

> In any case, rails magic stops after sending data to the browser. This
> basically cannot be a rails problem.

Rails is reporting it has finished in the production.log to tell me its
done. So I suppose you are right.

However, I am only seeing this if I run an .rhtml through the rails
controller. If I have apache serve up the .rhtml with a static reference to
an SVG embedded, it works.

Is it just running really, really slowly through the controller so that the
SVG never draws before I get too impatient (we're taking a number of minutes
here).

Thanks,
Chris


Florian Gross

unread,
Dec 2, 2004, 2:10:46 PM12/2/04
to
Williams, Chris wrote:

> Now, I'm running into something weird. When I try to embed the SVG in the
> rhtml using either the embed or object tags the SVG never actually loads -
> there's a nice big box where the chart should be and IE loads the page for a
> very long time.
>
> When I open the SVG file itself in IE, it displays fine.
> When I create a static html page on my HD that contains the exact same
> contents as the generated .rhtml page, it works fine.
> When I load the same static page through Apache, it works fine.

This sounds a lot like a Content-Type problem. Can you compare the
Content-Type that is used when you do this with a static page on Apache
versus the dynamic one via .rhtml?

Williams, Chris

unread,
Dec 2, 2004, 12:06:28 PM12/2/04
to
I've gone and bit the bullet and used SVG::Graph to generate my charts
within Rails. (The other solutions all seemed to not work on windows or need
perl or something else behind them to generate graphs. I know everyone hates
Windows, but we could use some graphing libraries that work on more than
Linux!)

Now, I'm running into something weird. When I try to embed the SVG in the
rhtml using either the embed or object tags the SVG never actually loads -
there's a nice big box where the chart should be and IE loads the page for a
very long time.

When I open the SVG file itself in IE, it displays fine.
When I create a static html page on my HD that contains the exact same
contents as the generated .rhtml page, it works fine.
When I load the same static page through Apache, it works fine.

Has anyone run into this when trying to embed SVG? Seeing as how I can view
the page fine with static html I'm guessing this is some weird problem with
Rails.

Thanks,
Chris

Tobias Luetke

unread,
Dec 2, 2004, 1:07:35 PM12/2/04
to
does your rails run on localhost ?

Maybe its a permission problem and IE only shows the SVG in its
trusted localhost domain.

In any case, rails magic stops after sending data to the browser. This


basically cannot be a rails problem.

On Fri, 3 Dec 2004 02:06:28 +0900, Williams, Chris
<cawil...@crt.xerox.com> wrote:
> I've gone and bit the bullet and used SVG::Graph to generate my charts
> within Rails. (The other solutions all seemed to not work on windows or need
> perl or something else behind them to generate graphs. I know everyone hates
> Windows, but we could use some graphing libraries that work on more than
> Linux!)
>
> Now, I'm running into something weird. When I try to embed the SVG in the

> .rhtml using either the embed or object tags the SVG never actually loads -


> there's a nice big box where the chart should be and IE loads the page for a
> very long time.
>
> When I open the SVG file itself in IE, it displays fine.
> When I create a static html page on my HD that contains the exact same
> contents as the generated .rhtml page, it works fine.
> When I load the same static page through Apache, it works fine.
>
> Has anyone run into this when trying to embed SVG? Seeing as how I can view
> the page fine with static html I'm guessing this is some weird problem with
> Rails.
>
> Thanks,
> Chris
>
>


--
Tobi
http://blog.leetsoft.com


Tobias Luetke

unread,
Dec 2, 2004, 2:13:45 PM12/2/04
to
try to put the working html in your public dir and request it directly
( or in some other way try to request it over tcp from localhost as
opposite to opening it directly with a file:// moniker.


--
Tobi
http://blog.leetsoft.com


Florian Gross

unread,
Dec 2, 2004, 4:48:37 PM12/2/04
to
Williams, Chris wrote:

> How can I easily [view http headers]? I'm not sure how to check...

http://livehttpheaders.mozdev.org/ if you use Firefox. Or just do a HTTP
request with telnet or dump the HTTP headers with wget -s.

Williams, Chris

unread,
Dec 2, 2004, 3:47:29 PM12/2/04
to
> try to put the working html in your public dir and request it directly
> ( or in some other way try to request it over tcp from localhost as
> opposite to opening it directly with a file:// moniker.

I've accessed it through Apache (pointing at my localhost) and it works
fine.

My ugly hack so far is to generate the SVG with a static name and have a
static webpage point to that. Then I redirect to the static page.

(So the workflow is: user submits form, I generate the new SVG with the
constant name, then I redirect them to the html page that embeds that file)

Chris


Williams, Chris

unread,
Dec 2, 2004, 3:49:23 PM12/2/04
to

> -----Original Message-----
> From: Florian Gross [mailto:fl...@ccan.de]
> Sent: Thursday, December 02, 2004 2:13 PM
> To: ruby...@ruby-lang.org
> Subject: Re: Problem with Rails and embedded SVG?


>
> Williams, Chris wrote:
>
> > Now, I'm running into something weird. When I try to embed the SVG in
> the

> > rhtml using either the embed or object tags the SVG never actually loads
> -
> > there's a nice big box where the chart should be and IE loads the page
> for a
> > very long time.
> >
> > When I open the SVG file itself in IE, it displays fine.
> > When I create a static html page on my HD that contains the exact same
> > contents as the generated .rhtml page, it works fine.
> > When I load the same static page through Apache, it works fine.
>

> This sounds a lot like a Content-Type problem. Can you compare the
> Content-Type that is used when you do this with a static page on Apache
> versus the dynamic one via .rhtml?

How can I easily do this? I'm not sure how to check...

Thanks,
Chris


Jeremy Kemper

unread,
Dec 3, 2004, 12:31:41 PM12/3/04
to
Williams, Chris wrote:
> Well, after some googling I found a suitable hack to embed the SVG.

This might help.

In public/.htaccess:
# Strip .svg extension to mollify IE (put above other rules)
RewriteRule ^(.*)\.svg$ $1

In app/controllers/foo_controller.rb:
class FooController < AbstractApplicationController
def index; end
def chart
send_data generate_svg_chart, :type => 'image/svg+xml'
end
end

In app/views/foo/index.rhtml:
<object type="image/svg+xml" data="<%= url_for :action => 'chart'
%>.svg" width="800" height="600"></object>

Best,
jeremy


Williams, Chris

unread,
Dec 3, 2004, 9:52:22 AM12/3/04
to
> -----Original Message-----
> From: Florian Gross [mailto:fl...@ccan.de]
> Sent: Thursday, December 02, 2004 4:53 PM
> To: ruby...@ruby-lang.org
> Subject: Re: Problem with Rails and embedded SVG?
>
> Williams, Chris wrote:
>

Well, after some googling I found a suitable hack to embed the SVG.

I took a look at the way Tobias Reif is serving his SVG on
http://www.pinkjuice.com/howto/rubysvg/

The only hack that works well (for me) is to write a ruby file which when
executed forces the content-type to "image/svg+xml" and writes out the SVG
graph. So I dynamically create this ruby file and then point to it as the
data source for the object tag.

<object type="image/svg+xml" data="/rails/chart_svg.cgi?IEHack=.svg"


width="800" height="600"></object>

In my case, with rails and my setup, I had to make the ruby file have a .cgi
extension to make it executable.

This works very well, and is much more palatable compared to my previous
hack of keeping a static html page pointing at the SVG file.

Chris


Pena, Botp

unread,
Dec 9, 2004, 8:55:25 PM12/9/04
to
Daigo Tomono [mailto:d_to...@yahoo.co.jp] announced:
//I would like to announce a first release of ruby-sphere: a
//set of libraries and user interfaces to calculate apparent
//positions of stars with a moderate accuracy.

what the.. This_ is too cool. Thanks Daigo!

//Best regards,
//Daigo

kind regards -botp


Jack, Paul

unread,
Dec 15, 2004, 5:28:09 PM12/15/04
to
> BTW, if you're just coming from Ruby to Java, I wrote an
> article on my blog that you might find really useful:
> http://fhwang.net/blog/40.html

Thanks. If nothing else, I've changed to underscores for
my methods...

I've got it all working nicely now. I used Tom's sample
code as a starting point. Thanks, Tom!

The Observable pattern that itsme213 recommended doesn't
seem to fit my needs since I need multiple listeners per
emitter but maybe that's just Java think...

Anyway, here's the code I ended up using, in case anyone
else wants to do this sort of thing. (I tried defining
attr_emitter as "def self.attr_emitter" in the Emitter
module, but that didn't work. It seems like you have
to define these types of things in the Module class?)

Thanks everyone for your help!

-Paul


class Module

def attr_emitter(*attrs)
attrs.each do |attr|
class_eval %{

def #{attr}
@#{attr}
end

def #{attr}=(x)
old = @#{attr}
@#{attr} = x
emit(:#{attr}, old)
end
}
end
end

end


module Emitter

def add_listener(listener)
raise "Invalid listener" unless listener.respond_to? :property_changed
@emitter_listeners = [] unless @emitter_listeners
@emitter_listeners.push(listener)
self
end

def remove_listener(listener)
return self unless @emitter_listeners
@emitter_listeners.delete(listener)
self
end

def emit(sym, oldValue)
return self unless @emitter_listeners
@emitter_listeners.each { |x| x.property_changed(self, sym, oldValue) }
self
end

end


James Edward Gray II

unread,
Dec 15, 2004, 5:33:22 PM12/15/04
to
On Dec 15, 2004, at 4:28 PM, Jack, Paul wrote:

> The Observable pattern that itsme213 recommended doesn't
> seem to fit my needs since I need multiple listeners per
> emitter but maybe that's just Java think...

Observable does support multiple listeners, just FYI.

James Edward Gray II

Joel VanderWerf

unread,
Dec 15, 2004, 5:43:41 PM12/15/04
to

If he's talking about standard ruby Observable, then yes it does support
multiple listeners.

If he's talking about my inaptly named Observable module (shoulda been
ObservableAttrs) then the answer is more subtle.

You can have multiple listeners, as long as the listeners are distinct
object, rather than multiple listener clauses for one object. In fact,
multiple listener clauses for an object are perfectly fine too, as long
as they are listening for distinct patterns. The following example has
two listeners, each with two "when" clauses:

require 'observable'

class Speaker
extend Observable
observable :foo
def run
self.foo = "1"
self.foo = "2"
self.foo = "3"
end
end

class Listener
def initialize(speaker)
speaker.when_foo /2/ do |v|
puts "saw a 2 in #{v.inspect}"
end
speaker.when_foo /\d/ do |v|
puts "saw a digit in #{v.inspect}"
end
# This would override the first when_foo clause
#speaker.when_foo /2/ do |v|
# puts "overridden"
#end
end
end

spk = Speaker.new
lst = [Listener.new(spk), Listener.new(spk)]

spk.run

OUTPUT

saw a digit in "1"
saw a digit in "1"
saw a 2 in "2"
saw a digit in "2"
saw a digit in "2"
saw a 2 in "2"
saw a digit in "3"
saw a digit in "3"


It is loading more messages.
0 new messages