Re: Finding non ascii characters in a set of files

2007-02-24 Thread Toby A Inkster
bg_ie wrote:

> What I'd like to do is scan a directory and list all the
> files in it that contain a non ascii character.

Not quite sure what your intention is. If you're planning a one-time scan
of a directory for non-ASCII characters in files, so that you can manually
fix those files up, then this Perl one-liner will do the trick. At the
command line, type:

perl -ne 'print "$ARGV:$.\n" if /[\x80-\xFF]/;' *

This will print out a list of files that contain non-ASCII characters, and
the line numbers which those characters appear on. Note this also
operates on binary files like images, etc, so you may want to be more
specific with the wildcard. e.g.:

perl -ne 'print "$ARGV:$.\n" if /[\x80-\xFF]/;' *.py *.txt *.*htm*

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Rational numbers

2007-02-24 Thread Toby A Inkster
aleaxit wrote:

> If anybody who has easy access to Microsoft's MSVC++.NET (and is willing
> to try building GMP 4.2 with/for it), or a PPC Mac with XCode installed
> (possibly with MacOSX 10.3...)

I'm writing this message on a MacOS 10.3.9 box with Xcode 1.5 (gcc 3.3)
installed. If you tell me how, I'd be happy to compile it for you.

Contact me through the feedback form on the site below.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: BDFL in wikipedia

2007-02-21 Thread Toby A Inkster
Jorge Vargas wrote:

> shouldn't it mention Linus, Larry Wall, others?[3]

Despite the link you posted, I don't think Linus, Larry Wall, Rasmus
Lerdorf, etc describe themselves as BDFLs, even if they fulfil similar
roles within their respective development communities.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
Now Playing ~ ./vol/music/snug/from_solar_to_polar/04_naked_+_smiling.ogg

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: BDFL in wikipedia

2007-02-21 Thread Toby A Inkster
Steven D'Aprano wrote:
> Carl Banks wrote:
>> 
>> Since when is Larry Wall benevolent?  He should be called the SDFL.
> 
> I can't think what the S stands for... if it was M, I'd say Malevolent,
> but S?

Scented, Sexy, Spanish... no, probably not those.

I assume "Sadistic".

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
Now Playing ~ ./vol/music/gorkys_zygotic_mynci_-_poodle_rockin.ogg

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Thanks for the help

2007-02-09 Thread Toby A Inkster
[EMAIL PROTECTED] wrote:
> Reid wrote:
>
>> I do not need 3d stuff. Just a couple of buttons and menu's.
> 
> That's not "3D", that's GUI (Graphical User Interface). "3D" usually
> refers to "3D graphics"...

Hence the original poster's clever use of the word "not" ;-)

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: lambda functions ?

2007-02-05 Thread Toby A Inkster
Maxim Veksler wrote:

> And what is the "f" object? An integer? a pointer? an Object?

A function.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Subscribing" to topics?

2007-02-04 Thread Toby A Inkster
Mizipzor wrote:

> I searhed around a little and it seems that not only do i need a
> newsreader, i need a newsserver to. To fetch all the messages from
> here. I learned that sometimes the ISP provides one, however, mine do
> not. But then I discovered that Google has a free newsserver, so I
> joined this group from there.

You discovered wrong -- Google does not provide a free newsserver. They no
doubt *have* several newsservers, but don't provide direct access to them
either free, or for a fee. They only provide a web interface to access the
contents of their newsservers, with a fraction of the features that a real
newsreader would.

You seem to already have a newsreader -- you're using Opera, which
includes a fairly good one, hidden away in the Hotlist/Panels/whatever-
they're-calling-it-today. Other newsreaders I'd recommend are PAN and
Forte Agent.

So you just need a server. "pubnews.gradwell.net" still seems to exist --
it's free. Alternatively, "news.individual.net" offers a good service for
a fairly low yearly cost.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Writing "pythonish" code

2007-02-02 Thread Toby A Inkster
Mizipzor wrote:

> One thing is that in c++ im used to have private members in classes and
> no member is altered except through the public functions of the class.

By convention, class members starting with a single underscore are
considered private. 

This is much the same as the convention that on UNIX, files that start with
a dot are considered hidden -- there is nothing actually *preventing* a
programme from showing you these files in a directory listing, but by
convention it won't, unless you explicitly ask to see them.

Class members starting with a double underscore are "mangled" which makes
it more difficult for other code (even subclasses!) to access the member.
Difficult though -- not impossible.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Web File System

2007-01-31 Thread Toby A Inkster
anthony.cutrone wrote:

> Files and folders have to be in an SQL database, mounted in ext3-like 
> system. File would be identified by a single ID, and links with names 
> should be connected on these IDs.

Take a look at FUSE.

Also, have you considered subversion?

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Ip address

2007-01-28 Thread Toby A Inkster
Scripter47 wrote:

> How do i get my ip address?

Which IP address. One computer might have many IP addresses. (Indeed a
typical network-connected computer will tend to have at least one for each
connected network device, plus the special address 127.0.0.1 for the
loopback network.) How is Python supposed to know which IP address you
want?

If you don't care which address, the code supplied by Adam should work. If
you do care, then you'll probably need to write OS-specific code for each
platform you choose to support, probably parsing the output of ipconfig
(Windows) or ifconfig (Linux/UNIX/Mac) somehow.

Adam also says:
| If you are wanting to to communicate over the internet you will have 
| to get the IP of you rounter.

Not strictly true, but if your network uses NAT, and you want some host
outside your network to be able to *connect to you*, then yes, you need the
IP address of your router. If you're not using NAT, then you shouldn't
need to worry about your router, as IP addresses alone provide full
end-to-end routing. (Indeed that's the whole point of IP.)

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Ip address

2007-01-28 Thread Toby A Inkster
Steve Holden wrote:

> There is absolutely no need to know the IP address of "your router" to 
> communicate with Internet devices. Either your IP layer is configured to 
> know the addresses of one or more routers, or it has discovered those 
> address by dynamic means, or you can't get off-net because there aren't 
> any routers.

... or you can't get off-net because you don't *know* the routers.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/CSS/Javascript/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Commandline wrapper: help needed

2007-01-28 Thread Toby A Inkster
Toby wrote:

> Any idea how to improve the script and solve this problem?

Hello Toby, excellent name you have there. What advantage (if any) does
this method have over standard UNIX-style pipes?

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me  ~ http://tobyinkster.co.uk/contact
-- 
http://mail.python.org/mailman/listinfo/python-list