Re: Hardlink sub-directories and files

2011-08-08 Thread Alexander Gattin
Hello, On Tue, Aug 02, 2011 at 02:32:54AM -0700, loial wrote: > This works fine for files, but the directory > also contains sub- directories (which themselves > contain files and sub-directories). However I > do not think it is possible to hard link > directories ? On some Unices it is, as I he

Re: send function keys to a legacy DOS program

2011-03-29 Thread Alexander Gattin
Hello, On Sun, Mar 20, 2011 at 06:59:46PM -0700, Justin Ezequiel wrote: > On Mar 20, 7:30 am, Alexander Gattin > wrote: > > You need to place 2 bytes into the circular buffer > > to simulate key press. Lower byte is ASCII code, > > higher byte is scan code (they are the

Re: send function keys to a legacy DOS program

2011-03-19 Thread Alexander Gattin
On Sun, Mar 20, 2011 at 12:52:28AM +0200, Alexander Gattin wrote: > On Thu, Mar 10, 2011 at 04:58:53PM -0800, Justin > Ezequiel wrote: > > We have an old barcode program (MSDOS and source code unavailable.) > > I've figured out how to populate the fields (by hacking into o

Re: send function keys to a legacy DOS program

2011-03-19 Thread Alexander Gattin
Hello, On Thu, Mar 10, 2011 at 04:58:53PM -0800, Justin Ezequiel wrote: > We have an old barcode program (MSDOS and source code unavailable.) > I've figured out how to populate the fields (by hacking into one of > the program's resource files.) > However, we still need to hit the following functio

Re: Connecting to remote Oracle db via Python

2011-02-18 Thread Alexander Gattin
Hello, On Thu, Feb 17, 2011 at 02:40:22AM -0800, pstatham wrote: > I've installed the cx_Oracle module for Python > and I'm trying to connect to my remote Oracle > db. Can you tnsping your remote Oracle DB successfully? > >>> uid = "scott" > >>> pwd = "tiger" > >>> service = "10.5.1.12:1521:PR10

Re: IMAP4_SSL, libgmail, GMail and corporate firewall/proxy

2011-02-18 Thread Alexander Gattin
Hello, On Fri, Feb 18, 2011 at 09:40:19AM +0500, Andrea Gavana wrote: > Fails with a variety of errors depending on which port I use: > > - Port 80: urllib2.HTTPError: HTTP Error 407: Proxy Authentication > Required ( The ISA Server requires authorization to fulfill the > request. Access to the W

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-11 Thread Alexander Gattin
Hello, On Tue, Feb 08, 2011 at 05:32:05PM +, Icarus Sparry wrote: > The key thing which makes this 'modern' is the > '+' at the end of the command, rather than '\;'. > This causes find to execute the grep once per > group of files, rather than once per file. many thanks to you, man! I'm surp

Re: How to Write grep in Emacs Lisp (tutorial)

2011-02-11 Thread Alexander Gattin
Hello, On Thu, Feb 10, 2011 at 07:52:34AM +0100, Petter Gustad wrote: > r...@rpw3.org (Rob Warnock) writes: > > invocation was given only one arg!! IT FOUND > > THE PATTERN, BUT DIDN'T TELL ME WHAT > > !@^%!$@#@! FILE IT WAS IN!! :-{ > > Sounds frustrating, but grep -H will always > print the fi

Re: String building using join

2011-01-03 Thread Alexander Gattin
Hello, On Sun, Jan 02, 2011 at 10:11:50AM -0800, Alex Willmer wrote: > def prg3(l): > return '\n'.join([str(x) for x in l if x]) just one fix (one fix one fix one fix): return '\n'.join([str(x) for x in l if x is not None]) -- With best regards, xrgtn -- http://mail.python.org/mailman/

Re: I am not able to verify the integrity of python.2.5.4.msi

2010-12-31 Thread Alexander Gattin
Hello, On Sun, Dec 26, 2010 at 05:44:22AM +0530, Varuna Seneviratna wrote: > > D:\Python>gpg --verify python-2.5.4.msi.asc > gpg: no valid OpenPGP data found. > gpg: the signature could not be verified. > Please remember that the signature file (.sig or .asc) > should be the first file given on th

Re: Wanted: slow regexes

2010-12-12 Thread Alexander Gattin
Hello, On Wed, Dec 08, 2010 at 04:24:02PM +, MRAB wrote: > Interestingly, that webpage says that: > > ("a" x 10) =~ /^(ab?)*$/ > > caused Perl to segfault. I tried it and it didn't segfault, but it > didn't match either It doesn't segfault but produces a warning with -w: xr...@xrgtn-

Re: Wanted: slow regexes

2010-12-08 Thread Alexander Gattin
Hello, On Mon, Dec 06, 2010 at 04:08:16AM +, MRAB wrote: > I'm looking for examples of regexes which are > slow (especially those which seem never to > finish) but whose results are known. does it have anything to do with http://swtch.com/~rsc/regexp/regexp1.html? -- With best regards, xrgt

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
Hello, On Fri, Nov 19, 2010 at 01:03:14PM +0100, Wolfgang Rohdewald wrote: > On Freitag 19 November 2010, Alexander Gattin wrote: > > It's better to select count(1) instead of > > count(*). not true, > > The latter may skip rows consisting > > entirely of NU

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
Hello, On Fri, Nov 19, 2010 at 12:32:19PM +0100, Alain Ketterlin wrote: > Alexander Gattin writes: > > It's better to select count(1) instead of > > count(*). The latter may skip rows consisting > > entirely of NULLs IIRC. > > Wrong: count(anyname) ignores NULL,

Re: strange subprocess behavior when calling ps

2010-11-19 Thread Alexander Gattin
Hello, On Wed, Nov 17, 2010 at 01:19:09AM -0800, Ned Deily wrote: > As far as I know, COMMAND_MODE has no special > meaning on other platforms UNIX_STD=2003 on HP-UX if anyone's interested... -- With best regards, xrgtn -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
On Fri, Nov 19, 2010 at 01:14:34PM +0200, Alexander Gattin wrote: > On Tue, Nov 16, 2010 at 01:52:42PM -0800, Ian > wrote: > > The proper way to get the number of rows is to > > use the COUNT aggregate function, e.g., "SELECT > > COUNT(*) FROM TABLE1", which w

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
Hello, On Tue, Nov 16, 2010 at 01:52:42PM -0800, Ian wrote: > The proper way to get the number of rows is to > use the COUNT aggregate function, e.g., "SELECT > COUNT(*) FROM TABLE1", which will return a > single row with a single column containing the > number of rows in table1. It's better to s

Re: Copy Protected PDFs and PIL

2010-11-14 Thread Alexander Gattin
Hello, On Fri, Nov 12, 2010 at 12:00:55PM -0800, Brett Bowman wrote: > MRAB - > I've tried worker threads, and it kills the > thread only and not the program as a whole. I > could use that as a work-around, but I would > prefer something more direct, in case other > problems arise. Looks like th

Re: Learning Pyhton - Functional Programming - How intersect/difference two dict with dict/values? fast!

2010-11-11 Thread Alexander Gattin
On Thu, Nov 11, 2010 at 11:51:33AM +0200, Alexander Gattin wrote: > functional-style code emerges: > > > >>> dict(filter(lambda t: t[1], > > ... map(lambda k: (k, filter(lambda v: v in dict2[k][0], dict1[k][0])), > > ...fil

Re: Learning Pyhton - Functional Programming - How intersect/difference two dict with dict/values? fast!

2010-11-11 Thread Alexander Gattin
Hello, On Tue, Nov 09, 2010 at 09:32:17AM -0800, macm wrote: > dict1 = {'ab':[[1,2,3,'d3','d4',5],12],'ac':[[1,3,'78a','79b'], > 54],'ad': [[56,57,58,59],34], 'ax': [[56,57,58,59],34]} > dict2 = {'ab':[[22,2,'a0','42s','c4','d3'],12],'ab':[[2,4,50,42,'c4'], > 12],'ac':[[1,3,'79b',45,65,'er4'],54],

Re: How convert list to nested dictionary?

2010-11-11 Thread Alexander Gattin
Hello, On Thu, Nov 04, 2010 at 02:10:12PM -0700, macm wrote: > > > How convert list to nested dictionary? > > > > l > > > ['k1', 'k2', 'k3', 'k4', 'k5'] > > result > > > {'k1': {'k2': {'k3': {'k4': {'k5': {}} > > http://www.amk.ca/python/writing/functional so, why didn't you try pyt

Re: How find all childrens values of a nested dictionary, fast!

2010-11-06 Thread Alexander Gattin
Hello, On Thu, Nov 04, 2010 at 09:20:04PM +, Arnaud Delobelle wrote: > Tough requirement, but I think I've got it. Two > lambdas, one reduce, one map ;) > > >>> a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]}, 'bc' > >>> :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,

Re: Has Next in Python Iterators

2010-10-23 Thread Alexander Gattin
Hello, On Thu, Oct 21, 2010 at 12:26:50PM +, Steven D'Aprano wrote: > I know what you're thinking: "it's easy to cache > the next result, and return it on the next > call". But iterators can also be dependent on > the time that they are called, like in this > example: > > def evening_time():

Re: Raw Sockets - IP-Encapsulation

2010-09-27 Thread Alexander Gattin
Hello, On Fri, Sep 24, 2010 at 04:51:01PM +0100, Nobody wrote: > On Thu, 23 Sep 2010 21:41:19 +0200, Matthias > Guentert wrote: > > I would like to create an IP tunnel using the > > IP protocol type 4 (socket.IPPROTO_IPIP) on a > > Linux host. (I also would be happy if I could > > create a GRE tun

Re: scp with paramiko

2010-09-14 Thread Alexander Gattin
Hello, On Wed, Sep 01, 2010 at 09:56:18AM -0700, cerr wrote: > I want to download a file from a client using > paramiko. I found plenty of ressources using > google on how to send a file but none that > would describe how to download files from a > client. Download files from remote to local? Ge

Re: rouble importing cx_Oracle on HPUX

2010-08-28 Thread Alexander Gattin
Hello, On Sat, Aug 28, 2010 at 09:27:05AM -0400, Cliff Martin wrote: > Yes, our entire toolchain is 64 bit - a mix of > stuff I have downloaded and built and some > packages from HP (in the form of depot files) > GCC was downloaded from HP, for example. I see. I bootstrapped from bundled cc, henc

Re: Trouble importing cx_Oracle on HPUX

2010-08-28 Thread Alexander Gattin
Hello, On Thu, Aug 26, 2010 at 08:08:42PM -0700, Cliff Martin wrote: > I have just gotten done building Python 3.1.2 on > HPUX 11.31 Itanium (IA64) using gcc 4.4.3, and > have tried building cx_Oracle to go with it. The > build succeeds, but test and importing does not. > I have tried building Pyt

Re: GSM to ISO / UCS2 to ISO

2010-08-28 Thread Alexander Gattin
Hello, On Mon, Aug 16, 2010 at 08:01:36PM +1000, James Mills wrote: > In an effort to avoid re-inventing the wheel so to speak > I was wondering if anyone's come across libraries/tools, etc > that achieve the same kind of functionality as the tools > library in this java app. unfortunately, no (e

Re: cx_Oracle 5.0.4 + Python 3.1.2 + Oracle Instant Client 10.2.04; DLL Load failed on import (Win/NT)

2010-08-12 Thread Alexander Gattin
Hello, On Wed, Aug 11, 2010 at 02:29:24PM -0700, tormod wrote: > I've tried countless times to build & install cx_Oracle on Python > 3.1.2, and failed every time, so I'd like to ask someone for help. ... > I've opened the cx_Oracle.pyd with Dependency Walker (http:// > www.dependencywalker.com/) a