POV-Ray : Newsgroups : povray.off-topic : 10 things to use a Min Heap for Server Time
7 Sep 2024 17:14:40 EDT (-0400)
  10 things to use a Min Heap for (Message 79 to 88 of 108)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Phil Cook
Subject: Re: 10 things to use a Min Heap for
Date: 23 Jun 2008 10:44:20
Message: <op.uc7hzon0c3xi7v@news.povray.org>
And lo on Mon, 23 Jun 2008 15:30:33 +0100, Invisible <voi### [at] devnull> did  
spake, saying:

> Why does everybody hate Milton Keynes so much?
>
> Is it the concrete cows?
>
>
>
> ...it is, isn't it?

Yep :-P

Nah I think it's just one of those long-standing jokes. I think it stems  
 from the fact that it was designed to be a great new town and the  
government of the day hyped it up and, as with so much, hype didn't meet  
reality. After that the great English past-time kicked in and it's become  
traditional.

-- 
Phil Cook

--
I once tried to be apathetic, but I just couldn't be bothered
http://flipc.blogspot.com


Post a reply to this message

From: Invisible
Subject: Re: 10 things to use a Min Heap for
Date: 23 Jun 2008 10:47:32
Message: <485fb784$1@news.povray.org>
Phil Cook wrote:

> Nah I think it's just one of those long-standing jokes. I think it stems 
> from the fact that it was designed to be a great new town and the 
> government of the day hyped it up and, as with so much, hype didn't meet 
> reality. After that the great English past-time kicked in and it's 
> become traditional.

Mmm, interesting. Most people I meet have never *heard* of Milton 
Keynes. And the ones who have never have anything nice to say about it. 
Heck, even the people who live there never seem to say anything nice 
about it...

Personally, I wouldn't want to live anywhere else.

[Well, unless anybody knows where I can find a Utopian paradise where 
everything is perfect?]

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: 10 things to use a Min Heap for
Date: 23 Jun 2008 12:12:18
Message: <485fcb62@news.povray.org>
Doctor John wrote:
> Dirty? Only in the same way that many large cities are dirty.

One of the things I noticed about China was that everywhere was dirty. 
And I don't mean litter and pollution, but rather dirt, like what you 
grow trees in. Like the whole country was built on top of slowly-drying 
mud or something. It was kind of weird. Not disgusting, any more than 
getting sand on you at the beach is disgusting. I just never encountered 
that sort of thing before.

-- 
Darren New / San Diego, CA, USA (PST)
  Helpful housekeeping hints:
   Check your feather pillows for holes
    before putting them in the washing machine.


Post a reply to this message

From: Darren New
Subject: Re: (Tainted)
Date: 23 Jun 2008 12:21:58
Message: <485fcda6$1@news.povray.org>
Invisible wrote:
>>> True, but there shouldn't be very many of those.
>>
>> It's still bad engineering. :-)
> 
> Abstract it out then. Make it a seperate function.

Of course. The problem there is that to make a complex control flow, you 
wind up with a dozen or two functions that really don't have an 
independent function, and they're all at the top-level of code. (You 
can't nest functions in Erlang, altho you can nest lambdas (of course), 
and the syntax is verbose enough you wind up with a dozen indents if you 
do something truly functional-style.)

I.e., it's bad engineering.

>> Say I want a counter for how many times I call X. That goes in the 
>> record, and X increments it.  But it also gets passed to Y and Z.
> 
> And this is bad because...?

It's bad engineering, the same way global variables are bad engineering. 
If the structure comes back with things changed that shouldn't have 
been, you have way more places to look. The whole point of "functional" 
is to limit the number of places you have to look to see what went wrong.

>> It's still not obvious when you're actually using the control flow 
>> (i.e., the program counter) as part of your state how the control 
>> flows. That's probably my problem - still used to using the PC as part 
>> of the program state.
> 
> OK - well that's a fairly low-level way of thinking about flow control.

I'd more say it's thinking about control flow at all, rather than 
thinking about "meaning" or some such. It's more that I'm trying to 
describe it in a way that makes clear what I'm talking about than it is 
I normally think of the PC as "part of the global state".

I often, however, say "at this point in the program, I know the 
following things are the case..."  As in, "by the time I leave this 
loop, I know the loop condition is false, so I can count on the index 
not pointing to a whitespace character" or some such.

>> Part of the problem is that you're supposed to crash out in Erlang if 
>> you get an error. So saying "did you read an integer" at all is a mess.
> 
> Yeah, Haskell's default compiler-generated stuff for parsing expressions 
> assumes the program will just crash if the string isn't valid. 

It's not really that in Erlang. It's more that since it's dynamically 
typed, trying to convert an arbitrary return from a read (which may 
include end-of-file or some other read error) into an integer requires 
a layer of catching of errors. Not all that unusual, but yet another 
level of nesting.

> Fortunately, you can use Parsec to do "real" parsing with actual error 
> messages and so forth if necessary.

I would consider something like that overkill for "read an integer from 
this file stream".

As I work on more projects with less interactivity and control flow, 
it's getting easier. Stuff where I'm just flogging files, or portions 
thereof, aren't excessively difficult. Maybe I'll go back and rewrite 
the interactive part of the program again and see if I've figured it out 
more.

(Another part of the problem, I suspect, is how I structured it. I'm 
trying to make it accessible in a variety of ways, in the sense that I 
rewrite as little as possible for different human languages, socket vs 
console vs web page, etc etc.)

-- 
Darren New / San Diego, CA, USA (PST)
  Helpful housekeeping hints:
   Check your feather pillows for holes
    before putting them in the washing machine.


Post a reply to this message

From: Warp
Subject: Re: 10 things to use a Min Heap for
Date: 23 Jun 2008 13:06:38
Message: <485fd81e@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> One of the things I noticed about China was that everywhere was dirty. 
> And I don't mean litter and pollution, but rather dirt, like what you 
> grow trees in. Like the whole country was built on top of slowly-drying 
> mud or something. It was kind of weird. Not disgusting, any more than 
> getting sand on you at the beach is disgusting. I just never encountered 
> that sort of thing before.

  "You call it dirt. I call it a healthy layer of earth." -- Toph Bei Fong

-- 
                                                          - Warp


Post a reply to this message

From: Gail Shaw
Subject: Re: 10 things to use a Min Heap for
Date: 23 Jun 2008 13:43:36
Message: <485fe0c8@news.povray.org>
"Invisible" <voi### [at] devnull> wrote in message
news:485f59bf$1@news.povray.org...

>
> It's old, dirty, overcrowded, expensive, and it looks like the decaying
> ruins of a fallen civilisation. What's to like?

WT??????

Last time I visited (last year), it was cleaner than JHB and had a lot less
traffic that JHB (probably comes from having public transport that's
actually usable).
Suppose that doesn't say much about JHB.
I didn't see a single thing that looked like it was decaying, though it did
look like about a quarter of the buildings were been renovated at the time.

Isn't it also the place with 80% or so of the IT work in England?


Post a reply to this message

From: Doctor John
Subject: Re: 10 things to use a Min Heap for
Date: 23 Jun 2008 13:58:31
Message: <485fe447$1@news.povray.org>
Gail Shaw wrote:
> 
> Isn't it also the place with 80% or so of the IT work in England?
> 
> 
You got it! :-)
BTW Next time you're over, give Stephen and I a call (separately, we
don't live together ;-) ). Don't bother to ask Andrew; he doesn't like
it here. :-)

John

-- 
I will be brief but not nearly so brief as Salvador Dali, who gave the
world's shortest speech. He said, "I will be so brief I am already
finished," then he sat down.


Post a reply to this message

From: Gail Shaw
Subject: Re: 10 things to use a Min Heap for
Date: 23 Jun 2008 14:07:09
Message: <485fe64d@news.povray.org>
"Doctor John" <doc### [at] gmailcom> wrote in message
news:485fe447$1@news.povray.org...

> BTW Next time you're over, give Stephen and I a call (separately, we
> don't live together ;-) ). Don't bother to ask Andrew; he doesn't like
> it here. :-)

I was only there for 8 hours. Layover on a flight to Denver. It gave me just
enought time to get to Picadilly Circus, take a sightseeing tour, get lunch
and get back to the airport.

If I'm ever in London for more than a day I'll ceratinly try and organise a
meeting.


Post a reply to this message

From: Stephen
Subject: Re: 10 things to use a Min Heap for
Date: 23 Jun 2008 14:08:01
Message: <nfpv54d5cfs6h55mhqigu441qud64q528e@4ax.com>
On Mon, 23 Jun 2008 19:45:10 +0200, "Gail Shaw"
<initialsurname@sentech sa dot com> wrote:

>Last time I visited (last year), it was cleaner than JHB and had a lot less
>traffic that JHB (probably comes from having public transport that's
>actually usable).

Love you Gail :-)
Ken loves you
But Johnson (Boris) probably doesn't care :)

I'm glad you liked your visit.
-- 

Regards
     Stephen


Post a reply to this message

From: Stephen
Subject: Re: 10 things to use a Min Heap for
Date: 23 Jun 2008 14:09:53
Message: <4mpv54567rjc2o95av1r1araqvgv8n76gh@4ax.com>
On Mon, 23 Jun 2008 15:29:23 +0100, "Phil Cook"
<phi### [at] nospamrocainfreeservecouk> wrote:

>
>#10 Exception 1: Unless you also live there and have done so for more then  
>10 years.

Fair dinkum :)

>#10 Exception 2: It's Milton Keynes
>
>I'm kidding about that last one, but not so much about the first.

Did you have your fingers crossed?  :-)
-- 

Regards
     Stephen


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.