comp.lang.python - 26 new messages in 13 topics - digest
comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en
comp.lang.python@googlegroups.com
Today's topics:
* Odd msg received from list - 4 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/6051442dd7f3cf27?hl=en
* writing fortran equivalent binary file using python - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/af85223e3c4a7786?hl=en
* Invalid syntax with print "Hello World" - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/7f0ce0366a7cd81c?hl=en
* @gmail.com accounts put on hold - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/6fc28709ca8aa2db?hl=en
* pypy and ctypes - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/ae520cf0ce5d6e6b?hl=en
* python 2.7.x on MacOSX: failed dlopen() on .so's - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/f7c6dbd1573a9577?hl=en
* Converting hex data to image - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/cd9fa5a301bb7a61?hl=en
* Most discussion on comp.lang.python is about developing with Python - 1
messages, 1 author
http://groups.google.com/group/comp.lang.python/t/0d22dd5dd221dc6d?hl=en
* ogg2mp3 utility? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/67299dcf692ae43f?hl=en
* Program Translation - Nov. 14, 2013 - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/69cada4c80ff7036?hl=en
* Automation - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/2cb5aaffece4c4a9?hl=en
* PyMyth: Global variables are evil... WRONG! - 4 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/40e017ec6b97306c?hl=en
* The Spirit of Python - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/55e6776fe7a032ae?hl=en
==============================================================================
TOPIC: Odd msg received from list
http://groups.google.com/group/comp.lang.python/t/6051442dd7f3cf27?hl=en
==============================================================================
== 1 of 4 ==
Date: Thurs, Nov 14 2013 6:26 am
From: Chris Angelico
On Fri, Nov 15, 2013 at 1:11 AM, Roy Smith <roy@panix.com> wrote:
> In article <mailman.2591.1384437196.18130.python-list@python.org>,
> Verde Denim <tdldev@gmail.com> wrote:
>
>> I got an odd message this morning from the list telling me that my
>> account was de-activated due to excessive bounces. I've only sent a
>> handful of messages to this board, but do read an awful lot of the posts
>> in order to learn more about the language. The message also listed my
>> account password, which I found odd. Has anyone else received a message
>> like this?
>
> This sounds like a variation of a classic phishing scam. You get an
> email which looks official, telling you that some account you have has
> been suspended because you need to verify some information. The wording
> of the message is always vague about exactly what account this is.
>
> Don't click on any of the links. At best, they're harvesting email
> addresses. At worst, they're harvesting personal information which can
> be used for identity theft, credit card fraud, or all sorts of
> malfeasance.
>
I agree in general, but I happen to be pretty familiar with Mailman
alerts, and this one was genuine. Also, it pointed to what does appear
to be the right address (mail.python.org). There's definitely
something going around that's causing problems for gmail users; maybe
spam is getting bounced/rejected instead of being dropped?
ChrisA
== 2 of 4 ==
Date: Thurs, Nov 14 2013 6:27 am
From: Chris Angelico
On Fri, Nov 15, 2013 at 1:24 AM, MRAB <python@mrabarnett.plus.com> wrote:
> I'm wondering if it has anything to do with spam filtering.
>
> If you're using a spam filter (it might be offered as a feature by your
> ISP) that bounces instead of just deleting, and the spam looks like it
> comes from or through the list, then the list would receive those
> bounces without you being aware of it.
I hadn't read your post when I typed up my own. You said everything I
was saying about spam, only better and sooner. :)
ChrisA
== 3 of 4 ==
Date: Thurs, Nov 14 2013 6:27 am
From: Joost Molenaar
On Thu, Nov 14, 2013 at 2:53 PM, Verde Denim <tdldev@gmail.com> wrote:
> Has anyone else received a message like this?
I did too. It seems to me that Gmail's spam filter might have been overly
enthusiastic, but the only way to find out is to look at the bounces
that the list
software received.
Yesterday I also received a warning from the debian-laptop mailing list program.
Joost
== 4 of 4 ==
Date: Thurs, Nov 14 2013 8:02 am
From: "Gisle Vanem"
"Chris Angelico" <rosuav@gmail.com> wrote:
> I agree in general, but I happen to be pretty familiar with Mailman
> alerts, and this one was genuine. Also, it pointed to what does appear
> to be the right address (mail.python.org). There's definitely
> something going around that's causing problems for gmail users;
It happended to me too. And I'm a Yahoo user. I clicked the MailMan
confirmation link and all emails seems to be received now (comparing
to what's on the NNTP group).
--gv
==============================================================================
TOPIC: writing fortran equivalent binary file using python
http://groups.google.com/group/comp.lang.python/t/af85223e3c4a7786?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Nov 14 2013 6:35 am
From: Sudheer Joseph
Thank you,
But it wont allow to write it in unformatted way so
that the fortran code can read
with
open(11,file="input.bin")
read(11) IWI,JWI,XFIN,YFIN,DXIN,DYIN,NREC,WDAY
with best regards,
sudheer
On Thu, Nov 14, 2013 at 7:48 PM, Oscar Benjamin
<oscar.j.benjamin@gmail.com>wrote:
> On 14 November 2013 00:53, Sudheer Joseph <sjo.india@gmail.com> wrote:
> > My trial code with Python (data is read from file here)
> >
> > from netCDF4 import Dataset as nc
> > import numpy as np
> > XFIN=0.0,YFIN=-90.0,NREC=1461,DXIN=0.5;DYIN=0.5
> > TITLE="NCMRWF 6HOURLY FORCING MKS"
> > nf=nc('ncmrwf_uv.nc')
> > ncv=nf.variables.keys()
> > IWI=len(nf.variables[ncv[0]])
> > JWI=len(nf.variables[ncv[1]])
> > WDAY=nf.varlables[ncv[2]][0:NREC]
> > U=nf.variables[ncv[3]][0:NREC,:,:]
> > V=nf.variables[ncv[4]][0:NREC,:,:]
> > bf=open('ncmrwf_uv.bin',"wb")
> > f.write(TITLE)
> > f.write(IWI,JWI,XFIN,YFIN,DXIN,DYIN,NREC,WDAY)
> > for i in np.arange(0,NREC):
> > f.write(U[i,:,:],V[i,:,:])
> > f.close()
> >
> > But the issue is that f.write do not allow multiple values( it allows
> one by one so throws an error with above code ) on same write statement
> like in the fortran code. experts may please advice if there a solution for
> this?
>
> Can you just call write twice? e.g.:
>
> f.write(U[i,:,:])
> f.write(V[i,:,:])
>
>
> Oscar
>
--
with best regards
Sudheer
**********************************************************************************
Dr. Sudheer Joseph
Scientist
INDIAN NATIONAL CENTRE FOR OCEAN INFORMATION SERVICES (INCOIS)
MINISTRY OF EARTH SCIENCES, GOVERNMENT OF INDIA
"OCEAN VALLEY" PRAGATHI NAGAR (BO)
OPP.JNTU, NIZAMPET SO
Andhra Pradesh, India. PIN- 500 090.
TEl:+91-40-23044600(R),Tel:+91-9440832534(Mobile)
Tel:+91-40-23886047(O),Fax:+91-40-23892910(O)
E-mail: sudheer.joseph@yahoo.com; sjo@incois.gov.in.
Web- http://oppamthadathil.tripod.com
--------------* ---------------
"The ultimate measure of a man is
not where he stands in moments of
comfort and convenience, but where
he stands at times of challenge and
controversy."
Martin Luther King, Jr.
"What we have done for ourselves alone dies with us.
What we have done for others and the world remains and is immortal."
- Albert Pines
== 2 of 2 ==
Date: Thurs, Nov 14 2013 6:46 am
From: Antoon Pardon
Op 14-11-13 01:53, Sudheer Joseph schreef:
> Hi,
> I need to write a binary file exactly as written by fortran code below to be read by another code which is part of a model which is not advisable to edit.I would like to use python for this purpose as python has mode flexibility and easy coding methods.
>
> character(40) :: TITLE="122322242"
> integer :: IWI,JWI
> real :: XFIN,YFIN,DXIN=0.5,DYIN=0.5,WDAY(6000)
> XFIN=0.0,YFIN=-90.0,NREC=1461,DXIN=0.5;DYIN=0.5;IWI=720;JWI=361
> real,allocatable,dimension(:,:,:) :: VAR1_VAL
> real,allocatable,dimension(:,:,:) :: VAR2_VAL
>
> open(11,file=outf,form='UNFORMATTED')
> WRITE(11) TITLE
> WRITE(11) NX,NY,XFIN,YFIN,DXIN,DYIN,NREC,WDAY
> write(*,'(A10,2f10.3)') "START=",VAR1_VAL(1,1,1),VAR2_VAL(1,1,1)
> write(*,'(A10,2f10.3)') "END=",VAR1_VAL(nx,ny,nrec),VAR2_VAL(nx,ny,nrec)
> do i=1,NREC
> WRITE(11) VAR1_VAL(:,:,i),VAR2_VAL(:,:,i)
> WRITE(*,'(2I10,f10.3)') NX,NY,WDAY(i)
> enddo
>
> My trial code with Python (data is read from file here)
>
> from netCDF4 import Dataset as nc
> import numpy as np
> XFIN=0.0,YFIN=-90.0,NREC=1461,DXIN=0.5;DYIN=0.5
> TITLE="NCMRWF 6HOURLY FORCING MKS"
> nf=nc('ncmrwf_uv.nc')
> ncv=nf.variables.keys()
> IWI=len(nf.variables[ncv[0]])
> JWI=len(nf.variables[ncv[1]])
> WDAY=nf.varlables[ncv[2]][0:NREC]
> U=nf.variables[ncv[3]][0:NREC,:,:]
> V=nf.variables[ncv[4]][0:NREC,:,:]
> bf=open('ncmrwf_uv.bin',"wb")
> f.write(TITLE)
> f.write(IWI,JWI,XFIN,YFIN,DXIN,DYIN,NREC,WDAY)
> for i in np.arange(0,NREC):
> f.write(U[i,:,:],V[i,:,:])
> f.close()
>
> But the issue is that f.write do not allow multiple values( it allows > one by one so throws an error with above code ) on same write statement
> like in the fortran code. experts may please advice if there a solution for this?
That is not the main issue. The python write only works with bytes or
strings, not with floats or ints. So you will have to convert your
numbers using struct. So the question is if you know the byte layout
fortran uses and if you can replicate it with the struct module.
--
Antoon Pardon
==============================================================================
TOPIC: Invalid syntax with print "Hello World"
http://groups.google.com/group/comp.lang.python/t/7f0ce0366a7cd81c?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Nov 14 2013 7:05 am
From: johannes.gunz97@gmail.com
Am Donnerstag, 12. März 2009 07:57:11 UTC+1 schrieb Henrik Bechmann:
> obviously total mewbiew:
>
> My first program in Python Windows
>
> print "Hello World"
>
> I select Run/Run Module and get an error:
>
> Syntax error, with the closing quote highlighted.
>
> Tried with single quotes as well. Same problem.
>
> Can someone explain my mistake?
>
> Thanks,
>
> - Henrik
thanx
== 2 of 2 ==
Date: Thurs, Nov 14 2013 8:41 am
From: unknown
On Thu, 14 Nov 2013 07:05:08 -0800, johannes.gunz97 wrote:
> Am Donnerstag, 12. März 2009 07:57:11 UTC+1 schrieb Henrik Bechmann:
>> obviously total mewbiew:
>>
>> My first program in Python Windows
>>
>> print "Hello World"
>>
>> I select Run/Run Module and get an error:
>>
>> Syntax error, with the closing quote highlighted.
>>
>> Tried with single quotes as well. Same problem.
>>
>> Can someone explain my mistake?
>>
>> Thanks,
>>
>> - Henrik
>
> thanx
which version of python?
if V3.X then you need print ('Hello World')
as print has changed from a statement to a function.
==============================================================================
TOPIC: @gmail.com accounts put on hold
http://groups.google.com/group/comp.lang.python/t/6fc28709ca8aa2db?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Nov 14 2013 7:05 am
From: Tim Golden
Several people have reported Mailman messages notifying them of their
subscription being suspended because of bounces.
The notifications are pukka and appear to have resulted from a reaction
by Google's mail servers to messages via this list from an invalid
address at a valid domain.
The Mailman admins have implemented a workaround and have attempted to
reactivate all gmail accounts. Please check your susbcription per the
notification email. If you have any problems, drop a line to
python-list-owner@python.org.
(With thanks to Ralf Hildebrandt who's done all the legwork...)
TJG
== 2 of 2 ==
Date: Thurs, Nov 14 2013 8:07 am
From: Matty Sarro
Whew, thank you for your hard work.
I was really worried I would stop getting emails about Islam, Hacking
Databases, and the Ruby Community ;)
Kidding, kidding. Great job with the fast workaround!
On Thu, Nov 14, 2013 at 10:05 AM, Tim Golden <mail@timgolden.me.uk> wrote:
> Several people have reported Mailman messages notifying them of their
> subscription being suspended because of bounces.
>
> The notifications are pukka and appear to have resulted from a reaction
> by Google's mail servers to messages via this list from an invalid
> address at a valid domain.
>
> The Mailman admins have implemented a workaround and have attempted to
> reactivate all gmail accounts. Please check your susbcription per the
> notification email. If you have any problems, drop a line to
> python-list-owner@python.org.
>
> (With thanks to Ralf Hildebrandt who's done all the legwork...)
>
> TJG
> --
> https://mail.python.org/mailman/listinfo/python-list
>
==============================================================================
TOPIC: pypy and ctypes
http://groups.google.com/group/comp.lang.python/t/ae520cf0ce5d6e6b?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Nov 14 2013 7:13 am
From: Neil Cerutti
On 2013-11-14, Peter Chant <pete@petezilla.co.uk> wrote:
> Or is it that - if I keep the code as simple as possible, PyPy
> is about as fast as you can get?
PyPy profiles your code as it runs and creates, using a
just-in-time compiler, highly optimized versions of frequently
run sections. You don't have to declare types or even think about
it; The scheme will work best with code that runs for a
significant amount of time.
cython allows you to declare types, and attempts to create more
efficient code *at compile time* using those type declaration.
Which approach will be better depends on how the code runs and
how clever you are at using cython.
PyPy isn't designed to speed up programs that run for a few
hundred milliseconds and then complete, though it might sometimes
work for that.
--
Neil Cerutti
==============================================================================
TOPIC: python 2.7.x on MacOSX: failed dlopen() on .so's
http://groups.google.com/group/comp.lang.python/t/f7c6dbd1573a9577?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Nov 14 2013 7:22 am
From: Paul Smith
On Wed, 2013-11-13 at 23:06 -0800, Ned Deily wrote:
> On Nov 13, 2013, at 17:24 , Paul Smith <paul@mad-scientist.net> wrote:
> > I'm discovering that this is tricky. I don't want to bring OS wars into
> > it, but this kind of thing is so simple and just works on GNU/Linux. I
> > guess I've been spoiled :-).
>
> Well, if you are building from scratch, you would likely run into some
> of the same issues on Linux systems, too. There are many variations
> in configurations that are mutually incompatible.
Possibly. However as long as you're using basic system libraries and
not higher-level stuff like GTK etc., you can compile on an older
version of Linux (say, Red Hat EL 5 or so) and the result will run
without any problems on pretty much any distribution, even the newest
ones: Red Hat, Ubuntu, Debian, Suse, etc. etc. We do this regularly,
for production code we ship to customers. About the only "basic"
libraries that cause problems are libssl/libcrypto... the openssl folks
just don't seem to care much about this issue.
> > I'm somewhat dreading my next effort after MacOS: the same thing, on
> > Windows :-/.
> >
> > And another task, which seems like it will be fun: building GDB on
> > MacOSX with Python support enabled...
>
> Keep in mind that on newer OS X releases, Apple no longer ships gcc or
> gdb. The standard compiler is clang and it has its own debuggers.
Yes, I'm aware. Very frustrating. We have a large set of specialized
macros, both in native GDB and in Python using GDB's extension, that are
invaluable for debugging our code. I'm not thrilled about the idea of
trying to get all that working in lldb as well. So we're going to stick
with GDB, building it ourselves, until it no longer works at all. At
that point we'll decide how to proceed.
> > Hm, that's an idea. I don't HAVE to build Python myself, actually, I
> > just need (a) it to be relocatable, and (b) to add these extra modules
> > to it so I can use it across systems without installing them
> > individually by hand.
>
> I'm not sure I know what you mean by "relocatable". Like the
> third-party package manager solutions, the python.org installers place
> the Pythons they install in fixed locations (under /Library/Frameworks
> with links from /usr/local/bin) but one that does not conflict with
> any system files, including the Apple-supplied system Pythons.
By relocatable I mean "runnable from any location"; i.e., not fixed. I
have a wrapper around the Python executable that can compute the correct
root directory and set any environment variables or add flags or
whatever might be needed.
Basically I have a large number of test systems and a set of test suites
that are all written in Python, and I need to be able to distribute the
same version of Python plus a specific set of additional modules across
all those systems to be sure they all have the same environment. Plus
the set of systems changes (new systems added/old ones removed)
regularly. I'm handling this by checking in the Python distribution
plus modules into a "tools" Git repository, then cloning it on each
system. However, I have no special privileges on these systems (so I
can't modify any system locations such as /usr/local) and I can't
control what user account will be running the tests (so the user's home
directory, where the tools repository is cloned, is not constant across
the systems).
I have this working on Linux with very little effort. Now I'm trying to
get the same result on MacOSX.
== 2 of 2 ==
Date: Thurs, Nov 14 2013 10:36 am
From: Ned Deily
In article <1384442536.3496.532.camel@pdsdesk>,
Paul Smith <paul@mad-scientist.net> wrote:
[...]
> By relocatable I mean "runnable from any location"; i.e., not fixed. I
> have a wrapper around the Python executable that can compute the correct
> root directory and set any environment variables or add flags or
> whatever might be needed.
In that case, the python.org installer may not be a good choice. You should
be to accomplish what you want by building your own Python. You'll probably
find you were getting tripped up by unnecessarily setting environment
variables. Good luck!
--
Ned Deily,
nad@acm.org
==============================================================================
TOPIC: Converting hex data to image
http://groups.google.com/group/comp.lang.python/t/cd9fa5a301bb7a61?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Nov 14 2013 7:32 am
From: Shyam Parimal Katti
I am implementing an authentication system(in Django) using LDAP as the
backend(django-auth-ldap). When we fetch the data from the LDAP server for
a particular valid user, the data associated with the user contains the
thumbnail photo in hex representation. E.x.:
[('CN=XX,OU=Users,OU=Accounts,DC=test,DC=com', {'msExchBlockedSendersHash':
['\xce'], 'mailNickname': ['test_user'], 'primaryGroupID': ['513'],
'logonCount': ['1021'], *thumbnailPhoto:
['\xef\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00`\x00`\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\t\t\x08\n\x0c\x14\r\x0c.....']*......
]
How do I convert the hex data for an image to the actual image?
Any help would be greatly appreciated.
Thanks,
Shyam
== 2 of 2 ==
Date: Thurs, Nov 14 2013 8:18 am
From: Tim Golden
On 14/11/2013 15:32, Shyam Parimal Katti wrote:
> I am implementing an authentication system(in Django) using LDAP as the
> backend(django-auth-ldap). When we fetch the data from the LDAP server
> for a particular valid user, the data associated with the user contains
> the thumbnail photo in hex representation. E.x.:
>
> [('CN=XX,OU=Users,OU=Accounts,DC=test,DC=com',
> {'msExchBlockedSendersHash': ['\xce'], 'mailNickname': ['test_user'],
> 'primaryGroupID': ['513'], 'logonCount': ['1021'], *thumbnailPhoto:
> ['\xef\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00`\x00`\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\t\t\x08\n\x0c\x14\r\x0c.....']*
> ...... ]
>
> How do I convert the hex data for an image to the actual image?
Well, the first few bytes suggest that it's a JPEG, so save the bytes as
"something.jpg" and there you have it: an actual image.
Alternatively, you could load it into PIL [1] / Pillow [2] and
manipulate it as you see fit...
TJG
[1] http://www.pythonware.com/products/pil/
[2] https://pypi.python.org/pypi/Pillow/
==============================================================================
TOPIC: Most discussion on comp.lang.python is about developing with Python
http://groups.google.com/group/comp.lang.python/t/0d22dd5dd221dc6d?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Nov 14 2013 8:13 am
From: Nobody
On Wed, 13 Nov 2013 15:35:56 -0500, bob gailer wrote:
> I joined a week or so ago.
>
> The subject line was copied from the description of comp.lang.python aka
> python-list@python.org.
>
> I am very disappointed to see so much energy and bandwidth going to
> conversations that bash individuals.
>
> Is there a moderator for this list?
"list"? As you have already noted, the mailing list is bi-directionally
gatewayed to a usenet group. The advantage of usenet is that anyone can
read or post without having to sign up. That's also its disadvantage.
==============================================================================
TOPIC: ogg2mp3 utility?
http://groups.google.com/group/comp.lang.python/t/67299dcf692ae43f?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Nov 14 2013 8:58 am
From: Tim Johnson
* Tim Johnson <tim@akwebsoft.com> [131113 17:06]:
> I've written an application that does some audio file conversions.
>
> I use mutagen for some of the mp3 file manipulation, but to convert
> ogg files to mp3 format I've been using subprocess to run the
> ogg2mp3 perl utility. (available from http://marginalhacks.com/) by
> David Madison.
>
> It's a "spot on" great app, but I would like to be able to "keep it
> all one codebase".
>
> Are there any python utility that anyone could recommend?
I've downloaded ogg2mp3.py (http://emptybits.com/ogg2mp3/ogg2mp3)
by Darren Stone http://bitmason.com, I've compared two
conversions.
Thus far, the perl utility produces a clearer playback, but I have
not yet played with the options available from the python script.
Both scripts rely on oggdec, ogginfo and lame.
On the mac available through macports, available on other *nixes as
well.
If anyone is interested, I'd welcome feedback on the python script
above and I will fiddle with it (not being an audio expert) to see
if I can get the playback improved.
I've looked at pymedia also. Have not tested it.
FYI.cheers
--
Tim
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com
==============================================================================
TOPIC: Program Translation - Nov. 14, 2013
http://groups.google.com/group/comp.lang.python/t/69cada4c80ff7036?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Nov 14 2013 9:07 am
From: mecej4
On 11/14/2013 8:18 AM, E.D.G. wrote:
> Posted by E.D.G. on November 14, 2013
>
> In view of the fact that I mentioned the following project in
> both Perl and Python Newsgroup notes and did not get any hostile
> responses I am going to take a chance and mention it again in all three
> of these Newsgroups. People posting responses might want to do that in
> just one Newsgroup. I will check all three for responses for a few weeks.
>
>
> This is the Web address for an interesting and apparently unique
> computer program written using FORTRAN 77. As far as I am aware, it has
> never been translated to newer language. There is a BASIC version that
> was apparently written around the same time as the FORTRAN version.
>
> http://www.bfo.geophys.uni-stuttgart.de/etgtab.html
>
> What a number of us would like to do is obtain a copy of the
> program that is written in a newer language so that we can then merge it
> with the programs available through the following Web page. The new
> programs would then be made available as freeware programs to
> researchers around the world. This indirect link is being used in an
> effort to keep Web site related spam to a minimum. I don't collect
> credits by having people visit that (indirect) Web site.
>
> http://www.freewebs.com/eq-forecasting/RH.html
>
> If there are any programmers who might be interested in such a
> translation effort then I would be interested in hearing from them.
>
> Etgtab generates Solid Earth Tide and ocean tide data for any
> location on or inside the planet. I am not aware of any other freeware
> program that can do that.
>
> SunGP available at that second Web site is the only freeware
> program that I know about that generates what are sometimes referred to
> as subsolar and sublunar types of data. The download code was written
> using True BASIC.
>
> If you draw a line between the centers of the sun and the Earth
> then the place where that line crosses the surface of the Earth is the
> subsolar location. The sublunar location is the same type of thing.
> The SunGP program code is also available in Perl code, but not through
> any Web sites.
>
>
If this old program is to be translated or reused, do use this
opportunity to fix some bugs in the program.
The data file contains data for 1200 waves, but the program computes
results for 1212 waves. For waves 1201 to 1212, the program ends up
calculating results based on uninitialized data. Whether or not this
affects the validity of the final output results is something that
someone knowledgeable about the field of application has to judge.
-- mecej4
== 2 of 2 ==
Date: Thurs, Nov 14 2013 9:36 am
From: Gordon Sande
On 2013-11-14 17:07:45 +0000, mecej4 said:
> On 11/14/2013 8:18 AM, E.D.G. wrote:
>> Posted by E.D.G. on November 14, 2013
>>
>> In view of the fact that I mentioned the following project in
>> both Perl and Python Newsgroup notes and did not get any hostile
>> responses I am going to take a chance and mention it again in all three
>> of these Newsgroups. People posting responses might want to do that in
>> just one Newsgroup. I will check all three for responses for a few weeks.
>>
>>
>> This is the Web address for an interesting and apparently unique
>> computer program written using FORTRAN 77. As far as I am aware, it has
>> never been translated to newer language. There is a BASIC version that
>> was apparently written around the same time as the FORTRAN version.
>>
>> http://www.bfo.geophys.uni-stuttgart.de/etgtab.html
>>
>> What a number of us would like to do is obtain a copy of the
>> program that is written in a newer language so that we can then merge it
>> with the programs available through the following Web page. The new
>> programs would then be made available as freeware programs to
>> researchers around the world. This indirect link is being used in an
>> effort to keep Web site related spam to a minimum. I don't collect
>> credits by having people visit that (indirect) Web site.
>>
>> http://www.freewebs.com/eq-forecasting/RH.html
>>
>> If there are any programmers who might be interested in such a
>> translation effort then I would be interested in hearing from them.
>>
>> Etgtab generates Solid Earth Tide and ocean tide data for any
>> location on or inside the planet. I am not aware of any other freeware
>> program that can do that.
>>
>> SunGP available at that second Web site is the only freeware
>> program that I know about that generates what are sometimes referred to
>> as subsolar and sublunar types of data. The download code was written
>> using True BASIC.
>>
>> If you draw a line between the centers of the sun and the Earth
>> then the place where that line crosses the surface of the Earth is the
>> subsolar location. The sublunar location is the same type of thing.
>> The SunGP program code is also available in Perl code, but not through
>> any Web sites.
>>
>>
> If this old program is to be translated or reused, do use this
> opportunity to fix some bugs in the program.
>
> The data file contains data for 1200 waves, but the program computes
> results for 1212 waves. For waves 1201 to 1212, the program ends up
> calculating results based on uninitialized data. Whether or not this
> affects the validity of the final output results is something that
> someone knowledgeable about the field of application has to judge.
>
> -- mecej4
Indeed! Under NAGWare Fortran it runs to completion with C=all but pulls an
undefined reference when C=undefined is added.
Lots of obsolete features and other warnings but no compiler error messages.
The obvious lessons are that 1. Fortran has very good historical continuity
and 2. the good debugging Fortran compilers do a good job.
==============================================================================
TOPIC: Automation
http://groups.google.com/group/comp.lang.python/t/2cb5aaffece4c4a9?hl=en
==============================================================================
== 1 of 1 ==
Date: Thurs, Nov 14 2013 9:10 am
From: Mark Lawrence
On 14/11/2013 03:56, renato.barbosa.pim.pereira@gmail.com wrote:
> I apologize again for my bad english and any inconvenience that I have generated.
>
I do wish that people would stop apologising for poor English, it's an
extremely difficult language. IIRC there are eight different ways of
pronouncing the vowel combination au. Whatever happened to "There
should be one-- and preferably only one --obvious way to do it."? :)
--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer
Mark Lawrence
==============================================================================
TOPIC: PyMyth: Global variables are evil... WRONG!
http://groups.google.com/group/comp.lang.python/t/40e017ec6b97306c?hl=en
==============================================================================
== 1 of 4 ==
Date: Thurs, Nov 14 2013 9:26 am
From: Rick Johnson
On Wednesday, November 13, 2013 11:50:40 PM UTC-6, Steven D'Aprano wrote:
> On Wed, 13 Nov 2013 19:45:42 -0800, Rick Johnson wrote:
> > On Wednesday, November 13, 2013 8:45:16 PM UTC-6, Steven D'Aprano wrote:
> >> A fully-auto machine gun with a hair-trigger and no
> >> safety is no different from a single-barrel shotgun with a safety and
> >> a trigger lock! You can blow your foot off with both!
> > Yes. But in the case of the shotgun you'd have to find the key, unlock
> > the trigger, unset the safety, and aim REALLY well... because your only
> > getting off one shot, and if you miss or only wound me, i've got that
> > full auto machine gun with hair trigger and no safety -- i won't need to
> > live very long to return the favor. >:)
> I think you're missing the point that we're talking about the coder
> shooting themselves in the foot, not Gunfight At The OK Corral. There's
> no "favour" to return.
And you missed the point that i took your straw-man and
converted him into satire. You owe me gratitude for
*politely* ignoring your repeated logical fallacies.
> Yes, the point is that process-wide global variables are
> demonstrated by 50+ years of programming experience to be
> best avoided (in general -- there are caveats and
> exceptions of course). We're talking about probably
> millions of person-hours of experience leading to the
> conclusion that "globals are harmful".
But yet Python has globals, you just have to *import* them.
But that design is flawed
> It isn't that global variables will leap out of the
> computer and attack you while you sleep,
Funny, that sounds like my argument from earlier. Something
about "gremlins".
> of course, but that in general *its too damn hard* for
> human programmers to write good, reliable, maintainable,
> correct (i.e. bug-free) code using process-wide global
> variables.
Complete FUD. Maybe for you. Not for me.
> Global variables are the spaghetti code of namespacing --
> everything is mixed up together in one big tangled mess.
It's a tangled mess if you design it to be a tangled mess.
> The more global variables you have, the worse the tangle.
Complete illogic.
What if all the globals are only accessed
and never mutated? You could have a million globals that never
change (of course they'd technically be constants) and never
suffer a single error from globals EVEN IF your an incompetent
software designer.
> One or two is not too bad. With good conventions for
> encapsulation to limit the amount of tangled, coupled code
> (e.g. naming conventions, or limiting globals to a single
> module at a time by default) the amount of harm can be
> reduced to manageable levels.
> SO now your agreeing that globals are not evil again. I
> positied an anaology in a passed thred that went something
> like this:
ManufacurerA claims his car is the safest on the road.
ManfacturerB drives ManfacturerA's car into a ditch and then
claims ManfacturerA is a liar.
Result: Who is wrong?
> Global variables increases coupling between distant parts
> of the code. I remember a nasty little bug in Windows
> where removing IE stopped copy-and- paste from working
> everywhere. That's a sign of excess coupling between code
> -- there's no logical reason why removing a web browser
> should cause copying text in Notepad to fail.
Do you have link describing this bug? I am not aware of such
bug ,but uh, i would not at all be surprised that windows
could break from removing that gawd awful IE.
Come to think of it, i'll bet it's not even a bug at all,
but a feature to prevent "wise users" from removing IE,
thereby maintaining IE's footprint in the wild.
Steven, this sounds more like Fascism than "clumsy use of
globals" to me.
But even IF globals are to blame, by removing IE, you have
removed a large chunk of code from a code base that was not
designed for modularity. (We could argue whether or not
windows should allow removal of IE, but ultimately that is
M$ decision)
No developer could possibly forecast every possible "bad
thing" a user might decide to do. Especially when we're
talking about ripping components of the software out
completely.
Do i think IE should be a removal component? HECK YEAH, and
i would have designed it that way. But IS is not my baby, it
belongs to Mr. Gates, and he designs his software any way he
damn well pleases, and you and i can choose not to use it.
Image if someone downloaded Python and just started ripping
out source files willy-nilly because they did not like them
for whatever reason. Then, they came to this list and start
bitching because Python was blowing chunks. And don't give
examples of things that can be ripped out without breaking
Python, because that is germane either.
How would you respond to such complaints?
Hmm...never thought you'd be agree with Mr. Gates did ya?
> We want to avoid unnecessary coupling: opening your fridge
> door shouldn't flush the toilet.
*KAH-BOOM* (Straw-bomb expodes)(AGAIN!)
> Since global variables increase coupling, and coupling is
> often harmful, one way to avoid unnecessary coupling is to
> avoid unnecessary global variables.
Nice! Your attempts to posit that "harmful coupling" is the
almost unavoidable outcome of "globals" is not fooling me.
Here's another way to phrase:
Since transportation increases chances of death or
injury from accidents, and death or injury is often
harmful, one way to to avoid unnecessary death or injury
is to avoid transportation.
There are two logical ways to react to such grim reality:
We could become consumed with fear and destroy all motor
vehicles, bicycles, skateboards, etc... and instead
adopt the locomotion of our forefathers by utilizing our
feet. or,
We reduce the risks to almost nothing by designing and
implementing globals via a logical and consistent
interface. Then, to be sure, we test religiously
(psst:we should be doing this anyway!!!)
But what we don't want to do is lull ourselves into a false
sense of security by "hiding" globals behind a pseudo
interface and thinking we have solved the problem of
globals.
And this is what Python modules are doing!
No, you've solved nothing. All you've done is to
stick you head in the sand.
============================================================
It's my code, my problem, not yours!
============================================================
Yes, you are correct.
If you want to go on using globals in a dangerous way, or
using module attributes and believing falsely they're not
global, then by all means go on. HOWEVER, don't infect the
world with your sloppy architecture. KEEP YOU CODE TO
YOURSELF!
But that's not the case is it, NO, many of you are infecting
Python's code base with horrible code.
Python's warts are *really* exposed when Python is embedded
as a scripting language. Since multiple scripts from
multiple authors will be running under the same process, any
one of them can bring the whole house of cards crashing
down. And with Python's current design, that possibility is
more likely.
It's sad, because Python is a great choice for scripting,
but the major design flaws are self defeating. Even
the best syntax ever created cannot make up for such
illogical inconsistencies at the core.
> Think of them as leaches. [snip remaining straw-bombs]
== 2 of 4 ==
Date: Thurs, Nov 14 2013 9:37 am
From: Joel Goldstick
On Thu, Nov 14, 2013 at 12:26 PM, Rick Johnson
<rantingrickjohnson@gmail.com> wrote:
> On Wednesday, November 13, 2013 11:50:40 PM UTC-6, Steven D'Aprano wrote:
>> On Wed, 13 Nov 2013 19:45:42 -0800, Rick Johnson wrote:
>> > On Wednesday, November 13, 2013 8:45:16 PM UTC-6, Steven D'Aprano wrote:
>> >> A fully-auto machine gun with a hair-trigger and no
>> >> safety is no different from a single-barrel shotgun with a safety and
>> >> a trigger lock! You can blow your foot off with both!
>> > Yes. But in the case of the shotgun you'd have to find the key, unlock
>> > the trigger, unset the safety, and aim REALLY well... because your only
>> > getting off one shot, and if you miss or only wound me, i've got that
>> > full auto machine gun with hair trigger and no safety -- i won't need to
>> > live very long to return the favor. >:)
>> I think you're missing the point that we're talking about the coder
>> shooting themselves in the foot, not Gunfight At The OK Corral. There's
>> no "favour" to return.
>
> And you missed the point that i took your straw-man and
> converted him into satire. You owe me gratitude for
> *politely* ignoring your repeated logical fallacies.
>
>> Yes, the point is that process-wide global variables are
>> demonstrated by 50+ years of programming experience to be
>> best avoided (in general -- there are caveats and
>> exceptions of course). We're talking about probably
>> millions of person-hours of experience leading to the
>> conclusion that "globals are harmful".
>
> But yet Python has globals, you just have to *import* them.
> But that design is flawed
>
>> It isn't that global variables will leap out of the
>> computer and attack you while you sleep,
>
> Funny, that sounds like my argument from earlier. Something
> about "gremlins".
>
>> of course, but that in general *its too damn hard* for
>> human programmers to write good, reliable, maintainable,
>> correct (i.e. bug-free) code using process-wide global
>> variables.
>
> Complete FUD. Maybe for you. Not for me.
>
>> Global variables are the spaghetti code of namespacing --
>> everything is mixed up together in one big tangled mess.
>
> It's a tangled mess if you design it to be a tangled mess.
>
>> The more global variables you have, the worse the tangle.
>
> Complete illogic.
>
> What if all the globals are only accessed
> and never mutated? You could have a million globals that never
> change (of course they'd technically be constants) and never
> suffer a single error from globals EVEN IF your an incompetent
> software designer.
>
>> One or two is not too bad. With good conventions for
>> encapsulation to limit the amount of tangled, coupled code
>> (e.g. naming conventions, or limiting globals to a single
>> module at a time by default) the amount of harm can be
>> reduced to manageable levels.
>
>> SO now your agreeing that globals are not evil again. I
>> positied an anaology in a passed thred that went something
>> like this:
>
> ManufacurerA claims his car is the safest on the road.
>
> ManfacturerB drives ManfacturerA's car into a ditch and then
> claims ManfacturerA is a liar.
>
> Result: Who is wrong?
>
>> Global variables increases coupling between distant parts
>> of the code. I remember a nasty little bug in Windows
>> where removing IE stopped copy-and- paste from working
>> everywhere. That's a sign of excess coupling between code
>> -- there's no logical reason why removing a web browser
>> should cause copying text in Notepad to fail.
>
> Do you have link describing this bug? I am not aware of such
> bug ,but uh, i would not at all be surprised that windows
> could break from removing that gawd awful IE.
>
> Come to think of it, i'll bet it's not even a bug at all,
> but a feature to prevent "wise users" from removing IE,
> thereby maintaining IE's footprint in the wild.
>
> Steven, this sounds more like Fascism than "clumsy use of
> globals" to me.
>
> But even IF globals are to blame, by removing IE, you have
> removed a large chunk of code from a code base that was not
> designed for modularity. (We could argue whether or not
> windows should allow removal of IE, but ultimately that is
> M$ decision)
>
> No developer could possibly forecast every possible "bad
> thing" a user might decide to do. Especially when we're
> talking about ripping components of the software out
> completely.
>
> Do i think IE should be a removal component? HECK YEAH, and
> i would have designed it that way. But IS is not my baby, it
> belongs to Mr. Gates, and he designs his software any way he
> damn well pleases, and you and i can choose not to use it.
>
> Image if someone downloaded Python and just started ripping
> out source files willy-nilly because they did not like them
> for whatever reason. Then, they came to this list and start
> bitching because Python was blowing chunks. And don't give
> examples of things that can be ripped out without breaking
> Python, because that is germane either.
>
> How would you respond to such complaints?
>
> Hmm...never thought you'd be agree with Mr. Gates did ya?
>
>> We want to avoid unnecessary coupling: opening your fridge
>> door shouldn't flush the toilet.
>
> *KAH-BOOM* (Straw-bomb expodes)(AGAIN!)
>
>> Since global variables increase coupling, and coupling is
>> often harmful, one way to avoid unnecessary coupling is to
>> avoid unnecessary global variables.
>
> Nice! Your attempts to posit that "harmful coupling" is the
> almost unavoidable outcome of "globals" is not fooling me.
> Here's another way to phrase:
>
> Since transportation increases chances of death or
> injury from accidents, and death or injury is often
> harmful, one way to to avoid unnecessary death or injury
> is to avoid transportation.
>
> There are two logical ways to react to such grim reality:
>
> We could become consumed with fear and destroy all motor
> vehicles, bicycles, skateboards, etc... and instead
> adopt the locomotion of our forefathers by utilizing our
> feet. or,
>
> We reduce the risks to almost nothing by designing and
> implementing globals via a logical and consistent
> interface. Then, to be sure, we test religiously
> (psst:we should be doing this anyway!!!)
>
> But what we don't want to do is lull ourselves into a false
> sense of security by "hiding" globals behind a pseudo
> interface and thinking we have solved the problem of
> globals.
>
> And this is what Python modules are doing!
>
> No, you've solved nothing. All you've done is to
> stick you head in the sand.
>
> ============================================================
> It's my code, my problem, not yours!
> ============================================================
>
> Yes, you are correct.
>
> If you want to go on using globals in a dangerous way, or
> using module attributes and believing falsely they're not
> global, then by all means go on. HOWEVER, don't infect the
> world with your sloppy architecture. KEEP YOU CODE TO
> YOURSELF!
>
> But that's not the case is it, NO, many of you are infecting
> Python's code base with horrible code.
>
> Python's warts are *really* exposed when Python is embedded
> as a scripting language. Since multiple scripts from
> multiple authors will be running under the same process, any
> one of them can bring the whole house of cards crashing
> down. And with Python's current design, that possibility is
> more likely.
>
> It's sad, because Python is a great choice for scripting,
> but the major design flaws are self defeating. Even
> the best syntax ever created cannot make up for such
> illogical inconsistencies at the core.
>
>> Think of them as leaches. [snip remaining straw-bombs]
> --
> https://mail.python.org/mailman/listinfo/python-list
I've been following along this thread a little bit. From what I get
out of it that the OP thinks only lousy coders can't write good code
with globals. If you are skilled (as he claims) they are useful. The
con argument says that over 50 years of learning how to make better
more productive computer languages, globals end up causing certain
problems.
So, beyond that, what is the point of the thread? Is it about python?
Just barely I guess
--
Joel Goldstick
http://joelgoldstick.com
== 3 of 4 ==
Date: Thurs, Nov 14 2013 9:56 am
From: Ethan Furman
On 11/14/2013 09:37 AM, Joel Goldstick wrote:
>
> So, beyond that, what is the point of the thread?
You haven't met Ranting Rick yet? He's a troll's troll, outdone only by one other whose name I don't remember.
His posts are, amazingly enough, rants. Usually about his (mis)perceptions of the failures of:
- Python
- The Python Leaders
- Good Coding Practices
- Everyone but himself (and the "Silent Majority" he represents)
He has been on vacation for a few months, but, alas, he is back. Interestingly, even though he is still in my kill file
I could tell the thread was his just from the subject title.
--
~Ethan~
== 4 of 4 ==
Date: Thurs, Nov 14 2013 10:43 am
From: Joel Goldstick
On Thu, Nov 14, 2013 at 12:56 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
> On 11/14/2013 09:37 AM, Joel Goldstick wrote:
>>
>>
>> So, beyond that, what is the point of the thread?
>
>
> You haven't met Ranting Rick yet? He's a troll's troll, outdone only by one
> other whose name I don't remember.
>
> His posts are, amazingly enough, rants. Usually about his (mis)perceptions
> of the failures of:
>
> - Python
> - The Python Leaders
> - Good Coding Practices
> - Everyone but himself (and the "Silent Majority" he represents)
>
> He has been on vacation for a few months, but, alas, he is back.
> Interestingly, even though he is still in my kill file I could tell the
> thread was his just from the subject title.
>
> --
> ~Ethan~
> --
> https://mail.python.org/mailman/listinfo/python-list
Ah, thanks. A tag team .. oh my!
--
Joel Goldstick
http://joelgoldstick.com
==============================================================================
TOPIC: The Spirit of Python
http://groups.google.com/group/comp.lang.python/t/55e6776fe7a032ae?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Nov 14 2013 10:11 am
From: Roy Smith
https://twitter.com/dabeaz/status/400813245532876800/photo/1
"Now THIS is a Python book I should get. I'm guessing it's about design patterns. Or maybe just the GIL. "
---
Roy Smith
roy@panix.com
== 2 of 2 ==
Date: Thurs, Nov 14 2013 10:47 am
From: jkn
On Thursday, November 14, 2013 6:11:08 PM UTC, Roy Smith wrote:
> https://twitter.com/dabeaz/status/400813245532876800/photo/1
>
>
> "Now THIS is a Python book I should get. I'm guessing it's about design patterns. Or maybe just the GIL. "
>
Excellent, thanks fro the link. And is that a book by Ethan Furman next to it??
J^n
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en
To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home