[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

YAML::Syck::Map.children_with_index has a non-useless mode?

Phlip

12/11/2006 4:41:00 AM

Ruboids:

I have some dirt-simple YAML, and I need to traverse the object model
returned by YAML.parse().

So if the top-level object is a Map (corresponding naturally to a native
Hash), how do I get the keys and values?

Try this:

map.children_with_index.each do |kid, key|
p kid
p key
end

The 'key's come out healthy Scalars, but the 'kid's are always nil!
Permutations involving map[key] and map.at(key) also return nil, because
that's what

Oh why can't I get non-nil kids from my map?? (Without using map.value[key]
to go down to the Hash - because I don't want to!)

--
Phlip
http://www.greencheese.u... <-- NOT a blog!!!


2 Answers

Paul Lutus

12/11/2006 5:01:00 AM

0

Phlip wrote:

> Ruboids:
>
> I have some dirt-simple YAML, and I need to traverse the object model
> returned by YAML.parse().
>
> So if the top-level object is a Map (corresponding naturally to a native
> Hash), how do I get the keys and values?
>
> Try this:
>
> map.children_with_index.each do |kid, key|
> p kid
> p key
> end
>
> The 'key's come out healthy Scalars, but the 'kid's are always nil!
> Permutations involving map[key] and map.at(key) also return nil, because
> that's what
>
> Oh why can't I get non-nil kids from my map?? (Without using
> map.value[key] to go down to the Hash - because I don't want to!)

The problem might lie in your code, or your YAML database. The parts that
are not in your message.

--
Paul Lutus
http://www.ara...

maready

3/26/2012 6:41:00 PM

0

On Mar 23, 2:50 pm, rkhalona <rkhal...@hotmail.com> wrote:
> On Mar 22, 2:43 pm, "Dontaitchic...@aol.com" <Dontaitchic...@aol.com>
> wrote:
>
>
>
> > On Mar 22, 7:32 am, td <tomdedea...@mac.com> wrote:
>
> > > On Mar 22, 7:22 am, Tassilo <david7ga...@aol.com> wrote:
>
> > > > A handful of Rosbaud performances were included in one of those
> > > > massive compilations of live recordings of Concertgebouw material
> > > > issued by the orchestra itself:
>
> > > > ANTHOLOGY OF THE ROYAL CONCERTGEBOUW ORCHESTRA - Volume III
> > > > RCO LIVE RCO 05001 (14 CDS)
> > > > SCHUBERT: Symphony No. 4 in C minor (Rosbaud/Feb. 29 [sic], 1961)
> > > > BERG: Three Orchestral Pieces (Rosbaud/Feb. 1, 1961)
> > > > KETTING: Symphony No. 1 (Rosbaud/Feb. 1, 1961)
> > > > DALLAPICCOLA: Variations for Orchestra (Rosbaud/Feb. 29, 1961)
>
> > > What seems clear from all of the the posts above is that Rosbaud's
> > > predilection for avant-garde music doomed his chances of taking his
> > > (rightful?) place  among the great conductors of his day.
>
> > > Yes, he did conduct Mozart, Haydn, Beethoven, Schubert et al., at
> > > least that is the conclusion one draws from the list of composers he
> > > recorded or was recorded conducting "live" and issued on a vast array
> > > of fly-by-night labels, mostly pirates. But what is also true is that
> > > he could spit marbles with the best of them and major record companies
> > > - EMI, DG, Decca, RCA Victor, Columbia - would not take on such a
> > > musician for fear of poor sales. Ditto the major orchestral ensembles.
> > > He could "guest" with the biggies - Don Tait speaks enticingly of his
> > > concerts in Chicago, for example - but the Music Director positions in
> > > these orchestras would simply not be available to him.
>
> > > I make no judgment about Rosbaud's musical tastes or the decisions he
> > > took which affected his career in this way. But it is clear that he
> > > was considered by the musical establishment to be out of the
> > > mainstream and therefore just beyond the pale. It is also possible
> > > that he was uncompromising in his tastes.
>
> >   That is incorrect on several counts.
>
> >   First, when it became clear around 1961 that Fritz Reiner's health
> > had been so damaged after autumn 1960 that he could not continue as
> > the CSO's Music Director, the unanimous choice of the CSO musicians to
> > succeed him was Hans Rosbaud. That post was his, if we'd been asked.
> > And I know that Chicagoans would have backed it up. I have been told
> > about a meeting at which the CSO's then-manager Seymour Raven told the
> > musicians that Rosbaud would definitely get the position but -- he was
> > seriously ill and could not accept it. Indeed, the trumpeter Bud
> > Herseth (who like all CSO musicians worshipped Rosbaud) told me he'd
> > seen Rosbaud without a high collar and that his neck had ghastly
> > cancerous ulcers. The cancer killed him in late 1963.  He would never
> > have taken the CSO position.
>
> >   Rosbaud didn't program avant-garde things regularly at all.
> > Occasionally, yes. But I heard him conduct Andrea Gabrieli, Vivaldi,
> > Haydn, Mozart, Beethoven, Schubert, a Schumann 2 for the ages,
> > Respighi, Faure, Roussel, Ravel...plus Webern and Berg. His programs
> > were stunningly varied. As was his mastery.
>
> >   Don Tait
>
> There is another very simple reason why Rosbaud may not have wanted a
> music director post with a major orchestra that
> involved administration duties and the usual political BS: the man was
> a musical technocrat, besides being an intellectual who was
> interested in many other subjects, as Boulez, Evans and others amply
> document.  He was absorbed with music and loved it.
> From everything I have read and heard about Rosbaud, I conclude he was
> a wise man.  Playing the jet set conductor was probably
> not his cup of tea and any chance that he may have been enticed to
> play such a creature was certainly denied by his illness.
> When one pages through Evans' listing of his radio recordings (the
> vast majority of which remain in the vaults) one is simply
> flabbergasted
> at the quantity, variety and range of the music this man knew and
> conducted.  It is almost superhuman.
> The fact that he did most of it with such quality makes it even more
> unbelievable.
>
> Here's a wild dream:  Someone comes along, digs out most or all of the
> recordings in the vaults in good condition and releases a Rosbaud
> Edition.  Perhaps there won't be many buyers, but I would be first in
> line.
>
> RK
>
> RK

It doesn't seem like such a far-fetched proposition at all --- I'm
sure that Hanssler, Tahra, Music and Arts will issue many things from
the SWF Baden-Baden archives in the future, maybe a box, hopefully his
nearly-complete Bruckner cycle (he didn't record Nos 0 and 1). As for
another poster's insinuation that the SWF orchestra under Rosbaud,
Bour and Gielen was a "second-string" ensemble ---- give me a break!