Re: M2crypto

2012-02-12 Thread geremy condra
you don't know what an IV is you're probably getting yourself into a lot of trouble working with low-level crypto libraries. Two suggestions: 1. Describe what you're trying to do- I'll be able to help more if I know what you're actually going for. 2. Try keyczar. It's not perfect, but it's a lot easier to get right. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: M2crypto

2012-02-13 Thread geremy condra
performance using M2Crypto? If your only goal is to do exactly that then go for it, but otherwise you're probably using the wrong tool for the job. Geremy Condra > On 13 Lut, 01:28, geremy condra wrote: >> On Sun, Feb 12, 2012 at 4:00 PM, Mel Wilson wrote: >> > zi

Re: [semi OT]: Smartphones and Python?

2012-02-15 Thread geremy condra
s it generally isn't an easy way to develop fully-fledged Android apps. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: python + php encrypt/decrypt

2011-06-06 Thread geremy condra
y example (the best way source codes) how to do >> > this in python and PHP? Please provide links to the AES implementation you're trying to use from PHP and the Python and PHP code you're using. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Bloom Filter in 22 lines of Python (updated)

2011-06-06 Thread geremy condra
and speed: > >  http://code.activestate.com/recipes/577684-bloom-filter/ Any chance of this landing in collections? Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: How good is security via hashing

2011-06-07 Thread geremy condra
the first place, I'd probably stay away from this method. And besides, # adds random junk to the filename- should make it hard to guess rrr = os.urandom(16) fname += base64.b64encode(rrr) has to be easier to read and reason about than the process above. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: How good is security via hashing

2011-06-07 Thread geremy condra
On Tue, Jun 7, 2011 at 1:42 PM, Paul Rubin wrote: > geremy condra writes: >> # adds random junk to the filename- should make it hard to guess >> rrr = os.urandom(16) >> fname += base64.b64encode(rrr) > > Don't use b64 output in a filename -- it can have slashes in

Re: How good is security via hashing

2011-06-07 Thread geremy condra
.  It then goes and runs them through a distiller (Fortuna), which > seems a little bit silly to me, but harmless. IIRC this is mostly to help deal with the possibility of running on older Windows machines, where the cryptographic random number service was of very poor quality. Geremy Condra -

Re: Bloom Filter in 22 lines of Python (updated)

2011-06-08 Thread geremy condra
On Wed, Jun 8, 2011 at 1:05 PM, Raymond Hettinger wrote: > On Jun 6, 10:47 am, geremy condra wrote: >> On Fri, Jun 3, 2011 at 1:17 PM, Raymond Hettinger wrote: >> > Thanks for all the feedback on the earlier post. >> >> > I've updated the recipe to use

Re: Any Better logic for this problem..

2011-06-09 Thread geremy condra
o you're dealing with a smaller number. Just use a precomputed table to do your trial division. There's a list of the first fifty million primes on prime pages- if you aren't dealing with specially constructed values (ie, RSA moduli) and haven't found a factor by the end of the first ten thousand or so you probably need to do a primality check before moving on to trying to factor it. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Any Better logic for this problem..

2011-06-10 Thread geremy condra
On Thu, Jun 9, 2011 at 6:10 PM, Dan Stromberg wrote: > > On Thu, Jun 9, 2011 at 10:55 AM, geremy condra wrote: >> >> On Thu, Jun 9, 2011 at 4:38 AM, Dave Angel wrote: >> > On 01/-10/-28163 02:59 PM, Chris Rebert wrote: >> >> >> >> On

Re: What is the most efficient way to compare similar contents in two lists?

2011-06-13 Thread geremy condra
ighly... informative. I learned a bit about Python, and > a lot about python-list, from the posts there. So what are we talking about here? Reduce? Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the most efficient way to compare similar contents in two lists?

2011-06-13 Thread geremy condra
On Mon, Jun 13, 2011 at 10:50 AM, Chris Angelico wrote: > On Tue, Jun 14, 2011 at 3:46 AM, geremy condra wrote: >> On Mon, Jun 13, 2011 at 9:30 AM, Chris Angelico wrote: >>> Ha! That *lengthy* thread started fairly soon after I joined this >>> list. It was highly... i

Re: Python 2.6 OR 3.2

2011-06-13 Thread geremy condra
> them would not even open.  Want to guess?  Yup, the config tools are (some > of them) written in python 2.6-- and they don't run in 2.7.1 nor 3.2  .   :( Just a note, Ubuntu 11.04 has 2.7 preinstalled. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread geremy condra
od >> name. I am open for any suggestions. > > Actually I was thinking "isn't that a functional programming language?" Same here. > My suggestion: Cruftbuster 'Phile' Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for Web

2011-06-15 Thread geremy condra
> known browser uses Python as a client-side scripting language. Not quite the same thing, but there's pyjamas. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Trapping MySQLdb warnings

2011-06-15 Thread geremy condra
_rdb = self.__conn.cursor() > ## And implemented as : > try : >    self.__rdb.execute(S) > except _mysql_exceptions.Warning,e: >    raise e ## replace with log(e) > > What else needs to be done? Have you tried http://docs.python.org/library/warnings.html#temporarily-suppressi

Re: Does hashlib support a file mode?

2011-07-06 Thread geremy condra
twice, I expect two objects. > > I am now aware that Python bends the definition of "call" based on > where the line occurs. Principle of least surprise. Python doesn't do anything to the definition of call. If you call hashlib.md5() twice, you get two objects: >>

Re: parsing packets

2011-07-10 Thread geremy condra
al bits, > then put it altogether in a packet to be sent out? Just use the struct module[0] to do your packing for you. There's not enough info in your description to write it out for you, but it sounds like it should do everything you need. Geremy Condra [0]: http://docs.python.org/library/struct.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for general advice on complex program

2011-07-16 Thread geremy condra
terrupted, or > paused, because I don't know if threads would stop if a wxDialog is being > show modally or not. > > So, am I on the right track here? I'd try watchdog[0] before I went to the trouble of rolling my own. Geremy Condra [0]: http://packages.python.org/watchdog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Code Examples

2011-03-01 Thread geremy condra
responses to this thread are really mean for comp.dsp, > not for comp.lang.python. Ah, so you're looking for an argument. This is abuse, you want room 12A just down the hall. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: arbitrary precision linear algebra

2011-03-02 Thread geremy condra
to define a matrix over RealField(precision_in_bits) and then take the eigenvalue of it. I don't know if it will actually produce the precision you need though. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: arbitrary precision linear algebra

2011-03-02 Thread geremy condra
On Wed, Mar 2, 2011 at 10:21 AM, geremy condra wrote: > On Wed, Mar 2, 2011 at 6:42 AM, Ben123 wrote: >> Hello. I have a written Python program which currently uses numpy to >> perform linear algebra operations. Specifically, I do matrix*matrix, >> matrix*vector, numpy.li

Re: arbitrary precision linear algebra

2011-03-02 Thread geremy condra
On Wed, Mar 2, 2011 at 10:47 AM, Ben123 wrote: > On Mar 2, 12:22 pm, geremy condra wrote: >> On Wed, Mar 2, 2011 at 10:21 AM, geremy condra wrote: >> > On Wed, Mar 2, 2011 at 6:42 AM, Ben123 wrote: >> >> Hello. I have a written Python program which currently uses

Re: Need an example program that implements rpm -pql via import rpm

2011-03-03 Thread geremy condra
and help text left as an exercise for the reader. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: What do I need to know in order to write a web application in python?

2011-03-05 Thread geremy condra
use text editors to make GUI applications, do they? Yes, they do. It isn't that bad once you get used to it, and it beats the snot out of trying to maintain the insensible gibberish that some of the autogen tools put out. On a side note, you should check out pygui[0]- very, very nice GUI

Re: I'm happy with Python 2.5

2011-03-06 Thread geremy condra
On Sun, Feb 27, 2011 at 6:27 AM, Tom Zych wrote: > n00m wrote: >> Am I turmoiling your wishful thinking? >> You may nourish it till the end of time. > > Let us cease to nourish those fabled ones who dwell under bridges. +1 QOTW. Geremy Condra -- http://mail.python.org/ma

Re: changing to function what works like a function

2011-03-07 Thread geremy condra
ult parts? > > I'd like to apologise for this post. The OP is not the Victor I > thought he was. If it's any consolation, I wrote a very similar email before coming to the same realization. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

function annotations in open source projects

2011-03-14 Thread geremy condra
I use them in evpy to automatically wrap c functions with a decorated, annotated function. The decorator code is also up on aspn, just search for "c function decorator" and it should come up. I did a similar thing with java a few years ago as well. Geremy Condra -- http://mail.python.o

Re: Fun python 3.2 one-liner

2011-03-29 Thread geremy condra
liner: from math import erf, sqrt def normal_cdf(x, mu=0, sigma=1): return (1/2) * (1 + erf((x-mu)/(sigma*sqrt(2 approximates the cumulative distribution function of the normal distribution. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread geremy condra
t base64.b64decode(code) > def spam(): >    print "Spam! Lovely spam! Lovely spam!" > > In [4]: exec(base64.b64decode(code)) > > In [5]: spam() > Spam! Lovely spam! Lovely spam! I know it's tongue-in-cheek, but please, please, please don't do this. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CPU

2011-04-01 Thread geremy condra
> >> This is one of the main reasons that statically-typed languages exist, and >> are used for most production software. > > I doubt that the reason they are "used for most production software" is a > technical one. I also suspect that there's some confusion betw

Re: Guido rethinking removal of cmp from sort method

2011-04-01 Thread geremy condra
ing at the data I took from PyPI a while back, it's pretty clear that Python's feature set would look very different overall if we applied this test to everything. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido rethinking removal of cmp from sort method

2011-04-01 Thread geremy condra
On Fri, Apr 1, 2011 at 5:41 PM, Steven D'Aprano wrote: > On Fri, 01 Apr 2011 14:31:09 -0700, geremy condra wrote: > >> On Wed, Mar 30, 2011 at 7:13 PM, Steven D'Aprano >> wrote: >> >> >> >>> Or, an alternative approach would be for one

Re: Guido rethinking removal of cmp from sort method

2011-04-02 Thread geremy condra
losophy is technically one of the most > aesthetic concepts in all of computer science--- with pure functional > programming (haskel, erlang) as a close second... I like how you inserted the word 'technically' in there to give this totally unsubstantiated assertion apparent wei

Re: Guido rethinking removal of cmp from sort method

2011-04-02 Thread geremy condra
On Sat, Apr 2, 2011 at 4:01 AM, Steven D'Aprano wrote: > On Fri, 01 Apr 2011 18:22:01 -0700, geremy condra wrote: > [...] >>>> I don't have a horse in this race, but I do wonder how much of Python >>>> could actually survive this test. My first (uneducated)

Re: Guido rethinking removal of cmp from sort method

2011-04-03 Thread geremy condra
On Sun, Apr 3, 2011 at 3:21 AM, Steven D'Aprano wrote: > On Sun, 03 Apr 2011 16:34:34 +1000, Brian Quinlan wrote: > >> On 3 Apr 2011, at 16:22, geremy condra wrote: >>> I think we're talking at cross purposes. The point I'm making is that >>> there a

Re: integer multiplication

2011-04-03 Thread geremy condra
Sage (anyone know off the top of their heads?) > thank you (sorry for the double email, this was supposed to go to the list) Karatsuba multiplication, at least for large integers. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: integer multiplication

2011-04-03 Thread geremy condra
On Sun, Apr 3, 2011 at 6:41 PM, Eddie Tsay wrote: > > On Sun, Apr 3, 2011 at 6:33 PM, geremy condra wrote: >> >> On Sun, Apr 3, 2011 at 6:20 PM, Eddie Tsay wrote: >> > Does anyone know what algorithms for integer multiplication does Python >> > use? >>

Re: Python CPU

2011-04-04 Thread geremy condra
robably >> wouldn't help all that much.  It didn't in the LISP machines. > > What might help more is having bytecodes that operate on > arrays of unboxed types -- numpy acceleration in hardware. I'd be interested in seeing the performance impact of this, although

Re: integer multiplication

2011-04-04 Thread geremy condra
nentials) I think >>I found gmpy to be around 4x faster than Python longs. > > For specialized use, specialized gmpy is the way to go. > > I am curious how gmpy compares to 3.x ints (longs) with small number > calculations like 3+5 or 3*5. I have this data somewhere, if you&#

Re: Testing for performance regressions

2011-04-04 Thread geremy condra
ons or hints I should know? If you can get on it, emulab is great for doing network performance and correctness testing, and even if you can't it might be worth running a small one at your company. I wish I'd found out about it years ago. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing for performance regressions

2011-04-05 Thread geremy condra
On Mon, Apr 4, 2011 at 10:25 PM, Steven D'Aprano wrote: > On Mon, 04 Apr 2011 20:59:52 -0700, geremy condra wrote: > >> On Mon, Apr 4, 2011 at 7:45 PM, Steven D'Aprano >> wrote: > >>> * The disclaimers about timing code snippets that can be found in the &

Re: How to program in Python to run system commands in 1000s of servers

2011-04-05 Thread geremy condra
as well.  What are the different ways of > programming in python to achieve this? There are a bajillion ways to do it badly, but SSH sounds like the right tool for the job here. You really don't want your remote admin system compromised, and fabric makes this kind of thing really much less

Re: Suggest some exercises on Python

2011-04-05 Thread geremy condra
or some similar threads in some sites, they propose some sites > which gives some exercises and puzzles to solve in python. But i'm feeling > it's too much complicated for my capability. If you're mathematically inclined, try Project Euler. It isn't python-specific, but it is

Re: who moved reload?

2011-04-06 Thread geremy condra
.  long day... > > This works: > > import tkinter > from tkinter.constants import * > > > This used to work: > > import Tkinter > from Tkconstants import * > > ...  not any more. Yep, things have moved. Glad you're finding your way around now! Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: fighting game made with python

2011-04-07 Thread geremy condra
e a configuration setup, but Lua and Angelscript are better suited to > high-end games where scripting is required because of their smaller > footprint. EVE online manages to do it. . Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 vs Java 1.6

2011-04-08 Thread geremy condra
fice. If you have reason to believe that your application is very atypical in terms of performance requirements, please post that so we can give you more specific advice. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Free software versus software idea patents

2011-04-11 Thread geremy condra
ence of lambda calculus no more rules out the applicability of patents to software (which I detest) than it rules out the applicability of patents to hardware (which I find only slightly less ridiculous) or other meatspace inventions. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Free software versus software idea patents

2011-04-11 Thread geremy condra
On Mon, Apr 11, 2011 at 2:10 AM, Steven D'Aprano wrote: > On Mon, 11 Apr 2011 00:53:57 -0700, geremy condra wrote: >> I am extremely skeptical of this argument. Leaving aside the fact that >> you've randomly decided to drop the "decidable" qualifier here- a

Re: [OT] Free software versus software idea patents

2011-04-11 Thread geremy condra
On Mon, Apr 11, 2011 at 3:28 PM, Steven D'Aprano wrote: > On Mon, 11 Apr 2011 11:17:09 -0700, geremy condra wrote: > >> On Mon, Apr 11, 2011 at 2:10 AM, Steven D'Aprano >> wrote: > [...] >>> Of course, some mathematics is obvious, or at least intuitive (a

Re: [OT] Free software versus software idea patents

2011-04-12 Thread geremy condra
On Tue, Apr 12, 2011 at 1:15 AM, harrismh777 wrote: > geremy condra wrote: >>> >>>    Software is another sort of animal entirely. Because software is not >>> just >>> >  based on mathematics--- IT IS mathematics. > >> I am extremely skeptical

Re: [even more OT than before] Arithmetic [was Free software versus software idea patents]

2011-04-12 Thread geremy condra
On Tue, Apr 12, 2011 at 4:34 AM, Steven D'Aprano wrote: > On Mon, 11 Apr 2011 15:55:37 -0700, geremy condra wrote: > > >>> Ah, I didn't know that! How wonderful! But in any case, Presburger >>> arithmetic is much weaker than even Peano arithmetic.

Re: Free software versus software idea patents

2011-04-12 Thread geremy condra
by > advocating for not-A in a way that discredits your point of view an > case so that A now seems much more reasonable?  It's not really > "concern trolling".  What would this be called? Harrisment. /I'm sorry, this is abuse... Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Free software versus software idea patents

2011-04-12 Thread geremy condra
rolling, which I found hilarious. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Free software versus software idea patents

2011-04-13 Thread geremy condra
7;re right. In this case you've let yourself get carried away with some very deep, very complex math that you don't fully understand and used it to justify a view that almost is almost certainly held for other reasons. You've reduced some of the most elegant and powerful works of the human mind to simple confirmation bias, and I think most mathematicians would find that shameful. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Free software versus software idea patents

2011-04-13 Thread geremy condra
y that discredits your point of view >>>> > an >>>> >  >  case so that A now seems much more reasonable?  It's not really >>>> >  >  "concern trolling".  What would this be called? >>> >>> > >>> >  Harrisment. >>&

Re: [OT] Free software versus software idea patents

2011-04-14 Thread geremy condra
On Thu, Apr 14, 2011 at 12:22 AM, harrismh777 wrote: > geremy condra wrote: >> >> Having said that, I have a greater respect for mathematics than I do >> for my own economic views, and I don't like seeing it become a >> political football. If you can prove someth

Re: [OT] Free software versus software idea patents

2011-04-15 Thread geremy condra
ugh an argument. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Free software versus software idea patents

2011-04-16 Thread geremy condra
bomb or a dialysis machine in >> mathematics is more of a challenge...) > > I can easily model a massless, frictionless, inelastic, infinitismally > thin lever. Beyond that, it gets complicated. With what kind of precision? Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Free software versus software idea patents

2011-04-18 Thread geremy condra
happy to be proven wrong, and if you'll provide your criteria for the question of what qualifies as 'being mathematics' we might get somewhere. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Teaching Python

2011-04-19 Thread geremy condra
stions! When you say 'hacking', you mean ? Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Teaching Python

2011-04-19 Thread geremy condra
On Tue, Apr 19, 2011 at 4:24 PM, Dan Stromberg wrote: > On Tue, Apr 19, 2011 at 4:03 PM, geremy condra wrote: >> On Tue, Apr 19, 2011 at 3:42 PM, Passiday wrote: >>> Hello, >>> >>> I am planning to teach Python to a group of high school students, who have

Re: [OT] Piling of prepositions (was: Namespaces in functions vs classes)

2011-04-19 Thread geremy condra
>> http://www.ourcivilisation.com/smartboard/shop/gowerse/complete/chap905.htm> >> > > Ending a sentence with a preposition is one aberration up with which I will > not put. > > With is a lousy word to start or end a sentence with. > >                 origins unk

Re: client-server parallellised number crunching

2011-04-26 Thread geremy condra
it then try dropping a liveCD with Hadoop on it in each machine and running it that way. If that can't work, try MPI. If you've gotten that far and nothing does the trick then you're probably going to have to give more details. On a side note, there are a reasonable number of exa

Re: client-server parallellised number crunching

2011-04-26 Thread geremy condra
On Tue, Apr 26, 2011 at 10:58 PM, Hans Georg Schaathun wrote: > On Tue, 26 Apr 2011 14:31:59 -0700, geremy condra >   wrote: > :  Without knowledge of what you're doing it's hard to comment > :  intelligently, > > I need to calculate map( foobar, L ) where foobar()

Re: Deditor

2011-04-27 Thread geremy condra
On Wed, Apr 27, 2011 at 1:47 PM, Yico Gaga wrote: >  why not linux? The download is a .deb, ie, for Debian and Ubuntu. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Coolest Python recipe of all time

2011-05-03 Thread geremy condra
= -a/b (where a and b are the sums). The solution > formula for three variables would be far more complex. Or just use a gauss-jordan solver, which has the advantage of being easy to explain and possible to verify by hand on small instances. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT]: PiCloud - really cool!

2011-05-04 Thread geremy condra
) > > print [cloud.result(job) for job in jobs] > > Enjoy! :) I was the poster across from them at PyCon two years back. Pretty fun to play with, although last I checked it was hard to do true HPC on it. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT]: PiCloud - really cool!

2011-05-04 Thread geremy condra
On Wed, May 4, 2011 at 5:29 PM, James Mills wrote: > On Thu, May 5, 2011 at 10:19 AM, geremy condra wrote: >> I was the poster across from them at PyCon two years back. Pretty fun >> to play with, although last I checked it was hard to do true HPC on >> it. > > Why&#x

Re: Coolest Python recipe of all time

2011-05-06 Thread geremy condra
t; ...     s = "The %s brown %s jumped over the %s %s." % (a, b, c, d) > ...     num_vowels = sum(s.count(c) for c in 'aeiou') > ...     return num_vowels in (12, 18, 19) > ... >>>> for _ in amb(test): > ...     print a, b, c, d > ... > quick fox lazy sloth > quick fox lazy dog > quick kangaroo stupid aardvark > [...more solutions cut for brevity] > hungry kangaroo confused aardvark > > > > As written, amb is just a brute-force solver using more magic than is > good for any code, but it's fun to play with. I use a similar technique *a lot* for various kinds of constraint solvers, but I have yet to come up with a really satisfying spelling for it. Have you looked at the way this is done in Sage? Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: obviscating python code for distribution

2011-05-16 Thread geremy condra
does you much more good than obfuscating it. The obvious attack surface here is pretty much totally exposed via network traffic, which any legitimate client can gain access to. A better approach would be to simply write more secure code in the first place. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread geremy condra
> Now use this (pairing) idea with your (halving) identities and you > should get a logarithmic algo. > > [If you cant do it ask again but yes its fun to work out so do > try :-) ] > -- > http://mail.python.org/mailman/listinfo/python-list > or O(1): φ = (1 + sqrt(5)) / 2 def fib(n): numerator = (φ**n) - (1 - φ)**n denominator = sqrt(5) return round(numerator/denominator) Testing indicates that it's faster somewhere around 7 or so. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread geremy condra
On Tue, May 17, 2011 at 10:19 AM, Jussi Piitulainen wrote: > geremy condra writes: > >> or O(1): >> >> φ = (1 + sqrt(5)) / 2 >> def fib(n): >>     numerator = (φ**n) - (1 - φ)**n >>     denominator = sqrt(5) >>     return round(numerator/denom

Re: Faster Recursive Fibonacci Numbers

2011-05-17 Thread geremy condra
On Tue, May 17, 2011 at 2:04 PM, Wolfram Hinderer wrote: > On 17 Mai, 20:56, geremy condra wrote: >> On Tue, May 17, 2011 at 10:19 AM, Jussi Piitulainen >> >> wrote: >> > geremy condra writes: >> >> >> or O(1): >> >> >> ö = (1

Re: obviscating python code for distribution

2011-05-18 Thread geremy condra
ystems there are a lot of people who have these skills in spades. > Obviously, if your threat sources are dedicated hackers or maybe MI5, > there is no point bothering with obfuscation, but if your threat source > is script kiddies, then it might be quite effective. On the theory that any

Re: obviscating python code for distribution

2011-05-18 Thread geremy condra
On Wed, May 18, 2011 at 10:24 AM, Chris Angelico wrote: > On Thu, May 19, 2011 at 2:54 AM, geremy condra wrote: >> On Wed, May 18, 2011 at 12:36 AM, Hans Georg Schaathun >> wrote: >>> But then, nothing is secure in any absolute sense. >> >> If you're t

Re: obviscating python code for distribution

2011-05-18 Thread geremy condra
On Wed, May 18, 2011 at 10:33 AM, Hans Georg Schaathun wrote: > On Wed, 18 May 2011 09:54:30 -0700, geremy condra >   wrote: > :  On Wed, May 18, 2011 at 12:36 AM, Hans Georg Schaathun > wrote: > : > But then, nothing is secure in any absolute sense. > : > :  If you

Re: obviscating python code for distribution

2011-05-18 Thread geremy condra
On Wed, May 18, 2011 at 12:56 PM, Hans Georg Schaathun wrote: > On Wed, 18 May 2011 12:07:49 -0700, geremy condra >   wrote: > :  I was playing around with an HSM the other day that had originally > :  targeted FIPS 140-3 level 5, complete with formal verification models > :  

Re: obviscating python code for distribution

2011-05-18 Thread geremy condra
I head to public with this. One good thing to do is to just read some of the black hat papers. They're pretty accessible and even if you don't know everything they're saying you should be able to get a general feel for things that way. You might also try working through things like

Re: obviscating python code for distribution

2011-05-19 Thread geremy condra
On Wed, May 18, 2011 at 10:21 PM, Hans Georg Schaathun wrote: > On Wed, 18 May 2011 14:34:46 -0700, geremy condra >   wrote: > :  Systems can be designed that are absolutely secure under reasonable > :  assumptions. The fact that it has assumptions does not make your > :

Re: obviscating python code for distribution

2011-05-19 Thread geremy condra
ls' is a good way to get your foot in the door. It has a practical, no-nonsense approach and is split into self-contained chapters so you don't waste too much of your time on tools that aren't relevant to you. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Faster Recursive Fibonacci Numbers

2011-05-19 Thread geremy condra
On Thu, May 19, 2011 at 3:47 PM, Steven D'Aprano wrote: > On Tue, 17 May 2011 10:02:21 -0700, geremy condra wrote: > >> or O(1): >> >> φ = (1 + sqrt(5)) / 2 >> def fib(n): >>     numerator = (φ**n) - (1 - φ)**n >>     denominator = sqrt(5) >>

Re: obviscating python code for distribution

2011-05-19 Thread geremy condra
On Thu, May 19, 2011 at 11:23 AM, Hans Georg Schaathun wrote: > On Thu, 19 May 2011 10:23:47 -0700, geremy condra >   wrote: > :  Let me get this straight: your argument is that operating *systems* > :  aren't systems? > > You referred to the kernel and not the system.  Th

Re: obviscating python code for distribution

2011-05-19 Thread geremy condra
On Thu, May 19, 2011 at 6:33 PM, Chris Angelico wrote: > On Fri, May 20, 2011 at 10:56 AM, geremy condra wrote: >>> Speaking of reasonable assumptions, one necessary assumption which is >>> particularly dodgy is that whoever deploys and configures it >>> understa

Re: obviscating python code for distribution

2011-05-20 Thread geremy condra
On Fri, May 20, 2011 at 12:10 AM, Steven D'Aprano wrote: > On Thu, 19 May 2011 17:56:12 -0700, geremy condra wrote: > >> TL;DR version: large systems have indeed been verified for their >> security properties. > > How confident are we that the verification softwar

Re: Faster Recursive Fibonacci Numbers

2011-05-20 Thread geremy condra
x*x == 0 > False > > > So you get different behaviour between floats and arbitrary precision > numbers. And this shows up in the above implementation; reimplementing it using Fractions and a truncated continuing fraction approximation of phi and the square root of 5 gets us up to about 500, at the cost of a very long computation time. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: obviscating python code for distribution

2011-05-20 Thread geremy condra
> > ... De Carte replies, "I think not..."     ... and then disappeared. At risk of being pedantic, I think you mean Descartes rather than De Carte. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Off-Topic Posts and Threads on the Python Mailing List

2011-10-11 Thread geremy condra
ere is another mailinglist for OT conversation. Extinguishing does not help either bruises or egos. You smell like a troll. You top-posted. Your post was nonsensical, error-filled, ill-formatted, grouchy, pointless, and dumb. You've earned my contempt, and may God have mercy on your troll. Ger

Re: Opportunity missed by Python ?

2011-10-15 Thread geremy condra
echanism to prevent calls from being issued without it. That means that if you were able to successfully inject code you would be no more protected here than with any other process. Geremy Condra > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Module for console text formatting?

2009-02-17 Thread geremy condra
You can insert those codes just like you would any other character. If there's enough interest I can whip up a wrapper library for you. http://www.linux.gr/cgi-bin/man2html?console_codes+4 On Tue, Feb 17, 2009 at 11:19 PM, srinivasan srinivas < sri_anna...@yahoo.co.in> wrote: > > Hi, > Does anyo

Re: Python AppStore / Marketplace

2009-02-24 Thread geremy condra
do you see this having over, say, porting portage or apt-get? Thanks for your time, Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-02-24 Thread geremy condra
I'm interested. If you are still serious about doing this in two months, send me an email. If you have something put together at that point we can talk about its future. Sound fair? Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Run a linux system command as a superuser, using a python script

2009-02-24 Thread geremy condra
Run the script as root and have it drop privs when it doesn't need them. Or set up a separate daemon to do the rootish parts of it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting screen dims platform specific? Say it ain't so!

2009-02-24 Thread geremy condra
For X systems you can use xwininfo, ie: from commands import getstatusoutput def get_screen_dims(): status, output = getstatusoutput("xwininfo -root") if not status: On Tue, Feb 24, 2009 at 6:53 PM, Luis Zarrabeitia wrote: > On Tuesday 24 February 2009 05:57:52 pm Lionel wrote: > > from win32

Re: Getting screen dims platform specific? Say it ain't so!

2009-02-24 Thread geremy condra
my apologies- hit enter accidentally. anyway, just process the output of that command for the Height: and Width: lines. -- http://mail.python.org/mailman/listinfo/python-list

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-26 Thread geremy condra
Use 1 and 2 and treat them as equivalent to boolean true and false. -- http://mail.python.org/mailman/listinfo/python-list

Re: Completely OT

2009-11-30 Thread geremy condra
can track! > But I presume this would entail doing searches for and eliminating all > unnecessary characters, right? > V Don't homebrew these things, they're easy to screw up and disastrous to get wrong. Also, if you're worried about how secure something you've written is, you can give yourself a little peace of mind by running over it with some of the standard script kiddie tools before deployment. It'll at least give you the comfort of knowing that they won't be able to autopwn you for a while. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: Bored.

2009-11-30 Thread geremy condra
side of things by working on your own projects all the time. Plus, it can be very satisfying to make a widely used piece of software better. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

Re: python bijection

2009-12-03 Thread geremy condra
y major CS data type missing from Python is some > form of (fast) directed graph implementation à la kjGraph: > >    http://gadfly.sourceforge.net/kjbuckets.html > > With these, you can easily build all sorts of relations between > objects and apply fast operations on them. In fact, it should then > be possible to build a complete relational database in Python > (along the lines of Gadfly). If you're in the market for a Python graph library, you may want to check out Graphine- I'm obviously biased (I wrote most of it) but it has a few more bells and whistles than kjbuckets, and is pretty darned easy to use. It also supports undirected and bridge graphs. Geremy Condra -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   >