}
> _phone_chars_compiled = None
>
> def phone2number(szinput):
> global _phone_chars_compiled
> if _phone_chars_compiled is None:
> _phone_chars_compiled = {}
> for i in range(256):
> a = chr(i)
>
Why use regular expressions at all for this? A timeit benchmark shows
a greater than 4x speedup with a rangetest in a loop over the string:
def phone2number(str):
chars = {'a': '2', 'b': '2', 'c': '2', 'd': '3', 'e': '3',
'f': '3', 'g': '4', 'h': '4', 'i': '4', 'j': '5', 'k': '5', 'l'
On 9/24/09 9:56 PM, Ian Lewis wrote:
> On Fri, Sep 25, 2009 at 6:33 AM, Chris Beaven wrote:
>
>> +1 on the concept of a signing module.
>>
>> On Sep 25, 7:48 am, Marty Alchin wrote:
>>
>>
>>> The one downside to using get() directly, as opposed to an altogether
>>> new method, is that
On Thu, Sep 17, 2009 at 10:04 AM, Russell Keith-Magee
wrote:
> As for likely roadblocks: I've been led to believe that Adrian has
> objections to framework-level logging. I have no idea as to the nature
> of his objection, but ticket #5415 indicates that he is (or has been,
> historically) in fa
"it depends." We're stuck with auto_now, and auto_now_add, and they
work perfectly fine in some situations. They just aren't the be-all, end-all
solution to automatically saving date columns, as you so bluntly pointed out.
> On Sep 10, 1:19 pm, Andrew Gwozdziewycz wrote:
On Thu, Sep 10, 2009 at 9:35 AM, Ryan K wrote:
> I'm trying to give advice to people but I can't even figure it out
> myself (even though it works for me just fine -- so far?).
Last week, I ran into a problem using them because I wanted to set manually
the date in certain situations. auto_now se
Sorry, I mistyped the email address; moving to django-users
On Sep 10, 7:04 am, Andrew Gwozdziewycz wrote:
> Hello,
>
> What's the recommended place to put code that should be run once upon
> application initialization? I'm currently doing something along the
> lines o
Hello,
What's the recommended place to put code that should be run once upon
application initialization? I'm currently doing something along the
lines of:
1. Create a new signal post_init
2. Connecting handlers to post_init in a file startup.py
3. Sending the signal at the top of a mode
On Tue, Aug 11, 2009 at 10:50 AM, Richard
Davies wrote:
>
> Hi all,
>
> With 1.1 out of the door (great!), here's a thought for 1.2...
>
> I often end up writing the same couple of template tags and filters. I
> think some of these are general enough and useful enough that they
> should be conside
This can be a fully qualified URL (e.g. "http://www.yahoo.com/
search/") or an absolute URL with no domain (e.g. "/search/"). Note
that this returns an HTTP status code 302.
---
Andrew Gwozdziewycz
[EMAIL PROTECTED]
http:
10 matches
Mail list logo