Re: Profiler for long-running application

2015-02-09 Thread Ryan Stuart
Hi Asad, Is there any reason why you can't just use profile/cProfile? In particular, you could use the api of that module to save out the profile stats to an external file with a unique name and then inspect them later with a tool like snakeviz . The code to

Re: TypeError: list indices must be integers, not tuple

2015-02-10 Thread Ryan Stuart
Hi, There is a lot of issues with this code. First, setting fav to a 1 tuples with a string probably isn't what you want. What you probably mean is: if restraunt == ("Pizza"): fav = 1 Second, when you are trying to lookup items in Menu, you are using the incorrect fav. Lists have int indicie

Re: Future of Pypy?

2015-02-22 Thread Ryan Stuart
On Mon Feb 23 2015 at 12:05:46 PM Paul Rubin wrote: > I don't see what the big deal is. I hear tons of horror stories about > threads and I believe them, but the thing is, they almost always revolve > around acquiring and releasing locks in the wrong order, forgetting to > lock things, stuff lik

Re: Future of Pypy?

2015-02-22 Thread Ryan Stuart
On Mon Feb 23 2015 at 1:50:40 PM Paul Rubin wrote: > That article is about the hazards of mutable state shared between > threads. The key to using threads safely is to not do that. So the > "transfer" example in the article would instead be a message handler in > the thread holding the account

Re: Future of Pypy?

2015-02-22 Thread Ryan Stuart
On Mon Feb 23 2015 at 4:15:42 PM Paul Rubin wrote: > > What do you mean about Queues working with processes? I meant > Queue.Queue. There is multiprocessing.Queue but that's much less > capable, and it uses cumbersome IPC like pipes or sockets instead of a > lighter weight lock. Threads can als

Re: Are threads bad? - was: Future of Pypy?

2015-02-24 Thread Ryan Stuart
On Tue Feb 24 2015 at 3:32:47 PM Paul Rubin wrote: > Ryan Stuart writes: > Sure, the shared memory introduces the possibility of some bad errors, > I'm just saying that I've found that by staying with a certain > straightforward style, it doesn't seem difficult i

Re: HELP!! How to ask a girl out with a simple witty Python code??

2015-03-04 Thread Ryan Stuart
On Thu, 5 Mar 2015 at 11:35 Xrrific wrote: > Could you please come up with something witty incorporating a simple > python line like If...then... but..etc. > Send her this: import base64 print(base64.b64decode('CkhpLCAKVGhpcyBpcyBzb21lb25lIGZyb20gdGhlIHB5dGhvbiBtYWlsaW5nIGxpc3QuIFRoaXMgZ3V5ICho

Re: test2

2015-03-24 Thread Ryan Stuart
rch$', gui_search), > # (r'^delete/$', ipdb_input_delete), > (r'^api/add/$', api_add), #check sensornet urls.py and > views/sensors.py for cool tricks. > (r'^api/search/$', api_search), #check sensornet urls.py and > views/sensors.py for cool tricks. > (r'^api/file/$', api_file), > > #(r'^asset/media/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, '../asset/media')}), > > #(r'^ip_db/media/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, 'ip_db/media')}), > #(r'^media/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, 'media')}), > #(r'^static/(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/sensornet/static'}), > > # extjs4 stuff > #(r'^asset/overview/extjs/(?P.*)$', 'serve', {'document_root': > os.path.join(PROJECT_PATH, '../asset/extjs')}), > #(r'^extjs/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, '../ip_db/extjs')}), > #(r'^extjs/(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/totis/tree/ipdb/django/ipdb/asset/static/extjs'}), > ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT), > 'ipdb.asset': { > 'handlers': ['console', 'logfile'], > 'level': 'DEBUG', > }, > } > } > > === > > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Ryan Stuart, B.Eng Software Engineer ABN: 81-206-082-133 W: http://www.textisbeautiful.net/ M: +61-431-299-036 -- https://mail.python.org/mailman/listinfo/python-list

Re: Parser needed.

2015-06-09 Thread Ryan Stuart
tine is real nice... to get rid of fudd/white space... and > just tokens which is nice. > > So for now I will use that as my tokenizer ;) =D > > and bracket level counting and sections and stuff like that yeah... > > > Bye, > Skybuck. > -- > https://mail.python.org/mailman/listinfo/python-list > -- Ryan Stuart, B.Eng Software Engineer ABN: 81-206-082-133 W: http://www.textisbeautiful.net/ M: +61-431-299-036 -- https://mail.python.org/mailman/listinfo/python-list

Re: Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

2015-09-21 Thread Ryan Stuart
ion of it being a compile time PRAGMA. Cheers > > There is some performance to be gained. I have a number of python scripts, > and don't want to alter the pragma statement for every script. This > computer never writes to the databases. > > thank you > > -- > https://mail

Re: Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

2015-09-22 Thread Ryan Stuart
gt; > On Tue, Sep 22, 2015 at 2:04 PM, Ryan Stuart > wrote: > >> On Thu, Sep 17, 2015 at 2:24 PM, sol433tt wrote: >> >>> I would like to have the Sqlite pragma statement "locking_mode" set to >>> "EXCLUSIVE" by default (RO database). Does thi