Title stringlengths 11 150 | A_Id int64 518 72.5M | Users Score int64 -42 283 | Q_Score int64 0 1.39k | ViewCount int64 17 1.71M | Database and SQL int64 0 1 | Tags stringlengths 6 105 | Answer stringlengths 14 4.78k | GUI and Desktop Applications int64 0 1 | System Administration and DevOps int64 0 1 | Networking and APIs int64 0 1 | Other int64 0 1 | CreationDate stringlengths 23 23 | AnswerCount int64 1 55 | Score float64 -1 1.2 | is_accepted bool 2
classes | Q_Id int64 469 42.4M | Python Basics and Environment int64 0 1 | Data Science and Machine Learning int64 0 1 | Web Development int64 1 1 | Available Count int64 1 15 | Question stringlengths 17 21k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Netbeans 7 not starting up after python plugin installation | 19,486,580 | 0 | 1 | 2,129 | 0 | python,macos,netbeans | I have the same problem afther installing the python plguin. To solve this problem i deleted the file: org-openide-awt.jar from C:\Users\MYUSERNAME.netbeans\7.0\modules
Regards!
Martín.
PD: I'm using Netbeans 7.0.1 anda Windows 7 64bit. | 0 | 1 | 0 | 0 | 2011-09-19T17:31:00.000 | 6 | 0 | false | 7,474,887 | 0 | 0 | 1 | 5 | I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install.
I am using a mac osx
I see there are no takers, so let me ask this: Is there a way to revert to before the new plugin install? |
Netbeans 7 not starting up after python plugin installation | 7,478,399 | 1 | 1 | 2,129 | 0 | python,macos,netbeans | I had the same issue. Netbeans would die before opening at all. I could not fix it, and had to revert back to 6.9.1. | 0 | 1 | 0 | 0 | 2011-09-19T17:31:00.000 | 6 | 0.033321 | false | 7,474,887 | 0 | 0 | 1 | 5 | I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install.
I am using a mac osx
I see there are no takers, so let me ask this: Is there a way to revert to before the new plugin install? |
Netbeans 7 not starting up after python plugin installation | 8,088,729 | 1 | 1 | 2,129 | 0 | python,macos,netbeans | I had the same problem, but with Windows 7. I deleted the .netbeans directory located in my home folder. That fixed my problem, hope it fixes yours. | 0 | 1 | 0 | 0 | 2011-09-19T17:31:00.000 | 6 | 0.033321 | false | 7,474,887 | 0 | 0 | 1 | 5 | I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install.
I am using a mac osx
I see there are no takers, so let me ask this: Is there a way to revert to before the new plugin install? |
Netbeans 7 not starting up after python plugin installation | 7,475,990 | -1 | 1 | 2,129 | 0 | python,macos,netbeans | I know I'm not answering your question directly, but I too was considering installing the Python plugin in Netbeans 7 but saw that it was still in Beta.
I use WingIDE from wingware for Python development. I'm a Python newbie but I'm told by the pros that Wing is the best IDE for Python. The "101" version is free and works very well. The licensed versions include more options such as version control integration and Django features. | 0 | 1 | 0 | 0 | 2011-09-19T17:31:00.000 | 6 | -0.033321 | false | 7,474,887 | 0 | 0 | 1 | 5 | I went to tools, plugins. Then chose to install the three python items that show up. After installation. I choose the restart netbeans option. But instead of restarting, netbeans just closed. And now it is not opening. Any ideas how to fix this? I normally develop Java on my netbeans 7 install.
I am using a mac osx
I see there are no takers, so let me ask this: Is there a way to revert to before the new plugin install? |
Using Django Caching with Mod_WSGI | 7,482,454 | 0 | 1 | 707 | 0 | python,django,performance | I had a similar problem with an app using memcached. The solution was running mod_wsgi in daemon mode instead of embeded mode, and Apache in mpm_worker mode. After that, application is working much faster. | 0 | 0 | 0 | 1 | 2011-09-19T20:57:00.000 | 3 | 0 | false | 7,477,211 | 0 | 0 | 1 | 3 | Is anyone aware of any issues with Django's caching framework when deployed to Apache/Mod_WSGI?
When testing with the caching framework locally with the dev server, using the profiling middleware and either the FileBasedCache or LocMemCache, Django's very fast. My request time goes from ~0.125 sec to ~0.001 sec. Fantastic.
I deploy the identical code to a remote machine running Apache/Mod_WSGI and my request time goes from ~0.155 sec (before I deployed the change) to ~.400 sec (post deployment). That's right, caching slowed everything down.
I've spent hours digging through everything, looking for something I'm missing. I've tried using FileBasedCache with a location on tmpfs, but that also failed to improve performance.
I've monitored the remote machine with top, and it shows no other processes and it has 6GB available memory, so basically Django should have full rein. I love Django, but it's incredibly slow, and so far I've never been able to get the caching framework to make any noticeable impact in a production environment. Is there anything I'm missing?
EDIT: I've also tried memcached, with the same result. I confirmed memcached was running by telneting into it. |
Using Django Caching with Mod_WSGI | 18,531,552 | 0 | 1 | 707 | 0 | python,django,performance | Same thing happened to me and was wondering what is that is taking so much time.
each cache get was taking around 100 millisecond.
So I debugged the code django locmem code and found out that pickle was taking a lot of time (I was caching a whole table in locmemcache).
I wrapped the locmem as I didn't wanted anything advanced, so even if you remove the pickle and unpickle and put it. You will see a major improvement.
Hope it helps someone. | 0 | 0 | 0 | 1 | 2011-09-19T20:57:00.000 | 3 | 0 | false | 7,477,211 | 0 | 0 | 1 | 3 | Is anyone aware of any issues with Django's caching framework when deployed to Apache/Mod_WSGI?
When testing with the caching framework locally with the dev server, using the profiling middleware and either the FileBasedCache or LocMemCache, Django's very fast. My request time goes from ~0.125 sec to ~0.001 sec. Fantastic.
I deploy the identical code to a remote machine running Apache/Mod_WSGI and my request time goes from ~0.155 sec (before I deployed the change) to ~.400 sec (post deployment). That's right, caching slowed everything down.
I've spent hours digging through everything, looking for something I'm missing. I've tried using FileBasedCache with a location on tmpfs, but that also failed to improve performance.
I've monitored the remote machine with top, and it shows no other processes and it has 6GB available memory, so basically Django should have full rein. I love Django, but it's incredibly slow, and so far I've never been able to get the caching framework to make any noticeable impact in a production environment. Is there anything I'm missing?
EDIT: I've also tried memcached, with the same result. I confirmed memcached was running by telneting into it. |
Using Django Caching with Mod_WSGI | 7,477,678 | 0 | 1 | 707 | 0 | python,django,performance | Indeed django is slow. But I must say most of the slowness goes from app itself.. django just forces you (bu providing bad examples in docs) to do lazy thing that are slow in production.
First of: try nginx + uwsgi. it is just the best.
To optimize you app: you need to find you what is causing slowness, it can be:
slow database queries (a lot of queries or just slow queries)
slow database itself
slow filesystem (nfs for example)
Try logging request queries and watch iostat or iotop or something like that.
I had this scenario with apache+mod_wsgi: first request from browser was very slow... then a few request from same browser were fast.. then if sat doing nothing for 2 minutes - wgain very slow. I don`t know if that was improperly configured apache if it was shutting down wsgi app and starting for each keepalive request. It just posted me off - I installed nging and with nginx+fgxi all was a lot faster than apache+mod_wsgi. | 0 | 0 | 0 | 1 | 2011-09-19T20:57:00.000 | 3 | 1.2 | true | 7,477,211 | 0 | 0 | 1 | 3 | Is anyone aware of any issues with Django's caching framework when deployed to Apache/Mod_WSGI?
When testing with the caching framework locally with the dev server, using the profiling middleware and either the FileBasedCache or LocMemCache, Django's very fast. My request time goes from ~0.125 sec to ~0.001 sec. Fantastic.
I deploy the identical code to a remote machine running Apache/Mod_WSGI and my request time goes from ~0.155 sec (before I deployed the change) to ~.400 sec (post deployment). That's right, caching slowed everything down.
I've spent hours digging through everything, looking for something I'm missing. I've tried using FileBasedCache with a location on tmpfs, but that also failed to improve performance.
I've monitored the remote machine with top, and it shows no other processes and it has 6GB available memory, so basically Django should have full rein. I love Django, but it's incredibly slow, and so far I've never been able to get the caching framework to make any noticeable impact in a production environment. Is there anything I'm missing?
EDIT: I've also tried memcached, with the same result. I confirmed memcached was running by telneting into it. |
Create dynamic URLs in Flask with url_for() | 67,442,944 | 0 | 241 | 402,348 | 0 | python,flask | You need to add function means that the page you want to render that function whould be added inside the url_for(function name).
It will redirect to that function and the page will render accordingly. | 0 | 0 | 0 | 0 | 2011-09-19T23:11:00.000 | 5 | 0 | false | 7,478,366 | 0 | 0 | 1 | 1 | Half of my Flask routes requires a variable say, /<variable>/add or /<variable>/remove. How do I create links to those locations?
url_for() takes one argument for the function to route to but I can't add arguments? |
Python on website to connect to phone connected to computer | 7,478,626 | 1 | 0 | 271 | 0 | javascript,android,python,django | What you're looking for isn't possible and should not be possible for security concerns. Do you want someone knowing what devices you have connected to your computer? You're essentially wanting a device sniffer but a website would not be capable of accessing the client's machine in this manner to access the desired information. | 0 | 0 | 1 | 0 | 2011-09-19T23:46:00.000 | 2 | 0.099668 | false | 7,478,590 | 0 | 0 | 1 | 2 | I know the title is a bit off, but what I'm asking is if it is possible to have a python script on my website that can detect if my Android phone is connected to the computer Im using to view the page. I don't know if this is possible since I think python is server-side, but maybe this is possible to do with JavaScript? I'm fairly new to programming so I may not be as smart as you guys out there but if someone could just lead me in the right direction I would be grateful. |
Python on website to connect to phone connected to computer | 7,479,646 | 1 | 0 | 271 | 0 | javascript,android,python,django | What you're looking for is not TOTALLY ABSOLUTELY impossible, but you may need some help from the computer you connect the device to, from the browser you're visiting your site with or from the device itself. Some possible options:
have a program running on your computer which checks if the device is connected and pinging a certain URL on your website if it is.
write a browser plugin which checks if the device is connected and exposing the information via some JS API - the JS code on your site will be able to use it.
have a program running on your device which pings your site each time the device is connected to a computer.
Admittedly, all the solutions are from the "tricky" category :) | 0 | 0 | 1 | 0 | 2011-09-19T23:46:00.000 | 2 | 1.2 | true | 7,478,590 | 0 | 0 | 1 | 2 | I know the title is a bit off, but what I'm asking is if it is possible to have a python script on my website that can detect if my Android phone is connected to the computer Im using to view the page. I don't know if this is possible since I think python is server-side, but maybe this is possible to do with JavaScript? I'm fairly new to programming so I may not be as smart as you guys out there but if someone could just lead me in the right direction I would be grateful. |
Python Parallel Processing Amazon EC2 or Alternatives? | 7,478,918 | 1 | 0 | 384 | 0 | python,multithreading,amazon-ec2,cloud,parallel-processing | Your requirements are too vague for a specific response. It is unlikely you are going to be able to elaborate them sufficiently for anybody to provide an authoritative answer.
Fortunately for you, many Infrastructure as a Service platforms like AWS and Rackspace let you test things out extremely inexpensively (literal pocket change), so give them a try and see what works for your application. | 0 | 1 | 0 | 1 | 2011-09-20T00:21:00.000 | 1 | 1.2 | true | 7,478,803 | 0 | 0 | 1 | 1 | I'm working on running a Memory/CPU intensive project on a cloud service, from my Googling and research it looks like I should use Amazon EC2 as there are guides it using MPI - however, reading up on stackoverflow about people's comparison of EC2 with rackspace, joyent, etc, I was wondering if this is really the best cloud option I should go with or is there an alternative better route I should take? Any insight would be appreciated.
Thanks, |
DJANGO_SETTINGS_MODULE is undefined | 15,087,670 | 5 | 5 | 30,612 | 0 | python,django,python-idle | Don't run django-admin.py for anything other than the initial project creation. For everything after that, use manage.py, which takes care of the finding the settings. | 0 | 0 | 0 | 0 | 2011-09-20T02:41:00.000 | 4 | 0.244919 | false | 7,479,493 | 0 | 0 | 1 | 2 | when i input from django.db import models into IDLE,the result throw a exception named Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
why does this exception occur and how i can fix it |
DJANGO_SETTINGS_MODULE is undefined | 14,872,658 | 8 | 5 | 30,612 | 0 | python,django,python-idle | You can use python manage.py shell instead of using IDLE.
manage.py reads and uses django settings including DJANGO_SETTINGS_MODULE. | 0 | 0 | 0 | 0 | 2011-09-20T02:41:00.000 | 4 | 1 | false | 7,479,493 | 0 | 0 | 1 | 2 | when i input from django.db import models into IDLE,the result throw a exception named Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
why does this exception occur and how i can fix it |
How do I properly install django registration on localhost? | 7,498,096 | 1 | 3 | 1,876 | 0 | python,django | i'd also add that there is a set of default templates somewhere that make the usage of registration vastly easier. think they were on ubernostrums google code last time i needed them. | 0 | 0 | 0 | 0 | 2011-09-20T20:41:00.000 | 4 | 0.049958 | false | 7,491,507 | 0 | 0 | 1 | 2 | I have a directory for a django project on my localhost
/MyDjangoList/
In this folder I have a django application called PK
I downloaded django-registration and unzipped the folder into the /MyDjangoList/
I went into terminal and went to the django-registration folder and ran
python setup.py install.
It did a bunch of things then spit out the following:
error: could not create '/usr/local/lib/python2.7/dist-packages/registration': Permission denied
The Install file says I can just put it into the same folder as my project, so do I even need to install this? If so, how do I properly install it? |
How do I properly install django registration on localhost? | 7,491,553 | 1 | 3 | 1,876 | 0 | python,django | Do you need more permission? As in you need to do: sudo python setup.py install | 0 | 0 | 0 | 0 | 2011-09-20T20:41:00.000 | 4 | 0.049958 | false | 7,491,507 | 0 | 0 | 1 | 2 | I have a directory for a django project on my localhost
/MyDjangoList/
In this folder I have a django application called PK
I downloaded django-registration and unzipped the folder into the /MyDjangoList/
I went into terminal and went to the django-registration folder and ran
python setup.py install.
It did a bunch of things then spit out the following:
error: could not create '/usr/local/lib/python2.7/dist-packages/registration': Permission denied
The Install file says I can just put it into the same folder as my project, so do I even need to install this? If so, how do I properly install it? |
Why did Google choose Java for the Android Operating System? | 7,497,322 | 10 | 19 | 9,975 | 0 | java,android,python | Google, as a company, uses Java a lot. The search features are written in Java. As far as I can tell from the outside, Google likes Java.
For most tasks, Java is faster than Python. I would rather work in Python, and I know how to write reasonably efficient Python, and yes PyPy is really shaking things up, but Google needed to provide a snappy experience on relatively underpowered phone processors so they likely didn't consider Python a contender.
Java, like Python, provides a great deal of isolation from details of the underlying hardware. I think all Android phones are ARM-based, but in theory you could make an Android phone based on an x86 chip or something completely different, and as long as you do a good job of porting the Dalvik VM, your code will run. (Aside from apps that have native ARM code compiled in, of course.)
Google likes the Java language, but they chose to write their own VM ("Dalvik") rather than license the Java VM. Compiled Java can be directly translated into Dalvik bytecodes. (Oracle sued Google over this. Oracle lost the lawsuit.) | 1 | 0 | 0 | 1 | 2011-09-21T09:02:00.000 | 2 | 1 | false | 7,497,199 | 0 | 0 | 1 | 1 | Full question
Why did Google choose Java for the Android Operating System and not the X language?
Where X would be one of the below:
Python version 2.7 or version 3
which is equally as powerful as Java
has a lot of useful third party libraries
is faster to develop in thanks to it's dynamic nature
C/C++ or ObjC
which are harder to develop in but
run faster thanks to less overhead
would require less beefy hardware, especially RAM
are equally as robust as Java but are more prone to app-wide crashes when just one module fails
And so on. My main concern when I asked this question was why Java and not Python. I can add other elements (languages) of comparison later if anyone else is also interested.
Info: I'm not a full-blown developer.
EDIT I was very much aware that my question was going to be met with some opposition and bashing, that's why I said that I'm not a full-blown developer. I have my personal opinions to support me and just that but even thus, I still got great answers. I understand now, yes, Dalvik VM runs Java bytecodes on ARM devices, but how different is that Java from any other Oracle/Sun Java spec, I don't know. I've been playing with both Java and Python and wrote at least one useful program in both + GUIs (Swing and PySide) and at least one third party library used. The order I did this was Java, then Python which made me realize how much faster it was for me to write everything from scratch in Python than it was in Java. Even packages seemed much easier to manager than Java's way of importing packages (thank God for Eclipse and a few intuitive clicks)... and then how complex would embedded apps be that you'd need to take extra care for type checking and unit tests (and afaik, unit tests are supposed to be a must nowadays for any serious developer)... but anyway, thanks for the answers so far. It's a learning process. ;) |
Getting error: AttributeError: class has no attribute '' | 7,503,299 | 1 | 0 | 1,839 | 0 | python | class Check_jira ends on line 25 and has only one method. Then you have an if block, and CheckForJiraIssueRecord is just a function defined in this block (that is, the function is defined if __name__ == '__main__'.
Just put the if block outside after the whole class definition. | 0 | 0 | 0 | 0 | 2011-09-21T16:18:00.000 | 1 | 1.2 | true | 7,503,149 | 0 | 0 | 1 | 1 | Here is the code:
1 #!/usr/bin/env python
2
3 import re, os, sys, jira, subprocess
4
5 class Check_jira:
6
7 def verify_commit_text(self, tags):
8 for line in tags:
9 if re.match('^NO-TIK',line):
10 return True
11 elif re.match('^NO-REVIEW', line):
12 return True
13 elif re.match(r'[a-zA-Z]+-\d+', line):
14 # Validate the JIRA ID
15 m = re.search("([a-zA-Z]+-\d+)",line)
16 if m:
17 my_args = m.group(1)
18 result = Check_jira.CheckForJiraIssueRecord(my_args)
19 if result == False:
20 util.warn("%s does not exist"%my_args)
21 else:
22 return True
23 return True
24 else:
25 return False
26 if __name__ == '__main__':
27 p = Check_jira()
28 commit_text_verified = p.verify_commit_text(os.popen('hg tip --template "{desc}"'))
29
30 if (commit_text_verified):
31 sys.exit(0)
32 else:
33 print >> sys.stderr, ('[obey the rules!]')
34 sys.exit(1);
35 def CheckForJiraIssueRecord(object):
36
37 sys.stdout = os.devnull
38 sys.stderr = os.devnull
39
40
41 try:
42 com = jira.Commands()
43 logger = jira.setupLogging()
44 jira_env = {'home':os.environ['HOME']}
45 command_cat= "cat"
46 command_logout= "logout"
47 #my_args = ["QA-656"]
48 server = "http://jira.myserver.com:8080/rpc/soap/jirasoapservice-v2?wsdl"
49 except Exception, e:
50 sys.exit('config error')
51
52 class Options:
53 pass
54 options = Options()
55
56 options.user = 'user'
57 options.password = 'password'
58
59 try:
60
61 jira.soap = jira.Client(server)
62 jira.start_login(options, jira_env, command_cat, com, logger)
63 issue = com.run(command_cat, logger, jira_env, my_args)
64 except Exception, e:
65 print sys.exit('data error')
so maybe:
1. if name == 'main': shoudl be at the bottom ?
2. So, i have 2 classes (Check_jira) and (Options)
3. Check_jira has 2 functions verify_commit_text() and CheckForJiraIssueRecord()
4. I pass object as an argument to CheckForJiraIssueRecord since i am passing my_args to it , on its usage.
5. Not sure how to call one function from another function in the same class
6. Error i am getting is :
Traceback (most recent call last):
File "/home/qa/hook-test/.hg/check_jira.py", line 31, in
commit_text_verified = p.verify_commit_text(os.popen('hg tip --template "{desc}"'))
File "/home/qa/hook-test/.hg/check_jira.py", line 21, in verify_commit_text
result = Check_jira.CheckForJiraIssueRecord(my_args)
AttributeError: class Check_jira has no attribute 'CheckForJiraIssueRecord'
transaction abort!
rollback completed
abort: pretxncommit.jira hook exited with status 1 |
App Engine problems using the command line | 7,507,801 | 2 | 1 | 219 | 0 | python,django,google-app-engine,command-line,google-cloud-datastore | If you're using Django 0.96 templates within a 'normal' App Engine app, then manage.py isn't involved at all.
/path/to/dev_appserver.py --clear_datastore .
is what you want, assuming you're CD'd to the root of your app. | 0 | 1 | 0 | 0 | 2011-09-21T21:24:00.000 | 1 | 1.2 | true | 7,506,854 | 0 | 0 | 1 | 1 | I am developing an App Engine project on Windows using Eclipse and Python 2.5 and Django 0.96. Everything in my app, including Django, is working nicely.
My problems arise when I try to use command line. For example, I'm told that if I want to clear the local datastore I can enter "python manage.py reset" but when I do so the response is "python: can't open file 'manage.py'".
I feel as if I have missed a configuration step. I have checked my system variables and "Path" includes "C:\Python25" (which I had added manually) but nothing Django or App Engine related. My .py extension is associated with C:\Python25\python.exe.
In my quest to solve this, and in trying to understand what manage.py is, I see that I might have had to create a Django project using "django-admin.py startproject [myproject]" but because everything works nicely from Eclipse I'm not sure if this is necessary now. In any case, if I try to enter this from the command line I get "'django-admin.py' is not recognized..."
Please, what am I missing? |
BrowserID without Javascript (preferably in Python) - is it possible? | 7,508,068 | -1 | 3 | 490 | 0 | python,graceful-degradation,noscript,browserid | One solution, use OpenID or hand-rolled email verification, but then I have 2 problems. :( | 0 | 0 | 1 | 0 | 2011-09-21T23:50:00.000 | 3 | -0.066568 | false | 7,508,016 | 0 | 0 | 1 | 1 | BrowserID currently uses a Javascript shim, while browsers are still (hopefully) developing support for it. Is it possible to use BrowserID for clients that don't run javascript?
I could read the 600 line JS shim, and figure out what navigator.id.getVerifiedEmail is meant to do, then replicate it on a server, but I was hoping there's an easier way. And even then, I don't think it would really work.
OK, digging a bit deeper, this seems to be peripheral to what BrowserID is meant to do, and might require some kind custom BrowserID validator, but I'm hoping there's an easier way. |
Inexplicable Urllib2 problem between virtualenv's. | 7,681,165 | 0 | 5 | 397 | 0 | python,http,cookies,urllib2,mechanize | Well, it looks like I know why the problem was happening, but I'm not 100% the reason for it.
I simply had to make the server wait (time.sleep()) after it sent the 2nd request (Move to another page) before doing the 3rd request (Perform a POST by filling in a form).
I don't know is it because of a condition with the 3rd party server, or if it's some sort of odd issue with URLlib? The reason it seemed to work on my development machine is presumably because it was slower then the server at running the code? | 0 | 0 | 1 | 0 | 2011-09-22T01:51:00.000 | 4 | 1.2 | true | 7,508,686 | 0 | 0 | 1 | 2 | I have some test code (as a part of a webapp) that uses urllib2 to perform an operation I would usually perform via a browser:
Log in to a remote website
Move to another page
Perform a POST by filling in a form
I've created 4 separate, clean virtualenvs (with --no-site-packages) on 3 different machines, all with different versions of python but the exact same packages (via pip requirements file), and the code only works on the two virtualenvs on my local development machine(2.6.1 and 2.7.2) - it won't work on either of my production VPSs
In the failing cases, I can log in successfully, move to the correct page but when I submit the form, the remote server replies telling me that there has been an error - it's an application server error page ('we couldn't complete your request') and not a webserver error.
because I can successfully log in and maneuver to a second page, this doesn't seem to be a session or a cookie problem - it's particular to the final POST
because I can perform the operation on a particular machine with the EXACT same headers and data, this doesn't seem to be a problem with what I am requesting/posting
because I am trying the code on two separate VPS rented from different companies, this doesn't seem to be a problem with the VPS physical environment
because the code works on 2 different python versions, I can't imagine it being an incompabilty problem
I'm completely lost at this stage as to why this wouldn't work. I've even 'turned-it-off-and-turn-it-on-again' because I just can't see what the problem could be.
I think it has to be something to do with the final POST coming from a VPS that the remote server doesn't like, but I can't figure out what that could be. I feel like there is something going on under the hood of URLlib that is causing the remote server to dislike the reply.
EDIT
I've installed the exact same Python version (2.6.1) on the VPS as is on my working local copy and it doesn't work remotely, so it must be something to do with originating from a VPS. How could this effect the Http request? Is it something lower level? |
Inexplicable Urllib2 problem between virtualenv's. | 7,550,771 | 1 | 5 | 397 | 0 | python,http,cookies,urllib2,mechanize | This is a total shot in the dark, but are your VPSs 64-bit and your home computer 32-bit, or vice versa? Maybe a difference in default sizes or accuracies of something could be freaking out the server.
Barring that, can you try to find out any information on the software stack the web server is using? | 0 | 0 | 1 | 0 | 2011-09-22T01:51:00.000 | 4 | 0.049958 | false | 7,508,686 | 0 | 0 | 1 | 2 | I have some test code (as a part of a webapp) that uses urllib2 to perform an operation I would usually perform via a browser:
Log in to a remote website
Move to another page
Perform a POST by filling in a form
I've created 4 separate, clean virtualenvs (with --no-site-packages) on 3 different machines, all with different versions of python but the exact same packages (via pip requirements file), and the code only works on the two virtualenvs on my local development machine(2.6.1 and 2.7.2) - it won't work on either of my production VPSs
In the failing cases, I can log in successfully, move to the correct page but when I submit the form, the remote server replies telling me that there has been an error - it's an application server error page ('we couldn't complete your request') and not a webserver error.
because I can successfully log in and maneuver to a second page, this doesn't seem to be a session or a cookie problem - it's particular to the final POST
because I can perform the operation on a particular machine with the EXACT same headers and data, this doesn't seem to be a problem with what I am requesting/posting
because I am trying the code on two separate VPS rented from different companies, this doesn't seem to be a problem with the VPS physical environment
because the code works on 2 different python versions, I can't imagine it being an incompabilty problem
I'm completely lost at this stage as to why this wouldn't work. I've even 'turned-it-off-and-turn-it-on-again' because I just can't see what the problem could be.
I think it has to be something to do with the final POST coming from a VPS that the remote server doesn't like, but I can't figure out what that could be. I feel like there is something going on under the hood of URLlib that is causing the remote server to dislike the reply.
EDIT
I've installed the exact same Python version (2.6.1) on the VPS as is on my working local copy and it doesn't work remotely, so it must be something to do with originating from a VPS. How could this effect the Http request? Is it something lower level? |
local_import function does not work | 7,525,938 | 0 | 2 | 642 | 0 | python,apache,wsgi,web2py,web2py-modules | Add testapp to your PYTHONPATH. | 0 | 0 | 0 | 1 | 2011-09-23T07:40:00.000 | 3 | 0 | false | 7,525,761 | 0 | 0 | 1 | 2 | local_import function randomly does not import my modules from modules
directory. The Error is:
ImportError: No module named testapp.modules.mymodule
I have this problem when i use web2py with apache (with wsgi). I have no problem when i run locally with "python web2py.py" command.
Any suggestion? |
local_import function does not work | 7,582,872 | 1 | 2 | 642 | 0 | python,apache,wsgi,web2py,web2py-modules | I will answer my own question :)
I started using mod_proxy and everything is ok. | 0 | 0 | 0 | 1 | 2011-09-23T07:40:00.000 | 3 | 0.066568 | false | 7,525,761 | 0 | 0 | 1 | 2 | local_import function randomly does not import my modules from modules
directory. The Error is:
ImportError: No module named testapp.modules.mymodule
I have this problem when i use web2py with apache (with wsgi). I have no problem when i run locally with "python web2py.py" command.
Any suggestion? |
Is it necessary to explicitly free memory in Google App Engine's Python environment? | 7,526,870 | 6 | 2 | 617 | 0 | python,google-app-engine | Python has it's own garbage collection so there's no need to release memory manually. | 0 | 1 | 0 | 0 | 2011-09-23T09:15:00.000 | 2 | 1.2 | true | 7,526,746 | 0 | 0 | 1 | 1 | Is there a way to free memory in google's app engine? Is there a garbage collector in python? |
Encrypting passwords on POST Django | 7,533,960 | 5 | 6 | 2,645 | 0 | python,django,encryption | SSL is a de facto solution, but if for some reason you can't have it, then you'll find shelter in some javascript libraries that encrypt post data. And there are plenty of them if you search.. But I don't believe that any of them can achieve maximum security. | 0 | 0 | 0 | 0 | 2011-09-23T17:52:00.000 | 1 | 1.2 | true | 7,532,972 | 0 | 0 | 1 | 1 | aside from using SSL, is there any way to encrypt a password in the Django framework on the first POST to the server? For example, if I have a form that accepts a username and password, then send it to another view, aren't the passwords sent to the backend unencrypted? If so, is there a way to encrypt the passwords before transmitting to the backend? |
What is a pythonic webserver equivalent to IIS and ASP? | 7,534,361 | 0 | 0 | 394 | 0 | python,webserver | WSGI setups are fairly easy to get started, but in no anyway turn key. django MVC has a simple built in development server if you plan on using a more comprehensive framework. | 0 | 0 | 0 | 1 | 2011-09-23T20:07:00.000 | 4 | 0 | false | 7,534,244 | 0 | 0 | 1 | 4 | For very simple, internal web-apps using ASP I was able to just switch IIS 'on' and then write some ASP scripts in the www directory that would start working immediately.
Is there an equivalent webserver app for Python scripts that I can run that will automatically start serving dynamic pages (python scripts) in a certain folder (with virtually no configuration)?
Solutions I've already found are either too limited (e.g. SimpleHTTPRequestHandler doesn't serve dynamic content) or require configuring the script that does the serving. |
What is a pythonic webserver equivalent to IIS and ASP? | 7,534,379 | 4 | 0 | 394 | 0 | python,webserver | There's always CGI. Add a script mapping of .py to "C:\Python27\python.exe" -u "%s" then drop .py files in a folder and IIS will execute them.
I'd not generally recommend it for real work—in the longer term you would definitely want to write apps to WSGI, and then deploy them through any number of interfaces including CGI—but it can be handy for quick prototyping. | 0 | 0 | 0 | 1 | 2011-09-23T20:07:00.000 | 4 | 0.197375 | false | 7,534,244 | 0 | 0 | 1 | 4 | For very simple, internal web-apps using ASP I was able to just switch IIS 'on' and then write some ASP scripts in the www directory that would start working immediately.
Is there an equivalent webserver app for Python scripts that I can run that will automatically start serving dynamic pages (python scripts) in a certain folder (with virtually no configuration)?
Solutions I've already found are either too limited (e.g. SimpleHTTPRequestHandler doesn't serve dynamic content) or require configuring the script that does the serving. |
What is a pythonic webserver equivalent to IIS and ASP? | 7,534,417 | 0 | 0 | 394 | 0 | python,webserver | My limited experience with Python web frameworks has taught me that most go to one extreme or the other: Django on one end is a full-stack MVC framework, that will do pretty much everything for you. On the other end, there are Flask, web.py, CherryPy, etc., which do much less, but stay out of your way.
CherryPy, for example, not only comes with no ORM, and doesn't require MVC, but it doesn't even have a templating engine. So unless you use it with something like Cheetah, you can't write what would look like .asp at all. | 0 | 0 | 0 | 1 | 2011-09-23T20:07:00.000 | 4 | 0 | false | 7,534,244 | 0 | 0 | 1 | 4 | For very simple, internal web-apps using ASP I was able to just switch IIS 'on' and then write some ASP scripts in the www directory that would start working immediately.
Is there an equivalent webserver app for Python scripts that I can run that will automatically start serving dynamic pages (python scripts) in a certain folder (with virtually no configuration)?
Solutions I've already found are either too limited (e.g. SimpleHTTPRequestHandler doesn't serve dynamic content) or require configuring the script that does the serving. |
What is a pythonic webserver equivalent to IIS and ASP? | 7,534,970 | 1 | 0 | 394 | 0 | python,webserver | For development or just to play around, here's an example using the standard Python library that I have used to help friend who wanted to get a basic CGI server up and running. It will serve python scripts from cgi-bin and files from the root folder. I'm not near a Windows computer at the moment to make sure that this still works. This also assumes Python2.x. Python 3.x has this, it's just not named the same.
Make a directory on your harddrive with a cgi-bin folder in it (Ex. "C:\server\cgi-bin")
In a command window, navigate to "C:\server" directory
Type the following assuming you've installed python 2.7 in C:\Python27:
"c:\python27\python.exe -m CGIHTTPServer"
You should get a message like "Serving HTTP on 0.0.0.0 port 8000"
Linux is the same - "python -m CGIHTTPServer" in a directory with a cgi-bin/ in it. | 0 | 0 | 0 | 1 | 2011-09-23T20:07:00.000 | 4 | 0.049958 | false | 7,534,244 | 0 | 0 | 1 | 4 | For very simple, internal web-apps using ASP I was able to just switch IIS 'on' and then write some ASP scripts in the www directory that would start working immediately.
Is there an equivalent webserver app for Python scripts that I can run that will automatically start serving dynamic pages (python scripts) in a certain folder (with virtually no configuration)?
Solutions I've already found are either too limited (e.g. SimpleHTTPRequestHandler doesn't serve dynamic content) or require configuring the script that does the serving. |
Check for Event Daily, and Send Notification Messages | 8,426,091 | 1 | 0 | 150 | 0 | php,python,google-app-engine | If you are using Google App Engine with Python you could use "Cron" to schedule a task to automatically run each day.
GAE also allows you to send emails, just a little tip: make sure that you 'invite' the email address used to send mail to the application as an administrator so that you can programatically send emails etc. | 0 | 0 | 1 | 1 | 2011-09-23T22:41:00.000 | 1 | 0.197375 | false | 7,535,544 | 0 | 0 | 1 | 1 | What is the best way to set up a system that checks for events daily and sends messages via email, Twitter, SMS, and possibly Facebook? Keep in mind, that I do not have access to a web server with root access (Using Rackspace Cloud). Would PHP have a solution for this? Would there be any drawbacks to using Google App Engine and Python? |
Need recommendation for templating configuration files and auditing | 7,537,437 | 1 | 1 | 275 | 0 | python,templates | Let's take the simplest approach.
Use whatever language and templating engine you want, write a script that generates a config by e.g. a device name.
To check, generate a config for a device, download the actual config from that device, run diff. Mail the differences, if any, to people in charge of auditing.
The templating engine makes no difference in your case: you have no performance constraints, it seems. I'd take Python + Mako / Jinja / Cheetah, or Ruby + Rails, but even a bash + sed script could work. | 0 | 0 | 0 | 0 | 2011-09-24T05:09:00.000 | 1 | 0.197375 | false | 7,537,169 | 0 | 0 | 1 | 1 | I am looking for a template engine for pushing and pulling data from configuration files. To be more specific, Cisco router configuration files. My goal has two parts
1) To be able to template my router config and insert unique data (hostname, interface IP's, ...etc) from an authoritative source (Mysql). Afterwards, I have a mechanism for loading the configs.
2) Once a device is configured and placed into production, I need a way of auditing against the latest version of my template. This would allow us to discover when operators change the running configuration.
Thoughts? |
Google App Engine Live Updates (Python) | 7,540,983 | 0 | 0 | 410 | 0 | python,ajax,google-app-engine | To make a calculator in a browser that does not involve a page refresh, your best bet is to learn javascript. Searching google or stackoverflow for javascript tutorials will give you lots of options to work from. You don't need to learn python or App Engine to create the calculator. You could use app engine to serve the javascript, but you wouldn't need to write any python to just serve static content like that. | 0 | 0 | 0 | 0 | 2011-09-24T06:17:00.000 | 2 | 0 | false | 7,537,397 | 0 | 0 | 1 | 1 | I was wondering if it would be possible to write an application using the Google App Engine and Python to create a basic calculator? However, the real question is would it be possible to have the calculator do the math without having to refresh the page?
To be more specific, I mean if there is an input box that a formula can be entered into (lets say for example the user inputs 2 + 2) and then the user clicks a submit button or calculate button, can the answer to the inputted problem be solved without the webpage having to refresh itself? If so, would it be possible to go about this without using AJAX? A very brief suggestion on how to go about this or a link to an application and its source code that updates things without refreshing the page would be greatly appreciated!
Thanks in advance for your answers! |
Django seamless upgrades with CDN | 7,540,281 | 0 | 3 | 570 | 0 | python,django,amazon-web-services,cdn,fabric | Seems to me the last part (change all templates and python code to use the new names) is easy. Store the current style "version number" in your settings. Make sure this version number is passed to your templates using the template context. Then, use that when rendering the templates to select the real URL to static files.
The steps involved in publishing a new set of static files is:
publish the new files to your CDN
edit your settings file
re-load your application settings
You can achieve the same type of effect using a similar scheme by storing the version number in the database rather than in the settings. This avoids the reload and changes are immediate, but will add a DB query at each view render.
How you integrate each of these steps into your development process is up to you. It might be possible to (conditionally) automate publishing to the CDN, editing the settings file and restarting the application. To "edit" the settings file easily, you can store the version number in a separate file and have the settings file read that on start-up. | 0 | 0 | 0 | 0 | 2011-09-24T16:07:00.000 | 4 | 0 | false | 7,540,147 | 0 | 0 | 1 | 1 | [I'm using AWS but I think this question is relevant to all CDNs]
I'm looking to seamless deploy my Django server to the AWS cloud.
All static content (e.g. images, javascript, etc.) go to the Amazon Cloudfront CDN.
The problem is that I'm trying to make the upgrade as "atomic" as possible, while I have very little control over the timing of CDN object invalidation.
According to TFM, the solution is to version my objects, i.e. rename them adding a version id, e.g. arrow_v123.png. Obviously if the new server points to arrow_v124.png I have complete control over the timing of the entire distribution.
I checked and from what I can tell the big boys are doing that - Facebook static content objects have a hashed name (and path).
BUT HOW DO I AUTOMAGICALLY DO THIS IN DJANGO?
I need to somehow:
Generate a new version number
Change all the names of all the objects that are static
Change all the templates and python code to use those new names
Or somehow integrate with the development process:
I edit a picture or a javascript file
I save it and it gets a new name?!?! and all references to it are auto-corrected?!?!
I'm using Fabric for deployments, so it makes sense I need to modify my fabfile somehow.
Please help.
Tal. |
Serve Django project on local WiFi Network | 47,001,073 | 0 | 4 | 10,959 | 0 | python,django | add 192.168.0.8 (or whatever your router ip is) as a string to ALLOWED_HOSTS list in settings then run server using python manage.py runserver 192.168.0.8:8000 | 0 | 0 | 0 | 0 | 2011-09-24T20:49:00.000 | 6 | 0 | false | 7,541,834 | 0 | 0 | 1 | 2 | I used
python manage runserver 0.0.0.0:8000
to start the server so that I can access the project from other computers on my wifi network, but when i browse to internet-ipaddress:8000 on an another computer, the project doesn't load. Am I missing a setting? |
Serve Django project on local WiFi Network | 7,541,893 | 6 | 4 | 10,959 | 0 | python,django | What do you mean by internet-ipaddress? That sounds like you're using the external IP of your router. You should be using the IP of the particular machine you're serving from, which will be an internal address like 192.168.0.2. | 0 | 0 | 0 | 0 | 2011-09-24T20:49:00.000 | 6 | 1 | false | 7,541,834 | 0 | 0 | 1 | 2 | I used
python manage runserver 0.0.0.0:8000
to start the server so that I can access the project from other computers on my wifi network, but when i browse to internet-ipaddress:8000 on an another computer, the project doesn't load. Am I missing a setting? |
How is rate_limit enforced in Celery? | 11,125,501 | 16 | 6 | 1,119 | 0 | python,django,asynchronous,queue,celery | Rate limited tasks are never dropped, they are queued internally in the worker so that they execute as soon as they are allowed to run.
The token bucket algorithm does not specify anything about dropping packets (it is an option, but Celery does not do that). | 0 | 1 | 0 | 0 | 2011-09-24T21:06:00.000 | 1 | 1.2 | true | 7,541,931 | 0 | 0 | 1 | 1 | I'm running a Django website where I use Celery to implement preventive caching - that is, I calculate and cache results even before they are requested by the user.
However, one of my Celery tasks could, in some situation, be called a lot (I'd say sightly quicker than it completes on average, actually). I'd like to rate_limit it so that it doesn't consume a lot of resources when it's actually not that useful.
However, I'd like first to understand how Celery's celery.task.base.Task.rate_limit attribute is enforced. Are tasks refused? Are they delayed and executed later?
Thanks in advance! |
How can I log all outgoing email in Django? | 7,552,429 | 2 | 13 | 7,599 | 0 | python,django,logging,django-email | I do not know if there exists a module that works this way, but writing a custom one is a piece of cake. Just create a separate model and every time you send an email, create a new instance ( use a custom method for email sending ). Then, link this model with the admin and bingo.. | 0 | 0 | 0 | 1 | 2011-09-26T08:11:00.000 | 4 | 0.099668 | false | 7,552,283 | 0 | 0 | 1 | 1 | My Django application sends out quite a bit of emails and I've tried testing it thoroughly. However, for the first few months, I'd like to log all outgoing emails to ensure that everything is working smoothly. Is there a Django module that allows me to do this and makes the outgoing emails visible through the administration panel
Thanks. |
How do I serialize a Java object such that it can be deserialized by pickle (Python)? | 7,558,455 | 1 | 10 | 8,413 | 0 | java,python,serialization | You can use a Java JSON serializer like GSON or Jackson to serilaise quite easily and use a python json pickle to deserialize | 0 | 0 | 1 | 0 | 2011-09-26T16:47:00.000 | 2 | 0.099668 | false | 7,558,389 | 0 | 0 | 1 | 1 | I'm using a Python service that uses pickled messages as part of its protocol. I'd like to query this service from Java, but to do so, I need to pickle my message on the client (Java). Are there any implementations of pickle that run on the JVM (ideally with minimal dependencies)?
Clarification: Modifying the server side is not an option, so while alternate serializations would be convenient, they won't solve the problem here. |
Use Python Framework or Build Own | 7,562,586 | 1 | 0 | 481 | 0 | python,frameworks | Learn from existing frameworks, I think. The Python web stack (wsgi, sqlalchemy, template engines, full stack frameworks, microframeworks) has spent a lot of time maturing. You'll have the opportunity to develop fast and learn from existing design. | 0 | 0 | 0 | 1 | 2011-09-26T23:18:00.000 | 1 | 0.197375 | false | 7,562,454 | 1 | 0 | 1 | 1 | I am an experienced PHP developer (10 years) who has built 3 different custom frameworks for extreme high traffic sites. I have recently started to get into programming a lot of python, usually just for fun (algorithms). I am starting to develop a new site as my side project and wanted to know if I should use a pre-existing python web framework (Django, Pyramids, ect...) or develop my own.
I know things might go a lot faster using a pre-existing framework, but from my experience with PHP frameworks and knowing the amount of traffic my side project could generate, whould it be better to develop an extremely light weight framework myself just like I have been doing for a while with PHP? It also might be a good way for me to learn python web development because most of my experience with the language has been for coding algorithms.
If I do use a pre-existing framework I was going to try out Pyramid or Django.
Also do other companies that use Python for web development and expect high traffic use their own web frameworks or a pre-existing one? |
How to control Apache via Django to connect to mongoose(another HTTP server)? | 7,567,682 | 0 | 0 | 320 | 1 | python,django,apache,mod-wsgi,mod-python | If you have control over what runs on the device side, consider using XML-RPC to talk from client to server. | 0 | 0 | 0 | 0 | 2011-09-27T07:52:00.000 | 2 | 0 | false | 7,565,812 | 0 | 0 | 1 | 1 | I have been doing lots of searching and reading to solve this.
The main goal is let a Django-based web management system connecting to a device which runs a http server as well. Django will handle user request and ask device for the real data, then feedback to user.
Now I have a "kinda-work-in-concept" solution:
Browser -> Apache Server: Browser have jQuery and HTML/CSS to collect user request.
Apache Server-> Device HTTP Server:
Apache + mod_python(or somesay Apache + mod_wsgi?) , so I might control the Apache to do stuff like build up a session and cookies to record login.
But, this is the issue actually bugs me.
How to make it work? Using what to build up socket connection between this two servers? |
Don't display .pyc files in the Xcode 4 project navigator | 11,637,636 | 1 | 1 | 423 | 0 | python,xcode | The best I can come with is the way I do it: By dragging only the .py files into the XCode project at the start. It's not ideal; there should be a way to filter out build files. This method also isn't great for sub-folders, since you have to create each folder and then drag the .py files in for each folder by hand. But it works, and now I have no .pyc files in my project. Also, irritatingly, I can't delete .pyc files from the project once they're in there, so controlling things from the outset is the only solution I found. | 0 | 0 | 0 | 0 | 2011-09-27T09:46:00.000 | 2 | 0.099668 | false | 7,567,157 | 0 | 0 | 1 | 1 | I'm working on a fairly large django-project in Xcode 4. I prefer not to see all the automatically generated .pyc files in the project navigator.
Does anyone know a way to hide the .pyc files from the interface?
I don't necessarily want to remove them from disk.
Thanks.
-
What fails:
Checking "Show only files with source-control status" hides all files except the .pyc files... If only there is a way to invert this selection.
Showing files with matching name will also only give me a solution for solely showing the .pyc files. Typing ".py" also yields .pyc files... |
Why are there no Makefiles for automation in Python projects? | 7,581,531 | 2 | 34 | 12,445 | 0 | python,automation,makefile,rake | Any decent test tool has a way of running the entire suite in a single command, and nothing is stopping you from using rake, make, or anything else, really.
There is little reason to invent a new way of doing things when existing methods work perfectly well - why re-invent something just because YOU didn't invent it? (NIH). | 0 | 0 | 0 | 1 | 2011-09-28T09:16:00.000 | 8 | 0.049958 | false | 7,580,939 | 0 | 0 | 1 | 3 | As a long time Python programmer, I wonder, if a central aspect of Python culture eluded me a long time: What do we do instead of Makefiles?
Most ruby-projects I've seen (not just rails) use Rake, shortly after node.js became popular, there was cake. In many other (compiled and non-compiled) languages there are classic Make files.
But in Python, no one seems to need such infrastructure. I randomly picked Python projects on GitHub, and they had no automation, besides the installation, provided by setup.py.
What's the reason behind this?
Is there nothing to automate? Do most programmers prefer to run style checks, tests, etc. manually?
Some examples:
dependencies sets up a virtualenv and installs the dependencies
check calls the pep8 and pylint commandlinetools.
the test task depends on dependencies enables the virtualenv, starts selenium-server for the integration tests, and calls nosetest
the coffeescript task compiles all coffeescripts to minified javascript
the runserver task depends on dependencies and coffeescript
the deploy task depends on check and test and deploys the project.
the docs task calls sphinx with the appropiate arguments
Some of them are just one or two-liners, but IMHO, they add up. Due to the Makefile, I don't have to remember them.
To clarify: I'm not looking for a Python equivalent for Rake. I'm glad with paver. I'm looking for the reasons. |
Why are there no Makefiles for automation in Python projects? | 7,581,523 | -3 | 34 | 12,445 | 0 | python,automation,makefile,rake | Is there nothing to automate?
Not really. All but two of the examples are one-line commands.
tl;dr Very little of this is really interesting or complex. Very little of this seems to benefit from "automation".
Due to documentation, I don't have to remember the commands to do this.
Do most programmers prefer to run stylechecks, tests, etc. manually?
Yes.
generation documentation,
the docs task calls sphinx with the appropiate arguments
It's one line of code. Automation doesn't help much.
sphinx-build -b html source build/html. That's a script. Written in Python.
We do this rarely. A few times a week. After "significant" changes.
running stylechecks (Pylint, Pyflakes and the pep8-cmdtool).
check calls the pep8 and pylint commandlinetools
We don't do this. We use unit testing instead of pylint.
You could automate that three-step process.
But I can see how SCons or make might help someone here.
tests
There might be space for "automation" here. It's two lines: the non-Django unit tests (python test/main.py) and the Django tests. (manage.py test). Automation could be applied to run both lines.
We do this dozens of times each day. We never knew we needed "automation".
dependecies sets up a virtualenv and installs the dependencies
Done so rarely that a simple list of steps is all that we've ever needed. We track our dependencies very, very carefully, so there are never any surprises.
We don't do this.
the test task depends on dependencies enables the virtualenv, starts selenium-server for the integration tests, and calls nosetest
The start server & run nosetest as a two-step "automation" makes some sense. It saves you from entering the two shell commands to run both steps.
the coffeescript task compiles all coffeescripts to minified javascript
This is something that's very rare for us. I suppose it's a good example of something to be automated. Automating the one-line script could be helpful.
I can see how SCons or make might help someone here.
the runserver task depends on dependencies and coffeescript
Except. The dependencies change so rarely, that this seems like overkill. I supposed it can be a good idea of you're not tracking dependencies well in the first place.
the deploy task depends on check and test and deploys the project.
It's an svn co and python setup.py install on the server, followed by a bunch of customer-specific copies from the subversion area to the customer /www area. That's a script. Written in Python.
It's not a general make or SCons kind of thing. It has only one actor (a sysadmin) and one use case. We wouldn't ever mingle deployment with other development, QA or test tasks. | 0 | 0 | 0 | 1 | 2011-09-28T09:16:00.000 | 8 | 1.2 | true | 7,580,939 | 0 | 0 | 1 | 3 | As a long time Python programmer, I wonder, if a central aspect of Python culture eluded me a long time: What do we do instead of Makefiles?
Most ruby-projects I've seen (not just rails) use Rake, shortly after node.js became popular, there was cake. In many other (compiled and non-compiled) languages there are classic Make files.
But in Python, no one seems to need such infrastructure. I randomly picked Python projects on GitHub, and they had no automation, besides the installation, provided by setup.py.
What's the reason behind this?
Is there nothing to automate? Do most programmers prefer to run style checks, tests, etc. manually?
Some examples:
dependencies sets up a virtualenv and installs the dependencies
check calls the pep8 and pylint commandlinetools.
the test task depends on dependencies enables the virtualenv, starts selenium-server for the integration tests, and calls nosetest
the coffeescript task compiles all coffeescripts to minified javascript
the runserver task depends on dependencies and coffeescript
the deploy task depends on check and test and deploys the project.
the docs task calls sphinx with the appropiate arguments
Some of them are just one or two-liners, but IMHO, they add up. Due to the Makefile, I don't have to remember them.
To clarify: I'm not looking for a Python equivalent for Rake. I'm glad with paver. I'm looking for the reasons. |
Why are there no Makefiles for automation in Python projects? | 53,604,587 | 2 | 34 | 12,445 | 0 | python,automation,makefile,rake | The make utility is an optimization tool which reduces the time spent building a software image. The reduction in time is obtained when all of the intermediate materials from a previous build are still available, and only a small change has been made to the inputs (such as source code). In this situation, make is able to perform an "incremental build": rebuild only a subset of the intermediate pieces that are impacted by the change to the inputs.
When a complete build takes place, all that make effectively does is to execute a set of scripting steps. These same steps could just be deposited into a flat script. The -n option of make will in fact print these steps, which makes this possible.
A Makefile isn't "automation"; it's "automation with a view toward optimized incremental rebuilds." Anything scripted with any scripting tool is automation.
So, why would Python project eschew tools like make? Probably because Python projects don't struggle with long build times that they are eager to optimize. And, also, the compilation of a .py to a .pyc file does not have the same web of dependencies like a .c to a .o.
A C source file can #include hundreds of dependent files; a one-character change in any one of these files can mean that the source file must be recompiled. A properly written Makefile will detect when that is or is not the case.
A big C or C++ project without an incremental build system would mean that a developer has to wait hours for an executable image to pop out for testing. Fast, incremental builds are essential.
In the case of Python, probably all you have to worry about is when a .py file is newer than its corresponding .pyc, which can be handled by simple scripting: loop over all the files, and recompile anything newer than its byte code. Moreover, compilation is optional in the first place!
So the reason Python projects tend not to use make is that their need to perform incremental rebuild optimization is low, and they use other tools for automation; tools that are more familiar to Python programmers, like Python itself. | 0 | 0 | 0 | 1 | 2011-09-28T09:16:00.000 | 8 | 0.049958 | false | 7,580,939 | 0 | 0 | 1 | 3 | As a long time Python programmer, I wonder, if a central aspect of Python culture eluded me a long time: What do we do instead of Makefiles?
Most ruby-projects I've seen (not just rails) use Rake, shortly after node.js became popular, there was cake. In many other (compiled and non-compiled) languages there are classic Make files.
But in Python, no one seems to need such infrastructure. I randomly picked Python projects on GitHub, and they had no automation, besides the installation, provided by setup.py.
What's the reason behind this?
Is there nothing to automate? Do most programmers prefer to run style checks, tests, etc. manually?
Some examples:
dependencies sets up a virtualenv and installs the dependencies
check calls the pep8 and pylint commandlinetools.
the test task depends on dependencies enables the virtualenv, starts selenium-server for the integration tests, and calls nosetest
the coffeescript task compiles all coffeescripts to minified javascript
the runserver task depends on dependencies and coffeescript
the deploy task depends on check and test and deploys the project.
the docs task calls sphinx with the appropiate arguments
Some of them are just one or two-liners, but IMHO, they add up. Due to the Makefile, I don't have to remember them.
To clarify: I'm not looking for a Python equivalent for Rake. I'm glad with paver. I'm looking for the reasons. |
Convert HTML into PDF using Python | 7,584,807 | 0 | 3 | 9,230 | 0 | python,html,django,wkhtmltopdf,html2pdf | A possible, but not so elegant solution, is to run a small scripts which renders the html via a headless browser component (webkit/xvfb on Linux) and then saves it as a pdf. | 0 | 0 | 0 | 0 | 2011-09-28T14:05:00.000 | 3 | 0 | false | 7,584,546 | 0 | 0 | 1 | 2 | I am trying to convert HTML into a PDF document in Django and haven't been successful.
I have tried using wkhtmltopdf 0.9.9, however Apache throws an error that wkhtmltopdf cannot connect to server. When I use wkhtmltopdf directly, it runs perfectly fine and converts the HTML into a PDF document.
I have also tried using unoconv, however the rendered PDF file doesn't have any CSS applied to it. I have also tried using xhtml2pdf. Again I am facing same issue; the rendered PDF file doesn't have any CSS styling applied. I have spent the better part of today and last night trying to solve this issue and I'm still no closer to solving the problem.
Let me know if you need any more information |
Convert HTML into PDF using Python | 7,584,643 | 0 | 3 | 9,230 | 0 | python,html,django,wkhtmltopdf,html2pdf | I suggest you to use pisa, pypdf and html5lib combination, it worked for me. | 0 | 0 | 0 | 0 | 2011-09-28T14:05:00.000 | 3 | 0 | false | 7,584,546 | 0 | 0 | 1 | 2 | I am trying to convert HTML into a PDF document in Django and haven't been successful.
I have tried using wkhtmltopdf 0.9.9, however Apache throws an error that wkhtmltopdf cannot connect to server. When I use wkhtmltopdf directly, it runs perfectly fine and converts the HTML into a PDF document.
I have also tried using unoconv, however the rendered PDF file doesn't have any CSS applied to it. I have also tried using xhtml2pdf. Again I am facing same issue; the rendered PDF file doesn't have any CSS styling applied. I have spent the better part of today and last night trying to solve this issue and I'm still no closer to solving the problem.
Let me know if you need any more information |
XSS With MongoDB / Django Forms | 7,585,077 | 1 | 0 | 1,441 | 0 | python,django,xss | XSS is a Javascript vulnerability, it is unrelated to SQL injection. To prevent XSS, you need to do the same sensitization, regardless of how your data is stored.
Based on its description, using that library and a CSRF token should be sufficient.
EDIT
While you do not need to worry about SQL injection with MongoDB. If you switch to a relational database, your application will no longer be secure. Sanitizing against XSS injection offers no protection against SQL injection, which the library you mention will not do. | 0 | 0 | 0 | 0 | 2011-09-28T14:42:00.000 | 2 | 0.099668 | false | 7,585,027 | 0 | 0 | 1 | 1 | I am running a 100% NoSQL backend (MongoDB) and developing using Django. The application I am building has a lot of different forms, and for a variety of reasons, I am trying to avoid using Django.Forms because they are complicated and do not seem to be very flexible.
How worried do I need to be about XSS (as far as I can tell, it is not possible to get a SQL injection when you are using MongoDB)
Since most of my forms are being submitted via AJAX...is it enough to just use the Django CRSF tokens + an open source sanitizing lib (http://bitkickers.blogspot.com/2011/01/sanitize-html-with-beautiful-soup.html) with all incoming data?
What is the best solution to this problem that does not involve using cleaned_data with Django Forms? |
Setup for high volume of database writing | 7,587,624 | 0 | 0 | 324 | 1 | python,django,database-design,amazon-web-services | You should actually be okay with low hundreds of writes per minute through SQLAlchemy (thats only a couple a second); if you're talking more like a thousand a minute, yeah that might be problematic.
What kind of data do you have? If it's fairly flat (few tables, few relations), you might want to investigate a non-relational database such as CouchDB or Mongo. If you want to use SQL, I strongly reccommend PostgreSQL, it seems to deal with large databases and frequent writes a lot better than MySQL.
It also depends how complex the data is that you're inserting.
I think unfortunately, you're going to just have to try a couple things and run benchmarks, as each situation is different and query optimizers are basically magic. | 0 | 0 | 0 | 0 | 2011-09-28T17:14:00.000 | 3 | 0 | false | 7,586,999 | 0 | 0 | 1 | 2 | I am researching a project that would require hundreds of database writes per a minute. I have never dealt with this level of data writes before and I am looking for good scalable techniques and technologies.
I am a comfortable python developer with experience in django and sql alchemy. I am thinking I will build the data interface on django, but I don't think that it is a good idea to go through the orm to do the amount of data writes I will require. I am definitely open to learning new technologies.
The solution will live on Amazon web services, so I have access to all their tools. Ultimately I am looking for advice on database selection, data writing techniques, and any other needs I may have that I do not realize.
Any advice on where to start?
Thanks,
CG |
Setup for high volume of database writing | 7,587,774 | 0 | 0 | 324 | 1 | python,django,database-design,amazon-web-services | If it's just a few hundred writes you still can do with a relational DB. I'd pick PostgreSQL (8.0+),
which has a separate background writer process. It also has tuneable serialization levels so you
can enable some tradeoffs between speed and strict ACID compliance, some even at transaction level.
Postgres is well documented, but it assumes some deeper understanding of SQL and relational DB theory to fully understand and make the most of it.
The alternative would be new fangled "NO-SQL" system, which can probably scale even better, but at the cost of buying into a very different technology system.
Any way, if you are using python and it is not 100% critical to lose writes on shutdown or power loss, and you need a low latency, use a threadsafe Queue.Queue and worker threads to decouple the writes from your main application thread(s). | 0 | 0 | 0 | 0 | 2011-09-28T17:14:00.000 | 3 | 0 | false | 7,586,999 | 0 | 0 | 1 | 2 | I am researching a project that would require hundreds of database writes per a minute. I have never dealt with this level of data writes before and I am looking for good scalable techniques and technologies.
I am a comfortable python developer with experience in django and sql alchemy. I am thinking I will build the data interface on django, but I don't think that it is a good idea to go through the orm to do the amount of data writes I will require. I am definitely open to learning new technologies.
The solution will live on Amazon web services, so I have access to all their tools. Ultimately I am looking for advice on database selection, data writing techniques, and any other needs I may have that I do not realize.
Any advice on where to start?
Thanks,
CG |
Should you hold a HTTP request while the server performs a time consuming operation? Or let the request go? | 7,588,103 | 2 | 2 | 489 | 0 | python,http,request | For requests that you know will take a long time (more than a few seconds) to process, you must assume at minimum that the connection may be forcibly severed by a firewall.
I would say you should implement a queue system on the backend. The request to perform the operation becomes a request to queue the operation. When the operation is actually completed, you can either wait for the client to poll, or proactively notify them somehow. For a browser, you'll pretty much have to either poll or send an e-mail. | 0 | 0 | 1 | 0 | 2011-09-28T18:42:00.000 | 3 | 0.132549 | false | 7,587,939 | 0 | 0 | 1 | 2 | Lets say an operation could take 2 to 10 minutes on the server to perform, for example to update an index which is time consuming.
Would you perform the operation while holding the request? ie not sending a HTTP Response until the operation has finished? And if the client/browser drops the request, just continue with the operation anyway?
What is the alternative? To kick-off the operation, and response with "long-time operation kicked off" ? What if the operation fails mid-way how would the client know? Maintain a server-side "status" of the operation?
Thanks |
Should you hold a HTTP request while the server performs a time consuming operation? Or let the request go? | 7,588,099 | 3 | 2 | 489 | 0 | python,http,request | You might also use a chunked response. First, push a chunk with some code that would display the “please wait” screen, flush the response and start the work. Then you can either push and flush chunks with periodical progress updates or just push one at the end with a “completed” information. Obviously you can employ JavaScript to get a nice UI.
(The above does not apply if you're using WSGI as the first WSGI specification is written in a way that blocks using responses of unknown length so using chunked responses there is impossible.) | 0 | 0 | 1 | 0 | 2011-09-28T18:42:00.000 | 3 | 1.2 | true | 7,587,939 | 0 | 0 | 1 | 2 | Lets say an operation could take 2 to 10 minutes on the server to perform, for example to update an index which is time consuming.
Would you perform the operation while holding the request? ie not sending a HTTP Response until the operation has finished? And if the client/browser drops the request, just continue with the operation anyway?
What is the alternative? To kick-off the operation, and response with "long-time operation kicked off" ? What if the operation fails mid-way how would the client know? Maintain a server-side "status" of the operation?
Thanks |
What back end tech to use for a 2-player, turn based, ajax web game?: Python or Java, FastCGI or app server? | 7,595,177 | 0 | 0 | 253 | 0 | java,python,ajax,web-applications | Some direct benefits of using Django instead of rolling your own
Database ORM
Templating
User authentication
Pluggable applications (use other people's stuff, yay!)
Also, Django can be deployed as a FCGI application. | 0 | 0 | 0 | 0 | 2011-09-29T09:20:00.000 | 1 | 1.2 | true | 7,595,124 | 0 | 0 | 1 | 1 | I'm building a web based 2 player game, client side interface will all be done in an ajax manor with html/css/javascript. I want clients to be able to initiate games and join others, chat etc, but I'm stuck on what the best way to code and communicate with the server is, I would like to use either Java or Python.
Python via FastCGI seems to be more widely accommodated for on hosting providers?
What are the advantages in this case for using a java/python web app like tomcat or django as apposed to taking the fastgci route and what combination would you recommend?
Thanks!
Chris |
Downloading files in background with Python | 7,595,902 | 2 | 3 | 751 | 0 | python,web-applications,background | Timout duration is up to you, you could just make it longer.
Anyway there are plenty of flash or AJAX uploaders out there, nothing you can do only server side AFAIK | 0 | 0 | 1 | 0 | 2011-09-29T10:14:00.000 | 1 | 1.2 | true | 7,595,809 | 0 | 0 | 1 | 1 | I have got a working web application in Python that downloads a file into the web server upon a user's request. This works fine for small file downloads but when the user requests a larger file, the connection times out. So, I think I need to process the download in the background but I'm not sure what tool is most suitable for this. Celery seems to be right but I don't really want it to be queued(the download must start immediately). What would you suggest? |
dependency resolution pip virtualenv | 7,602,082 | 1 | 0 | 512 | 0 | python,dependencies,virtualenv,pip | Using pip + virtualenv you can't have two versions of a library installed at the same time.
And, unfortunately, I don't know of any good ways of handling this situation. Sorry. | 0 | 0 | 0 | 0 | 2011-09-29T17:31:00.000 | 1 | 1.2 | true | 7,601,098 | 1 | 0 | 1 | 1 | I have 2 local libraries which are dependent on different version of suds.
Example -
Module-A-1.0's setup.py has a requirement of suds ==0.3.9.
Module-B-1.0's setup.py has a requirement of suds ==0.4.0.
Both these modules are required by Module-C, which has the following its setup.py
django
Module-A-1.0
Module-B-1.0
Module-C will be installed in a virtualenv using pip. My question is which version of suds will be installed and can I have both versions installed in the same virtual env?
What I noticed was, whichever module I specified first in the setup.py for Module-C, that version of suds gets installed. So in this case suds 0.3.9. If I switched the modules to
django
Module-B-1.0
Module-A-1.0
The version of suds that gets installed in suds-0.4.0. |
How do I override the default session timeout with pyramid + pyramid-beaker + beaker | 7,608,095 | 2 | 3 | 2,326 | 0 | python,pyramid,beaker | Changing the timeout isn't supported by beaker. If you are trying to make a session stick around that long, you should probably just put it into a separate cookie. A common use-case is the "remember me" checkbox on login. This helps you track who the user is, but generally the actual session shouldn't be sticking around that long and gets recreated. | 0 | 0 | 0 | 0 | 2011-09-29T21:36:00.000 | 2 | 1.2 | true | 7,603,674 | 0 | 0 | 1 | 1 | I am using pyramid to create a web application. I am then using pyramid-beaker to interface beaker into pyramid's session management system.
Two values affect the duration of a user's session.
The session cookie timeout
The actual session's life time on either disk/memcache/rdbms/etc
I currently have to cookie defaulted (via the standard beaker config) to delete when the browser closes. I have the session data set to clear out after 2 hours. This works prefectly.
What I need to know is how to override the cookie's timeout and the session timeout to both be 30 days or some other arbirtrary value. |
Having an issue with setting up MySQLdb on Mac OS X Lion in order to support Django | 7,605,229 | 1 | 2 | 3,834 | 1 | python,mysql,django,macos,mysql-python | Install pip if you haven't already, and run
pip install MySQL-Python | 0 | 0 | 0 | 0 | 2011-09-30T01:53:00.000 | 3 | 0.066568 | false | 7,605,212 | 0 | 0 | 1 | 2 | So I am pretty sure that I have managed to dork up my MySQLdb installation. I have all of the following installed correctly on a fresh install of OS X Lion:
phpMyAdmin
MySQL 5.5.16
Django 1.3.1
And yet when I try to run "from django.db import connection" in a django console, I get the following:
from django.db import connection Traceback (most recent call
last): File "", line 1, in File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/init.py",
line 78, in
connection = connections[DEFAULT_DB_ALIAS] File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/utils.py",
line 93, in getitem
backend = load_backend(db['ENGINE']) File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/utils.py",
line 33, in load_backend
return import_module('.base', backend_name) File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/utils/importlib.py",
line 35, in import_module
import(name) File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/backends/mysql/base.py",
line 14, in
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/[my
username]/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so,
2): Library not loaded: libmysqlclient.18.dylib Referenced from:
/Users/[my
username]/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so
Reason: image not found
I have no idea why this is happening, could somebody help walk me through this? |
Having an issue with setting up MySQLdb on Mac OS X Lion in order to support Django | 12,027,574 | 5 | 2 | 3,834 | 1 | python,mysql,django,macos,mysql-python | I found the following solution for this issue. It worked for me. I have encountered this problem when I was running python console from PyCharm.
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib | 0 | 0 | 0 | 0 | 2011-09-30T01:53:00.000 | 3 | 0.321513 | false | 7,605,212 | 0 | 0 | 1 | 2 | So I am pretty sure that I have managed to dork up my MySQLdb installation. I have all of the following installed correctly on a fresh install of OS X Lion:
phpMyAdmin
MySQL 5.5.16
Django 1.3.1
And yet when I try to run "from django.db import connection" in a django console, I get the following:
from django.db import connection Traceback (most recent call
last): File "", line 1, in File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/init.py",
line 78, in
connection = connections[DEFAULT_DB_ALIAS] File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/utils.py",
line 93, in getitem
backend = load_backend(db['ENGINE']) File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/utils.py",
line 33, in load_backend
return import_module('.base', backend_name) File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/utils/importlib.py",
line 35, in import_module
import(name) File
"/Library/Python/2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/backends/mysql/base.py",
line 14, in
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/[my
username]/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so,
2): Library not loaded: libmysqlclient.18.dylib Referenced from:
/Users/[my
username]/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.7-intel.egg-tmp/_mysql.so
Reason: image not found
I have no idea why this is happening, could somebody help walk me through this? |
Python Audio Transfer Through Lasers | 7,632,584 | 1 | 5 | 1,017 | 0 | python,audio,signal-processing,frequency | I would tackle the receiving end using two FIR filters, one for each frequency that you are trying to detect. The coefficients of the filters are just a copy of the signal you are looking for (i.e. 250Hz in one case and 450Hz in the other). You would have to look at the output of your solar panel to decide whether that is a square wave, sine wave, or something in between. The length of the filter corresponds to the duration of the tone (i.e. 'x' in your question). The samples are fed into both filters in parallel.
The output of each filter needs to be rectified (i.e. take the absolute value) and smoothed. The smoothing can be done using a simple moving average over a period of about half x (you can experiment to find the best value). Then if you compare the smoothed values (i.e. is a>b, or b>a) you should get a stream of 0's and 1's.
Things to be aware of: This assumes the channel behaves the same for both frequencies (i.e. you get similar snr and attenuation). You might need to tweak your frequencies a bit because 450Hz is quite close to 500Hz which is a harmonic of 250Hz. | 0 | 0 | 0 | 1 | 2011-09-30T04:57:00.000 | 4 | 0.049958 | false | 7,606,111 | 0 | 0 | 1 | 2 | I'm currently working on a project that has been relatively easy, up until now. The underlying project is to transmit data/messages over lasers using audio transformation.
In a nutshell the process is currently like this
The user enters a message
Message is turned into binary
For each 1 and 0 in the binary message, it plays a corresponding tone to signal which is which, in my case 250hz for a 1 and 450 hz for a 0.
The outgoing tone is sent over a stereo cable to an audio transformer rigged to a laser
A solar panel acts as a microphone and records the incoming "sound" as a file
It them plays the file back and reads off the tones and tries to match each 250 and 450 hz to a 1 or 0 (which is where my issue lies).
Up until the actual processing of the sound is fine, my current issue is the following.
I play the tones each for x time, on the receiving end it is recorded for y time, y time is cut sampled many times and then analyzed sample by sample which then logs each frequency. This is inefficient and inaccurate. I have had many issues regardless of the time I play the tones for it often hears a tone twice or doesn't hear it at all, which completely throws off whole messages.
I have tried to match the rate at which it samples with the time each tone plays, but unless aligned accordingly it does not work. I've only had a few successful tests for messages like 'test' and 'hi'. I have already looked into bpsk and fsk, but I feel as if I'm already doing something like it but that I have a bad receiving end to decipher it all.
This is all written in Python and I'd be very grateful for any tips, suggestions, or possible implementations that you can provide. Also for tone emission I'm using pyaudiere and for recording I'm using pyaudio.
Thanks!
-Steve |
Python Audio Transfer Through Lasers | 7,614,995 | 1 | 5 | 1,017 | 0 | python,audio,signal-processing,frequency | Did you do a sanity check by listening to the sound files (both transmit and receive), or viewing the waveforms with an audio editor, to see if they roughly sound or look the same? That way you can narrow down the problem to channel induced errors versus your software analysis.
Your decoding/demodulation software will need a synchronization method that can determine and track the times that the audio signal changes from one frequency of modulation to another, then you will need to separately test this synchronization method for offset errors. | 0 | 0 | 0 | 1 | 2011-09-30T04:57:00.000 | 4 | 0.049958 | false | 7,606,111 | 0 | 0 | 1 | 2 | I'm currently working on a project that has been relatively easy, up until now. The underlying project is to transmit data/messages over lasers using audio transformation.
In a nutshell the process is currently like this
The user enters a message
Message is turned into binary
For each 1 and 0 in the binary message, it plays a corresponding tone to signal which is which, in my case 250hz for a 1 and 450 hz for a 0.
The outgoing tone is sent over a stereo cable to an audio transformer rigged to a laser
A solar panel acts as a microphone and records the incoming "sound" as a file
It them plays the file back and reads off the tones and tries to match each 250 and 450 hz to a 1 or 0 (which is where my issue lies).
Up until the actual processing of the sound is fine, my current issue is the following.
I play the tones each for x time, on the receiving end it is recorded for y time, y time is cut sampled many times and then analyzed sample by sample which then logs each frequency. This is inefficient and inaccurate. I have had many issues regardless of the time I play the tones for it often hears a tone twice or doesn't hear it at all, which completely throws off whole messages.
I have tried to match the rate at which it samples with the time each tone plays, but unless aligned accordingly it does not work. I've only had a few successful tests for messages like 'test' and 'hi'. I have already looked into bpsk and fsk, but I feel as if I'm already doing something like it but that I have a bad receiving end to decipher it all.
This is all written in Python and I'd be very grateful for any tips, suggestions, or possible implementations that you can provide. Also for tone emission I'm using pyaudiere and for recording I'm using pyaudio.
Thanks!
-Steve |
Django ImageField "Upload a valid image. The file you uploaded was either not an image or a corrupted image." | 7,611,630 | 7 | 5 | 5,678 | 0 | python,django,virtualenv | This issue was solved by using pip to install "pillow" instead of "pil" which allows easy deployment to virtualenv. | 0 | 0 | 0 | 0 | 2011-09-30T06:18:00.000 | 3 | 1 | false | 7,606,614 | 0 | 0 | 1 | 1 | I have PIL installed, however whenever I try to upload a .png file to an image field through the Django Admin for my model, I get this error:
"Upload a valid image. The file you uploaded was either not an image or a corrupted image."
Other image types work fine. I have tried several different PNG files.
I have tried rebuilding PIL after installing pypng, libpng-dev, etc.. and am on ubuntu server. |
Do I need to use a web framework for a simple website? | 11,603,886 | 1 | 4 | 1,425 | 0 | python,frameworks,pyramid | As RonakG first pointed, it all depends on the kind of website you intend to have up and running. Actually, your question is too general for a single, definitive answer. There are more aspects to consider other than just being in python. For example, deadlines. This means considering the learning curve to achieve your results. If you don't have much time, a steep learning curve (time to learn it in order to develop it) is certainly something you will want to avoid. Perhaps you already develop in other languages, and need integration and/or migration support, need scalability, reusability, etc, etc, etc.
Another thing that is not so clear in your question is what you mean by "The site won't be that complicated and will resemble a modern blog (users, messages, news and other similar features)". If it really resembles just a modern blog, with users, messages and news, you could google for CMS (Content Management Systems). There are many options available, that could make you have your site up and running in almost no-time. All you'll have to learn is how to customize whatever it has to as to comply to your needs.
That said, if you prefer python, there are some good CMSs available which you can develop your site fast, like Plone. And if you prefer Django, there's Django CMS and there's the excellent Pinax project, which takes the django code reusability to deliver you sample fully customizable, complete websites. | 0 | 0 | 0 | 0 | 2011-09-30T14:21:00.000 | 4 | 0.049958 | false | 7,611,759 | 0 | 0 | 1 | 4 | The site won't be that complicated and will resemble a modern blog (users, messages, news and other similar features).
Do I need to use a framework for this, and if so, which is best?
Pyramid, Django? |
Do I need to use a web framework for a simple website? | 7,612,176 | 3 | 4 | 1,425 | 0 | python,frameworks,pyramid | It depends on what kind of website you are planning to come up with. If the website is going to be just a set of static HTML files, then you don't really need a framework. But if your website will have lots of dynamic content that will get updated on regular basis, you should go with some framework. That will make your life maintaining the website much more simpler.
Django is the most popular framework written in Python. It has very good documentation and a strong community base too. | 0 | 0 | 0 | 0 | 2011-09-30T14:21:00.000 | 4 | 1.2 | true | 7,611,759 | 0 | 0 | 1 | 4 | The site won't be that complicated and will resemble a modern blog (users, messages, news and other similar features).
Do I need to use a framework for this, and if so, which is best?
Pyramid, Django? |
Do I need to use a web framework for a simple website? | 7,611,778 | 2 | 4 | 1,425 | 0 | python,frameworks,pyramid | Go with Django - 10,000 Elvis fans can't be wrong.
Or roll your own from scratch. You'll learn a lot, know everything about how you site works, and better appreciate what a framework does for you. | 0 | 0 | 0 | 0 | 2011-09-30T14:21:00.000 | 4 | 0.099668 | false | 7,611,759 | 0 | 0 | 1 | 4 | The site won't be that complicated and will resemble a modern blog (users, messages, news and other similar features).
Do I need to use a framework for this, and if so, which is best?
Pyramid, Django? |
Do I need to use a web framework for a simple website? | 7,612,742 | 8 | 4 | 1,425 | 0 | python,frameworks,pyramid | You certainly don't need a webframework to create a simple website. Given that you're new to python and interested in building a python website, I imagine this implies: you're interested in learning python. If you're exclusively interested in learning django-python, there's no reason you can't jump in to django, as Ronak said, of course. He's right. It has a lot of documentation. But it will make for somewhat of an odd intro to python.
If I were in your shoes, I'd either start making some offline programs first, or consider an ultra-lightweight framework. Many would advocate web2py or pyramid for ultralightweight. I might consider going even lighter. Something like Bottle, where you're more or less just pairing functions with urls. This way you can at least do a bit of hacking/trial-and-error, instead of launching right into django.
It's not that django doesn't use python-- it will tell you many times that it is in fact 'just python.' But it's adapted at its core to be used in a large business setting (the chicago something or other online, i think). So it enforces various rules that are helpful in managing many different employees working on a project together. You may or may not wish for this kind of 'help.' It also means the scale of projects is assumed to be large and the time-horizon, limitless. If you want to see how a python dictionary works, you may not want to spend a long time configuring settings and creating the pseudo-static-typing you need for your database, and so on, just to execute your project and see a result.
I realize I will automatically get downvoted for this, but I believe it to be sound advice. | 0 | 0 | 0 | 0 | 2011-09-30T14:21:00.000 | 4 | 1 | false | 7,611,759 | 0 | 0 | 1 | 4 | The site won't be that complicated and will resemble a modern blog (users, messages, news and other similar features).
Do I need to use a framework for this, and if so, which is best?
Pyramid, Django? |
What are your best practices for working with test data in Django? | 7,613,691 | 0 | 2 | 199 | 0 | python,django,testing,tdd | Make sure you use sqlite for testing purposes. There's a considerable difference in speed compared to other db engines. | 0 | 0 | 0 | 0 | 2011-09-30T16:57:00.000 | 2 | 0 | false | 7,613,616 | 0 | 0 | 1 | 1 | I currently use a single fixtures file per application, but as projects grow, the tests are taking far too long and I believe that the (now large) fixtures being loaded for each test class are at fault.
I've avoided having lots of smaller fixtures because of concerns about duplication and maintenance, but I know think that's unavoidable.
Before I go down that path though, I thought I would ask what others do with fixtures for testing their applications/projects. |
Flask's @before_request executes more than once | 7,615,352 | 6 | 4 | 1,899 | 0 | python,flask | If you run with app.debug = True and serve media files (images, css, js etc.) from Flask, they also count as full requests. If that is not the case, then please provide some more information about your setup. | 0 | 0 | 0 | 0 | 2011-09-30T19:45:00.000 | 1 | 1.2 | true | 7,615,317 | 0 | 0 | 1 | 1 | I added an app.logger.error('test') inside my @app.before_request and noticed that there are up to 8 lines of test in my log per request, even if it's just abort(500). I just can't seem to find out why, what could cause this? |
Is there any loss of functionality with streaming jobs in hbase/hadoop versus using java? | 7,707,068 | 1 | 3 | 758 | 0 | java,python,hadoop,hbase,thrift | Yes, you should get data local code execution with streaming. You do not push the data to where the program is, you push the program to where the data is. Streaming simply takes the local input data and runs it through stdin to your python program. Instead of each map running inside of a java task, it spins up and instance of your python program and just pumps the input through that.
If you really want to do fast processing you really should learn java though. Having to pipe everything through stdin and stout is a lot of overhead. | 0 | 1 | 0 | 0 | 2011-10-02T00:27:00.000 | 2 | 0.099668 | false | 7,623,858 | 0 | 0 | 1 | 1 | Sorry in advance if this is a basic question. I'm reading a book on hbase and learing but most of the examples in the book(and well as online) tend to be using Java(I guess because hbase is native to java). There are a few python examples and I know I can access hbase with python(using thrift or other modules), but I'm wondering about additional functions?
For example, hbase has a 'coprocessors' function that pushs the data to where your doing your computing. Does this type work with python or other apps that are using streaming hadoop jobs? It seems with java, it can know what your doing and manage the data flow accordingly but how does this work with streaming? If it doesn't work, is there a way to get this type of functionality(via streaming without switching to another language)?
Maybe another way of asking this is..what can a non-java programmer do to get all the benefits of the features of hadoop when streaming?
Thanks in advance! |
Secure authentication system in python? | 7,627,865 | 1 | 5 | 6,817 | 0 | python,security,web-applications,authentication,login | It's hard to be specific without knowing your setup. However, the one thing you should not do is reinventing the wheel. Security is tricky, if your wheel is lacking something you may not know until it's too late.
I wouldn't be surprised if your web framework came with a module/library/plugin for handling users, logins and sessions. Read its documentation and use it: it was hopefully written by people who know a bit about security.
If you want to know how it's done, study the documentation and source of said module. | 0 | 0 | 0 | 0 | 2011-10-02T16:48:00.000 | 2 | 0.099668 | false | 7,627,752 | 0 | 0 | 1 | 1 | I am making a web application in python and I would like to have a secure login system.
I have done login systems many times before by having the user login and then a random string is saved in a cookie which is also saved next to that user in a database which worked fine but it was not very secure.
I believe understand the principles of an advanced system like this but not the specifics:
Use HTTPS for the login page and important pages
Hash the password saved in the database(bcrypt, sha256? use salt?)
Use nonces(encrypted with the page url and ip?)
But apart from those I have no idea how to reliably check if the person logged in is really the user, or how to keep sessions between page requests and multiple open pages securely, etc.
Can I have some directions (preferably specific ones since I am new to this advanced security programming.
I am just trying to accomplish a basic user login-logout to one domain with security, nothing too complicated. |
Python/C Raw Socket Operations using Django, Mod_WSGI, Apache | 7,630,026 | 1 | 2 | 344 | 0 | python,django,sockets,mod-wsgi,freebsd | Use Celery or some other back end service which runs as root. Having a web application process run as root is a security problem waiting to happen. This is why mod_wsgi blocks you running daemon processes as root. Sure you could hack the code to disable the exclusion, but I am not about to tell you how to do that. | 0 | 1 | 0 | 0 | 2011-10-02T20:07:00.000 | 1 | 0.197375 | false | 7,628,889 | 0 | 0 | 1 | 1 | I'm currently writing a web application using Django, Apache, and mod_wsgi that provides some FreeBSD server management and configuration features, including common firewall operations.
My Python/C library uses raw sockets to interact directly with the firewall and works perfectly fine when running as root, but raw socket operations are only allowed for root.
At this point, the only thing I can think of is to install and use sudo to explicitly allow the www user access to /sbin/ipfw which isn't ideal since I would prefer to use my raw socket library operations rather than a subprocess call.
I suppose another option would be to write (local domain sockets) or use an existing job system (Celery?) that runs as root and handles these requests.
Or perhaps there's some WSGI Daemon mode trickery I'm unaware of? I'm sure this issue has been encountered before. Any advice on the best way to handle this? |
Can Gstreamer be used server-side to stream audio to multiple clients on demand? | 7,634,531 | 1 | 2 | 1,045 | 0 | python,audio,stream,gstreamer | You might want to look at Flumotion (www.flumotion.org). It is a python based streaming server using GStreamer, you might be able to get implementation ideas from that in terms of how you do your application. It relies heavily on the python library Twisted for its network handling. | 0 | 1 | 0 | 0 | 2011-10-03T02:17:00.000 | 1 | 0.197375 | false | 7,630,548 | 0 | 0 | 1 | 1 | I'm working on an audio mixing program (DAW) web app, and considering using Python and Python Gstreamer for the backend. I understand that I can contain the audio tracks of a single music project in a gst.Pipeline bin, but playback also appears to be controlled by this Pipeline.
Is it possible to create several "views" into the Pipeline representing the project? So that more than one client can grab an audio stream of this Pipeline at will, with the ability to do time seek?
If there is a better platform/library out there to use, I'd appreciate advice on that too. I'd prefer sticking to Python though, because my team members are already researching Python for other parts of this project.
Thanks very much! |
How can I test the validity of a ReferenceProperty in Appengine? | 7,637,063 | 3 | 2 | 199 | 0 | python,google-app-engine,google-cloud-datastore | This will test key existence without returning an entity:
db.Query(keys_only=True).filter('__key__ =', test_key).count(1) == 1
I'm not certain that it's computationally cheaper than fetching the entity. | 0 | 1 | 0 | 0 | 2011-10-03T15:02:00.000 | 1 | 1.2 | true | 7,636,806 | 0 | 0 | 1 | 1 | I am currently testing a small application I have written. I have not been sufficiently careful in ensuring the data in my datastore is consistent and now I have an issue that I have some records referencing objects which no longer exist. More specifially, I have some objects which have ReferenceProperty's which have been assigned values; the objects referred to have been deleted but the reference remains.
I would like to add some checks to my code to ensure that referenced objects exist and acting accordingly. (Of course, I also need to clean up my data).
One approach is to just try to get() it; however, this should probably retrieve the entire object - I'd like an approach which just tests the existence of the object, ideally, just resulting in costs of key manipulations on the datastore, rather than full entity reads.
So, my question is the following: is there a simple mechanism to test if a given ReferenceProperty is valid which only involves key access operations (rather than full entity get operations)? |
HAML or Jade template syntax available for Python? | 20,442,720 | 6 | 18 | 7,585 | 0 | python,haml,pug | I really love jade. Pyjade made it possible to use jade in some python project with jinja or django.
But I have to say that pyjade is not 100% compatible with jade.
For example, ternary operator is not supported in pyjade. You can use some python syntax to do the same thing, But that will make the template only can be used with pyjade but not the original jade.
So if you want to share same templates between jade and pyjade, STOP. but if you just want to use jade syntax in a python project, pyjade will be good choice. | 0 | 0 | 0 | 0 | 2011-10-03T16:25:00.000 | 4 | 1 | false | 7,637,789 | 1 | 0 | 1 | 1 | Are there any template engines for Python with a syntax similar to Jade or HAML? |
What are the different options for social authentication on Appengine - how do they compare? | 7,662,946 | 11 | 6 | 552 | 0 | python,google-app-engine,oauth,openid,facebook-authentication | In my research on this question I found that there are essentially three options:
Use Google's authentication mechanisms (including their federated login via OpenID)
Pros:
You can easily check who is logged in via the Users service provided with Appengine
Google handles the security so you can be quite sure it's well tested
Cons:
This can only integrate with third party OpenID providers; it cannot integrate with facebook/twitter at this time
Use the social authentication mechanisms provided by a known framework such as tipfy, or django
Pros:
These can integrate with all of the major social authentication services
They are quite widely used so they are likely to be quite robust and pretty well tested
Cons:
While they are probably well tested, they may not be maintained
They do come as part of a larger framework which you may have to get comfortable with before deploying your app
Roll your own social authentication
Pros:
You can do mix up whatever flavours of OpenID and OAuth tickles your fancy
Cons:
You are most likely to introduce security holes
Unless you've a bit of experience working with these technologies, this is likely to be the most time consuming
Further notes:
It's probable that everyone will move to OpenID eventually and then the standard Google authentication should work everywhere
The first option allows you to point a finger at Google if there is a problem with their authentication; the second option imposes more responsibility on you, but still allows you to say that you use a widely used solution if there is a problem and the final option puts all the responsibility on you
Most of the issues revolve around session management - in case 1, Google does all of the session management and it is pretty invisible to the developer; in case 2, the session management is handled by the framework and in the 3rd case, you've to devise your own. | 0 | 1 | 0 | 1 | 2011-10-05T10:42:00.000 | 1 | 1.2 | true | 7,660,059 | 0 | 0 | 1 | 1 | [This question is intended as a means to both capture my findings and sanity check them - I'll put up my answer toute suite and see what other answers and comments appear.]
I spent a little time trying to get my head around the different social authentication options for (python) Appengine. I was particularly confused by how the authentication mechanisms provided by Google can interact with other social authentication mechanisms. The picture is complicated by the fact that Google has nice integration with third party OpenID providers but some of the biggest social networks are not OpenID providers (eg facebook, twitter). [Note that facebook can use OpenID as a relaying party, but not as a provider].
The question is then the following: what are the different options for social authentication in Appengine and what are the pros and cons of each? |
App Engine memcache speed "dict" vs "Class Object" | 7,661,286 | 1 | 0 | 409 | 0 | python,google-app-engine | You need to measure but for all intended purposes the results should be that its about the same speed.
If any method tend to be faster I don't really think its going to impact you overall performance that much.
Your main latency will be the RPC call to the memache which might be two factor slower then the slowest serialization. | 0 | 1 | 0 | 0 | 2011-10-05T10:57:00.000 | 3 | 1.2 | true | 7,660,231 | 0 | 0 | 1 | 1 | I have page handler with 95% traffic, it fetches model from DB using its key and then uses fields in the fetched model to fill a django template.
I want to memcache the fetched model so as to avoid DB reads. Not all fields of the model are used in template so i want to cache it with just the required feilds so as to improve cache utilization and fit more such models in cache.
So i want to convert the Model in a dictionary or 'class boject' with only the fields required in template.
Memcache uses pickle to serialize values, so for serialization purpose which will be faster dictionary or 'class object'?? |
python non-web application pattern | 7,681,882 | 3 | 1 | 230 | 0 | python,parsing,user-interface | MVC is just as applicable to non-web applications. The only things that change are the View (GUI controls instead of web controls) and the types of input the Controller can/must deal with. | 0 | 0 | 0 | 0 | 2011-10-07T00:08:00.000 | 2 | 1.2 | true | 7,681,871 | 1 | 0 | 1 | 1 | In web design I use MVC pattern, but sometimes I need to create non-web application.
This may be some parser or GUI utility program.
What pattern is a classic solution for this kind of application? |
Getting Apache cgi to send json in Python | 7,683,660 | 1 | 1 | 1,336 | 0 | python,ajax,apache,cgi | You need to send a Content-Type header to tell the browser what type of data you're sending it. Without that you'll get the 500 error you're experiencing. | 0 | 0 | 0 | 1 | 2011-10-07T06:05:00.000 | 2 | 0.099668 | false | 7,683,597 | 0 | 0 | 1 | 1 | I have an apache server that I am using for cgi. I am writing my cgis in Python.
As long as my responses are of the form "Content-Type: text/html\n #" it works.
But if I send anything else, I get a 500 error and my logs say "malformed header from script. Bad header" Can I change my configurations to make it work? Is there anything else I can do? |
django/python: screen sharing api | 7,683,885 | 4 | 4 | 2,038 | 0 | python,django,api | Django is a web development framework; remote desktop viewing is a client-side task. It may be possible to integrate screen sharing into a web site that is built using Django, but Django itself will likely have no involvement with the "guts" of the task. | 0 | 0 | 0 | 0 | 2011-10-07T06:31:00.000 | 1 | 0.664037 | false | 7,683,769 | 0 | 0 | 1 | 1 | I am looking for a screen sharing functionality api in django/python which allows remote users to view your desktop in real time.
Any recommendations on a library/api to use?
Thanks. |
Python self contained web application and server? | 7,721,670 | 0 | 6 | 1,744 | 0 | python,deployment | cherrypy is the easiest one to use, django is feature rich and tornado is more advanced with asynchrounous web server(in my opinion it is better than multithreaded web server).
For what you want, django is best suitable for you IMO. | 0 | 1 | 0 | 0 | 2011-10-07T14:10:00.000 | 3 | 0 | false | 7,688,442 | 0 | 0 | 1 | 1 | What is a good and easy way to distribute a web application and server bundled together, python way?
So I can say to a user "Here take this tar/whatever, unpack it and run blahblah.py" and blahblah.py will run a http/wsgi server and serve my application?
Im looking for a stable production-ready multi-threaded wsgi-server with which I can bundle my app, without the need for nginx or other "frontends" or having to deal with any configuration. |
Passing variables between Python and Javascript | 7,689,717 | 6 | 15 | 18,016 | 0 | javascript,python,variables,sqlalchemy | python has a json module, which is a perfect fit for this scenario.
using a good old AJAX, with json as the data format will allow you to exchange data between javascript and your python module.
(unless your python module is running on the client side, but then i don't see how you could execute it from the browser...) | 0 | 0 | 1 | 0 | 2011-10-07T15:49:00.000 | 3 | 1 | false | 7,689,695 | 0 | 0 | 1 | 1 | Imagine that you need to write some Javascript that simply changes a set of checkboxes when a drop down list is changed.
Depending on which item is selected in the list, some of the checkboxes will become checked/unchecked.
In the back, you have Python code along with some SQLAlchemy.
The Javascript needs to identify the selected item in the list as usual, send it back to the Python module which will then use the variable in some SQLAlchemy to return a list of checkboxes which need to be checked i.e. "User selected 'Ford', so checkboxes 'Focus', 'Mondeo', 'Fiesta' need to be checked"
The issue Im having is that I cant seem to find a way to access the python modules from the Javascript without turning a div into a mini browser page and passing a url containing variables into it!
Does anyone have any ideas on how this should work? |
Processing a HTML file using Python | 7,694,645 | 1 | 0 | 278 | 0 | python,regex | Parse the HTML using BeautifulSoup, then only retrieve the text. | 0 | 0 | 0 | 0 | 2011-10-08T03:34:00.000 | 5 | 0.039979 | false | 7,694,637 | 1 | 0 | 1 | 2 | I wanted to remove all the tags in HTML file. For that I used re module of python.
For example, consider the line <h1>Hello World!</h1>.I want to retain only "Hello World!". In order to remove the tags, I used re.sub('<.*>','',string). For obvious reasons the result I get is an empty string (The regexp identifies the first and last angle brackets and removes everything in between). How could I get over this issue? |
Processing a HTML file using Python | 7,694,658 | 1 | 0 | 278 | 0 | python,regex | You can make the match non-greedy: '<.*?>'
You also need to be careful, HTML is a crafty beast, and can thwart your regexes. | 0 | 0 | 0 | 0 | 2011-10-08T03:34:00.000 | 5 | 1.2 | true | 7,694,637 | 1 | 0 | 1 | 2 | I wanted to remove all the tags in HTML file. For that I used re module of python.
For example, consider the line <h1>Hello World!</h1>.I want to retain only "Hello World!". In order to remove the tags, I used re.sub('<.*>','',string). For obvious reasons the result I get is an empty string (The regexp identifies the first and last angle brackets and removes everything in between). How could I get over this issue? |
Openerp Unable to Show more then 100 Meetings in Calendar View? | 7,842,932 | 0 | 1 | 270 | 0 | python,openerp | I just experimented with the calendar view for the CRM cases screen. (I don't have the meetings module installed.) It looks like the calender view doesn't update itself right away, and you can force it by moving to the next month and then back.
Here's what I did, maybe you can do something similar:
Open the list view. Open the last item in the list and check what date it's on.
Switch to the calendar view and make sure that item is visible on that date.
Switch back to the list view, expand the search filters at the top and reduce the limit from 200 to 20.
Click the find button to get a much shorter list.
Switch to the calendar view. At this point, I expect that the item I looked at before will be gone, but it's still visible.
Move to the next month, and then back. Now the item is gone.
I did all this in OpenERP 5.0. | 0 | 0 | 0 | 0 | 2011-10-08T11:45:00.000 | 2 | 0 | false | 7,696,565 | 0 | 0 | 1 | 2 | When I create meetings in openerp for any user.. I can see them on both Calendar View and List View.. How ever When My meetings exceeds 100 for a single user it doesn't show newly created meetings in calendar view. How ever I can see all of them in my list view... Have any one faced this problem before.. Please Help |
Openerp Unable to Show more then 100 Meetings in Calendar View? | 8,137,529 | 0 | 1 | 270 | 0 | python,openerp | Yes,even I encountered the same problem.This is actually a limitation in OpenERP.So I created a new class called Meeting_history.So when meetings exceeds more than 90,the first 10 meetings or the older ten meetings gets removed from crm_meeting table and gets stored in meeting_history class where we can view older meetings of that user. | 0 | 0 | 0 | 0 | 2011-10-08T11:45:00.000 | 2 | 0 | false | 7,696,565 | 0 | 0 | 1 | 2 | When I create meetings in openerp for any user.. I can see them on both Calendar View and List View.. How ever When My meetings exceeds 100 for a single user it doesn't show newly created meetings in calendar view. How ever I can see all of them in my list view... Have any one faced this problem before.. Please Help |
Error was: No module named Random | 7,700,751 | 3 | 0 | 9,192 | 0 | python,django,random | If the error is exactly "No module named Random", then you've written import Random when you really meant import random. There is no module in the Python standard library called Random. Module names are case sensitive in Python. If that doesn't solve your problem, please show us some code from whatever module imports random | 0 | 0 | 0 | 0 | 2011-10-09T00:55:00.000 | 1 | 1.2 | true | 7,700,743 | 0 | 0 | 1 | 1 | Python 2.4.3, when I run python via the command line and import random, it works just fine. When I run a django based website "python manage.py runserver", the server starts up fine, but as soon as I load a page, it tosses me this error.
I really have no clue how to fix this. I've done some searching, random is core to python, the import I tried from the python interpreter seems to indicated to me that it's working. However, it's not working when running the website.
Any help would be greatly appreciated,
Thanks,
~P |
Custom TCP/IP server in django webapp? | 7,701,968 | 2 | 1 | 1,043 | 0 | python,django | What for. Make your desktop app speak HTTP and use an alternate API provided by another application. | 0 | 0 | 0 | 0 | 2011-10-09T05:28:00.000 | 4 | 1.2 | true | 7,701,633 | 0 | 0 | 1 | 1 | I was going to write this website for communicating with others and i want to implement a desktop app too so now I was wondering whether is is possible to integrate a python, maybe twisted tcp ip server within django so that both the site and the custom tcp could run alongside each other...?
Thanks in Advance |
Best way to earmark messages in an IMAP folder? | 7,793,784 | 1 | 0 | 59 | 0 | python,imap | The UID is guaranteed to be unique. Store each one locally. | 0 | 0 | 0 | 1 | 2011-10-10T12:12:00.000 | 1 | 1.2 | true | 7,712,554 | 0 | 0 | 1 | 1 | I am working on an application that is supposed to connect to IMAP account, read through emails and pick out emails sent by lets say "Mark", then it is supposed to respond to mark
with an automatic response such as "Got it mate" and then do the same tomorrow, with the only difference that tomorrow it should not respond to the same email.
I am not sure how to achieve this the best way, I have thought of storing the processed IDs in a table, or record last check date. But I feel these are not the best CS solutions. |
What's the cleanest way to add arbitrary data to ModelForm? | 7,715,301 | 1 | 0 | 209 | 0 | python,django,django-1.3,django-forms | Just exclude the sender field from the ModelForm and, when you instantiate the object in the view on the POST endpoint (just before saving), make sure you populate the sender field with the appropriate session or user ID.
When you exclude the field, there is no way to add the field to the post data[1], so a user can't spoof it.
[1] With JavaScript, a &sender=someSenderId could be added in theory, but in your view, you don't need to look for a sender field. It won't be serialized into the ModelForm object. | 0 | 0 | 0 | 0 | 2011-10-10T15:38:00.000 | 2 | 0.099668 | false | 7,715,263 | 0 | 0 | 1 | 1 | Imagine we're developing a message system, and each Message has a foreign key for sender.
We're using ModelForms, and there is a MessageForm that infers its fields from Message.
Of course, we don't want the user to be able to spoof sender by posting a different sender ID.
Therefore, we must exclude sender from ModelForm and fill it from session on post.
Where and how should I assign arbitrary data to ModelForm fields?
In my example, I probably want to access session so we need to access to request as well.
Does this mean the code has to be in the view, right after the form has been created?
How do we assign a form field from code and make sure it overrides POST data?
(Of course, the example is pretty fictional and is here just to illustrate the problem.) |
Python Audio over Network Problems | 13,102,430 | 0 | 2 | 2,438 | 0 | python,tcp,speex,pyaudio | Did you run ping or ttcp to test network performance between the 2 hosts?
If you have latency spikes or if some packets are dropped your approach to sending voice stream will suffer badly. TCP will wait for missing packet, report it being lost, wait for retransmit, etc.
You should be using UDP over lossy links and audio compression that handles missing packets gracefully. Also in this case you have to timestamp outgoing packets. | 0 | 0 | 1 | 1 | 2011-10-11T02:55:00.000 | 1 | 0 | false | 7,720,932 | 0 | 0 | 1 | 1 | Hello I am having problems with audio being sent over the network. On my local system with no distance there is no problems but whenever I test on a remote system there is audio but its not the voice input i want its choppy/laggy etc. I believe its in how I am handling the sending of the audio but I have tried now for 4 days and can not find a solution.
I will post all relevant code and try and explain it the best I can
these are the constant/global values
#initilaize Speex
speex_enc = speex.Encoder()
speex_enc.initialize(speex.SPEEX_MODEID_WB)
speex_dec = speex.Decoder()
speex_dec.initialize(speex.SPEEX_MODEID_WB)
#some constant values
chunk = 320
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
I found adjusting the sample rate value would allow for more noise
Below is the pyAudio code to initialize the audio device this is also global
#initalize PyAudio
p = pyaudio.PyAudio()
stream = p.open(format = FORMAT,
channels = CHANNELS,
rate = RATE,
input = True,
output = True,
frames_per_buffer = chunk)
This next function is the keypress function which writes the data from the mic and sends it using the client function This is where I believe I am having problems.
I believe how I am handling this is the problem because if I press and hold to get audio it loops and sends on each iteration. I am not sure what to do here. (Ideas!!!)
def keypress(event):
#chunklist = []
#RECORD_SECONDS = 5
if event.keysym == 'Escape':
root.destroy()
#x = event.char
if event.keysym == 'Control_L':
#for i in range(0, 44100 / chunk * RECORD_SECONDS):
try:
#get data from mic
data = stream.read(chunk)
except IOError as ex:
if ex[1] != pyaudio.paInputOverflowed:
raise
data = '\x00' * chunk
encdata = speex_enc.encode(data) #Encode the data.
#chunklist.append(encdata)
#send audio
client(chr(CMD_AUDIO), encrypt_my_audio_message(encdata))
The server code to handle the audio
### Server function ###
def server():
PORT = 9001
### Initialize socket
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server_socket.bind((socket.gethostbyname(socket.gethostname()), PORT))
# socket.gethostbyname(socket.gethostname())
server_socket.listen(5)
read_list = [server_socket]
### Start receive loop
while True:
readable, writable, errored = select.select(read_list, [], [])
for s in readable:
if s is server_socket:
conn, addr = s.accept()
read_list.append(conn)
print "Connection from ", addr
else:
msg = conn.recv(2048)
if msg:
cmd, msg = ord(msg[0]),msg[1:]
## get a text message from GUI
if cmd == CMD_MSG:
listb1.insert(END, decrypt_my_message(msg).strip() + "\n")
listb1.yview(END)
## get an audio message
elif cmd == CMD_AUDIO:
# make sure length is 16 --- HACK ---
if len(msg) % 16 != 0:
msg += '\x00' * (16 - len(msg) % 16)
#decrypt audio
data = decrypt_my_message(msg)
decdata = speex_dec.decode(data)
#Write the data back out to the speaker
stream.write(decdata, chunk)
else:
s.close()
read_list.remove(s)
and for completion the binding of the keyboard in Tkinter
root.bind_all('', keypress)
Any ideas are greatly appreciated how I can make that keypress method work as needed or suggest a better way or maybe I am doing something wrong altogether
*cheers
Please note I have tested it without the encryption methods also and same thing :-) |
Web mining or scraping or crawling? What tool/library should I use? | 7,723,049 | 2 | 2 | 4,419 | 0 | java,python,web-crawler,web-scraping,web-mining | If you are going to builld a crawler you need to (Java specific):
Learn how to use the java.net.URL and java.net.URLConnection classes or use the HttpClient library
Understand http request/response headers
Understand redirects (both HTTP, HTML and Javascript)
Understand content encodings (charsets)
Use a good library for parsing badly formed HTML (e.g. cyberNecko, Jericho, JSoup)
Make concurrent HTTP requests to different hosts, but ensure you issue no more than one to the same host every ~5 seconds
Persist pages you have fetched, so you don't need to refetch them every day if they
don't change that often (HBase can be useful).
A way of extracting links from the current page to crawl next
Obey robots.txt
A bunch of other stuff too.
It's not that difficult, but there are lots of fiddly edge cases (e.g. redirects, detecting encoding (checkout Tika)).
For more basic requirements you could use wget.
Heretrix is another option, but yet another framework to learn.
Identifying About us pages can be done using various heuristics:
inbound link text
page title
content on page
URL
if you wanted to be more quantitative about it you could use machine learning and a classifier (maybe Bayesian).
Saving the front page is obviously easier but front page redirects (sometimes to different domains, and often implemented in the HTML meta redirect tag or even JS) are very common so you need to handle this. | 0 | 0 | 1 | 0 | 2011-10-11T07:48:00.000 | 6 | 0.066568 | false | 7,722,876 | 0 | 0 | 1 | 1 | I want to crawl and save some webpages as HTML. Say, crawl into hundreds popular websites and simply save their frontpages and the "About" pages.
I've looked into many questions, but didn't find an answer to this from either web crawling or web scraping questions.
What library or tool should I use to build the solution? Or is there even some existing tools that can handle this? |
Auto-Terminating Long-Running Requests in Django | 7,732,719 | 6 | 6 | 1,440 | 0 | python,django,apache,mod-wsgi | It is actually really difficult to terminate a single Python request thread in a multithread application. The best you can do is make a decision to shutdown the whole process and restart it. Because such an action will disrupt concurrent requests, you would as a result really need to restrict yourself to a single threaded configuration.
Even then the support in mod_wsgi 3.X isn't ideal for this. There is inactivity-timeout for daemon mode, but it actually causes process to be restarted in two situations. The first is when there are no requests at all and process is idle. The second is when all request threads have blocked and timeout expires.
In mod_wsgi 4.X (in repository trunk at this time), the two concepts have been separated and now inactivity-timeout only applies to completely idle process with no concurrent requests. A new blocked-timeout has been added to separately specific a timeout for when whole process is blocked. It is this latter one you can use.
If you want to learn more about the new option, you will need to go over to the mod_wsgi mailing list to discusss it. | 0 | 0 | 0 | 0 | 2011-10-11T17:50:00.000 | 1 | 1.2 | true | 7,730,257 | 0 | 0 | 1 | 1 | I've got a setup with Apache + mod_wsgi running django code, and I'd like to add a layer of protection in case a non-terminating view slips in. Something that kills-off a requests exceeding, say, 30 seconds would be ideal.
For testing I've just put a time.sleep(60) in a view.
I've tried the TimeOut 30 setting in Apache, but I still get curl returning after 60 seconds.
I see mod_wsgi itself offers three different time-out values, but none of them seem to apply to a long-running request.
Is there a standard piece of Django middleware for this or is there a knob I'm missing on Apache or mod_wsgi? |
Channel disconnect notification in channel api in google app engine | 7,741,709 | 4 | 4 | 1,617 | 0 | javascript,python,google-app-engine,channel-api | The amount of time it takes the Channel API front-end servers to "realize" that a channel is disconnected is contingent on browser implementation.
On well-behaved browsers, we catch the beforeunload event and post a message to our front-end that says, "this client is going away." On other browsers, we may not get the event (or we may not be able to listen to it for various implementation reasons, like the browser sends it too often (FFFUUUU IE)) or once we get the event the XHR we send may get swallowed. In those cases, the frontend server realizes the client is gone because it fails to receive a heartbeat -- this is what's happening on your phone. (out of curiousity, what phone?)
Your case is interesting because you're explicitly calling onclose. The only thing this does is dispose the iframe that has the Channel FE code -- in other words, onclose just behaves as if the whole browser window was closed; it doesn't take advantage of the fact that the browser is still in a good state and could wait to close until a message is sent.
So I recommend two things: add a custom handler to your code (that does the same thing as your /_ah/disconnect handler) so you can just make an XHR when you know you're manually closing the channel. This is kludgy but functional. The bummer about this is you'll need to explicitly know your client id in your javascript code.
Second, add an issue to our issue tracker (http://code.google.com/p/googleappengine/issues/list) to request better disconnect notification when onclose is called explicitly.
Hope that helps; sorry there's not an easy answer right now. | 0 | 1 | 1 | 0 | 2011-10-12T06:29:00.000 | 1 | 1.2 | true | 7,736,105 | 0 | 0 | 1 | 1 | Im using my GAE application on my phone. I face a problem in getting the disconnect notification to /_ah/channel/disconnected in channels api even if i manually close the socket by socket.close() function. the post occurs after a delay of say one minute. Does anyone know the way to speed things up? In my case socket.close() doesnt produce the channel disconnect notification(only in phone though.. it works perfectly from a laptop)! |
Can we create queue in rabbitmq with python | 9,051,453 | 2 | 1 | 1,697 | 0 | python,django,rabbitmq | In AMQP, you don't create a queue. Instead, you declare a queue, and if the queue doesn't already exist, then it is created.
In some cases all you need to do is to declare the queue in the processes that consume messages. But if you want persistent and durable queues then it is best to declare them beforehand with a shell script, or in the message publisher. Even if the message publisher does not do anything with the queue, it can still declare it to ensure that messages from the exchange are never dropped. | 0 | 0 | 0 | 0 | 2011-10-12T13:24:00.000 | 2 | 0.197375 | false | 7,740,771 | 0 | 0 | 1 | 1 | I'm working on project that need to control sending queue by code. So I just curious that anybody use to create queue in rabbitmq by python/django code? :) |
AppEngine: switching to Python 2.7 | 7,744,371 | 5 | 4 | 839 | 0 | python,google-app-engine | There is no way to avoid changing the app ID, but you can request that the old ID be aliased so requests to old_appid.appspot.com will be handled by the new application. If you're serving the application on your own domain, of course, the app ID is irrelevant.
The Master/Slave datastore will almost certainly never be supported on Python 2.7; Google doesn't recommend its use at all (I wouldn't use the term deprecated, since they've expressed no plans to actually remove it and kill the huge number of existing applications using it, but they certainly want to do as much as they can to discourage its use.) | 0 | 1 | 0 | 0 | 2011-10-12T16:54:00.000 | 1 | 1.2 | true | 7,743,653 | 0 | 0 | 1 | 1 | For tons of reasons, I would like to go ahead and switch to Python 2.7. The new python version requires using the High Replication Datastore. As far as I can see, converting to it is not really possible: the only way is to create a new app, with new ID, and copy over the datastore. Changing my app ID is something I am not keen on doing.
Is there a way around App ID changing? Or is a workaround expected in the near future? Will the 2.7 version eventually support the Master/Slave Datastore? I suppose not all AppEngine users will be that happily changing their id... |
Python quit unexpectedly while running Django | 7,747,494 | 0 | 1 | 1,009 | 0 | python,django,crash,interpreter,osx-lion | It looks like its the mysql-extension that crashes, if you have XCode you can try to make sure you have the latest one compiled locally and installed. | 0 | 1 | 0 | 0 | 2011-10-12T20:13:00.000 | 1 | 0 | false | 7,745,997 | 0 | 0 | 1 | 1 | I'm running Python 2.7.1 on 64-bit Mac OSX Lion. Python keeps crashing while I'm running my local Django 1.3 development server. The error log is below.
This is starting to get annoying. Any ideas?
Process: Python [22917] Path:
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python Version: ??? (???) Code Type:
X86-64 (Native) Parent Process: Python [22635]
Date/Time: 2011-10-12 15:01:21.968 -0500 OS Version: Mac OS
X 10.7.1 (11B26) Report Version: 9
Interval Since Last Report: 293584 sec Crashes Since Last
Report: 6 Per-App Crashes Since Last Report: 5 Anonymous
UUID: AF6F3F62-2520-45F9-AD9C-B5D08053AE23
Crashed Thread: 1
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at 0x0000000000000058
VM Regions Near 0x58:
-->
__TEXT 0000000101d94000-0000000101d95000 [ 4K] r-x/rwx SM=COW
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Application Specific Information: objc[22917]: garbage collection is
OFF
Thread 0:: Dispatch queue: com.apple.main-thread 0
libsystem_kernel.dylib 0x00007fff91c41386 close + 10 1
libmysqlclient.18.dylib 0x00000001028330dc vio_close + 60 2
libmysqlclient.18.dylib 0x00000001028329db vio_delete + 33 3
libmysqlclient.18.dylib 0x0000000102818069 end_server + 50 4
libmysqlclient.18.dylib 0x0000000102818174 mysql_close + 101 5
_mysql.so 0x00000001028006a3 _mysql_ConnectionObject_close + 65 6 _mysql.so 0x0000000102802274 _mysql_ConnectionObject_dealloc + 39 7
org.python.python 0x0000000101df1a85 0x101d9d000 + 346757
8 org.python.python 0x0000000101dd1caa 0x101d9d000 +
216234 9 org.python.python 0x0000000101dd473a
PyDict_DelItem + 186 10 org.python.python
0x0000000101e5255c 0x101d9d000 + 742748 11 org.python.python
0x0000000101da4d32 PyObject_Call + 97 12 org.python.python
0x0000000101da4eed PyObject_CallFunctionObjArgs + 178 13
org.python.python 0x0000000101df5818 0x101d9d000 + 362520
14 org.python.python 0x0000000101df5946
PyObject_ClearWeakRefs + 246 15 org.python.python
0x0000000101e51b61 0x101d9d000 + 740193 16 org.python.python
0x0000000101dd1caa 0x101d9d000 + 216234 17 org.python.python
0x0000000101e3e235 PyThreadState_Clear + 129 18 org.python.python
0x0000000101e3e44c PyInterpreterState_Clear + 41 19
org.python.python 0x0000000101e3fb7f Py_Finalize + 344 20
org.python.python 0x0000000101e3fd90 0x101d9d000 + 667024
21 org.python.python 0x0000000101e3fdc7 PyErr_PrintEx +
41 22 org.python.python 0x0000000101e403f4
PyRun_SimpleFileExFlags + 730 23 org.python.python
0x0000000101e502af Py_Main + 2715 24 org.python.python
0x0000000101d94e88 0x101d94000 + 3720
Thread 1 Crashed: 0 org.python.python
0x0000000101e270dc PyEval_EvalFrameEx + 22922 1 org.python.python
0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 2 org.python.python
0x0000000101e27e6c 0x101d9d000 + 568940 3 org.python.python
0x0000000101e24e0a PyEval_EvalFrameEx + 14008 4 org.python.python
0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 5 org.python.python
0x0000000101e27e6c 0x101d9d000 + 568940 6 org.python.python
0x0000000101e24e0a PyEval_EvalFrameEx + 14008 7 org.python.python
0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 8 org.python.python
0x0000000101dc5abf 0x101d9d000 + 166591 9 org.python.python
0x0000000101da4d32 PyObject_Call + 97 10 org.python.python
0x0000000101db36e9 0x101d9d000 + 91881 11 org.python.python
0x0000000101da4d32 PyObject_Call + 97 12 org.python.python
0x0000000101e20c40 PyEval_CallObjectWithKeywords + 180 13
org.python.python 0x0000000101e5240d 0x101d9d000 + 742413
14 libsystem_c.dylib 0x00007fff8dfcb8bf _pthread_start +
335 15 libsystem_c.dylib 0x00007fff8dfceb75 thread_start
+ 13
Thread 2: 0 libsystem_kernel.dylib 0x00007fff91c40df2
__select + 10 1 time.so 0x00000001021ae030 0x1021ad000 + 4144 2 org.python.python
0x0000000101e24d77 PyEval_EvalFrameEx + 13861 3 org.python.python
0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 4 org.python.python
0x0000000101e27e6c 0x101d9d000 + 568940 5 org.python.python
0x0000000101e24e0a PyEval_EvalFrameEx + 14008 6 org.python.python
0x0000000101e27df7 0x101d9d000 + 568823 7 org.python.python
0x0000000101e24e0a PyEval_EvalFrameEx + 14008 8 org.python.python
0x0000000101e27cd8 PyEval_EvalCodeEx + 1996 9 org.python.python
0x0000000101dc5abf 0x101d9d000 + 166591 10 org.python.python
0x0000000101da4d32 PyObject_Call + 97 11 org.python.python
0x0000000101db36e9 0x101d9d000 + 91881 12 org.python.python
0x0000000101da4d32 PyObject_Call + 97 13 org.python.python
0x0000000101e20c40 PyEval_CallObjectWithKeywords + 180 14
org.python.python 0x0000000101e5240d 0x101d9d000 + 742413
15 libsystem_c.dylib 0x00007fff8dfcb8bf _pthread_start +
335 16 libsystem_c.dylib 0x00007fff8dfceb75 thread_start
+ 13
Thread 1 crashed with X86 Thread State (64-bit): rax:
0x00007fab51368e10 rbx: 0x0000000000000000 rcx: 0x00007fab5146dc90
rdx: 0x0000000101ecd670 rdi: 0x00007fab5146de28 rsi:
0x0000000000000009 rbp: 0x0000000102dae630 rsp: 0x0000000102dae4c0
r8: 0x00007fff784a50b0 r9: 0x0000000102dae458 r10:
0x0000000000000081 r11: 0x0000000102c23064 r12: 0x00007fab51368e10
r13: 0x0000000103023f90 r14: 0x000000000000007c r15:
0x00000001023c4ddb rip: 0x0000000101e270dc rfl: 0x0000000000010246
cr2: 0x0000000000000058 Logical CPU: 2
Binary Images:
0x101d94000 - 0x101d94fff org.python.python (2.7.1 - 2.7.1) /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
0x101d9d000 - 0x101eb8ff7 org.python.python (2.7.1 - 2.7.1) /System/Library/Frameworks/Python.framework/Versions/2.7/Python
0x1020ea000 - 0x1020edfff strop.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so
0x1020f2000 - 0x1020f5fff operator.so (??? - ???) <59A152D0-52ED-354C-9C2D-D7390E3EC216>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so
0x10213b000 - 0x10213cfff _functools.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so
0x102140000 - 0x102141fff _locale.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so
0x102145000 - 0x102149fff _struct.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so
0x10218f000 - 0x102195ff7 _socket.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so
0x10219d000 - 0x1021a1fff _ssl.so (??? - ???) <50FC05D5-0434-3054-9C09-CA8923FED0C0>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so
0x1021a7000 - 0x1021a8fff cStringIO.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cStringIO.so
0x1021ad000 - 0x1021aefff time.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/time.so
0x1021b5000 - 0x1021b8fff _collections.so (??? - ???) <62C1B5B7-654D-397A-8840-7EBB907DBCA1>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so
0x1021be000 - 0x1021c4fff itertools.so (??? - ???) <7C8350B9-8DD3-377A-A5C1-1103A6C955A6>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/itertools.so
0x1021cd000 - 0x1021cdfff _bisect.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_bisect.so
0x1021d1000 - 0x1021d2fff _heapq.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_heapq.so
0x1021d7000 - 0x1021d9ff7 binascii.so (??? - ???) <9B353DAC-B0E8-3B4B-91A1-50F6F86AA928>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/binascii.so
0x10221d000 - 0x10221dfff _scproxy.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_scproxy.so
0x102221000 - 0x10222cff7 datetime.so (??? - ???) <9EC1E3BD-3BD3-3B39-AE19-448CCEEA747A>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/datetime.so
0x102322000 - 0x102327fff math.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/math.so
0x1023ad000 - 0x1023aefff _hashlib.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_hashlib.so
0x1023b2000 - 0x1023b3ff7 _random.so (??? - ???) <3C7A7C17-1698-32D0-BF09-F50A19F75E4B>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_random.so
0x102437000 - 0x102443fff cPickle.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cPickle.so
0x102449000 - 0x10244bfff select.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/select.so
0x1024d1000 - 0x1024d2fff fcntl.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/fcntl.so
0x102596000 - 0x10259bfff array.so (??? - ???) <177F1D09-ACEE-3E39-8F1E-3EE8BA8A7AC6>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/array.so
0x102661000 - 0x102661fff grp.so (??? - ???) <563EC9A6-F38F-3518-9BBB-912E9F01FDA1>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/grp.so
0x1026a5000 - 0x1026a6fff termios.so (??? - ???) <578DA44F-17E3-3343-982F-BB543CBB49F1>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/termios.so
0x10276b000 - 0x10276dfff zlib.so (??? - ???) <81E54FCE-EEAC-3E97-BB05-1143EB6AECA6>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/zlib.so
0x1027b2000 - 0x1027b8fff pyexpat.so (??? - ???) <0E02E7DD-AC97-38B5-BB3B-856249DEBFF9>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/pyexpat.so
0x1027ff000 - 0x102804fff +_mysql.so (??? - ???) <8B1F4F4C-09C5-33DC-9DA4-D611FF9E2AF4> /Users/USER/*/_mysql.so
0x102810000 - 0x102aa0ff7 libmysqlclient.18.dylib (18.0.0 - compatibility 18.0.0) <6A688A2F-6420-D89A-A3BD-5F9605F6C4C2>
/usr/lib/libmysqlclient.18.dylib
0x102e31000 - 0x102e42fff _io.so (??? - ???) <5451CA4B-98A0-3F70-9322-DBE6B7D93CF1>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so
0x102e51000 - 0x102e5dff7 +parser.so (??? - ???) <9384AA00-C2F8-3407-94F6-210FA55AFD70>
/Library/Python/2.7/site-packages/http_parser/parser.so
0x102f2d000 - 0x102f3efff _ctypes.so (??? - ???) <2D2AE6AF-704A-3CBB-954B-33BA49B78254>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so
0x102f8a000 - 0x102f8efff _json.so (??? - ???)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_json.so
0x7fff61994000 - 0x7fff619c8ac7 dyld (195.5 - ???) <4A6E2B28-C7A2-3528-ADB7-4076B9836041> /usr/lib/dyld
0x7fff876a6000 - 0x7fff876d3fe7 libSystem.B.dylib (159.0.0 - compatibility 1.0.0) <7B4D685D-939C-3ABE-8780-77A1889E0DE9>
/usr/lib/libSystem.B.dylib
0x7fff88a3b000 - 0x7fff88a3cfff libDiagnosticMessagesClient.dylib (??? - ???)
<3DCF577B-F126-302B-BCE2-4DB9A95B8598>
/usr/lib/libDiagnosticMessagesClient.dylib
0x7fff89578000 - 0x7fff89593fff libexpat.1.dylib (7.2.0 - compatibility 7.0.0)
/usr/lib/libexpat.1.dylib
0x7fff899ec000 - 0x7fff89a25fe7 libssl.0.9.8.dylib (0.9.8 - compatibility 0.9.8)
/usr/lib/libssl.0.9.8.dylib
0x7fff8a000000 - 0x7fff8a001fff libdnsinfo.dylib (395.6.0 - compatibility 1.0.0) <718A135F-6349-354A-85D5-430B128EFD57>
/usr/lib/system/libdnsinfo.dylib
0x7fff8a163000 - 0x7fff8a169fff libmacho.dylib (800.0.0 - compatibility 1.0.0)
/usr/lib/system/libmacho.dylib
0x7fff8a1cf000 - 0x7fff8a1d1fff libquarantine.dylib (36.0.0 - compatibility 1.0.0) <4C3BFBC7-E592-3939-B376-1C2E2D7C5389>
/usr/lib/system/libquarantine.dylib
0x7fff8a223000 - 0x7fff8a224fff libsystem_sandbox.dylib (??? - ???) <8D14139B-B671-35F4-9E5A-023B4C523C38> /usr/lib/system/libsystem_sandbox.dylib
0x7fff8a225000 - 0x7fff8a22dfff libsystem_dnssd.dylib (??? - ???) <7749128E-D0C5-3832-861C-BC9913F774FA>
/usr/lib/system/libsystem_dnssd.dylib
0x7fff8a28f000 - 0x7fff8a29dfff libdispatch.dylib (187.5.0 - compatibility 1.0.0) <698F8EFB-7075-3111-94E3-891156C88172>
/usr/lib/system/libdispatch.dylib
0x7fff8ae52000 - 0x7fff8ae9dfff com.apple.SystemConfiguration (1.11 - 1.11) <0B02FEC4-C36E-32CB-8004-2214B6793AE8>
/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x7fff8afbd000 - 0x7fff8b1bffff libicucore.A.dylib (46.1.0 - compatibility 1.0.0) <82DCB94B-3819-3CC3-BC16-2AACA7F64F8A>
/usr/lib/libicucore.A.dylib
0x7fff8b4bb000 - 0x7fff8b4fdff7 libcommonCrypto.dylib (55010.0.0 - compatibility 1.0.0)
/usr/lib/system/libcommonCrypto.dylib
0x7fff8c12f000 - 0x7fff8c213def libobjc.A.dylib (228.0.0 - compatibility 1.0.0)
/usr/lib/libobjc.A.dylib
0x7fff8c32b000 - 0x7fff8c39efff libstdc++.6.dylib (52.0.0 - compatibility 7.0.0) <6BDD43E4-A4B1-379E-9ED5-8C713653DFF2>
/usr/lib/libstdc++.6.dylib
0x7fff8c711000 - 0x7fff8c713fff com.apple.TrustEvaluationAgent (2.0 - 1)
<80AFB5D8-5CC4-3A38-83B9-A7DF5820031A>
/System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent
0x7fff8c74b000 - 0x7fff8c74cfff libunc.dylib (24.0.0 - compatibility 1.0.0)
/usr/lib/system/libunc.dylib
0x7fff8c7b5000 - 0x7fff8c8c1fef libcrypto.0.9.8.dylib (0.9.8 - compatibility 0.9.8) <3AD29F8D-E3BC-3F49-A438-2C8AAB71DC99> /usr/lib/libcrypto.0.9.8.dylib
0x7fff8cc05000 - 0x7fff8cdd8ff7 com.apple.CoreFoundation (6.7 - 635) <57446B22-0778-3E07-9690-96AC705D57E8> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fff8ce15000 - 0x7fff8ce1afff libcompiler_rt.dylib (6.0.0 - compatibility 1.0.0) <98ECD5F6-E85C-32A5-98CD-8911230CB66A>
/usr/lib/system/libcompiler_rt.dylib
0x7fff8d07f000 - 0x7fff8d083fff libdyld.dylib (195.5.0 - compatibility 1.0.0)
/usr/lib/system/libdyld.dylib
0x7fff8d6e4000 - 0x7fff8d759ff7 libc++.1.dylib (19.0.0 - compatibility 1.0.0)
/usr/lib/libc++.1.dylib
0x7fff8df5d000 - 0x7fff8df5eff7 libsystem_blocks.dylib (53.0.0 - compatibility 1.0.0) <8BCA214A-8992-34B2-A8B9-B74DEACA1869>
/usr/lib/system/libsystem_blocks.dylib
0x7fff8df5f000 - 0x7fff8df7cff7 libxpc.dylib (77.16.0 - compatibility 1.0.0) <0A4B4775-29A9-30D6-956B-3BE1DBF98090>
/usr/lib/system/libxpc.dylib
0x7fff8df7d000 - 0x7fff8e05afef libsystem_c.dylib (763.11.0 - compatibility 1.0.0) <1D61CA57-3C6D-30F7-89CB-CC6F0787B1DC>
/usr/lib/system/libsystem_c.dylib
0x7fff8e3d9000 - 0x7fff8e3deff7 libsystem_network.dylib (??? - ???) <4ABCEEF3-A3F9-3E06-9682-CE00F17138B7> /usr/lib/system/libsystem_network.dylib
0x7fff8e6dd000 - 0x7fff8e6deff7 libremovefile.dylib (21.0.0 - compatibility 1.0.0)
/usr/lib/system/libremovefile.dylib
0x7fff8f409000 - 0x7fff8f414ff7 libc++abi.dylib (14.0.0 - compatibility 1.0.0) <8FF3D766-D678-36F6-84AC-423C878E6D14>
/usr/lib/libc++abi.dylib
0x7fff8f7f7000 - 0x7fff8f7fcfff libcache.dylib (47.0.0 - compatibility 1.0.0)
/usr/lib/system/libcache.dylib
0x7fff8fb23000 - 0x7fff8fb23fff libkeymgr.dylib (23.0.0 - compatibility 1.0.0) <61EFED6A-A407-301E-B454-CD18314F0075>
/usr/lib/system/libkeymgr.dylib
0x7fff8fee2000 - 0x7fff8ff30ff7 libauto.dylib (??? - ???) /usr/lib/libauto.dylib
0x7fff8ff31000 - 0x7fff8ff37ff7 libunwind.dylib (30.0.0 - compatibility 1.0.0) <1E9C6C8C-CBE8-3F4B-A5B5-E03E3AB53231>
/usr/lib/system/libunwind.dylib
0x7fff907bd000 - 0x7fff907c1fff libmathCommon.A.dylib (2026.0.0 - compatibility 1.0.0)
/usr/lib/system/libmathCommon.A.dylib
0x7fff91aae000 - 0x7fff91ab8ff7 liblaunch.dylib (392.18.0 - compatibility 1.0.0) <39EF04F2-7F0C-3435-B785-BF283727FFBD>
/usr/lib/system/liblaunch.dylib
0x7fff91ae3000 - 0x7fff91aecfff libnotify.dylib (80.0.0 - compatibility 1.0.0)
/usr/lib/system/libnotify.dylib
0x7fff91b74000 - 0x7fff91b7bfff libcopyfile.dylib (85.1.0 - compatibility 1.0.0) <172B1985-F24A-34E9-8D8B-A2403C9A0399>
/usr/lib/system/libcopyfile.dylib
0x7fff91c2a000 - 0x7fff91c4afff libsystem_kernel.dylib (1699.22.73 - compatibility 1.0.0)
<69F2F501-72D8-3B3B-8357-F4418B3E1348>
/usr/lib/system/libsystem_kernel.dylib
0x7fff9288c000 - 0x7fff928c8fff libsystem_info.dylib (??? - ???)
/usr/lib/system/libsystem_info.dylib
0x7fff93506000 - 0x7fff93518ff7 libz.1.dylib (1.2.5 - compatibility 1.0.0) <30CBEF15-4978-3DED-8629-7109880A19D4>
/usr/lib/libz.1.dylib
0x7fff939e7000 - 0x7fff939e8fff libffi.dylib (??? - ???) /usr/lib/libffi.dylib
External Modification Summary: Calls made by other processes
targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0 Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0 Calls made by all processes on this machine:
task_for_pid: 206162
thread_create: 1
thread_set_state: 0
VM Region Summary: ReadOnly portion of Libraries: Total=62.8M
resident=27.3M(43%) swapped_out_or_unallocated=35.5M(57%) Writable
regions: Total=62.7M written=16.7M(27%) resident=22.3M(35%)
swapped_out=0K(0%) unallocated=40.5M(65%) REGION TYPE
VIRTUAL
=========== ======= MALLOC 53.2M MALLOC guard page 32K STACK GUARD 56.0M Stack 9232K VM_ALLOCATE 8K
__DATA 2320K
__LINKEDIT 48.2M
__TEXT 14.6M
__UNICODE 544K shared memory 12K
=========== ======= TOTAL 183.8M
Model: MacBookPro8,1, BootROM MBP81.0047.B0E, 2 processors, Intel Core
i7, 2.7 GHz, 8 GB, SMC 1.68f96 Graphics: Intel HD Graphics 3000, Intel
HD Graphics 3000, Built-In, 512 MB Memory Module: BANK 0/DIMM0, 4 GB,
DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334448302D4348392020 Memory
Module: BANK 1/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE,
0x4D34373142353237334448302D4348392020 AirPort:
spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom
BCM43xx 1.0 (5.100.98.75.10) Bluetooth: Version 2.5.0f17, 2 service,
19 devices, 1 incoming serial ports Network Service: AirPort, AirPort,
en1 Serial ATA Device: APPLE SSD TS128C, 121.33 GB Serial ATA Device:
OPTIARC DVD RW AD-5970H USB Device: hub_device, 0x0424 (SMSC),
0x2513, 0xfa100000 / 3 USB Device: BRCM2070 Hub, 0x0a5c (Broadcom
Corp.), 0x4500, 0xfa110000 / 5 USB Device: Bluetooth USB Host
Controller, apple_vendor_id, 0x821a, 0xfa113000 / 8 USB Device: Apple
Internal Keyboard / Trackpad, apple_vendor_id, 0x0245, 0xfa120000 / 4
USB Device: FaceTime HD Camera (Built-in), apple_vendor_id, 0x8509,
0xfa200000 / 2 USB Device: hub_device, 0x0424 (SMSC), 0x2513,
0xfd100000 / 2 USB Device: My Passport 0730, 0x1058 (Western Digital
Technologies, Inc.), 0x0730, 0xfd120000 / 4 USB Device: IR Receiver,
apple_vendor_id, 0x8242, 0xfd110000 / 3 |
Is Pro Django book still relevant? | 7,747,777 | 23 | 12 | 2,272 | 0 | python,django,metaprogramming | It's not my place to speak about its worth or recommendations, but I wrote the book with Django 1.0 in mind precisely to make sure it stayed relevant as long as possible. The aspects of Django that I documented are still present and functional, and the general aspects of Python are also still valid. They may have grown additional options along the way, but they shouldn't be removed any time soon or changed in any backward-incompatible way.
That said, I covered some examples of best practices and also some workarounds for things that Django didn't support at the time. Because of new features added to Django since 1.0 was released, these aren't necessarily still the best approaches anymore. So feel free to read it for the factual descriptions of how things work, but take the recommendations with a grain of salt and always consult the official documentation for the latest features. | 0 | 0 | 0 | 0 | 2011-10-12T20:44:00.000 | 3 | 1 | false | 7,746,344 | 0 | 0 | 1 | 2 | I want to dig deeper into Django's internals and the official online documentation only goes so far toward that end.
The reviews for Marty Alchin's Pro Django are fantastic (I've read Pro Python and really enjoyed it). However, the book is from 2008 and is based on Django v1.0. My company builds off v1.3.
Is this book still worthwhile? How can I best learn about Django's meta-programming (beyond looking through the source code, which I am also doing)?
Thanks |
Is Pro Django book still relevant? | 7,746,386 | 8 | 12 | 2,272 | 0 | python,django,metaprogramming | Yes, it's definitely still relevant. Although a lot has changed in Django since version 1, the internal parts and the concepts that Pro Django deals with are mostly the same. I'd have no hesitation in recommending the book - it's a really useful insight into how Django works and teaches some very useful methods as well. | 0 | 0 | 0 | 0 | 2011-10-12T20:44:00.000 | 3 | 1.2 | true | 7,746,344 | 0 | 0 | 1 | 2 | I want to dig deeper into Django's internals and the official online documentation only goes so far toward that end.
The reviews for Marty Alchin's Pro Django are fantastic (I've read Pro Python and really enjoyed it). However, the book is from 2008 and is based on Django v1.0. My company builds off v1.3.
Is this book still worthwhile? How can I best learn about Django's meta-programming (beyond looking through the source code, which I am also doing)?
Thanks |
Running command with browser | 7,747,962 | 0 | 0 | 198 | 0 | javascript,python,macos,unix,controls | On the client side (the browser), you can do it with the simplest approach. Just an html form. javascript would make it nicer for validation and to do ajax calls so the page doesnt have to refresh. But your main focus is handling it on the server. You could receive the form request in the language of your choice. If you are already running python, you could write a super fast cgi python script. Look at the cgi module for python. You would need to put this into the apache server on osx if thats where you will host it.
Unfortunately, your question about exactly how to write it is beyond the scope of a simple answer. But google for how to write and html form, or look at maybe jquery to build a quick form that can make ajax calls easily.
Then search for how to use the python cgi module and receive POST requests. | 0 | 0 | 1 | 0 | 2011-10-12T23:43:00.000 | 3 | 0 | false | 7,747,852 | 0 | 0 | 1 | 2 | I want to have a "control panel" on a website, and when a button is pressed, I want it to run a command on the server (my computer). The panel is to run different python scripts I wrote (one script for each button), and I want to run the panel on my Mac, my iPod touch, and my wii. The best way I see for this is a website, since they all have browsers. Is there a javascript or something to run a command on my computer whenever the button is pressed?
EDIT: I heard AJAX might work for server-based things like this, but I have no idea how to do that. Is there like a 'system' block or something I can use? |
Running command with browser | 7,747,896 | 0 | 0 | 198 | 0 | javascript,python,macos,unix,controls | Here are three options:
Have each button submit a form with the name of the script in a hidden field. The server will receive the form parameters and can then branch off to run the appropriate script.
Have each button hooked to it's own unique URL and use javascript on the button click to just set window.location to that new URL. Your server will receive that URL and can decide which script to run based on the URL. You could even just use a link on the web page with no javascript.
Use Ajax to issue a unique URL to your server. This is essentially the same (from the server's point of view) as the previous two options. The main difference is that the web browser doesn't change what URL it's pointing to. The ajax call just directs the server to do something and return some data which the host web page can then do whatever it wants with. | 0 | 0 | 1 | 0 | 2011-10-12T23:43:00.000 | 3 | 1.2 | true | 7,747,852 | 0 | 0 | 1 | 2 | I want to have a "control panel" on a website, and when a button is pressed, I want it to run a command on the server (my computer). The panel is to run different python scripts I wrote (one script for each button), and I want to run the panel on my Mac, my iPod touch, and my wii. The best way I see for this is a website, since they all have browsers. Is there a javascript or something to run a command on my computer whenever the button is pressed?
EDIT: I heard AJAX might work for server-based things like this, but I have no idea how to do that. Is there like a 'system' block or something I can use? |
account(s) management over multiple tenants | 7,757,039 | 2 | 2 | 126 | 0 | python,google-app-engine,namespaces,user-accounts | If 'user identity' can span tenants (your apps), then keep user entities in a common namespace (the default namespace works fine for that, and that's the default when a request begins). Anything specific to a tenant (e.g., what authorization a user identity has for a specific tenant) can be stored where it is most convenient. I find that putting it in the tenant's namespace simplifies queries that would otherwise have to specify that or filter it out. | 0 | 1 | 0 | 0 | 2011-10-13T14:58:00.000 | 1 | 1.2 | true | 7,756,132 | 0 | 0 | 1 | 1 | i have an app with multiple tenants on GAE.
over the 'master' (which is a tenant on its own) i let people register and create a subapp/tenant where the creator is the owner of the app.
what is the best way to manage the user accounts?
lets say USER_A creates APP_A and USER_B creates APP_B.
so there are 2 users and 2 apps where each user is owner to the app it created and does not have access to the other users app.
now USER_B wants to give access to the other user on his app.
what is the best way to model this situation.
should i store members in a completely separate namespace and validate the users session by switching constantly between namespaces?
i think the best place to keep what permissions a specific user has on an app is on the actual app tenant rather than the USER object.
any tips or best practices?
thank you |
PyDev project for Google App Engine not finding webapp2 | 17,769,623 | 0 | 6 | 5,907 | 0 | python,eclipse,google-app-engine,pydev | adding ${GOOGLE_APP_ENGINE}/lib/webapp2-2.5.2 to the "External Libraries" worked for me.
App Engine SDK ver:1.8.2
Python version: 2.7 | 0 | 1 | 0 | 0 | 2011-10-13T16:00:00.000 | 5 | 0 | false | 7,756,981 | 0 | 0 | 1 | 3 | I am attempting to try out Google App Engine with python. Being familiar with Eclipse, I decided to use PyDev. After some trouble, I have a hello world program working... almost. It cannot find the webapp2 import, telling me it is unresolved. I have followed all of the instructions I can find, and have the google app engine libraries linked up - I think. I have searched for webapp2 as a potential import, and cannot find this anywhere in any of the library files. I am really new to python in general, and even newer to the Google App Engine, so I am certain that this is a simple problem that is exacerbated by my newness.
I am running on OS-X, running Eclipse Indigo Service Release 1. I have the latest version of PyDev available for download as of Tuesday evening. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.