[issue10970] string.encode('base64') is not the same as base64.b64encode(string)

2011-01-21 Thread Mahmoud Abdelkader
Mahmoud Abdelkader mabdelka...@gmail.com added the comment: Thanks for the clarification Terry. This is indeed not a bug. For reference, the pieces of code I pasted line-wrapped after the 76th character, which was my main source of confusion. After reading RFC3548, I am now informed

[issue10970] string.encode('base64') is not the same as base64.b64encode(string)

2011-01-20 Thread Mahmoud Abdelkader
New submission from Mahmoud Abdelkader mabdelka...@gmail.com: Given a string, encoding it with .encode('base64') is not the same as using base64's b64encode function. I think this is very unclear and unintuitive. Here's some example code to demonstrate the problem. Before I attempt to submit

Re: easy question, how to double a variable

2009-09-22 Thread Mahmoud Abdelkader
http://codingforums.com/showthread.php?s=e26b8b0aabc69745ef24a855b1a0fc83t=177529 It seems that this dude really is looking for how to double a variable... hi looking for help catching up in a class and overall to get me better than i am now. I can pay you by the week or per hour. everything

A multi-threaded file searcher for processing large text files

2009-07-17 Thread Mahmoud Abdelkader
for is to launch multiple threads that process different parts of the file (different chunks) and return their results, probably indexed by their chunk offset. Then I can iterate over that sequentially. I think that would be a trivial parallel optimization. Thoughts? Comments? Thanks very much, Mahmoud

Re: proposal: add setresuid() system call to python

2009-07-17 Thread Mahmoud Abdelkader
Why don't you write a python extension module? This is a perfect opportunity for that. -- mahmoud mack abdelkader http://blog.mahmoudimus.com/ On Fri, Jul 17, 2009 at 4:01 PM, travis+ml-pyt...@subspacefield.orgtravis%2bml-pyt...@subspacefield.org wrote: Hello, Historically, I have used

Re: creating my own logwatch in python

2009-07-17 Thread Mahmoud Abdelkader
A few code critiques: - Your code is not very help friendly because it can not be run, so I have to deadlist debug it. - There are various syntax errors in the code: - for example: file is not defined when you invoke tail(file) - You are overshadowing a built-in type 'file' by that name,

Re: one-time factory in python for an experienced java guy

2009-07-14 Thread Mahmoud Abdelkader
What Paul was trying to elaborate on is that have your customers or whomever will use this implement their own generator protocol to generate whatever number format they need. Paul just gave you an example with itertools.count(), where it is an infinite generator that yields count+1 every time.