Re: File opening modes (r, w, a ...)

2018-02-22 Thread Lew Pitcher
jf...@ms4.hinet.net wrote:

> ast於 2018年2月22日星期四 UTC+8下午8時33分00秒寫道:
>> Hello
>> 
>> I share a very valuable table I found on
>> StackOverflow about file opening modes
>> 
>> If like me you always forget the details of
>> file opening mode, the following table provides
>> a good summary
>> 
>>| r   r+   w   w+   a   a+
>> --|--
>> read  | +   +++
>> write | ++   ++   +
>> write after seek  | ++   +
>> create|  +   ++   +
>> truncate  |  +   +
>> position at start | +   ++   +
>> position at end   |   +   +
> 
> What the "write after seek" means?

It /should/ mean that programs are permitted to seek to a point in the file, 
and then write from that point on.

A write to a read mode ("r") file isn't permitted at all,
so neither is "write after seek" to a read mode file.

A write to an append mode ("a" and "a+") file always write to the end of the 
file, effectively negating any seek.

HTH

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Proposed new syntax

2017-08-17 Thread Lew Pitcher
Marko Rauhamaa wrote:

> Gregory Ewing :
>> I don't agree that the word "for" necessarily implies proceduralness.
> 
> Programming languages stole the word from math, where it is
> nonprocedural.
> 
> Really, "for" is just a preposition. In Algol, for example,
> proceduralness was not in the word "for" but in "do":
[snip]
> I guess we have C to blame for the redefinition of the word "for" in
> programmers' minds.

Sorry, but that use of "for" was part of the programmer's lexicon well 
before the invention of C. Computer languages have inherited and used it 
since (at least) 1948.

Dartmouth BASIC (1964) had "FOR"
  FOR I=1 TO 10

ALGOL-60 (1960) had "for"
  for i:=1 step 1 until 10

ALGOL-58 (1958) had "for"
  for i:=1(1)10

Superplan (1948) had "fur" (German for the English word "for")
  Für k=1(1)10 :

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pound sign problem

2017-04-11 Thread Lew Pitcher
Chris Angelico wrote:

> On Wed, Apr 12, 2017 at 1:24 AM, Lew Pitcher
>  wrote:
>>
>> What in "Try changing your target encoding to something other than ASCII"
>> is encouragement to use "old legacy encodings"?
>>
>>> In 2017, unless you are reading from old legacy files created using a
>>> non-Unicode encoding, you should just use UTF-8.
>>
>> Thanks for your opinion. My opinion differs.
> 
> So what encoding *do* you recommend, and why is it better than UTF-8?

I recommend whatever encoding is appropriate for the output. That's not up 
to you or me to decide; that's a question that only the OP can answer.

(Imagine, python on an IBM Zseries running ZOS; the "native" characterset is 
one of the EBCDIC variants. Would UTF-8 be a better choice there? )


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pound sign problem

2017-04-11 Thread Lew Pitcher
Steve D'Aprano wrote:

> On Tue, 11 Apr 2017 12:50 am, Lew Pitcher wrote:
> 
>> David Shi wrote:
>> 
>>> In the data set, pound sign escape appears:
>>> u'price_currency': u'\xa3', u'price_formatted': u'\xa3525,000',
> 
> That looks like David is using Python 2.
> 
>>> When using table.to_csv after importing pandas as pd, an error message
>>> persists as follows: UnicodeEncodeError: 'ascii' codec can't encode
>>> character u'\xa3' in position 0: ordinal not in range(128)
>> 
>> There is no "pound sign" in ASCII[1]. Try changing your target encoding
>> to something other than ASCII.
> 
> Please don't encourage the use of old legacy encodings.

I wonder if you actually read my reply.

What in "Try changing your target encoding to something other than ASCII" is 
encouragement to use "old legacy encodings"?

> In 2017, unless you are reading from old legacy files created using a
> non-Unicode encoding, you should just use UTF-8.

Thanks for your opinion. My opinion differs.


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pound sign problem

2017-04-10 Thread Lew Pitcher
David Shi wrote:

> In the data set, pound sign escape appears:
> u'price_currency': u'\xa3', u'price_formatted': u'\xa3525,000',
> When using table.to_csv after importing pandas as pd, an error message
> persists as follows: UnicodeEncodeError: 'ascii' codec can't encode
> character u'\xa3' in position 0: ordinal not in range(128)

There is no "pound sign" in ASCII[1]. Try changing your target encoding to 
something other than ASCII.

[1]: See http://std.dkuug.dk/i18n/charmaps/ascii for a list of valid ASCII 
values.

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: best way to ensure './' is at beginning of sys.path?

2017-02-04 Thread Lew Pitcher
On Saturday February 4 2017 13:56, in comp.lang.python, "Wildman" 
 wrote:

> On Sat, 04 Feb 2017 18:25:03 +, Grant Edwards wrote:
> 
>> On 2017-02-04, Wildman via Python-list  wrote:
>> 
>>> No, I do not know.  You might try your question in a linux specific
>>> group.  Personally I don't understand the danger in having the dot
>>> in the path.  The './' only means the current directory.
>> 
>> It allows a malicous user to put an evil executable someplace public
>> like /tmp and have it executed accidentally.  For example, let's say
>> this executable file was named "sl" and placed in /tmp.
>> 
>> --sl--
>> #!/bin/bash
>> rm -rf $HOME
>> --
>> 
>> The next time you are in the /tmp directory looking for something, can
>> you guess what happens when you mistype "ls" as "sl"?
>> 
>>> DOS and Windows has searched the current directory since their
>>> beginning.  Is that also dangerous?
>> 
>> Yes.
> 
> Your scenario assumes the malicious user has root access
> to be able to place a file into /tmp.

It doesn't take root access to write a file to /tmp
In fact, /tmp is specifically set up to allow /any/ user to create /any/ file 
or directory in it.

Witness:
  guest@bitsie:~$ whoami
  guest

I'm not the root account

  guest@bitsie:~$ groups
  users audio video cdrom plugdev scanner

Nor do I have proxy root access (wheel group)

  guest@bitsie:~$ ls /tmp
  58949ba84867f  58949bab2fe41  ksocket-lpitcher/
  58949ba87a976  gpg-15lbqc/lost+found/
  58949ba87b6d7  kde-lpitcher/  ssh-0DwhGZKgCeHE/

That's what /tmp has in it right now

  guest@bitsie:~$ cat >/tmp/dothis < #!/bin/bash
  > echo gotcha
  > EOF

There. I've created a script as a file in /tmp
No root access required; no special privileges at all

  guest@bitsie:~$ chmod a+x /tmp/dothis

Hey! I've even made the file executable

  guest@bitsie:~$ ls -l /tmp
  total 120
  -rw--- 1 lpitcher users 23735 Feb  3 10:03 58949ba84867f
  -rw--- 1 lpitcher users 23735 Feb  3 10:03 58949ba87a976
  -rw--- 1 lpitcher users 23735 Feb  3 10:03 58949ba87b6d7
  -rw--- 1 lpitcher users 23735 Feb  3 10:03 58949bab2fe41
  -rwxr-xr-x 1 guestusers24 Feb  4 14:05 dothis*
  drwx-- 2 lpitcher users  4096 Feb  4 10:10 gpg-15lbqc/
  drwx-- 2 lpitcher users  4096 Feb  4 13:47 kde-lpitcher/
  drwx-- 2 lpitcher users  4096 Feb  4 14:01 ksocket-lpitcher/
  drwx-- 2 root root   4096 Jan 10  2012 lost+found/
  drwx-- 2 lpitcher users  4096 Feb  4 10:10 ssh-0DwhGZKgCeHE/


See? /tmp/dothis is an executable file, owned by guest

  guest@bitsie:~$ /tmp/dothis
  gotcha

See? It is executable

Now, imagine that guest had, instead, written
  /tmp/sl
as
  #!/bin/bash
  cd $HOME
  rm -rf ./
and made it executable.

If /tmp were part of the $PATH, and there were no other executables named "sl" 
found in PATH directories before the /tmp directory, then anyone making that 
simple typo would execute guest's /tmp/sl and lose their home directory.

> And there would
> have to be some reason why I would be looking around in
> /tmp.

If you've set your $PATH to include /tmp, then /that's/ the "reason why" you'd 
"be looking around in /tmp".

But, this argument can be said for /any/ directory that untrusted users have 
write access to (including your own $HOME directory); include that directory 
in your $PATH, and you risk executing a trojan binary. 

> After 10 years of using Linux, it hasn't happened
> yet.  And last I would have to be a complete idiot.
> 
> I suppose all that could be a reality, but, how many
> computers do you know of have been compromised in this
> manor?

Probably many, especially in high-use, public or semi-restricted systems like 
those found in Universities, libraries, and other "public" institutions. Even 
corporate systems have this exposure, which is why large corporations spend a 
lot of money on Information Systems security. 

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-08 Thread Lew Pitcher
On Thursday December 8 2016 11:48, in comp.lang.python, "Random832"
 wrote:

> On Wed, Dec 7, 2016, at 15:29, Lew Pitcher wrote:
>> But, point of fact is that the feature to disable globbing is not often
>> needed. Most Unix programs that accept filenames are happy to accept a
>> list of filenames. There is not much call for a program to perform it's own
>> globbing, like is required in Windows.
>> 
>> In fact, I can only think of three Unix "commandline" programs that need
>> shell globbing disabled:
>>   find - which performs it's own filename matching
>>   grep - which uses regular expressions to search the contents of files,
>>   and
>>   sed  - which uses regular expressions to edit the contents of files.
>> (I'm sure that there are a few more examples, though).
> 
> tar can do its own filename matching in some contexts, to match files
> inside the archive for example.
> 
> 7z does its own filename matching to allow distinguishing "extract from
> multiple archives" [x \*.zip] from "extract a list of filenames from a
> single archive" [x a.zip b.zip] - a BartC-compliant command line
> paradigm if I ever saw one. I suspect it also allows you to match files
> inside the archives in the list part.
> 
> scp lets you pass glob patterns to be matched on the remote server.
> also, quoting for scp is somewhat unpleasant, since metacharacters in
> general, not just globs but also $variables, quotes,`commands` etc, are
> interpreted by both the local shell and the remote shell. sftp is a
> little more sane, but still has remote globs for fetching, and quotes to
> escape those globs.


True. I had forgotten those.

Still, it's a short list of programs that either need to do their own
globbing, or need the shell to NOT glob for them. 

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Lew Pitcher
On Wednesday December 7 2016 14:57, in comp.lang.python, "BartC"
 wrote:

> On 07/12/2016 18:02, BartC wrote:
> 
>> If I want to run a Windows program on Linux, and that program needs to
>> see *.* unexpanded, then it can't undo that expansion. The cat is
>> already out of the bag.
> 
> I mean, the genie is out of the bottle, whatever. You know what I mean,
> the operation is not reversible.

So, don't pull the cork.

Look, Bart, in a Unix shell, the user has the option to enable or disable
globbing (that action that converts the argument * into a list of files). A
Unix shell can give a program exactly the same list of unaltered arguments
that a Windows shell can.

But, point of fact is that the feature to disable globbing is not often
needed. Most Unix programs that accept filenames are happy to accept a list
of filenames. There is not much call for a program to perform it's own
globbing, like is required in Windows.

In fact, I can only think of three Unix "commandline" programs that need shell
globbing disabled:
  find - which performs it's own filename matching
  grep - which uses regular expressions to search the contents of files, and
  sed  - which uses regular expressions to edit the contents of files.
(I'm sure that there are a few more examples, though).

If your argument is with Unix shell globbing, I say that you can disable it.

If your argument is with Python's use of the default shell options to parse
commandlines in the Popen() method, then you need to talk to the authors of
Python to see if they can give you a way to alter this behaviour.

Otherwise, you are just being cranky and argumentative. Stop it. Suck it up
and move on. The world doesn't revolve around BartC, no matter how loud he
yells.

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-06 Thread Lew Pitcher
On Tuesday December 6 2016 12:36, in comp.lang.python, "BartC" 
wrote:

> On 06/12/2016 17:00, MRAB wrote:
>> On 2016-12-06 13:52, BartC wrote:
> 
>>> Some special syntax is known about: | < and > for example. % less so
>>> (I've never, ever used it in live input AFAIK).
>>>
>> [snip]
>>
>> You've never used ImageMagick?
>>
>> If you want to shrink an image to half its size:
>>
>> convert dragon.gif -resize 50% half_dragon.gif
> 
> No. But that '50%' is seen by apps (eg. with Python's 'print sys.argv')
> on both Windows and Linux.
> 
> However, I can imagine that a calculator app might have trouble with
> some expressions:
> 
> calculate 3*5

I can't see this being an issue with the "calculator app", unless the
calculator app itself is written to perform file globbing.

It /might/ be an issue with the shell, if you permit it to glob
the "calculator app" arguments before invoking the "calculator app" binary.
But, then again, Unix shell filename globbing is something that the user can
disable temporarily or permanently if necessary.

For example:
  calculate '3*5'
or
  sh -o noglob -c "calculate 3*5"
or even
  sh -o noglob
  calculate 3*5

> This expression might be seen as 345 if there happens to be file called
> '345' lying around.

Only if shell globbing is enabled, and you don't specifically bypass it.


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Detect Linux Runlevel

2016-12-05 Thread Lew Pitcher
On Monday December 5 2016 17:24, in comp.lang.python, "Chris Angelico"
 wrote:

> On Tue, Dec 6, 2016 at 8:38 AM, Lew Pitcher
>  wrote:
>> The OP asked for the runlevel, not the systemd target.
> 
> Runlevels don't exist in systemd. And systemd targets don't exist in
> Upstart. The question "what runlevel are we in" does not make sense
> unless you're using an init system that works on the basis of
> runlevels (eg sysvinit).

I repeat: The OP asked for the runlevel, not the systemd target.

That should tell you that an answer involving systemd "does not make sense".

To the OP: as others have said, the file
  /var/run/utmp
contains various records, including the RUN_LVL (runlevel) record. You can
find some documentation in utmp(3), including a record layout, and an values
list.

I don't know that python includes a standard or builtin method to parse the
utmp file; to retrieve the runlevel, you may have to code your own access
routine as part of your python code, or resort to invoking an external
program like who(1).

HTH
-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Detect Linux Runlevel

2016-12-05 Thread Lew Pitcher
On Monday December 5 2016 16:25, in comp.lang.python, "DFS" 
wrote:

> On 12/05/2016 03:58 PM, Wildman wrote:
>> I there a way to detect what the Linux runlevel is from
>> within a Python program?  I would like to be able to do
>> it without the use of an external program such as 'who'
>> or 'runlevel'.
> 
> 
> Why not?
> 
> '>>> import os
> '>>> os.system("systemctl get-default")
> graphical.target

Because

  $ cat rlevel.py
  import os
  os.system("systemctl get-default")
  16:36 $ python rlevel.py
  sh: systemctl: command not found
  16:36 $ 


> systemd 'graphical.target' corresponds to the old runlevel 5.

Yes? So?

The OP asked for the runlevel, not the systemd target.


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread Lew Pitcher
On Monday December 5 2016 11:23, in comp.lang.python, "BartC" 
wrote:

> On 05/12/2016 15:53, Chris Angelico wrote:
>> On Tue, Dec 6, 2016 at 2:41 AM, BartC  wrote:
>>>
>>> Are you saying that if someone executes:
>>>
>>>   subprocess.Popen(["python","a.py", "*"])
>>>
>>> the output will be: ['a.py','*']?
>>>
>>> In that case forget Windows vs. Linux, you now have a program that will
>>> get command parameters processed differently depending on whether it was
>>> invoked from a shell or not.
>>
>> Yes, that is correct. *SHELLS DO STUFF*. If you can't comprehend this,
>> you should get to know your shell. Try this:
>>
>> python a.py %PATH%
>>
>> subprocess.Popen(["python", "a.py", "%PATH%"])
>>
>> Would you expect those to do the same? If you do, prepare for Windows
>> to surprise you. If you don't, why do you keep expecting other shells
>> to do nothing?
> 
> You still don't get point. I write a program P, a native executable. It
> takes command line parameters but exactly what it gets depends on
> whether it's started from a 'shell' or from inside another program?

In Unix, it always has.


> I 
> don't want to worry about that stuff or exactly how it is invoked!

Then, I guess that you have a problem, don't you?

>  > subprocess.Popen(["python", "a.py", "%PATH%"])
> 
> Yes, %...% is an escape sequence. Those % signs are supposed to stand
> out and have been chosen not to clash with typical input.
> 
> And the end result of the transformation is, here, also a SINGLE thing;
> any parameter following will still be the second parameter, not the 14771th!
> 
> Are you saying that the * in ABC*EF also makes the whole thing some
> escape pattern?

If you ask the shell to parse the arguments, then, "YES, the * in ABC*EF makes
the argument a candidate for globbing".

> And one that could massively expand the number of parameters,

Yes

> pushing all the following ones out of the way, and making it 
> impossible to discover where these expanded parameters end and the
> normal ones recommence.

The best way to think about it is that all parameters are parameters, whether
derived from a glob input to a shell, or explicitly specified in the
invocation.

If you have a need for positional parameters, then either specify that your
code only accepts them in specific places, or find a way to disable globbing
(it can be done) and handle the expansion yourself, in your own code.

> If someone had thought this up now, it would rapidly be dismissed as
> being unworkable. But because it's been in Unix/Linux/whatever so long,
> no one can see anything wrong with it!

Primarily because there /IS/ nothing wrong with it.

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-05 Thread Lew Pitcher
On Monday December 5 2016 10:41, in comp.lang.python, "BartC" 
wrote:

> On 05/12/2016 15:05, Chris Angelico wrote:
>> On Tue, Dec 6, 2016 at 1:11 AM, BartC  wrote:
>>>
>>> BTW what does Popen() do when one argument is '*.*'? Will that get
>>> expanded to multiple extra arguments, and at what point will it be
>>> expanded?
>>
>> Nope. Popen is not a shell.
>>
>> It sounds as if you want a nerfed shell. Go ahead! I'm sure one
>> exists. It'll frustrate you no end once you get used to a better
>> shell, though - always does when I find myself on Windows...
> 
> That's not the point I was making.
> 
> Say you have this program a.py:
> 
>import sys
>print (sys.argv)
> 
> And let's say there are just 3 files in the current directory: a.py,
> b.py and c.py.
> 
> If run from a Linux shell:
> 
>python a.py *
> 
> The output is: ['a.py', 'b.py', 'c.py'] or something along those lines
> (there might be two copies of a.py).

And, that's because, before invoking Popen, the SHELL has globbed that '*'
argument into the three filenames and substituted those names where the '*'
was.

If you don't use a shell, then (on Unix), you have to perform the globbing
yourself before invoking Popen.

> 
> Are you saying that if someone executes:
> 
>subprocess.Popen(["python","a.py", "*"])
> 
> the output will be: ['a.py','*']?
> 
> In that case forget Windows vs. Linux, you now have a program that will
> get command parameters processed differently depending on whether it was
> invoked from a shell or not.

Yes.

> Or a program that sometimes will see "*" as an argument, and sometimes a
> big list of files that merges into all the other arguments.
> 

Yes.

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question about working with html entities in python 2 to use them as filenames

2016-11-22 Thread Lew Pitcher
On Tuesday November 22 2016 15:54, in comp.lang.python, "Steven Truppe"
 wrote:

> I've made a pastebin with a few examples: http://pastebin.com/QQQFhkRg
> 
> 
> 
> On 2016-11-22 21:33, Steven Truppe wrote:
>> I all,
>>
>>
>> i'm using linux and python 2 and want to parse a file line by line by
>> executing a command with the line (with os.system).
>>
>> My problem now is that i'm opening the file and parse the title but
>> i'm not able to get it into a normal filename:
>>
>>
>> import os,sys
>>
>> import urlib,re,cgi
>>
>> import HTMLParser, uincodedata
>>
>> import htmlentiytdefs
>>
>> imort chardet
>>
>> for ULR in open('list.txt', "r").readlines():
>>
>> teste_egex="(.+?)
>>
>> patter = re.compile(these_regex)
>>
>> htmlfile=urlib.urlopen(URL)
>>
>> htmltext=htmlfile.read()
>>
>> title=re.aindall(pater, htmltext)[0]
>>
>> title = HTMLParser.HTMLParser.unescape(title)
>>
>> print "title = ", title
>>
>> # here i would like to create a directory named after the content of
>> the title
>>
>>
>> I allways get this error:
>>
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2
>>
>>
>>
>> i've played around with .ecode('latin-1') or ('utf8') but i was not
>> yet able to sove this simple issue.

I'm no python programmer, but I do have a couple of observations.

First, though, here's an extract from that pastebin posting of yours:
> print "Title = ", title.decode()
>  
> - RESULT 
> Title =  Wizo - Anderster Full Album - YouTube
> Title =  Wizo - Bleib Tapfer / für'n Arsch Full Album - YouTube
> Title =  WIZO - Uuaarrgh Full Album - YouTube
> Title =  WIZO - Full Album - "Punk gibt's nicht umsonst! (Teill
III)" - YouTube
> Title =  WIZO - Full Album - "DER" - YouTube
> Title =  Alarmsignal -  Wir leben - YouTube
> Title =  the Pogues - Body of an american - YouTube
> Title =  The Pogues -  The band played waltzing matilda - YouTube
> Title =  Hey Rote Zora - Heiter bis Wolkig - YouTube
> Title =  Für immer Punk - die goldenen Zitronen - YouTube
> Title =  Fuckin' Faces - Krieg und Frieden - YouTube
> Title =  Sluts - Anders - YouTube
> Title =  Absturz - Es ist schön ein Punk zu sein - YouTube
> Title =  Broilers - Ruby Light & Dark - YouTube
> Title =  Less Than Jake 02 - My Very Own Flag - YouTube
> Title =  The Mighty Mighty Bosstones - The Impression That I Get - YouTube
> Title =  Streetlight Manifesto - Failing Flailing (lyrics) - YouTube
> Title =  Mustard Plug - Mr. Smiley - YouTube
>  
> But when i try:
> os.mkdir(title)
> i get the following:
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23:
> ordinal not in range(128) 

Now for the observations

1) some of your titles contain the '/' character, which on your platform
(Linux) is taken as a path separator character. The os.mkdir() method
apparently expects it's "path" argument to name a file in an already existing
directory. That is to say, if path is "/a/b/c", then os.mkdir() expects that
the directory /a/b will already exist. Those titles that contain the path
separator character will cause os.mkdir() to attempt to create a file in a
subdirectory of the current directory, and that subdirectory doesn't exist
yet. You either have to sanitize your input to remove the path separators,
and use os.mkdir() to create a file named with the name of the sanitized
path, /or/ use os.makedirs(), which will create all the subdirectories
required by your given path.

2) Apparently os.mkdir() (at least) defaults to requiring an ASCII pathname.
Those of your titles that contain Unicode characters cannot be stored
verbatim without either
  a) re-encoding the title in ASCII, or
  b) flagging to os.mkdir() that Unicode is acceptable.
Apparently, this is a common problem; a google search brought up several pages
dedicated to answering this question, including one extensive paper on the
topic (http://nedbatchelder.com/text/unipain.html). There apparently are ways
to cause os.mkdir() to accept Unicode inputs; their effectiveness and
side-effects are beyond me.

HTH
-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


RE: What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Lew Pitcher
On Thursday September 8 2016 17:17, in comp.lang.python, "Joaquin Alzola"
 wrote:

> Hi Ben
> 
> Thanks for the advice.
> 
>> * Complain
> 
> Basically what all comes down is to complain. I wonder if in a company of
> 80,000 people I will manage to change that behaviour.

Why don't you, at least, include a "signature" line at the end of /your/ text.
That way, the automatically-added "confidentiality clause" will end up
appended to the signature. Since many news readers discard or suppress
display of the signature, the "confidentiality clause" won't be as much of an
issue.

> This email is 
> confidential and may be subject to privilege. If you are not the intended
> recipient, please do not copy or disclose its content but contact the sender
> immediately upon receipt.

A signature begins with a line consisting only of two hyphens followed by a
space. Any lines that follow that line are considered to be part of the
signature.

-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Lew Pitcher
On Thursday May 28 2015 17:50, in comp.lang.c, "Skybuck Flying"
 wrote:

> Hello,
> 
> I was just coding and ran into a little logic problem which is as follows:
> 
> There are two booleans/variables which can be either false or true.
> 
> The desired thrutle table is:
> 
> A = input
> B = input
> C = output
> 
> A B C:
> ---
> F F T
> F T F
> T F T
> T T T

Seems simple enough: C == A || !B

18:38 $ cat testlogic.c
#include 
#include 

/*
** A = input
** B = input
** C = output
** 
** A B C:
** ---
** F F T
** F T F
** T F T
** T T T
*/

int testlogic(int a, int b)
{
  return (a || !b);
}

int main(void)
{
  /* A B C */
  int ttable[4][3] = {  {0,0,1},/* F F T */
{0,1,0},/* F T F */
{1,0,1},/* T F T */
{1,1,1} /* T T T */
 };
  int rc = EXIT_SUCCESS;
  int i, max;

  for (i = 0, max = sizeof(ttable) / sizeof(ttable[0]); i < max ; ++i)
if (testlogic(ttable[i][0],ttable[i][1]) != ttable[i][2])
{
  printf("testlogic failed on test %d\n",i);
  rc = EXIT_FAILURE;
}

  if (rc == EXIT_SUCCESS) puts("SUCCESS");

  return rc;
}
18:39 $ cc -o testlogic testlogic.c
18:39 $ ./testlogic
SUCCESS


-- 
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Beginner needs advice

2011-05-24 Thread Lew Schwartz
So, if I read between the lines correctly, you recommend Python 3? Does the
windows version install with a development environment?
-- 
http://mail.python.org/mailman/listinfo/python-list


Beginner needs advice

2011-05-24 Thread Lew Schwartz
Here's my background:

I'm a Windows based Visual FoxPro developer, and I want to start programming
in Python. I'll be sticking to Windows (XP & 7) and my immediate needs are
to manage & display large groups of jpg's, tiff's etc... so I need form
based & graphics capable libraries (in addition to basic programming skills,
of course).

So Python 2 or 3? Add on packages/libraries? Tutorials?

Thanks!

-Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: multi-core software

2009-06-07 Thread Lew

Jon Harrop wrote:

I agree entirely but my statements were about parallelism and not
concurrency. Parallel and concurrent programming have wildly different
characteristics and solutions. I don't believe shared mutable state is
overly problematic in the context of parallelism. Indeed, I think it is
usually the best solution in that context.


Interesting distinction.  Would it be fair to compare concurrent programming 
to the bricks used to build the parallel program's edifice?


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: multi-core software

2009-06-07 Thread Lew

Jon Harrop wrote:

I see no problem with mutable shared state.

In which case, Jon, you're in a small minority.


Patricia Shanahan wrote:

In my opinion, shared mutable state has a lot of problems. It is also
sometimes the best design for performance reasons.


As Dr. Jon pointed out upthread, one can write decent code with mutable shared 
state.  It is also true that mutable state presents a lot of problems - 
potential problems, ones that can be solved, but not ones that can be solved 
thoughtlessly.  On the flip side, one can write a tremendous amount of 
effective multi-threaded code involving shared mutable state with attention to 
a few rules of thumb, like always synchronize access and don't use different 
monitors to do so.


Unlike some environments (e.g., database management systems), Java's tools to 
manage concurrency are explicit and low level.  The programmer's job is to 
make sure those tools are used correctly to avoid problems.  As long as they 
do that, then there is no special problem with shared mutable state.


There is, however, a cost.  Certain things must happen slower when you share 
mutable state, than when you share immutable state or don't share state. 
Certain things must happen when you share mutable state, regardless of speed, 
because without them your code doesn't work.  For some reason, concurrent 
programming is an area often not well understood by a significant percentage 
of workaday programmers.  When problems do arise, they tend to be 
probabilistic in nature and vary widely with system characteristics like 
attempted load.


So the meeting ground is, yes, concurrent mutable state can present problems 
if not properly managed.  Properly managing such is not necessarily a huge 
burden, but it must be borne.  When done properly, shared mutable state will 
not present problems in production.


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: multi-core software

2009-06-07 Thread Lew

Scott David Daniels wrote:

the nub of the problem is not on the benchmarks.  There is something
to be said for the good old daays when you looked up the instruction
timings that you used in a little document for your machine, and could
know the cost of any loop.  We are faster now, but part of the cost of
that speed is that timing is a black art.  


Those good old days never existed.  Those manuals never accounted for things 
that affected timing even then, like memory latency or refresh time.  SRAM 
cache made things worse, since the published timings never mentioned 
cache-miss delays.  Though memory cache might seem a recent innovation, it's 
been around a while.  It would be challenging to find any published timing 
since the commercialization of computers that would actually tell the cost of 
any loop.


Things got worse when chips like the '86 family acquired multiple instructions 
for doing loops, still worse when pre-fetch pipelines became deeper and wider, 
absolutely Dark Art due to multi-level memory caches becoming universal, and 
throw-your-hands-up-and-leave-for-the-corner-bar with multiprocessor NUMA 
systems.  OSes and high-level languages complicate the matter - you never know 
how much time slice you'll get or how your source got compiled or optimized by 
run-time.


So the good old days are a matter of degree and self-deception - it was easier 
to fool ourselves then that we could at least guess timings proportionately if 
not absolutely, but things definitely get more unpredictable over evolution.


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Ban Xah Lee

2009-03-09 Thread Lew

s...@netherlands.com wrote:

On Mon, 09 Mar 2009 22:08:54 -0400, Lew  wrote:


Larry Gates wrote:

For me, the worst thing is when I'm programming, and a bug *actually* gets
on my monitor.  In real life, I'm this tough person: a rugged tradesmen.
I'm so phobic of bugs that I'll run away screaming like a girl.
I had a smudge on my monitor some years ago.  It was on the frame, not the 
screen itself, but visible on the side.  The person next to me pointed at it, 

  ^
He said: "I work so close to you we must be telemarketers, does my body odor
bother you?"


Uh ...

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Ban Xah Lee

2009-03-09 Thread Lew

Christian wrote:
... [Xah Lee] seems to be mostly doing a often highly intelligent monologue ... 


Really?

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Ban Xah Lee

2009-03-09 Thread Lew

Larry Gates wrote:

For me, the worst thing is when I'm programming, and a bug *actually* gets
on my monitor.  In real life, I'm this tough person: a rugged tradesmen.
I'm so phobic of bugs that I'll run away screaming like a girl.


I had a smudge on my monitor some years ago.  It was on the frame, not the 
screen itself, but visible on the side.  The person next to me pointed at it, 
thinking an insect had crawled onto the monitor, and asked, "Is that a bug?"


I looked, realized it was a baked-in blemish and answered, "No, it's a feature."

I didn't realize what I had done until after I said it.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: HTML Correctness and Validators

2009-01-06 Thread Lew
Xah Lee wrote...
>> recently [sic] i [sic] wrote a blog essay about html [sic] correctness and 
>> html [sic]
>> validators, with relations [sic] to the programing [sic] lang [sic] 
>> communities. I hope
>> programing [sic] lang [sic] fans will take more consideration on [sic] the 
>> correctness
>> of the doc [sic] they produces [sic].

"Aaron Gray" wrote:
> Do you enjoy spamming comp.lang.functional with OT cross-posts ?

Is that a rhetorical question?

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Mathematica 7 compares to other languages

2008-12-04 Thread Lew

Andreas Waldenburger wrote:

On Wed, 03 Dec 2008 20:38:44 -0500 Lew <[EMAIL PROTECTED]> wrote:


Xah Lee wrote:

enough babble ...

Good point.  Plonk.  Guun dun!



I vaguely remember you plonking the guy before. Did you unplonk him in
the meantime? Or was that just a figure of speech?


I have had some hard drive and system changes that wiped out my old killfiles.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Mathematica 7 compares to other languages

2008-12-03 Thread Lew

Xah Lee wrote:

enough babble ...


Good point.  Plonk.  Guun dun!

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Mathematica 7 compares to other languages

2008-12-02 Thread Lew

George Sakkis wrote:

As a Slashdotter would put it... you must be new here ;-)


For certain values of "here".  I've seen Xah before, and I'm happy to engage 
if he behaves himself.  Some of his initial ideas I actually find engaging. 
His followups leave a lot to be desired.


f/u set to comp.lang.functional.  It looks like he's got nothing to offer us 
Java weenies this time around.


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Mathematica 7 compares to other languages

2008-12-02 Thread Lew
Xah Lee wrote:
> If [yo]u would like to learn [the] [E]nglish lang[uage] and writing insights 
> from me,
> peruse:

/Au contraire/, I was suggesting a higher standard for your posts.


> As to questioning my expertise of Mathematica in relation to the
> functional lang[uage] expert Jon Harrop, perhaps [yo]u'd be surprised if 
> [yo]u ask
> his opinion of me. My own opinion, is that my Mathematica expertise
> surpasses his. My opinion of his opinion of me is that, my opinion on
> Mathematica is not to be trifled with.

I have no assertion or curiosity about Jon Harrop's expertise compared
to yours.  I was expressing my opinion of his expertise, which is
high.

> Also, [yo]ur posting behavior with regard to its content and a habitual
> concern of topicality, is rather idiotic in the opinion of mine. On

There is no reason for you to engage in an /ad hominem/ attack.  It
does not speak well of you to resort to deflection when someone
expresses a contrary opinion, as you did with both Jon Harrop and with
me.  I suggest that your ideas will be taken more seriously if you
engage in more responsible behavior.

> the surface, the army of [yo]ur kind have the high spirit for the health
> of community. But underneath, i [sic] think it is [yo]u who [a]r[e] the most
> wortheless with regards to online computing forum's health.

You are entitled to your opinion.  I take no offense at your attempts
to insult me.

How does your obfuscatory behavior in any way support your technical
points?

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Mathematica 7 compares to other languages

2008-12-02 Thread Lew
Xah Lee wrote:
> LOL Jon. r u trying to get me to do otimization for you free?

These are professional software development forums, not some script-
kiddie cellphone-based chat room.  "r" is spelled "are" and "u" should
be "you".

> how about pay me $5 thru paypal? I'm pretty sure i [sic] can speed it up.
> Say, maybe 10%, and even 50% is possible.

The first word in a sentence should be capitalized.  "PayPal" is a
trademark and should be capitalized accordingly.  The word "I" in
English should be capitalized.

Proper discipline in these matters helps the habit of mind for
languages like Java, where case counts.

Jon Harrop has a reputation as an extremely accomplished software
maven and columnist.  I find his claims of relative speed and
compactness credible.  He was not asking you to speed up his code, but
claiming that yours was not going to be as effective.  The rhetorical
device of asking him for money does nothing to counter his points,
indeed it reads like an attempt to deflect the point.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Mathematica 7 compares to other languages

2008-12-01 Thread Lew

Jon Harrop wrote:

Xah Lee wrote:

(nothing Java-related)

Please take this crud out of the Java newsgroup.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: Mathematica 7 compares to other languages

2008-12-01 Thread Lew

[EMAIL PROTECTED] wrote:

A rational human would realize that not too many people peruse this
newsgroup,
and that most of them have already seen the wall of text post that you
generate every time.


Just out of curiosity, what do you consider "this" newsgroup, given its wide 
crossposting?


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: what's so difficult about namespace?

2008-11-27 Thread Lew

[EMAIL PROTECTED] wrote:

It's mostly a problem of culture.

If you look, for example, at chinese [sic] names, the name space is not that
much important:
"Xee Laa" only takes this space:
"   "
 ^^^


Chinese names are presumably not spelled with Roman letters in Chinese, so 
this really says nothing about how Chinese "wastes" space.



Instead, if you take a typical english [sic] name, say, "Abraham Lincoln",
you instantly recognize the waste of space used by this name:
"  "
 ^^


How is that wasted?  "Abraham Lincoln" is a longer name.  Only one character 
is silent.  In the transliteration you show for a Chinese name, two characters 
are wasted.



Concluding: I think that americans [sic] are very good at wasting name
spaces, whereas chinese [sic] ones seem less name space hungry.

Sure, you could make some other example, proving for the contrary, but
I think the one cited above already suffices.


Your example shows the opposite of what you claim.  By your own example, the 
Chinese transliteration "wasted" twice as much space as the American one.


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: what's so difficult about namespace?

2008-11-27 Thread Lew

Xah Lee wrote:

this one is published a decade ago by a lisp [sic] dignitary.
Its theory of programing [sic] and software engineering is poetry and
taoism [sic].
It suggests that C will be the last lang.


In a paroxysm of precognitive genius, seemingly.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: what's so difficult about namespace?

2008-11-26 Thread Lew

Xah Lee wrote:

Of languages that do have namespace that i [sic] have at least working
expertise: Mathematica, Perl, Python, Java. Knowing these langs
sufficiently well, i [sic] do not see anything special about namespace. The
_essence_ of namespace is that a char is choosen as a separator, and
the compiler just use this char to split/connect identifiers.


That is hardly the essence of namespaces, just a notational convenience to 
help humans relate to namespaces.  The essence of namespaces is that they are 
distinct.


It's also not an accurate statement.  XML namespaces, for example, use many 
characters as separators, not just one, but that's not the essence.  The 
essence is that all the characters matter, not just the putative separators.



Although i [sic] have close to zero knowledge about compiler or parser, but
from a math point of view and my own 18 years of programing
experience, i [sic] cannot fathom what could possibly be difficult of
introducing or implementing a namespace mechanism into a language. I
do not understand, why so many languages that lacks so much needed


Point not proven.  If they were really needed in every language, every 
language would have them.



namespace for so long? If it is a social problem, i [sic] don't imagine they
would last so long. It must be some technical issue?


Yeah, like technically they aren't needed everywhere.


Could any compiler expert give some explanation?


Compilers are not relevant.  XML has namespaces, and compilers certainly 
aren't the issue there.


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-07-22 Thread Lew

Rob Warnock wrote:

Martin Gregorie  <[EMAIL PROTECTED]> wrote:
+---
| John W Kennedy wrote:
| > No, the "thunks" were necessary at the machine-language level to 
| > /implement/ ALGOL 60, but they could not be expressed /in/ ALGOL.

|
| Are you sure about that? 
+---


I don't know if John is, but *I* am!  ;-}


At this point we are so far off topic for clj.programmer, but still impinging 
on functional programming issues with the discussion of closures, et al., that 
I respectfully request that you all exclude clj.programmer from followups to 
this thread.


(f-u set to comp.lang.functional)

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: spam

2008-07-13 Thread Lew

rickman wrote:

On Jul 12, 9:21 am, Scott in SoCal <[EMAIL PROTECTED]> wrote:

In message
<[EMAIL PROTECTED]>,

rickman <[EMAIL PROTECTED]> wrote:

spam

*PLONK!*


I love the way that people who plonk others feel the need to inform
everyone of it.  That ranks up there with, "I know what you are, but
what am I?"


That's one interpretation, likely not the plonkers but supportable by reasoning.

Another supportable interpretation is that it both does the offender the 
courtesy of notification so that they get one last chance to reconsider their 
behavior, and suggests to the community at large that they follow suit.  So a 
public "plonk" is actually a service both to the troll/spammer/innocent victim 
of slander and to the larger newsgroup community.


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: spam <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

2008-07-12 Thread Lew

WDC wrote:

BTW I reported it, yo should too.


To whom did you report it, so that we may also report it there?

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-06-30 Thread Lew

Robert Maas wrote:

/\
| ,-.-.   |  |
| | | |,   .,---.,---.,---.,---.,---.,---.,---|,---. |
| | | ||   |`---.|   ||   ||   ||---'|---'|   |`---. |
| ` ' '`---|`---'`---'`   '`   '`---'`---'`---'`---' |
|  `---' |
| | | o  | | |
| |---.,---.|,---..,---.,---.|,---.,---.   |---.,---.,---.   |
| |   ||---'||   |||   |,---|||   ||---'---|   ||,---|   |
| `   '`---'`---'|---'``   '`---^`---'`---|`---'   `---'``---^ | |
||`---'   '  |
|   |   | |  |
| ,---.,---.|--- . . .,---.,---.,---|,---.,---.   |---.,---.,---.|
| |   ||   ||| | ||   ||   ||   ||---'|---|   ||,---||
| `   '`---'`---'`-'-'`---'`   '`---'`---'`   `---'``---^o   |
\(Rendered by means of <http://www.sc*.html>)/
 (You don't need JavaScript or images to see that ASCII-text image!!
  You just need to view this in a fixed-pitch font such as Monaco.)

Then enter your best guess of the text (40-50 chars) into this TextField:
      +--+
  | Your son totally needs a Wonder-Bra(r), double-D |
  +--+


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-05-30 Thread Lew

Gordon Etly wrote:

Lew wrote:

John Thingstad wrote:



Perl is solidly based in the UNIX world on awk, sed, bash and C.
I don't like the style, but many do.



Please exclude the Java newsgroups from this discussion.


Why? Do you speak for everyone in that, this, or other groups?


I don't know why you'd even want to impose your Perl conversation on the Java 
group in the first place, troll.


Plonk.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-05-30 Thread Lew

John Thingstad wrote:

Perl is solidly based in the UNIX world on awk, sed, bash and C.
I don't like the style, but many do.


Please exclude the Java newsgroups from this discussion.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: blogs, longbets.org, and education of sociology

2008-05-25 Thread Lew

[EMAIL PROTECTED] wrote:
For about the past 10 years, i [sic] have been 


saying things like


... fart ignorant ..., often in a
irresponsible and carefree way.

...

Some of these beer drinking f**kheads are simply being a asshole,

...

vandalism. (the tech geekers use in-group slang for this: “troll”.)


Actually, it's argot, not slang.  The definition is fairly narrow and well 
understood.


more obscenity:

technology. (note: not reading more motherf**king slashdot or
motherf**king groklaw or more great podcasts on your beatific language
or your postmodernistic f**khead idols)


And the temerity of:

(One thing you can do, is actually take a course on philosophy,
history, law, economics, in your local community college.)


Yeah, those bastions of intellectual elitism.

Plonk, plonk, plonk.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list

Re: generate all possible math expr of one term

2008-05-14 Thread Lew

[EMAIL PROTECTED] wrote:

 —Xah Lee, 2005


Blah, blah, blah.  Plonk.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list

Re: The Importance of Terminology's Quality

2008-05-10 Thread Lew

Sherman Pendley wrote:

Lew <[EMAIL PROTECTED]> writes:


You guys are off topic.  None of the million groups to which this
message was posted are about netiquette.


Netiquette has come up at one point or another in pretty much every
group I've ever read. It's pretty much a universal meta-topic.


Good, then please have the courtesy not to include comp.lang.java.programmer 
in the distribution for this thread any longer.


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-05-10 Thread Lew

Waylen Gumbal wrote:

George Neuner wrote:

On Thu, 8 May 2008 22:38:44 -0700, "Waylen Gumbal" <[EMAIL PROTECTED]>
wrote:





Not everyone follows language-neutral groups (such as
comp,programming as you pointed out), so you actually reach more
people by cross posting. This is what I don't understand - everyone
seems to assume that by cross posting, one intends on start a
"flamefest", when in fact most such "flamefests" are started by
those who cannot bring themselves to skipping over the topic that
they so dislike.

The problem is that many initial posts have topics that are misleading
or simplistic.  Often an interesting discussion can start on some
point the initial poster never considered or meant to raise.


Is this not a possibility for any topic, whether it's cross-posted or 
not?


You guys are off topic.  None of the million groups to which this message was 
posted are about netiquette.


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-05-08 Thread Lew

Waylen Gumbal wrote:
Not everyone follows language-neutral groups (such as comp,programming 
as you pointed out), so you actually reach more people by cross posting. 
This is what I don't understand - everyone seems to assume that by cross 
posting, one intends on start a "flamefest", when in fact most such 
"flamefests" are started by those who cannot bring themselves to 
skipping over the topic that they so dislike.


It's not an assumption in Xah Lee's case.  He spams newsgroups irregularly 
with rehashed essays from years ago, and a number of people are just tired of 
him.  Don't blame the victims for the perpetrator's actions, OK?


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-05-08 Thread Lew

Robert Maas, http://tinyurl.com/uh3t wrote:

I have my own gripe against regular expressions ("regex" for short).
I hate the extremely terse format, with horrible concoctions of
escape and anti-escape magic characters, to fit within Unix's
255-character limit on command lines, compared to a nicely
s-expression nested notation that would be possible if regex hadn't
entrenched itself so solidly.


This is all very interesting, but not Java.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: The Importance of Terminology's Quality

2008-05-08 Thread Lew

[EMAIL PROTECTED] wrote:

 |   PLEASE DO NOT   |:.:\:\:/:/:.:
 |  FEED THE TROLLS  |   :=.' -   - '.=:


I don't think Xah is trolling here (contrary to his/her habit)
but posing an interesting matter of discussion.


Interesting is in the eye of the beholder.  After you'd read the same recycled 
crud from certain posters again and again, it because trollish spam.


--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: pop langs website ranking

2008-04-22 Thread Lew

Gerry Ford wrote:
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

On Apr 22, 4:41 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

In February, i spent few hours researching the popularity of some
computer language websites.


I seem to recall this exact same post from *last* February.

--->I remember it too.  Xah is quite the self-promoter.  Massive 
cross-posters don't have anything to say for me.


So don't do it.

--
Lew
--
http://mail.python.org/mailman/listinfo/python-list


Re: SPAM

2007-11-14 Thread Lew
just bob wrote:
> "John Bean" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> On Wed, 14 Nov 2007 11:04:35 -0800, "just bob"
>> <[EMAIL PROTECTED]> wrote:
>>
>> Your SPAM appears to be non-existent. Vapourware. Not real.
>>
>> Shame, I fancied a Spam fritter.
>>
> 
> The guy gets Google dollars when people view the site or click on links, me 
> thinks. It's spam. 

Yes, but it's not SPAM.

SPAM is a registered trademark of Hormel Foods Corporation for a canned pork 
product.

Spam is unwanted messages or email.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-22 Thread Lew
Xah Lee <[EMAIL PROTECTED]> wrote:
>> 4. Inargurated a massive collection of documents that are invalid
>> HTML. (due to the programing moron's ingorance and need to idolize a
>> leader, and TeX's inherent problem of being a typesetting system that
>> is unsuitable of representing any structure or semantics)

There's something a little fey about someone calling out a "programing [sic] 
moron's ingorance [sic]" and then devolving right into blue speech.

I think Xah Lee should look into:
<http://en.wikipedia.org/wiki/Psychological_projection>

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-22 Thread Lew
Xah Lee wrote:
> i have written ... No coherent argument, 

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Distributed RVS, Darcs, tech love

2007-10-21 Thread Lew
llothar wrote:
> On 21 Okt., 22:45, Lew <[EMAIL PROTECTED]> wrote:
> 
>> Evidence is that TeX development is dead.
> 
> Exactly and Knuths only contribution to software development was the
> theory of
> "literate" programming. As i said for me algorithms are not software
> development,
> this is programming in the small (something left for coding apes), not
> programming
> in the large. There are no problems anymore with programming the
> small, sure you
> can try to develop Judy Arrays or another more optimized sorting
> algorithm, but
> this has no real world effect. It is theoretical computer science -
> well a few
> people seem to like this.
> 
> And as an evidence that this theory works ("literate" programming) -
> there is no
> easy prove about efficient workflow - was his TeX program where only
> some parts
> are handled like this. But drawing an conclusion from a "developement
> dead"
> project to other "in development" projects is just sorry: fucking
> stupid.

No, I conclude that literate programming works from the prevalence of tools 
like Javadoc and Doxygen, and the Sun and MS coding standards documents.  I 
see the direct benefits in my own work every day.

Proposing a straw-man argument then knocking it down with mere purple prose 
like "just sorry: [sic] fucking stupid" is, sorry, just fucking stupid.  See? 
  No logic there at all.  Thus proving that there's no logic there at all.

> Everythink in the real world says that "literate" programming is not
> useable.

Rrr?  "Everythink" does, eh?  Maybe what the world needs instead is literate 
programmers, then.

Cite some specifics, please?  And remember, when you say "everything" that 
even one counter-example disproves.

There is evidence that aspects of "literate" programming do work.  Besides, 
that a theory is wrong is part of science, not a denigration of the scientist. 
  Even a wrong theory, like Newtonian mechanics, advances the science (e.g., 
physics) and is evidence that the scientist (Isaac Newton) is a genius.  Like 
Donald Knuth.

> Sure if you are an academic guy you can do endless post-mortem
> analysis you might
> find this amazing but it is just as worthless for the real world as a
> guy building
> a copy of the Eiffel tower from burned matches - a pure hobby.

So you say, again with just rhetoric and complete lack of evidence or argument 
to support the outrageous assertion.  Many people, myself included, have seen 
your so-called "real world" benefit significantly from academic results. 
Object-oriented programming is an example.  The fertilization works both ways; 
check out how the science of computer graphics expanded thanks to LucasFilms.

Try using reason, logic and evidence for your points instead of merely 
shouting obscenities, hm?

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Distributed RVS, Darcs, tech love

2007-10-21 Thread Lew
llothar wrote:
> Well programming in the small like sort algorithms for sure. But not
> for his great discoveries but for one of the first man who was paid
> for this by this university employee.

What a curious thesis.

> But in the field of software enginering as i said before he
> completely
> failed.

As you said, but for which you provided absolutely no evidence, and the 
counter evidence that Arne provided is that he has not "completely" failed for 
any useful value of "failed".  Statements of absolute only need one 
counterexample.  /The Art of Programming/ is arguably the most significant 
contribution to the field of software engineering.  By any reasonable 
assessment, on the basis of that one work alone Knuth was a success.

Your rhetorical tack of unfounded assertions and inflammatory 
characterizations, not to say complete disregard for the reality of the 
situation, do not make a cogent case, much less a convincing one.

I am afraid that your conclusion is quite mistaken.  Knuth is, if anything, a 
huge success in the field of software engineering, whether you rate it as 
making a contribution to the art, or as being paid to perform the art.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Distributed RVS, Darcs, tech love

2007-10-21 Thread Lew
llothar wrote:
> On 21 Okt., 21:39, Arne Vajhøj <[EMAIL PROTECTED]> wrote:
> 
>> That level of activity could be considered dead.
> 
> For me at least 2% of the total line count should be changed
> to call it non dead.
> 
> I don't say it it not used anymore for users it might be
> not dead but this is not the point under discussion here.

No, there are two points - not whether Tex is "dead", but whether it's a "dead 
end" (which do you mean?), and whether in any way that says anything about 
Knuth's ability as a programmer.

Evidence is that TeX development is dead.  There is not yet firm evidence that 
Tex is a "dead end" (or even what that means), and there has been none (nor, I 
expect, is there any) that any of that reflects on Knuth's skill as a 
programmer.

The switch from asserting "dead end" to asserting "dead" is sort of an 
interesting rhetorical device.  Just pick one or the other, or if you prefer, 
assert both, but please be clear.  Should we just accept that you meant, "less 
than 2% of total line count changed"?  Per year?  Per century?  What if the 
code is perfect and has no need of change?  Is it (a) dead (end)?

(Who uses line count as a metric of anything any more?)

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Distributed RVS, Darcs, tech love

2007-10-21 Thread Lew
OMouse wrote:
> For the love of the Perl, Python, Lisp, Java and functional
> programmers, please just give an abstract of what you've written and
> link to it?

I expect you'll be ignored on that.  Xah Lee reposts and reposts these essays 
from years agone.  I don't even read his posts, just the responses.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Distributed RVS, Darcs, tech love

2007-10-21 Thread Lew
Arne Vajhøj wrote:
> Lew wrote:
>>> very
>>> different. Having a dead - i mean end of development line software
>>> like TeX - and
>>
>> Based on what do you call it "dead end".  It's used, it's outlasted 
>> many other flashes in the pan, it does what its users require.  You 
>> will need evidence for such a claim.
> 
> According to wikipedia the last version is from december 2002.
> 
> That level of activity could be considered dead.
> 
> It would for almost any other software. Tex has some
> "absolute" over it, so I am not sure normal software
> practices apply.
> 
> But you could argue based on that.

No, you present good evidence that TeX is a dead end.  It still doesn't 
support the claim llothar wrote:
>> Depends. I would call Knuth as one of the worst programmers. 

Plenty of brilliant programmers have written software that is no longer used 
(except in legacy use cases).  Good software, too.  I suppose what I was 
reacting to was the notion that TeX was a dead end at the time Knuth came up 
with it, and that that somehow invalidated the accomplishment of coming up 
with TeX.

The fact that it is still in use even five years after cessation of 
development does mitigate the "dead end" assessment at least potentially.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Distributed RVS, Darcs, tech love

2007-10-21 Thread Lew
llothar wrote:
> Depends. I would call Knuth as one of the worst programmers. Look at
> his total
> failures on literature programming. Software Engineering is something

Umm, the term is "literate" programmer and there is evidence that it is not a 
"failure".

> very
> different. Having a dead - i mean end of development line software
> like TeX - and

Based on what do you call it "dead end".  It's used, it's outlasted many other 
flashes in the pan, it does what its users require.  You will need evidence 
for such a claim.

> then trying to base a theory about software engineering (which is
> based on changes)

"base a theory" on what?  There's a clause missing here.

> is so absolutely stupid ...

Is that a technical evaluation?  It looks like random inflammatory comments 
without basis in logic or evidence.  Can stupidity be absolute?  What is the 
metric of stupidity?

How would you disprove that assertion?  Oh, wait, there wasn't an assertion. 
The sentence was incomplete.  What are you asserting?

A theory based on what, exactly, is "so absolutely stupid"?

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Distributed RVS, Darcs, tech love

2007-10-20 Thread Lew
George Neuner wrote:
> An attractive person of the opposite sex stands on the other side of
> the room.  You are told that your approach must be made in a series of
> discrete steps during which you may close half the remaining distance
> between yourself and the other person.
> 
> Mathematician: "But I'll never get there!"
> 
> Engineer: "I'll get close enough."

Mechanician (to the researcher): Hey, you look pretty good.  What's your sign?

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-07 Thread Lew
[EMAIL PROTECTED] wrote:
> Don't both "man" and those words for measurement come ultimately from
> words for "hand" (similarly to words like "manual", as in labor)? Our
> clever hands with their opposable thumbs being considered a defining
> characteristic. And our tool use thus derived. Handspans also having
> been a common (if imprecise) early unit of measurement (along with
> forearm-spans, as in cubits, strides, and foot-length, from which the
> measurement in feet still derives its name).

For most humans, the length of their foot from heel to toe is nearly equal to 
the length of their forearm elbow to wrist.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-04 Thread Lew
Tim X wrote:
> "The Americans are identical to the British in all respects except, of
> course, language."  Oscar Wilde

> "We (the British and Americans) are two countries separated by a common
> language.  G.B. Shaw


>  There is a well-known saying: Two nations separated by a common language. 
> However, this phrase doesn't seem to have been positively recorded in this 
> form by anyone.
> 
> In The Canterville Ghost Oscar Wilde wrote:
> 
>  /We have really everything in common with America nowadays except, of 
> course, language/
> 
> In a 1951 book of quotations, and without attributing a source, George 
> Bernard Shaw was credited with saying:
> 
>  /England and America are two countries separated by the same language/
> 
> Even Dylan Thomas had his say in a radio talk in the early 50s:
> 
>  /[European writers and scholars in America are] up against the barrier of a 
> common language/
> 
> But where the original phrase came from, nobody knows, and it is probably 
> simply incorrectly quoted.
<http://yedda.com/questions/origin_famous_sentence_quotations_8625651351715/>

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-03 Thread Lew
rjack wrote:
> Webster? WEBSTER. . . ?
> 
> Whatever happened to the Oxford English Dictionary ?
> Seems to me the English have always spoken the definitive
> English. . . that's why they call it ENGLISH.

What is in a name?  A rose by any other name would still smell as sweet.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-03 Thread Lew
Bent C Dalager wrote:
> In article <[EMAIL PROTECTED]>, David Kastrup  <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] (Bent C Dalager) writes:
>>
>>> I have never claimed equivalence. What I have made claims about are
>>> the properties of one of the meanings of a word. Specifically, my
>>> claim is that "free" is a reasonable description of some one or some
>>> thing that has been "liberated".
>> But it suggests that the natural state would be the unfree state.
> 
> Would this be a good thing? Would it be a bad thing? What is your
> point?

"There's no easy way to be free."

"The price of freedom is eternal vigilance."

Freedom is not natural.  It must be defended.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The meaning of a = b in object oriented languages

2007-09-19 Thread Lew
Lew wrote:
>> Java is a strongly-typed, compiled language which means it does more
>> static type checking and thus would reject treating a as both an array
>> and a String.
>>   In that environment the programmer must choose one or the other.

Ken Bloom wrote:
> In this Java example, a and b are statically typed to be of type Object. 
> Both Strings and Arrays [sic] descend from Object. (And primatives [sic] like 
> integers and the like will be autoboxed into descendants of Object).

That doesn't make Strings and arrays assignment compatible, and besides, it 
isn't so.

It was not stated by the OP that they were statically typing the variable to 
Object.  In fact, their example used a type "Animal".  They also used the 
syntax "a[1]", which is not possible in Java with a variable of type Object. 
So clearly a and b are /not/ statically typed to Object.

Unless you meant "/if/ a and b are statically typed [to] Object" that the 
assignment will work, which is true but of sharply limited usefulness.

In that case, you are a) defeating Java's type system and b) not getting the 
benefit of the Stringness or arrayness of the variable.  This is in contrast 
to the dynamically-typed languages wherein the variable will behave like an 
object of the runtime type, unlike in Java.

Back to the OP's example:
Summercool wrote:
>> so that's why  a[1] = "foobar"  will change what b will display, but 
>> a = "foobar" will not change what b will display.

Again, this cannot be done in Java.  The same variable a cannot be set to a 
String and still be used with array syntax.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Lew
Roel Schroeven wrote:
> Laurent Pointal schreef:
>> Summercool a écrit :
>>>
>>> The meaning of  a = b  in object oriented languages.
>>> 
>> 
>>
>> Oups, reading the subject I thought it was a Xah Lee post.
> 
> me too ...

Nah, this dude's all right, so far.  As if my opinion mattered.

Stay with it, Summercool.  It's what discussion groups are for.

Here's why the reaction: cross-posting of computer-science-type essays, 
something Xah Lee does.  But he recycles all his decades-old crap and really 
doesn't participate in the discussion.  This isn't that at all.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: The meaning of a = b in object oriented languages

2007-09-18 Thread Lew
Summercool wrote:
> when a writing or a book reads "a is a Hash object; a is an Array
> object; or a is an Animal object" it is just a short form to say that
> "a is a reference to that object."
> 
> b = a means "whatever a is referencing to, now b is referencing it
> too".
> 
> so that's why  a[1] = "foobar"  will change what b will display, but
> a = "foobar" will not change what b will display.  

You can't do both in Java.  Is a an array or a String?  If a is a String and b 
is an array, then neither `a = b' nor `b = a' will compile in Java.

Java is a strongly-typed, compiled language which means it does more static 
type checking and thus would reject treating a as both an array and a String. 
  In that environment the programmer must choose one or the other.

Otherwise what you say is exactly correct.

> (because a[1] = "foobar" says "what is  a  referencing?  go there and change 
> its
> content that has the index 1"  and when b goes there to see it, it is
> also changed.)

Speaking just of Java, it's useful to distinguish a variable from an object 
(instance).  As you point out, the variable represents a reference to the 
instance.  The variable has a compile-time type in Java, which may be 
different from the run-time type of the object, albeit compatible.

C++ is similar in this respect.  Python and Ruby are more, shall we say, 
flexible in their type systems.

Both jet liners and hang gliders have their uses, both are flight, and neither 
is really suitable for the other's purpose.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Car-ac-systems

2007-09-11 Thread Lew
John Timney (MVP) wrote:
> How do I control one with C# then!  Thats not on your site, clearly not 
> everything I need to know then.  Waste of a site!

Please do not top post.

> "knjaz" <[EMAIL PROTECTED]> wrote in message 
>> Here you can find everything you need to know about car air
>> conditioning
>>
>> http://car-ac-systems.blogspot.spam/

I'm starting to see "blogspot" as a synonym for "spam".

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Latest models of Gibson guitars

2007-08-20 Thread Lew
RickH wrote:
> On Aug 19, 9:24 pm, Randall Ainsworth <[EMAIL PROTECTED]>
> wrote:
>> In article <[EMAIL PROTECTED]>, Hermit
>>
>> <[EMAIL PROTECTED]> wrote:
>>> How does the image quality compare with a DSLR?
>> Depends on whether it's a Paul or a Strat.
> 
> A Strat is a Fender, but I'd rather win a Gibson es175.

Please do not include comp.lang.java.programmer in this discussion, as it is 
wy off topic.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Latest models of Gibson guitars

2007-08-20 Thread Lew
Twisted wrote:
> On Aug 19, 2:41 pm, [EMAIL PROTECTED] wrote:
>> This is  a newsgroup of programming language Python, stop with this!
> 
> Python?! Python is as off-topic here as guitars, unlike, say, Java...

When referring to "this" newsgroup or "here", one must remember that this is a 
cross-posted thread, so those concepts have multiple referents.

Take another look at the address field ("Newsgroups:") of the message, then 
redefine "this newsgroup" accordingly - there are more than one due to the 
spammish cross-posting of the original message.

So let's all stop being so parochial, hmm?

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Portable general timestamp format, not 2038-limited

2007-07-12 Thread Lew
Ben Finney wrote:
> [0] Left unqualified, referring to a site named "Wiki" refers to *the*
> Wiki, at http://c2.com/cgi/wiki>. If you mean some other
> subsequent Wiki site, you'll need to be more specific.

I'm betting they meant
<http://en.wikipedia.org/wiki/Main_Page>

or one of its non-English siblings.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-08 Thread Lew
Twisted wrote:
> On Jul 7, 6:12 pm, Lew <[EMAIL PROTECTED]> wrote:
>> Twisted wrote:
>> Edward Dodge wrote:
>>>> So -- what magical computer app illuminates the entire room and shows
>>>> you how to use everything at the flip of a switch?  This brilliant
>>>> discovery would put Sam's, O'Reilly, the for-Dummies series, and
>>>> virtually every other computer book publisher out of business in weeks.
>>>> Naturally, this would include the publishers of books on "easy-to-use"
>>>> Microsoft products.
>>> I don't know, but it sure as hell isn't emacs.
>> The reason you don't know, and Edward Dodge's point, is that there is no such
>> app, whether emacs or not.
> 
> Translation: since perfection is unattainable, we shouldn't even try,
> and just foist upon our poor users whatever awkward and hard-to-learn
> interface pops into our heads first?

Nice rhetoric but completely twisted the point.  Blt!

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs: terminology buffer and keybinding

2007-07-07 Thread Lew
Twisted wrote:
Edward Dodge wrote:
>> So -- what magical computer app illuminates the entire room and shows
>> you how to use everything at the flip of a switch?  This brilliant
>> discovery would put Sam's, O'Reilly, the for-Dummies series, and
>> virtually every other computer book publisher out of business in weeks.
>> Naturally, this would include the publishers of books on "easy-to-use"
>> Microsoft products.
> 
> I don't know, but it sure as hell isn't emacs.

The reason you don't know, and Edward Dodge's point, is that there is no such 
app, whether emacs or not.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: People who reply to spammers [was: Re: I need some cleanings tips and advice.]

2007-06-23 Thread Lew
Steven D'Aprano wrote:
> On Fri, 22 Jun 2007 16:11:58 +, Colin B. replied to a spammer with:
> 
>> Let's see if I get this right.
>>
>> You create a website for a subject that you know nothing about. Then you
>> try to solicit content in a bunch of programming language newsgroups.
>>
>> Wow, that's pretty pathetic, even for a google-groups poster!
>>
>> Begone with you.
> 
> You know, my ISP did a pretty good job of recognizing the original post as
> spam, and dropped it, so I never even saw it until your post came along.
> So I wonder, who is more pathetic -- the spammer, who at least is hoping
> to make money from his rudeness, or idiots who try to reason with spammers
> AND include the spam in their reply?
> 
> Thanks a lot Colin, I really appreciate you finding a way to bypass the
> spam filtering. Not.
> 
> (You know, if I were a spammer, I would disguise my spam as an indignant
> response to spam, thus guaranteeing a vastly greater audience.)
> 
> Colin, if that doesn't convince you to STOP ENGAGING SPAMMERS IN
> DISCUSSION, no matter how witty you think your reply is, let me
> point out that by rudely including the text of the spam in your
> post, you are associating your name and email address with spam. That
> might not be such a good thing to do as more and more people use Bayesian
> filtering. 

Oh, hush.  What fun is life when you can't unleash your venom on a spammer who 
probably will never read it?

Take a chill pill and enjoy the fun.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs

2007-06-22 Thread Lew
Twisted wrote:
> I find these anecdotes liberally sprinkled into this thread frankly
> unbelievable. Either they are not using the same software I understand
> "emacs" to refer to, or someone somewhere is simply lying. 

So if someone provides evidence with which you disagree, you accuse them of 
lying.

There's no opportunity for reasoned discourse in the face of such tactics.  Or 
room for new information to combat one's prejudices.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Portable general timestamp format, not 2038-limited

2007-06-22 Thread Lew
James Harris wrote:
> a) store, as a 32-bit number, days since a virtual year zero (there is
> no year zero in common era time 
<http://en.wikipedia.org/wiki/Common_Era>).

But according to the same article:
> (It [year zero] is, however, used in the astronomical system and ISO 8601.)

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs

2007-06-21 Thread Lew
Lew wrote:
>> To the claim that "emacs is too hard for the beginner" we have a mounting 
>> pile 
>> of steaming evidence that refutes.  It may still be true that it is too hard 
>> for some beginners..

notbob wrote:
> I point them to jed.  I, too, was overwhelmed by emacs, initially, but
> can't stand vi so I had to do something.  jed was my savior.  It uses
> many standard keys like backspace and the arrows, so newbs aren't so
> confused.  

You mean compared to the way emacs also uses the same "standard" keys, like 
backspace and the arrows?  How are the arrow keys in emacs more confusing than 
the arrow keys in jed?

Your comment reads like you've missed most of this thread.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs

2007-06-21 Thread Lew
Joel J. Adamson wrote:
> My point is that I'm the sort of person that has a mind set up for
> Emacs.  I had none of the difficulties that someone else might have,
> who's used to other kinds of software.
> 
> However, I'll also point out that my wife has used Emacs a couple
> times, and she's never done more than point and click with a computer,
> and she's had no frustration whatsoever.

A new user of two hours' experience.  A father of a six-year old whose child 
hums along happily with emacs.  A computer widow who "had no frustration 
whatsoever" with it.

To the claim that "emacs is too hard for the beginner" we have a mounting pile 
of steaming evidence that refutes.  It may still be true that it is too hard 
for some beginners, but then again the power cord can be too hard for some 
people.  (I used to help customers find the Big Red Switch when they first got 
a computer.  There were many who needed it.)

To the claim that emacs has arcane keystrokes comes the evidence that modern 
revs have "normal" keystrokes like right-arrow, F1, Ctrl-End.

To the claim that the help is too hard to use comes the evidence that three 
simple keystroke patterns are all one needs to know, and anecdotal evidence of 
the help system's utility.

Some will refuse to face the truth.  To the open-minded, let the facts speak 
for themselves.

I bet Xah Les is all over smiles about how well his controversy bloomed.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs

2007-06-21 Thread Lew
Bjorn Borud <[EMAIL PROTECTED]> writes:
>> so if the context was system administration, I'd vote for vi as
>> well. if the context was programming I'd vote Emacs.

David Kastrup wrote:
> You know you can use something like
> C-x C-f /su::/etc/fstab RET
> (or /sudo::/etc/fstab) in order to edit files as root in a normal
> Emacs session?

I've been using emacs for something like twenty years and never knew that 
before.

I like the built-in therapist in emacs.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs

2007-06-20 Thread Lew
Ed wrote:
> Thanks, all, for the answers.
> 
> But, Lew: GWMF?
> 
> - Gardner Winter Music Festival? (You have to love the black'n'white
> photo on the right at: http://www.gwmf.org/)
> 
> - Generalized Whitening-Matched Filter?
> 
> - http://www.gwmf.com/  ?
> 
> - http://www.gwmf.de/host/ ?
> 
> - http://www.goatworld.com/gwmf.shtml  

Google was my friend.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Modernization of Emacs

2007-06-19 Thread Lew
Ed wrote:
> On 19 Juni, 07:14, Harry George
>> I've used emacs since the 1980's.
> ...
>> --
>> Harry George
>> PLM Engineering Architecture
> 
> I've asked this question on an emacs forum and got no response, so I
> presume the answer is no, but I see, Harry, that you're a veteran, so
> maybe you've seen things few others have.
> 
> Have you ever seen an, "Extract method," function for emacs? Whereby
> you highlight some lines of code, press a key, and the code is whisked
> into its own method, with the appropriate method invocation left in
> its place. If you could post a link, that'd be just champion.

I googled about a bit and came up with
<http://bicyclerepair.sourceforge.net/>
linked from
<http://en.wikipedia.org/wiki/Refactoring>

I also looked at emacs's own "Info" pages and found this tidbit:

> `M-x c-beginning-of-defun'
> `M-x c-end-of-defun'
>  Move point to the beginning or end of the current function or
>  top-level definition.  These are found by searching for the least
>  enclosing braces.  (By contrast, `beginning-of-defun' and
>  `end-of-defun' search for braces in column zero.)  If you are
>  editing code where the opening brace of a function isn't placed in
>  column zero, you may wish to bind `C-M-a' and `C-M-e' to these
>  commands.  *Note Moving by Defuns::.
> 
> `M-a'
>  Move point to the beginning of the innermost C statement
>  (`c-beginning-of-statement').  If point is already at the beginning
>  of a statement, move to the beginning of the preceding statement.
>  With prefix argument N, move back N - 1 statements.
> 
>  In comments or in strings which span more than one line, this
>  command moves by sentences instead of statements.
> 
> `M-e'
>  Move point to the end of the innermost C statement or sentence;
>  like `M-a' except that it moves in the other direction
>  (`c-end-of-statement').

You could, and I believe others have, create a macro to encapsulate these 
actions with setting the mark and copying the region.

Here is a very promising-looking one that I found for C(**) and Java:
<http://xref-tech.com/speller/main.html>

GWMF.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-10 Thread Lew
Twisted wrote:
>> Oh come on! Toy languages (such as any set of editor commands) and
>> joke languages (ala Intercal) don't count, even if they are
>> technically Turing-complete. ;)
>>
>> Nor does anything that was designed for the every-character-at-a-
>> premium punch-card era, particularly if it is, or rhymes with,
>> "COBOL".
>>
>> Those have excuses, like it's a joke or it's a constrained
>> environment. Perl, unfortunately, has no such excuses. If there were
>> such a thing as "embedded Perl", I'd have to hesitate here, but since
>> there isn't...

Larry Elmore wrote:
> Neither APL nor Snobol nor J are toy or joke languages.

Indeed.  One wonders where Perl would be if Snobol hadn't preceded it.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-09 Thread Lew
Twisted wrote:
> On Jun 8, 7:30 pm, "Jürgen Exner" <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>>
>> [nothing relevant to Perl]
> 
> Perl?? Perl is even less relevant to Java than the original post,
> which admittedly has some connection to pretty much all programming
> languages. (Perl, on the other hand, has no connection to any known
> programming language. ;) In particular, Perl code looks more like line
> noise than like code from any known programming language. ;))

Hmm - I know of APL and SNOBOL.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: is laziness a programer's virtue?

2007-04-17 Thread Lew
"Lew" ranted maniacally:
>> Y'know, even in jest, calling for an oppressive regime to suppress even 
>> wrong-headed and self-serving garbage self-expression is immoral and 
>> horrible. How dare you?
>>
>> Free speech, free press and free expression of ideas is not something to 
>> take so lightly.

Bruce C. Baker wrote:
> That's right! Momma don't allow no levity around here!
> 
> Off with Markus' head! :-D

As they walked off together, Alice heard the King say in a low
voice, to the company generally, `You are all pardoned.'  `Come,
THAT'S a good thing!' she said to herself, for she had felt quite
unhappy at the number of executions the Queen had ordered.
- /Alice's Adventures in Wonderland/, Lewis Carroll
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is laziness a programer's virtue?

2007-04-17 Thread Lew
Markus E Leypold
>> Trying to correct Xah's behaviour is probably impossible.

Ingo Menger wrote:
> Perhaps somebody could ask the chinese government to put him in jail
> for "hurting international society" :)

Y'know, even in jest, calling for an oppressive regime to suppress even 
wrong-headed and self-serving garbage self-expression is immoral and horrible. 
  How dare you?

Free speech, free press and free expression of ideas is not something to take 
so lightly.

-- 
Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Requirements For A Visualization Software System For 2010

2007-04-04 Thread Lew
galathaea wrote:
> On Apr 3, 12:23 pm, "Xah Lee" <[EMAIL PROTECTED]> wrote:
> [top posting for clarity]

You mean to reduce clarity.

Please do not top-post - instead, trim the post and respond in line.  It makes 
the messages easier for the rest of us.

-- 
Lew

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What are OOP's Jargons and Complexities

2007-03-31 Thread Lew
Michele Dondi wrote:
> Even better: pick one entry of your choice from
> 
> http://images.google.com/images?q=%22don%27t+feed+the+troll%22

I pick <http://img371.imageshack.us/img371/8263/noah7ok6rh.jpg/>

-- Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What are OOP's Jargons and Complexities

2007-03-31 Thread Lew
Arved Sandstrom wrote:
> "Timofei Shatrov" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> On Fri, 30 Mar 2007 06:48:05 GMT, "Mike Schilling" 
>> <[EMAIL PROTECTED]>
>> tried to confuse everyone with this message:
>>
>>> Xah Lee wrote:
>>>
>>>> So, a simple code like this in normal languages:
>>>> becomes in Java:
>>> Only when written by someone almost entirely ignorant of Java.
>>>
>> Which is the state most people want to be in...
> 
> Which based on what I've seen, is the state that most Java programmers are 
> in. They'd have no idea why Mike said what he did.

what EVerrr!

-- Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What are OOP's Jargons and Complexities

2007-03-30 Thread Lew
Xah Lee wrote:
>> public class test {
>>   public static void main(String[] args) {
>> String a = new String("a string");
>> String b = new String("another one");
>> StringBuffer c = new StringBuffer(40);
>> c.append(a); c.append(b);
>> System.out.println(c.toString());
>> }
>> }
> 
> Er. How about
> 
> public class test {
>   public static void main(String[] args) {
> String a = "a string";
> String b = "another one";
> StringBuffer c = a + b;
> System.out.println(c);
> }
> }

bugbear wrote:
> Alternatively I could recode your Lisp example
> as badly as you coded your Java.

 From what I've seen and heard of Xah Lee, you'd probably lose the bad-coding 
competition to him. He's a professional.

-- Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What are OOP's Jargons and Complexities

2007-03-30 Thread Lew
Timofei Shatrov wrote:
> On Fri, 30 Mar 2007 06:48:05 GMT, "Mike Schilling" <[EMAIL PROTECTED]>
> tried to confuse everyone with this message:
> 
>> Xah Lee wrote:
>>
>>> So, a simple code like this in normal languages:
> 
>>> becomes in Java:
>>>
>>>
>> Only when written by someone almost entirely ignorant of Java. 
>>
> 
> Which is the state most people want to be in...

As a particular case of the general proposition that most people want to be 
ignorant of computer programming.

-- Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What are OOP's Jargons and Complexities

2007-03-29 Thread Lew
Uri Guttman wrote:
> please DO NOT EVER followup xah's posts into comp.lang.perl.misc. he is
> not wanted there and is considered a troll. he hates perl so why he
> crossposts there is a question. if you want to followup, post only in
> your own group. keep him and his useless threads out of c.l.p.misc.

We've heard similar reports about Xah Lee on other newsgroups as well.

-- Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: On Java's Interface (the meaning of interface in computer programing)

2007-03-23 Thread Lew
Sherm Pendley wrote:
> Lew <[EMAIL PROTECTED]> writes:
> 
>> Jim Burton wrote:
>>> Or you could stop feeding the trolls.
>> Does not apply. The OP was not being trollish
> 
> You obviously don't know Xah. He's been doing this for years, cross-
> posting to various language groups trying to start an argument between
> them. He even brags about being a troll on his web site.

OK - that last is telling. I believe in the possibility of redemption: if a 
troll posts non-trollishly then I am willing to give them the benefit of the 
doubt.

But if Xah were being trollish, why didn't they jump on my response and call 
me names?

I still think that analysis of the original post is a useful exercise to learn 
Java. It's one thing to know what's right - it's another to know what's wrong 
and exactly why. The more subtle Xah or other minions of Satan get in their 
presentations, the more interesting the forensic exercise to dig out the truth.

Perhaps I am just trying to make a silk purse out of a sow's ear.

-- Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: On Java's Interface (the meaning of interface in computer programing)

2007-03-22 Thread Lew
Jim Burton wrote:
> Or you could stop feeding the trolls.

People need to stop saying that. The original post was a detailed if incorrect 
exposition of Java information. How in the world do you rate that trollish?

I have absolutely no reason to rate the OP as a troll or their post as trollish.

-- Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: On Java's Interface (the meaning of interface in computer programing)

2007-03-21 Thread Lew
Dr. Who wrote:
> Don't Feed The Trolls :-)

But, but - you fed me!?

Oh, wait, I'm only a half-troll, on my father's side.

Thanks for the attention.

Kidding aside, a post like the OP's is useful as an exercise in finding the 
errors, grammatical and factual. It's like a math book I had in my first year 
at university. Its theorems were riddled with typographical errors, mixing the 
us, vs and ws all around. I'd be up for hours figuring out if I was wrong or 
the book was wrong. In the end it gave me a lot more exercise than the 
homework problems did.

Also, I wanted to protect the innocent.

We could put up a contest - whoever finds and corrects the most errors in the 
post wins. Ties broken by the quality of the correct explanations. Incorrect 
explanations count against the entry.

-- Lew
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: On Java's Interface (the meaning of interface in computer programing)

2007-03-21 Thread Lew
Xah Lee wrote:
> In a functional language, a function can be specified by its name and

Are you sure you know what a "functional language" is?

> parameter specs. For example:
> f(3)
> f(3, [9,2])
> f("some string")

This is not really "typical" syntax for a functional language. LISP, for 
example, has the "function name" as an element of a list. (Some might argue 
that LISP isn't exactly a functional language.)

Also, since you are commenting on Java, you should use "Java-like" syntax 
rather than "[9,2]". What is "[9,2]" intended to represent? The range of 
integers decreasing from 9 to 2, inclusive?

> For another example, usually a program needs to talk to another
> software such as a database software. 

Interesting use of the word "software".

> In essence, making the database useful to other software.

This is not a sentence.

> Such a list of function spec is often called API, which stands for Application
> Programing Interface.

"an API"

> The API terminology is abused by the marketing-loving Sun Microsystems
> by calling the Java language's documentation as “The Java API”, even
> though Java the language and its paraphernalia of libraries and
> hardware-emulation system (all together jargonized as “the Java
> Platform”) isn't a Application nor Interface. (a [sic] API implies that
> there are two disparate entities involved, which are allowed to
> communicate thru [sic] it. In the case of “The Java API”, it's one entity
> talking to itself.).

This is incorrect in every factual detail. And what's with the editorial 
comment in the middle of the exposition ("marketing-loving", "jargonized")? 
How does that help explain the concepts, even if it were supportable by the 
evidence?

Sun calls the API documentation "the Java API documentation", not "the Java 
API", and not the language documentation, and the API is indeed an interface. 
An API need not be, and quite often is not, an application - being an 
application is in no wise part of being an API. And why in the world did you 
capitalize "Application" and "Interface"?

It's "an API", not "a API". It's "through", not "thru".

The statement about an "API" having to do with "two disparate entities" makes 
no sense. There is certainly nothing in the API that one can characterize as 
"one entity talking to itself". What "entities" do you imagine are involved?

> In general, the interface concept in programing is a sort of
> specification that allows different entities to call and make use of
> the other [sic], with the implication that the caller need not know what's
> behind the facade.

There is no antecedent for "the other", and you haven't defined "entities", 
and the word "interface" has a number of meanings "in general ... in 
programming". You should focus on the Java meaning (and your grammar).

> In the Object Oriented Programing Paradigm [sic], a new concept arose, that
> is the “interface” aspect of a class.

Historical citation needed. And an interface is not an "aspect of a class".

> As we've seen, a function has parameter spec [sic] that is all there it [sic] 
> is a
> user needs to know for using it. In Java, this is the method's
> “signature”. Now, as the methodology of the OOP experience multiplies,
> it became apparent that the interface concept can be applied to
> Classes as well. Specifically: the interface of a class is the class's
> methods.

OK, I've had enough. I'd say you need a good editor to clean up the grammar, 
but then all you'd have is a better-written incorrect explanation.

-- Lew
-- 
http://mail.python.org/mailman/listinfo/python-list