Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Chris Angelico
On Tue, Jun 30, 2015 at 2:49 PM, Peter Pearson wrote: > Time zones teem with sneaky software problems, and so does daylight-saving > time, so this problem might strain my brain. Maybe it's going to turn > out that my expectations are unreasonable . . . as in, "Well, smarty pants, > how do you wan

Scapy and MGCP

2015-06-30 Thread Devaki Chokshi (dchokshi)
Hello, As per reply received I have begun to use scapy for MGCP. I started off with reading a .pcap file with MGCP packets. For example: from scapy.all import * from scapy.utils import * from scapy.layers.mgcp import * mgcp_pkts = rdpcap("my-mgcp-capture.pcap") However, rdpcap() is returni

Segmentation Fault with multiple interpreters

2015-06-30 Thread Florian Rüchel
Hey there, I'm not sure this is the correct list considering the level of internal Python knowledge it likely requires. If I should take this to another list, please let me know. I have written an application that links against libpython and starts multiple interpreters within one thread. Beyond

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 02:09:17 UTC+2 skrev Ben Bacarisse: > Ian Kelly writes: > > > On Mon, Jun 29, 2015 at 4:56 PM, Ian Kelly wrote: > >> On Mon, Jun 29, 2015 at 4:39 PM, wrote: > >>> http://jt.node365.se/baseconversion8.html > > > By the way, I think you have a bug. I did my time test

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: It still bug out on very big numbers if base outside integer scope. I am very keen on suggestions regarding the logic to make it faster. Concerning the algorithmic complexity, it can't be faster than square time in the number of digits N.

Re: enumerate XML tags (keys that will become headers) along with text (values) and write to CSV in one row (as opposed to "stacked" values with one header)

2015-06-30 Thread Robert Kern
On 2015-06-30 01:54, Denis McMahon wrote: On Sun, 28 Jun 2015 17:07:00 -0700, Ned Batchelder wrote: On Sunday, June 28, 2015 at 5:02:19 PM UTC-4, Denis McMahon wrote: string 3 string 2 string 1 Each is just a member of the collection things, the xml does not contain sufficient

get Coursera video download link via program

2015-06-30 Thread iMath
I want extract Coursera video download link via program(mainly Python) behind those links https://www.coursera.org/learn/human-computer-interaction/lecture/s4rFQ/the-interaction-design-specialization https://www.coursera.org/learn/calculus1/lecture/IYGhT/why-is-calculus-going-to-be-so-much-fun

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: > > It still bug out on very big numbers if base outside integer scope. > > I am very keen on suggestions regarding the logic to make it faster. > > Concerning the algor

Re: get Coursera video download link via program

2015-06-30 Thread iMath
I know the two packages : BeautifulSoup and requests may help, I am also able to login in Coursera via requests, the difficulty is how to find out the video download link from the page. -- https://mail.python.org/mailman/listinfo/python-list

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: > > It still bug out on very big numbers if base outside integer scope. > > I am very keen on suggestions regarding the logic to make it faster. > > Concerning the algor

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 11:35:06 UTC+2 skrev jonas.t...@gmail.com: > Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: > > > It still bug out on very big numbers if base outside integer scope. > > > I am very keen

EuroPython 2015: Call for On-site Volunteers

2015-06-30 Thread M.-A. Lemburg
EuroPython is organized and run by volunteers from the Python community, but we’re only a few and we will need more help to make the conference run smoothly. We need your help ! --- We will need help with the conference and registration desk, giving out the swag bags and t-shirts,

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Jon Ribbens
On 2015-06-30, Steven D'Aprano wrote: > On Tue, 30 Jun 2015 06:52 am, Randall Smith wrote: >> Not sure why you posted the link. The crc32 checksum is just to check >> for possible filesystem corruption. The system does periodic data >> corruption checks. BTRFS uses crc32 checksums also. Please

Re: enumerate XML tags (keys that will become headers) along with text (values) and write to CSV in one row (as opposed to "stacked" values with one header)

2015-06-30 Thread Chris Angelico
On Tue, Jun 30, 2015 at 11:26 AM, Dennis Lee Bieber wrote: > My system takes something like three hours just to generate a 500GB > backup (one partition each week -- I have a 4TB backup drive with only > 740GB free; the other drives are only half full or I'd need an 8TB backup). > And that

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 11:43:55 UTC+2 skrev jonas.t...@gmail.com: > Den tisdag 30 juni 2015 kl. 11:35:06 UTC+2 skrev jonas.t...@gmail.com: > > Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > > > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: > > > > It still b

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 15:22:44 UTC+2 skrev jonas.t...@gmail.com: > Den tisdag 30 juni 2015 kl. 11:43:55 UTC+2 skrev jonas.t...@gmail.com: > > Den tisdag 30 juni 2015 kl. 11:35:06 UTC+2 skrev jonas.t...@gmail.com: > > > Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > >

Parsing logfile with multi-line loglines, separated by timestamp?

2015-06-30 Thread Victor Hooi
Hi, I'm trying to parse iostat -xt output using Python. The quirk with iostat is that the output for each second runs over multiple lines. For example: 06/30/2015 03:09:17 PM avg-cpu: %user %nice %system %iowait %steal %idle 0.030.000.030.000.00 99.94 Device:

Re: Linear time baseconversion

2015-06-30 Thread Ian Kelly
On Tue, Jun 30, 2015 at 8:13 AM, wrote: >> Regarding the time it seem to double the digits quadruple the time. And that >> is still linear or? > > 2x seem linear to me? That's not linear, nor is it "2x". If doubling the size of the input quadruples the time, then doubling the size of the input

Python 3 resuma a file download

2015-06-30 Thread zljubisic
Hi, I would like to download a file (http://video.hrt.hr/2906/otv296.mp4) If the connection is OK, I can download the file with: import urllib.request urllib.request.urlretrieve(remote_file, local_file) Sometimes when I am connected on week wireless (not mine) network I get WinError 10054 exce

Re: Linear time baseconversion

2015-06-30 Thread Ian Kelly
On Tue, Jun 30, 2015 at 9:40 AM, Ian Kelly wrote: > On Tue, Jun 30, 2015 at 3:07 AM, Christian Gollwitzer wrote: >> Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: >>> >>> It still bug out on very big numbers if base outside integer scope. >>> I am very keen on suggestions regarding the l

Re: Parsing logfile with multi-line loglines, separated by timestamp?

2015-06-30 Thread Skip Montanaro
Maybe define a class which wraps a file-like object. Its next() method (or is it __next__() method?) can just buffer up lines starting with one which successfully parses as a timestamp, accumulates all the rest, until a blank line or EOF is seen, then return that, either as a list of strings, one m

Re: Parsing logfile with multi-line loglines, separated by timestamp?

2015-06-30 Thread Chris Angelico
On Wed, Jul 1, 2015 at 1:47 AM, Skip Montanaro wrote: > Maybe define a class which wraps a file-like object. Its next() method (or > is it __next__() method?) can just buffer up lines starting with one which > successfully parses as a timestamp, accumulates all the rest, until a blank > line or EO

Re: Linear time baseconversion

2015-06-30 Thread Ian Kelly
On Tue, Jun 30, 2015 at 3:07 AM, Christian Gollwitzer wrote: > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: >> >> It still bug out on very big numbers if base outside integer scope. >> I am very keen on suggestions regarding the logic to make it faster. > > > Concerning the algorithmic

Re: Linear time baseconversion

2015-06-30 Thread Chris Angelico
On Wed, Jul 1, 2015 at 1:45 AM, Ian Kelly wrote: > On Tue, Jun 30, 2015 at 9:40 AM, Ian Kelly wrote: >> On Tue, Jun 30, 2015 at 3:07 AM, Christian Gollwitzer >> wrote: >>> Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: It still bug out on very big numbers if base outside inte

Re: Linear time baseconversion

2015-06-30 Thread Michael Torrie
Do you have some Python code to show us? -- https://mail.python.org/mailman/listinfo/python-list

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 18:12:46 UTC+2 skrev Michael Torrie: > Do you have some Python code to show us? No i just thought you would find the digit search algorithm interesting. -- https://mail.python.org/mailman/listinfo/python-list

Re: Linear time baseconversion

2015-06-30 Thread Ian Kelly
On Tue, Jun 30, 2015 at 10:10 AM, Chris Angelico wrote: > When there's a simple ratio between the bases, it's fairly > straight-forward to convert a few digits at a time. Converting base > 256 into base 64, for instance, can be done by taking three digits and > yielding four. But within that, you

Re: enumerate XML tags (keys that will become headers) along with text (values) and write to CSV in one row (as opposed to "stacked" values with one header)

2015-06-30 Thread Marko Rauhamaa
Robert Kern : >> >>tuplemember_1 >>tuplemember_2 >> >>tuplemember_n/item> >> > > [...] > > Yes! Any conforming XML implementation will preserve the order. And not only the order: the newlines and other whitespace around the s are also preserved as children of . > And if you ar

Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Peter Pearson
On Tue, 30 Jun 2015 17:01:15 +1000, Chris Angelico wrote: > On Tue, Jun 30, 2015 at 2:49 PM, Peter Pearson > wrote: >> Time zones teem with sneaky software problems, and so does daylight-saving >> time, so this problem might strain my brain. Maybe it's going to turn >> out that my expectations ar

Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Chris Angelico
On Wed, Jul 1, 2015 at 2:42 AM, Peter Pearson wrote: > I'm just glad I don't have to worry about the distinctions among > UTC, GMT, TAI, and UT1. Fortunately, that's often the case. GMT can be ignored, and the other three differ by less seconds than most humans ever care about. If you're scheduli

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Randall Smith
On 06/29/2015 10:00 PM, Steven D'Aprano wrote: On Tue, 30 Jun 2015 06:52 am, Randall Smith wrote: Not sure why you posted the link. The crc32 checksum is just to check for possible filesystem corruption. The system does periodic data corruption checks. BTRFS uses crc32 checksums also. Pleas

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Randall Smith
On 06/29/2015 03:49 PM, Jon Ribbens wrote: On 2015-06-29, Randall Smith wrote: Same reason newer filesystems like BTRFS use checkusms (BTRFS uses CRC32). The storage machine runs periodic file integrity checks. It has no control over the underlying filesystem. True, but presumably neither d

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Steven D'Aprano
On Tue, 30 Jun 2015 10:19 pm, Jon Ribbens wrote: > On 2015-06-30, Steven D'Aprano wrote: >> On Tue, 30 Jun 2015 06:52 am, Randall Smith wrote: >>> Not sure why you posted the link. The crc32 checksum is just to check >>> for possible filesystem corruption. The system does periodic data >>> corr

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Chris Angelico
On Wed, Jul 1, 2015 at 4:17 AM, Steven D'Aprano wrote: > If you can trick me into turning encryption off (say, you use a social > engineering attack on me and convince me to delete "the virus crypto.py"), > then I might inadvertently upload unencrypted data to you. Or maybe you > find an attack on

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Jon Ribbens
On 2015-06-30, Steven D'Aprano wrote: > On Tue, 30 Jun 2015 10:19 pm, Jon Ribbens wrote: >> Eh? The game is over right there. I don't trust you, and yet >> I have just given you my private data, unencrypted. > > Yes. That is exactly the problem. If the application doesn't encrypt the > data for me

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Steven D'Aprano
On Wed, 1 Jul 2015 03:39 am, Randall Smith wrote: > On 06/29/2015 10:00 PM, Steven D'Aprano wrote: >> I'm making an assumption here -- I assume that the sender records a >> checksum for uploaded files so that when they get something back again >> they can tell whether or not it is the same conten

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Chris Angelico
On Wed, Jul 1, 2015 at 4:59 AM, Steven D'Aprano wrote: > Today, if the key is compromised, all is lost. Is it possible that there are > ciphers that are resistant to discovery of the key? Obviously if you know > the key you can read encrypted messages, that's what the key is for, but > there are s

Re: Linear time baseconversion

2015-06-30 Thread Michael Torrie
On 06/30/2015 10:24 AM, jonas.thornv...@gmail.com wrote: > Den tisdag 30 juni 2015 kl. 18:12:46 UTC+2 skrev Michael Torrie: >> Do you have some Python code to show us? > > No i just thought you would find the digit search algorithm interesting. Yeah it is interesting, although I didn't really see

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
Am 30.06.15 um 17:40 schrieb Ian Kelly: On Tue, Jun 30, 2015 at 3:07 AM, Christian Gollwitzer wrote: Concerning the algorithmic complexity, it can't be faster than square time in the number of digits N. Baseconversion needs to do a sequence of division operations, where every operation gves you

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
Am 30.06.15 um 18:34 schrieb Ian Kelly: On Tue, Jun 30, 2015 at 10:10 AM, Chris Angelico wrote: When there's a simple ratio between the bases, it's fairly straight-forward to convert a few digits at a time. Converting base 256 into base 64, for instance, can be done by taking three digits and y

Re: How to debug TypeError: required field "lineno" missing from expr?

2015-06-30 Thread Mark Lawrence
On 29/06/2015 03:44, Steven D'Aprano wrote: On Mon, 29 Jun 2015 11:14 am, Mark Lawrence wrote: Purely as an exercise I've been converting Grant Jenks' pypatt[1] from 2.7 to 3.4. I've managed to sort out most of the required changes by checking on what I can see with an AST pretty printer[2].

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Jon Ribbens
On 2015-06-30, Steven D'Aprano wrote: > I don't think there has been much research into keeping at least *some* > security even when keys have been compromised, apart from as it relates to > two-factor authentication. That's because "the key" is all the secret part. If an attacker knows the algor

Re: Python 3 resuma a file download

2015-06-30 Thread Cameron Simpson
On 30Jun2015 08:34, zljubi...@gmail.com wrote: I would like to download a file (http://video.hrt.hr/2906/otv296.mp4) If the connection is OK, I can download the file with: import urllib.request urllib.request.urlretrieve(remote_file, local_file) Sometimes when I am connected on week wireless (

Re: Parsing logfile with multi-line loglines, separated by timestamp?

2015-06-30 Thread Victor Hooi
Aha, cool, that's a good idea =) - it seems I should spend some time getting to know generators/iterators. Also, sorry if this is basic, but once I have the "block" list itself, what is the best way to parse each relevant line? In this case, the first line is a timestamp, the next two lines are

Re: Parsing logfile with multi-line loglines, separated by timestamp?

2015-06-30 Thread Chris Angelico
On Wed, Jul 1, 2015 at 2:06 PM, Victor Hooi wrote: > Aha, cool, that's a good idea =) - it seems I should spend some time getting > to know generators/iterators. > > Also, sorry if this is basic, but once I have the "block" list itself, what > is the best way to parse each relevant line? > > In

Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Peter Pearson
On 30 Jun 2015 00:56:26 GMT, Peter Pearson wrote: > The following code produces a plot with a line running from (9:30, 0) to > (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. > > If I use timezone None instead of pacific, the plot is as desired, but > of course that doesn't solve the gene