🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #206614

Re: Header Pattern

#206614
From: Nomen Nescio
Date: Thu, 29 Jun 2006 17:00
64 lines
3736 bytes
Zax wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> On Thu, 29 Jun 2006 13:14:13 +0200, Thomas J. Boschloo wrote in
> Message-Id: <44a3b5cc$0$31645$e4fe514c@news.xs4all.nl>:
> 
> >
> > Sorry, I don't know Python enough to comment on this. There are data
> > structures that optimize and reorder themselves in the process of
> > running a program. E.g. Balanced Trees.

No. Thomas is talking about coding paradigms and devised algorithms,
not arbitrarily reordering data structures.

This is like.... "programming 101" guys. It's something that's just not
done, and any language that would attempt it would be laughed out of
coderland so fast its hair would catch fire from the wind friction. Can
you even imagine creating a list of items in sequence and trying to
access the Nth element, but getting element Y?

Gimme a break already!
 
> Python does this with Hashes, (which are what my news headers are
> stored in during processing).
> 
> Python 2.3.5 (#2, Mar  6 2006, 10:12:24) 
> [GCC 4.0.3 20060304 (prerelease) (Debian 4.0.2-10)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> test = {"a":1,"b":2,"c":3,"d":4}
> >>> print test
> {'a': 1, 'c': 3, 'b': 2, 'd': 4}
> 
> Looks reordered to me.  :)

Only because you fail to understand that Python dictionaries aren't an
ordered data structure to begin with. :(

>>> print test[0]
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
KeyError: 0
>>> print test['a']
1

You can't sequentially iterate over their elements for example, because
there is no "order" to them that can be indexed. They have to be
accessed by key:value references for a reason. If you must iterate over
all the elements in a dictionary you create a list of keys and iterate
over that, accessing key:value elements accordingly.

I don't know where you came up with "hashes", but it sounds like a made
up shot in the dark explanation of a behavior you don't understand to
me because Python dictionary key:values are strictly un-hashable as we
can see by trying to slice key elements....

>>> print test['a':]
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: unhashable type


Technical Details
Message-ID: <fc2543215f031a4508a843e44350ee84@dizum.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newspeer.monmouth.com!newsgate.cistron.nl!xs4all!news.wiretrip.org!news.dizum.com!sewer-output!mail2news
References: <449be286$0$31640$e4fe514c@news.xs4all.nl> <LXJ7E9CO38892.2155439815@anonymous.poster> <449d1e82$0$31654$e4fe514c@news.xs4all.nl> <E14RRXER38892.3819212963@anonymous.poster> <79760KTR38892.7362615741@twistycreek.com> <QRCPP4N438892.9747916667@anonymous.poster> <QUUQFQCS38893.4921180556@anonymous.poster> <994cfec04a17ce164aefb2eba639151b@pboxmix.winstonsmith.info> <P4B5B2EA38893.7680902778@anonymous.poster> <e6d56ae3d0c7e312ccf9ca0734452f15@deuxpi.ca> <34N8BBAL38894.5699421296@anonymous.poster> <5920b7e56fccbe09d583e3865fce6be8@dizum.com> <44a18637$0$31647$e4fe514c@news.xs4all.nl> <f5c21951b024dd3b2ae9671dc2045261@mixmaster.it> <44a3b5cc$0$31645$e4fe514c@news.xs4all.nl> <e80i4m$gqd$1@bananasplit.info>

Show Full Headers
Complete Article Headers
Message-ID: <fc2543215f031a4508a843e44350ee84@dizum.com>
Subject: Re: Header Pattern
Date: Thu, 29 Jun 2006 17:00:04 +0000
From: Nomen Nescio <nobody@dizum.com>
References: <449be286$0$31640$e4fe514c@news.xs4all.nl> <LXJ7E9CO38892.2155439815@anonymous.poster> <449d1e82$0$31654$e4fe514c@news.xs4all.nl> <E14RRXER38892.3819212963@anonymous.poster> <79760KTR38892.7362615741@twistycreek.com> <QRCPP4N438892.9747916667@anonymous.poster> <QUUQFQCS38893.4921180556@anonymous.poster> <994cfec04a17ce164aefb2eba639151b@pboxmix.winstonsmith.info> <P4B5B2EA38893.7680902778@anonymous.poster> <e6d56ae3d0c7e312ccf9ca0734452f15@deuxpi.ca> <34N8BBAL38894.5699421296@anonymous.poster> <5920b7e56fccbe09d583e3865fce6be8@dizum.com> <44a18637$0$31647$e4fe514c@news.xs4all.nl> <f5c21951b024dd3b2ae9671dc2045261@mixmaster.it> <44a3b5cc$0$31645$e4fe514c@news.xs4all.nl> <e80i4m$gqd$1@bananasplit.info>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.privacy.anon-server.20141023.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newspeer.monmouth.com!newsgate.cistron.nl!xs4all!news.wiretrip.org!news.dizum.com!sewer-output!mail2news
Newsgroups: alt.privacy.anon-server
Mail-To-News-Contact: abuse@dizum.com
Organization: mail2news@dizum.com
Lines: 64