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
multi threading python/ruby vs java?
2,965,919
9
2
5,035
0
java,python,ruby
This is not a question about Ruby, Python or Java, but more about a specific implementation of Ruby, Python or Java. There are Java implementations with extremely efficient threading implementations and there are Java implementations with extremely bad threading implementations. And the same is true for Ruby and Python, and really basically any language at all. Even languages like Erlang, where an inefficient threading implementation doesn't even make sense, sometimes have bad threading implementations. For example, if you use JRuby or Jython, then your Ruby and Python threads are Java threads. So, they are not only as efficient as Java threads, they are exactly the same as Java threads.
0
0
0
0
2010-06-03T05:59:00.000
3
1.2
true
2,963,615
1
0
1
2
i wonder if the multi threading in python/ruby is equivalent to the one in java? by that i mean, is it as efficient? cause if you want to create a chat application that use comet technology i know that you have to use multi threading. does this mean that i can use python or ruby for that or is it better with java? thanks
multi threading python/ruby vs java?
2,966,837
1
2
5,035
0
java,python,ruby
philosodad is not wrong to point out the constraint that the GIL presents. I won't speak for Ruby, but I am sure that it's safe to assume that when you refer to Python that you are in fact referring to the canonical cPython implementation. In the case of cPython, the GIL matters most if you want to parallelize computationally intensive operations implemented in Python (as in not in C extensions where the GIL can be released). However, when you are writing a non-intensive I/O-bound application such as a chat program, the efficiency of the threading implementation really just doesn't matter all that much.
0
0
0
0
2010-06-03T05:59:00.000
3
0.066568
false
2,963,615
1
0
1
2
i wonder if the multi threading in python/ruby is equivalent to the one in java? by that i mean, is it as efficient? cause if you want to create a chat application that use comet technology i know that you have to use multi threading. does this mean that i can use python or ruby for that or is it better with java? thanks
php equivalent to jython?
2,968,495
1
4
494
0
java,php,python,jython
Well: Java Server Pages (JSP) are "equivalent" to PHP, but using java classes. It's "equivalent" in that it's HTML with embedded java code, but not at all compatible to PHP syntax.
0
0
0
1
2010-06-03T17:35:00.000
5
0.039979
false
2,968,381
0
0
1
2
i wonder if there is a php equivalent to jython so you can use java classes with php? thanks
php equivalent to jython?
2,968,418
1
4
494
0
java,php,python,jython
I just googled php jvm and got a bunch of hits. Never tried any of them.
0
0
0
1
2010-06-03T17:35:00.000
5
0.039979
false
2,968,381
0
0
1
2
i wonder if there is a php equivalent to jython so you can use java classes with php? thanks
How to deal with "partial" dates (2010-00-00) from MySQL in Django?
3,027,410
7
8
4,080
1
python,mysql,database,django,date
First, thanks for all your answers. None of them, as is, was a good solution for my problem, but, for your defense, I should add that I didn't give all the requirements. But each one help me think about my problem and some of your ideas are part of my final solution. So my final solution, on the DB side, is to use a varchar field (limited to 10 chars) and storing the date in it, as a string, in the ISO format (YYYY-MM-DD) with 00 for month and day when there's no month and/or day (like a date field in MySQL). This way, this field can work with any databases, the data can be read, understand and edited directly and easily by a human using a simple client (like mysql client, phpmyadmin, etc.). That was a requirement. It can also be exported to Excel/CSV without any conversion, etc. The disadvantage is that the format is not enforce (except in Django). Someone could write 'not a date' or do a mistake in the format and the DB will accept it (if you have an idea about this problem...). This way it's also possible to do all of the special queries of a date field relatively easily. For queries with WHERE: <, >, <=, >= and = work directly. The IN and BETWEEN queries work directly also. For querying by day or month you just have to do it with EXTRACT (DAY|MONTH ...). Ordering work also directly. So I think it covers all the query needs and with mostly no complication. On the Django side, I did 2 things. First, I have created a PartialDate object that look mostly like datetime.date but supporting date without month and/or day. Inside this object I use a datetime.datetime object to keep the date. I'm using the hours and minutes as flag that tell if the month and day are valid when they are set to 1. It's the same idea that steveha propose but with a different implementation (and only on the client side). Using a datetime.datetime object gives me a lot of nice features for working with dates (validation, comparaison, etc.). Secondly, I have created a PartialDateField that mostly deal with the conversion between the PartialDate object and the database. So far, it works pretty well (I have mostly finish my extensive unit tests).
0
0
0
0
2010-06-04T02:49:00.000
5
1.2
true
2,971,198
0
0
1
1
In one of my Django projects that use MySQL as the database, I need to have a date fields that accept also "partial" dates like only year (YYYY) and year and month (YYYY-MM) plus normal date (YYYY-MM-DD). The date field in MySQL can deal with that by accepting 00 for the month and the day. So 2010-00-00 is valid in MySQL and it represent 2010. Same thing for 2010-05-00 that represent May 2010. So I started to create a PartialDateField to support this feature. But I hit a wall because, by default, and Django use the default, MySQLdb, the python driver to MySQL, return a datetime.date object for a date field AND datetime.date() support only real date. So it's possible to modify the converter for the date field used by MySQLdb and return only a string in this format 'YYYY-MM-DD'. Unfortunately the converter use by MySQLdb is set at the connection level so it's use for all MySQL date fields. But Django DateField rely on the fact that the database return a datetime.date object, so if I change the converter to return a string, Django is not happy at all. Someone have an idea or advice to solve this problem? How to create a PartialDateField in Django ? EDIT Also I should add that I already thought of 2 solutions, create 3 integer fields for year, month and day (as mention by Alison R.) or use a varchar field to keep date as string in this format YYYY-MM-DD. But in both solutions, if I'm not wrong, I will loose the special properties of a date field like doing query of this kind on them: Get all entries after this date. I can probably re-implement this functionality on the client side but that will not be a valid solution in my case because the database can be query from other systems (mysql client, MS Access, etc.)
django and netbeans?
2,971,775
0
10
19,247
0
python,django,netbeans,ide
Netbeans doesn't have a django plugin that I know of. Eclipse's pydev plugin is decent, I typically use any ol' editor and bpython. I've heard great things about wingware and intellij's new python ide is pretty good.
0
0
0
0
2010-06-04T03:25:00.000
3
0
false
2,971,309
0
0
1
1
I use netbeans for all of my Linux development (C/C++, Php, Python, Symfony). I am now learning django, and wondered if I could use netbeans as the IDE. I cant seem to find a Django plugin for netbeans. Is there one?. If no when is one planned? Worst case scenario, I'll have to use another IDE (I really dont want to learn another IDE) - But, If so, what do you guys use for django development?
Django chat with ajax polling
2,973,756
0
2
3,357
0
python,ajax,django,comet,chat
ajax is the best here what you will need: 1) server view that will return recent messages 2) client-side caller by timer (I prefer jQuery and its timers plugin) and success handler, that will populate the chat window
0
0
0
0
2010-06-04T11:21:00.000
2
0
false
2,973,591
0
0
1
1
I need to create a chat similar to facebook chat. I am thinking to create a simple application Chat and then using ajax polling ( to send request every 2-3 seconds ). Is this a good approach ?
Proper way to define "remaining time off" for a Django User
2,978,805
2
1
218
0
python,django,user-profile
If you do not want to modify/inherit from the original User model I'd say it's totally ok if the method is added to your UserProfile!
0
0
0
0
2010-06-04T21:11:00.000
2
0.197375
false
2,977,824
0
0
1
1
I've implemented a UserProfile model (as the Django 1.2 docs say is the proper way to save additional data about a User) which has a 'remaining_vacation_hours' field. In our current system, when a user fills out a Time Off Request, the remaining hours available should be checked to see that they have enough vacation to use, or otherwise be warned that they are asking for more than they have. Of course, vacation hours are annually replenished, so it would be appropriate for the system to check if the user would have additional vacation accrued for the dates they're asking off. Simply creating a get_remaining_vacation_hours() method would suffice, because other calculations or business logic that might need to be added in the future could be added to or called from that method. My question is, does it sound correct that the get_remaining_vacation_hours() method be added to the UserProfile model? It seems to make sense, but I wanted to verify with the community that I wasn't overlooking a better practice for this type of thing. Any ideas or suggestions are welcome.
Anyone using IronPython in a production application?
3,000,668
3
5
1,311
0
ironpython
I'm doing web development for a German firm using Django on the server side and Silverlight with IronPython on the client. We're an all Python development company so being able to do "full stack" development with Python is great (although it was originally the customer who specified Silverlight).
0
0
0
0
2010-06-05T06:20:00.000
3
0.197375
false
2,979,402
0
0
1
1
I've been toying with the idea of adding IronPython for extending a scientific application I support. Is this a good or horrible idea? Are there any good examples of IronPython being used in a production application. I've seen Resolver, which is kind of cute. Are there any other apps out there? What I don't get is this. Is it any easier to use IronPython than to just use something like code DOM to create script like extensibility in your application? Anyone have some horror stories or tales of glorious success with IronPython / IronRuby?
Django admin add page, how to, autofill with latest data(0002)+1=0003
2,982,717
1
1
165
0
python,django,admin
Not reliably. What will happen if multiple people access it at the same time is that data will be overwritten. Let the PK serve its purpose, behind the scenes.
0
0
0
0
2010-06-06T00:52:00.000
1
0.197375
false
2,982,708
0
0
1
1
When adding a new data, can we automatically add a dynamic default data where the value is previous recorded data(0002)+1=0003
Getting logging.debug() to work on Google App Engine/Python
17,550,812
8
25
7,359
0
python,debugging,google-app-engine
In case someone is using the Windows Google Application Launcher. The argument for debug can be set under Edit > Application Settings In the Extra Command Line Flags, add --log_level=debug
0
1
0
0
2010-06-06T03:01:00.000
4
1
false
2,982,959
0
0
1
2
I'm just getting started on building a Python app for Google App Engine. In the localhost environment (on a Mac) I'm trying to send debug info to the GoogleAppEngineLauncher Log Console via logging.debug(), but it isn't showing up. However, anything sent through, say, logging.info() or logging.error() does show up. I've tried a logging.basicConfig(level=logging.DEBUG) before the logging.debug(), but to no avail. What am I missing?
Getting logging.debug() to work on Google App Engine/Python
27,547,085
1
25
7,359
0
python,debugging,google-app-engine
On a Mac: 1) click Edit > Application Settings 2) then copy and paste the following line into the "Extra Flags:" field --log_level=debug 3) click Update your debug logs will now show up in the Log Console
0
1
0
0
2010-06-06T03:01:00.000
4
0.049958
false
2,982,959
0
0
1
2
I'm just getting started on building a Python app for Google App Engine. In the localhost environment (on a Mac) I'm trying to send debug info to the GoogleAppEngineLauncher Log Console via logging.debug(), but it isn't showing up. However, anything sent through, say, logging.info() or logging.error() does show up. I've tried a logging.basicConfig(level=logging.DEBUG) before the logging.debug(), but to no avail. What am I missing?
Talking to an Authentication Server
2,986,411
1
0
308
0
python,authentication,rest
Assuming you plan to write your own auth client code, it isn't event-driven, and you don't need to validate an https certificate, I would suggest using python's built-in urllib2 to call the auth server. This will minimize dependencies, which ought to make deployment and upgrades easier. That being said, there are more than a few existing auth-related protocols and libraries in the world, some of which might save you some time and security worries over writing code from scratch. For example, if you make your auth server speak OpenID, many off-the-self applications and servers (including Apache) will have auth client plugins already made for you.
0
0
1
0
2010-06-06T23:14:00.000
3
0.066568
false
2,986,317
0
0
1
2
I'm building my startup and I'm thinking ahead for shared use of services. So far I want to allow people who have a user account on one app to be able to use the same user account on another app. This means I will have to build an authentication server. I would like some opinions on how to allow an app to talk to the authentication server. Should I use curl? Should I use Python's http libs? All the code will be in Python. All it's going to do is ask the authentication server if the person is allowed to use that app and the auth server will return a JSON user object. All authorization (roles and resources) will be app independent, so this app will not have to handle that. Sorry if this seems a bit newbish; this is the first time I have separated authentication from the actual application.
Talking to an Authentication Server
2,986,610
0
0
308
0
python,authentication,rest
Your question isn't really a programming problem so much as it is an architecture problem. What I would recommend for your specific situation is to setup an LDAP server for authentication, authorization, and accounting (AAA). Then have your applications use that (every language has modules and libraries for LDAP). It is a reliable, secure, proven, and well-known way of handling such things. Even if you strictly want to enforce HTTP-based authentication it is easy enough to slap an authentication server in front of your LDAP and call it a day. There's even existing code to do just that so you won't have to re-invent the wheel.
0
0
1
0
2010-06-06T23:14:00.000
3
0
false
2,986,317
0
0
1
2
I'm building my startup and I'm thinking ahead for shared use of services. So far I want to allow people who have a user account on one app to be able to use the same user account on another app. This means I will have to build an authentication server. I would like some opinions on how to allow an app to talk to the authentication server. Should I use curl? Should I use Python's http libs? All the code will be in Python. All it's going to do is ask the authentication server if the person is allowed to use that app and the auth server will return a JSON user object. All authorization (roles and resources) will be app independent, so this app will not have to handle that. Sorry if this seems a bit newbish; this is the first time I have separated authentication from the actual application.
django app organization
2,987,352
8
6
1,802
0
python,django
First, large files are pretty common in python. Python is not java, which has one class per file, rather one module per file. Next, views, even as the standard used, is a python module. A module need not be a single file. It can be a directory containing many files, and __init__.py And then, views.py is only a convention. You, the application programmer are referring to it, and django itself doesn't refer anywhere. So, you are free to put it in as many files and refer appropriate functions to be handed over, the request to, in the urls.py
0
0
0
0
2010-06-07T01:44:00.000
3
1.2
true
2,986,659
0
0
1
2
I have been reading some django tutorial and it seems like all the view functions have to go in a file called "views.py" and all the models go in "models.py". I fear that I might end up with a lot of view functions in my view.py file and the same is the case with models.py. Is my understanding of django apps correct? Django apps lets us separate common functionality into different apps and keep the file size of views and models to a minimum? For example: My project can contain an app for recipes (create, update, view, and search) and a friend app, the comments app, and so on. Can I still move some of my view functions to a different file? So I only have the CRUD in one single file?
django app organization
2,986,813
1
6
1,802
0
python,django
They don't have to go in views.py. They have to be referenced there. views.py can include other files. So, if you feel the need, you can create other files in one app that contain your view functions and just include them in views.py. The same applies to models.py. Django apps lets us separate common functionality into different apps and keep the file size of views and models to a minimum? For example: My project can contain an app for recipes (create, update, view, and search) and a friend app, the comments app, and so on. I don't know about the "to a minimum" part - some apps are just big in views, others big in models. You should strive to partition things well, but sometimes there is just a lot of code. But other than that, this is a fair summary of Django apps, yes.
0
0
0
0
2010-06-07T01:44:00.000
3
0.066568
false
2,986,659
0
0
1
2
I have been reading some django tutorial and it seems like all the view functions have to go in a file called "views.py" and all the models go in "models.py". I fear that I might end up with a lot of view functions in my view.py file and the same is the case with models.py. Is my understanding of django apps correct? Django apps lets us separate common functionality into different apps and keep the file size of views and models to a minimum? For example: My project can contain an app for recipes (create, update, view, and search) and a friend app, the comments app, and so on. Can I still move some of my view functions to a different file? So I only have the CRUD in one single file?
what should i do after openid (or twitter ,facebook) user login my site ,on gae
2,988,807
1
0
264
0
python,google-app-engine,openid,integration
I understand your question. You wish to be able to maintain a list of users that have signed up with your service, and also want to record users using OpenID to authenticate. In order to solve this I would do either of the following: Create a new user in your users table for each new user logged in under OpenID, and store their OpenID in this table to allow you to join the two. Move your site to OpenID and change all references to your current users to OpenID users. I'd probably go with Option 1 if you already have this app in production. Note: More experienced Open ID users will probably correct me!
0
1
0
0
2010-06-07T02:24:00.000
1
0.197375
false
2,986,766
0
0
1
1
how to integration local user and openid(or facebook twitter) user , did you know some framework have already done this , updated my mean is : how to deal with 'local user' and 'openid user', and how to mix them in one model . please give me a framework that realize 'local user' and 'openid user'
Read -> change -> save. Thread safe
2,989,839
0
0
249
0
python,google-app-engine,thread-safety
memcache is 'just' a cache, and in its usual guise it's not suitable for an atomic data store, which is what you're trying to use it for. I'd suggest using the GAE datastore instead, which is designed for this sort of issue.
0
0
0
0
2010-06-07T06:18:00.000
4
0
false
2,987,429
0
0
1
1
This code should automatically connect players when they enter a game. But the problem is when two users try to connect at the same time - in this case 2nd user can easily overwrite changes made by 1st user ('room_1' variable). How could I make it thread safe? def join(userId): users = memcache.get('room_1') users.append(userId) memcache.set('room_1', users) return users I'm using Google App Engine (python) and going to implement simple game-server for exchanging peers given by Adobe Stratus.
Avoid 404 page override
2,998,022
0
0
87
0
python,django
Within the templates folder, there is should be a 404.html. Remove that, and django defaults to the standard 404 page!
0
0
0
0
2010-06-08T13:39:00.000
1
0
false
2,997,764
0
0
1
1
I 'm using django-lfs with default django-app.Its appear django-lfs override 404 default template. How to avoid this process
what is the recommended way of running a embedded web server within a desktop app (say wsgi server with pyqt)
3,003,086
6
6
2,601
0
python,user-interface,desktop,pyqt,wsgi
Use something like CherryPy or paste.httpserver. You can use wsgiref's server, and it generally works okay locally, but if you are doing Ajax the single-threaded nature of wsgiref can cause some odd results, or if you ever do a subrequest you'll get a race condition. But for most cases it'll be fine. It might be useful to you not to have an embedded threaded server (both CherryPy and paste.httpserver are threaded), in which case wsgiref would be helpful (all requests will run from the same thread). Note that if you use CherryPy or paste.httpserver all requests will automatically happen in subthreads (those packages do the thread spawning for you), and you probably will not be able to directly touch the GUI code from your web code (since GUI code usually doesn't like to be handled by threads). For any of them the server code blocks, so you need to spawn a thread to start the server in. Twisted can run in your normal GUI event loop, but unless that's important it adds a lot of complexity. Do not use BaseHTTPServer or SimpleHTTPServer, they are silly and complicated and in all cases where you might use then you should use wsgiref instead. Every single case, as wsgiref is has a sane API (WSGI) while these servers have silly APIs.
0
0
0
0
2010-06-08T20:50:00.000
3
1.2
true
3,001,185
0
0
1
1
The desktop app should start the web server on launch and should shut it down on close. Assuming that the desktop is the only client allowed to connect to the web server, what is the best way to write this? Both the web server and the desktop run in a blocking loop of their own. So, should I be using threads or multiprocessing?
Fetching a random record from the Google App Engine Datastore?
3,003,170
23
21
5,002
0
python,google-app-engine,google-cloud-datastore
Assign each entity a random number and store it in the entity. Then query for ten records whose random number is greater than (or less than) some other random number. This isn't totally random, however, since entities with nearby random numbers will tend to show up together. If you want to beat this, do ten queries based around ten random numbers, but this will be less efficient.
0
1
0
0
2010-06-09T03:55:00.000
2
1.2
true
3,002,999
0
0
1
1
I have a datastore with around 1,000,000 entities in a model. I want to fetch 10 random entities from this. I am not sure how to do this? can someone help?
Is there a way to set a fixed width for the characters in HTML?
3,005,405
3
2
396
0
python,pyqt4,qtextedit
What you're asking for is called a fixed-width font. As James Hopkin remarked, HTML text in <tt> or <pre> tags is rendered with a fixed-width font. However, what you describe sounds like a table. HTML has direct support for that, with <table>, <tr> (row) and <td> (data/cell). Don't bother with fixed-width fonts; just put your A and the Z in the second <td> of their rows.
0
0
0
0
2010-06-09T10:45:00.000
2
1.2
true
3,005,063
0
0
1
2
Is there a way to set a fix size for the characters in HTML? That means, say … First row, 8th character is “Z” Second row’s 8th character is “A” I want to print out , when printed the “Z” has to be exactly on top of “A” *Note: I'm using the insertHtml method in QTextEdit()
Is there a way to set a fixed width for the characters in HTML?
3,005,297
0
2
396
0
python,pyqt4,qtextedit
Put the text in <tt> tags (or <pre> around a whole paragraph of text).
0
0
0
0
2010-06-09T10:45:00.000
2
0
false
3,005,063
0
0
1
2
Is there a way to set a fix size for the characters in HTML? That means, say … First row, 8th character is “Z” Second row’s 8th character is “A” I want to print out , when printed the “Z” has to be exactly on top of “A” *Note: I'm using the insertHtml method in QTextEdit()
Create event for another owner using Facebook Graph API
6,583,766
0
1
700
0
python,django,facebook
This is possible, using the access token provided for your page you can publish to this as you would with a user. If you want to post FROM the USER than you need to use the current user's access token, if you want to post FROM the PAGE then using the access token from the page you can publish to that
0
0
1
0
2010-06-09T12:12:00.000
1
0
false
3,005,640
0
0
1
1
I'm at the moment working on a web page where the users who visit it should have the possibility to create an event in my web page's name. There is a Page on Facebook for the web page which should be the owner of the user created event. Is this possible? All users are authenticated using Facebook Connect, but since the event won't be created in their name I don't know if that's so much of help. The Python SDK will be used since the event shall be implemented server side. / D
Python version 2.6 required, which was not found in the registry
13,910,180
0
57
72,470
0
python,installation
maybe your installer is i386 and your computer is AMD64. try to find the right package!
0
0
0
0
2010-06-09T18:01:00.000
9
0
false
3,008,509
1
0
1
3
Can't download any python Windows modules and install. I wanted to experiment with scrapy framework and stackless but unable to install due to error "Python version 2.6 required, which was not found in the registry". Trying to install it to Windows 7, 64 bit machine
Python version 2.6 required, which was not found in the registry
8,712,435
21
57
72,470
0
python,installation
For me this happens on a 32 bit system with activepython installed. It seams that the regs are not in HKEY_CURRENT_USER so here is what I do to fix that. Export the "Python" section under HKEY_LOCAL_MACHINE -> Software Open the export in notepad notepad. Replace "LOCAL_MACHINE" with "CURRENT_USER" Since I have 2.7 installed I also had to replace "2.7" with "2.6" (make sure that you do not affect the path which points to the installation of python). Over write the reg backup and run it. Now if you run the installation of whatever package you needed it will find python. This helped in my case but be aware that it might not work for you.
0
0
0
0
2010-06-09T18:01:00.000
9
1
false
3,008,509
1
0
1
3
Can't download any python Windows modules and install. I wanted to experiment with scrapy framework and stackless but unable to install due to error "Python version 2.6 required, which was not found in the registry". Trying to install it to Windows 7, 64 bit machine
Python version 2.6 required, which was not found in the registry
7,170,483
80
57
72,470
0
python,installation
I realize this question is a year old - but I thought I would contribute one additional bit of info in case anyone else is Googling for this answer. The issue only crops up on Win7 64-bit when you install Python "for all users". If you install it "for just me", you should not receive these errors. It seems that a lot of installers only look under HKEY_CURRENT_USER for the required registry settings, and not under HKEY_LOCAL_MACHINE. The page linked by APC gives details on how to manually copy the settings to HKEY_CURRENT_USER. Or here's the PowerShell command to do this: cp -rec HKLM:\SOFTWARE\Python\ HKCU:\SOFTWARE
0
0
0
0
2010-06-09T18:01:00.000
9
1
false
3,008,509
1
0
1
3
Can't download any python Windows modules and install. I wanted to experiment with scrapy framework and stackless but unable to install due to error "Python version 2.6 required, which was not found in the registry". Trying to install it to Windows 7, 64 bit machine
how to make a chat room on gae ,has any audio python-framework to do this?
3,020,384
0
0
749
0
python,google-app-engine,audio,chat
You'll need two things: A browser plugin to get audio. You could build this on top of eg. http://code.google.com/p/libjingle/'>libjingle which has the advantage of being cross-platform and allowing P2P communication, not to mention being able to talk to arbitrary other XMPP endoints. Or you could use Flash to grab the audio and bounce the stream off a server you build (I think trying to do STUN in Flash for P2P would be impossible), but this would be very tricky to do in App Engine because you'd need it to be long-running. A way to get signaling messages between your clients. You'll have to poll until the Channel API is released (soon). This is a big hairy problem, to put it mildly, but it would be awesome if you did it.
0
1
0
0
2010-06-10T08:07:00.000
4
0
false
3,012,661
0
0
1
3
i want to make a chat room on gae ,(audio chat) has any framework to do this ? thanks
how to make a chat room on gae ,has any audio python-framework to do this?
3,080,160
1
0
749
0
python,google-app-engine,audio,chat
Try Adobe Stratus (it works with p2p connections) and you could use Google App Engine only for exchanging peer ids.
0
1
0
0
2010-06-10T08:07:00.000
4
0.049958
false
3,012,661
0
0
1
3
i want to make a chat room on gae ,(audio chat) has any framework to do this ? thanks
how to make a chat room on gae ,has any audio python-framework to do this?
3,013,054
1
0
749
0
python,google-app-engine,audio,chat
App Engine doesn't directly support audio chat of any sort, and since it's based around a request-response system with (primarily) HTTP requests, you can't implement it yourself.
0
1
0
0
2010-06-10T08:07:00.000
4
1.2
true
3,012,661
0
0
1
3
i want to make a chat room on gae ,(audio chat) has any framework to do this ? thanks
How do Django signals work?
3,012,925
18
5
2,048
0
python,django,signals
Django signals are synchronous. The handlers are executed as soon as the signal is fired, and control returns only when all appropriate handlers have finished.
0
0
0
0
2010-06-10T08:40:00.000
2
1.2
true
3,012,863
0
0
1
1
How does Django's event routing system work?
Sequence and merge jpeg images using Python?
3,013,162
2
1
634
0
python,linux,pdf,merge,jpeg
Not exactly knowing what you mean my sequence - ImageMagick, esp. its 'montage' is probably the tool you need. IM has python interface, too, altough I have never used it. EDIT: As after your edit I do not get the point of this any more, I cannot recommend anything, either. :(
0
0
0
0
2010-06-10T09:21:00.000
1
0.379949
false
3,013,134
0
0
1
1
im doing a project as part of academic programme.Im doing this in linux platform.here i wanted to create a application which retrieve some information from some pdf files .for eg i have pdfs of subject2,subject1,in both the whole pdf is divided in to 4 modules and i want to get the data of module 1 from pdf..for this purpose my tutor told me to use pdftohtml application and convert pdf files to html and jpeg images.now i want to create a Python script which will combine the pages(which have been coverted in to jpeg images) under module 1 and merge it into a single file and then i will convert it back to pdf . how can i do this?.if anyone can provide any such python script which have done any functions similar to this then it will be very helpful. .... thanks in advance
Editing django code within django - Django
3,015,914
3
1
135
0
python,django
Providing an editing interface is one half of the battle but it's pretty straightforward. There are already apps out there to provide editing of templates and media files so it's pretty much just an extension of that. The hardest part is restarting the server which would have to happen in order for the new code to be compiled. I don't think there's a way to do this from within the server so here's how I would do it: When you make an edit, create a new file in the project root. eg an empty file called restart. Write an bash script to look for that file, if it exists, restart the site and delete the file. Cron the script to run once every 10 seconds. It shouldn't use any meaningful resources. One serious issue is if you introduce bugs. You could test-compile (ie running the dev-server before you restart the site and check the input) but that's not very robust and you could easily end up in a situation where you lose access to the site. As that's the case, it might be wise to set up the editor as a completely separate site so you're never locked out...
0
0
0
0
2010-06-10T15:24:00.000
2
0.291313
false
3,015,825
0
0
1
1
just wondering if it would be possible in some experimental way, to edit django app code within django safely to then refresh the compiled files. Would be great if someone has tried something similar already or has some ideas. I would like to be able to edit small bits of code from a web interface, so I can easily maintain a couple of experimental projects. Help would be great! Thanks.
Fast Esp Custom Stage Development
3,421,127
0
0
816
0
python,stage,fast-esp
The FAST documentation (ESP Document Processor Integration Guide) has a pretty good example of how to write a custom document processor. FAST does not provide the source code to any of it's software, but the AttributeFilter stage functionality should be very straightforward.
0
0
0
0
2010-06-10T15:31:00.000
2
1.2
true
3,015,874
1
0
1
2
I am working on Enterprise Search and we are using Fast ESP and for now i have 4 projects but i have no information about stages and python. But i realize that i have learn custom stage development. Because we have a lot of difficulties about document processing. I want to know how can i develop custom stage and especially i wanna know about how i can find Attributefilter stage source code. I am waiting your answers
Fast Esp Custom Stage Development
47,027,134
0
0
816
0
python,stage,fast-esp
I had worked with FAST ESP for document processing and we used to modify the python files. you can modify them but you need to restart the document processor each time you modify any file. You need to search for document processing in the admin UI, there you go to the pipelines, and you can create a custom pipeline based on standard pipelines included in FAST ESP. Once you create your pipeline, then you can select the stage (python program) that you want to modify and the UI shows you the path of each script. I highly recommend you to create your custom stages for each pipeline you modify.
0
0
0
0
2010-06-10T15:31:00.000
2
0
false
3,015,874
1
0
1
2
I am working on Enterprise Search and we are using Fast ESP and for now i have 4 projects but i have no information about stages and python. But i realize that i have learn custom stage development. Because we have a lot of difficulties about document processing. I want to know how can i develop custom stage and especially i wanna know about how i can find Attributefilter stage source code. I am waiting your answers
How exactly does a python (django) request happen? does it have to reparse all the codebase?
3,018,777
5
2
207
0
python,django,pipeline,request-pipeline
With a scripting language like python (or php), things are not compiled down to bytecode like in .net or java. Wrong: everything you import in Python gets compiled to bytecode (and saved as .pyc files if you can write to the directory containing the source you're importing -- standard libraries &c are generally pre-compiled, depending on the installation choices of course). Just keep the main script short and simple (importing some module and calling a function in it) and you'll be using compiled bytecode throughout. (Python's compiler is designed to be extremely fast -- with implications including that it doesn't do a lot of otherwise reasonable optimizations -- but avoiding it altogether is still faster;-).
0
0
0
0
2010-06-10T21:32:00.000
2
1.2
true
3,018,690
0
0
1
2
With a scripting language like python (or php), things are not compiled down to bytecode like in .net or java. So does this mean that on every request, it has to go through the entire application and parse/compile it? Or at least all the code required for the given call stack?
How exactly does a python (django) request happen? does it have to reparse all the codebase?
3,018,704
3
2
207
0
python,django,pipeline,request-pipeline
When running as CGI, yes, the entire project needs to be loaded for each request. FastCGI and mod_wsgi keep the project in memory and talk to it over a socket.
0
0
0
0
2010-06-10T21:32:00.000
2
0.291313
false
3,018,690
0
0
1
2
With a scripting language like python (or php), things are not compiled down to bytecode like in .net or java. So does this mean that on every request, it has to go through the entire application and parse/compile it? Or at least all the code required for the given call stack?
wav file manupalation
3,021,073
0
1
660
0
python,wav
NumPy can load the data into arrays for easy manipulation. Or SciPy. I forget which.
1
0
0
0
2010-06-11T07:45:00.000
3
0
false
3,021,046
0
0
1
1
I want get the details of the wave such as its frames into a array of integers. Using fname.getframes we can ge the properties of the frame and save in list or anything for writing into another wav or anything,but fname.getframes gives information not in integers some thing like a "/xt/x4/0w' etc.. But i want them in integer so that would be helpful for manupation and smoothening join of 2 wav files
Web application architecture, and application servers?
3,022,395
2
3
1,161
1
php,python,model-view-controller,cakephp,application-server
How do go about implementing this? Too big a question for an answer here. Certainly you don't want 2 sets of code for the scraping (1 for scheduled, 1 for demand) in addition to the added complication, you really don't want to be running job which will take an indefinite time to complete within the thread generated by a request to your webserver - user requests for a scrape should be run via the scheduling mechanism and reported back to users (although if necessary you could use Ajax polling to give the illusion that it's happening in the same thread). What frame work(s) should I use? Frameworks are not magic bullets. And you shouldn't be choosing a framework based primarily on the nature of the application you are writing. Certainly if specific, critical functionality is precluded by a specific framework, then you are using the wrong framework - but in my experience that has never been the case - you just need to write some code yourself. using something more complex than a cron job Yes, a cron job is probably not the right way to go for lots of reasons. If it were me I'd look at writing a daemon which would schedule scrapes (and accept connections from web page scripts to enqueue additional scrapes). But I'd run the scrapes as separate processes. Is MVC a good architecture for this? (I'm new to MVC, architectures etc.) No. Don't start by thinking whether a pattern fits the application - patterns are a useful tool for teaching but describe what code is not what it will be (Your application might include some MVC patterns - but it should also include lots of other ones). C.
0
0
0
0
2010-06-11T10:12:00.000
2
1.2
true
3,021,921
0
0
1
1
I'm building a web application, and I need to use an architecture that allows me to run it over two servers. The application scrapes information from other sites periodically, and on input from the end user. To do this I'm using Php+curl to scrape the information, Php or python to parse it and store the results in a MySQLDB. Then I will use Python to run some algorithms on the data, this will happen both periodically and on input from the end user. I'm going to cache some of the results in the MySQL DB and sometimes if it is specific to the user, skip storing the data and serve it to the user. I'm think of using Php for the website front end on a separate web server, running the Php spider, MySQL DB and python on another server. What frame work(s) should I use for this kind of job? Is MVC and Cakephp a good solution? If so will I be able to control and monitor the Python code using it? Thanks
How to merge or copy anonymous session data into user data when user logs in?
3,024,470
1
0
140
0
python,session,e-commerce,web.py
If very much depends on your system ofcourse. But personally I always try to merge the data and immediately store it in the same way as it would be stored as when the user would be logged in. So if you store it in a session for an anonymous user and in the database for any authenticated user. Just merge all data as soon as you login.
0
0
0
0
2010-06-11T15:44:00.000
1
0.197375
false
3,024,191
0
0
1
1
This is a general question, or perhaps a request for pointers to other open source projects to look at: I'm wondering how people merge an anonymous user's session data into the authenticated user data when a user logs in. For example, someone is browsing around your websites saving various items as favourites. He's not logged in, so they're saved to an anonymous user's data. Then he logs in, and we need to merge all that data into their (possibly existing) user data. Is this done different ways in an ad-hoc fashion for different applications? Or are there some best practices or other projects people can direct me to?
Google App Engine - update_indexes error
3,025,435
1
1
221
0
java,python,google-app-engine,google-cloud-datastore
I followed what was suggested in the error logs and that worked for me: Empty the index.yaml file (create a backup first) Run vacuum_indexes again Look at your app's admin console and don't go to the next step till all your indexes are deleted. Specify the indexes you want to be created in index.yaml Run update_indexes Look at your app's admin console and it should show that your indexes are now building. Enjoy the fruits of your labor :) Cheers, Keyur
0
1
0
0
2010-06-11T16:55:00.000
1
0.197375
false
3,024,663
0
0
1
1
I have a Java app deployed on app engine and I use appcfg.py of the Python SDK to vacuum and update my indexes. Yesterday I first ran vacuum_indexes and that completed successfully - i.e. it en-queued tasks to delete my existing indexes. The next step was probably a mistake on my part - I then ran update_indexes even though my previous indexes weren't yet deleted. Needless to say that my update_indexes call errored out. So much so that now when I look at my app engine console, it shows the status of all my indexes as "Error". A day has passed an it still shows the status on my indexes as "Error". Can someone help my out of my fix?! Thanks, Keyur P.S.: I have posted this on the GAE forums as well but hoping SO users have faced and resolved this issue as well.
Python module being reloaded for each request with django and mod_wsgi
3,027,902
1
2
629
0
python,django,apache,mod-wsgi
I guess, you had a value of 1 for MaxClients / MaxRequestsPerChild and/or ThreadsPerChild in your Apache settings. So Apache had to startup Django for every mod_python call. That's why it took so long. If you have a wsgi-daemon, then a restart takes only place if you "touch" the wsgi script.
0
0
0
1
2010-06-11T18:46:00.000
2
0.099668
false
3,025,378
0
0
1
2
I have a variable in init of a module which get loaded from the database and takes about 15 seconds. For django development server everything is working fine but looks like with apache2 and mod_wsgi the module is loaded with every request (taking 15 seconds). Any idea about this behavior? Update: I have enabled daemon mode in mod wsgi, looks like its not reloading the modules now! needs more testing and I will update.
Python module being reloaded for each request with django and mod_wsgi
3,032,332
3
2
629
0
python,django,apache,mod-wsgi
You were likely ignoring the fact that in embedded mode of mod_wsgi or with mod_python, the application is multiprocess. Thus requests may go to different processes and you will see a delay the first time a process which hasn't been hit before is encountered. In mod_wsgi daemon mode the default has only a single process. That or as someone else mentioned you had MaxRequestsPerChild set to 1, which is a really bad idea.
0
0
0
1
2010-06-11T18:46:00.000
2
1.2
true
3,025,378
0
0
1
2
I have a variable in init of a module which get loaded from the database and takes about 15 seconds. For django development server everything is working fine but looks like with apache2 and mod_wsgi the module is loaded with every request (taking 15 seconds). Any idea about this behavior? Update: I have enabled daemon mode in mod wsgi, looks like its not reloading the modules now! needs more testing and I will update.
Templates vs. coded HTML
3,026,766
1
5
2,377
0
python,html,templates
I would highly recommend using templates. Templates help to encourage a good MVC structure to your application. Python code that emits HTML, IMHO, is wrong. The reason I say that is because Python code should be responsible for doing logic and not have to worry about presentation. Template syntax is usually restrictive enough that you can't really do much logic within the template, but you can do any presentation specific type logic that you may need. ymmv.
0
0
0
0
2010-06-11T22:48:00.000
5
0.039979
false
3,026,731
0
0
1
1
I have a web-app consisting of some html forms for maintaining some tables (SQlite, with CherryPy for web-server stuff). First I did it entirely 'the Python way', and generated html strings via. code, with common headers, footers, etc. defined as functions in a separate module. I also like the idea of templates, so I tried Jinja2, which I find quite developer-friendly. In the beginning I thought templates were the way to go, but that was when pages were simple. Once .css and .js files were introduced (not necessarily in the same folder as the .html files), and an ever-increasing number of {{...}} variables and {%...%} commands were introduced, things started getting messy at design-time, even though they looked great at run-time. Things got even more difficult when I needed additional javascript in the or sections. As far as I can see, the main advantages of using templates are: Non-dynamic elements of page can easily be viewed in browser during design. Except for {} placeholders, html is kept separate from python code. If your company has a web-page designer, they can still design without knowing Python. while some disadvantages are: {{}} delimiters visible when viewed at design-time in browser Associated .css and .js files have to be in same folder to see effects in browser at design-time. Data, variables, lists, etc., must be prepared in advanced and either declared globally or passed as parameters to render() function. So - when to use 'hard-coded' HTML, and when to use templates? I am not sure of the best way to go, so I would be interested to hear other developers' views. TIA, Alan
What is the best way to implement a 'last seen' function in a django web app?
3,033,505
1
7
1,321
0
python,django,apache2
You need to persist the info server-side, integrity isn't critical, throughput and latency are important. That means you should use some sort of key-value store. Memcached and redis have keys that expire. You probably have memcached already installed, so use that. You can reset expiry time of the user:last-seen:$username key every visit, or you can use mawimawi's cookie technique and have expiry = 4 * cookie-lifetime.
0
0
0
0
2010-06-12T08:12:00.000
4
0.049958
false
3,027,973
0
0
1
4
I have a running django/apache2 + memcached app (ubuntu) and would like to keep track of logged in users that are online. What would be the best way to track this? I would prefer not writing to the database each time a logged in user loads a page; but what other options are there?
What is the best way to implement a 'last seen' function in a django web app?
3,028,869
0
7
1,321
0
python,django,apache2
You can't do that in django without using a database/persistent-storage because of the same reason why django sessions are stored in database: There can be multiple instances of your applications running and the must synchronize their states+data through a single persistence source [1] Alternatively, you might want to write this information in a folder in a file named with user id and then check its create/modified date to find the required information.
0
0
0
0
2010-06-12T08:12:00.000
4
0
false
3,027,973
0
0
1
4
I have a running django/apache2 + memcached app (ubuntu) and would like to keep track of logged in users that are online. What would be the best way to track this? I would prefer not writing to the database each time a logged in user loads a page; but what other options are there?
What is the best way to implement a 'last seen' function in a django web app?
3,028,094
1
7
1,321
0
python,django,apache2
A hashmap or a queue in memory with a task running every hour or so to persist it.
0
0
0
0
2010-06-12T08:12:00.000
4
0.049958
false
3,027,973
0
0
1
4
I have a running django/apache2 + memcached app (ubuntu) and would like to keep track of logged in users that are online. What would be the best way to track this? I would prefer not writing to the database each time a logged in user loads a page; but what other options are there?
What is the best way to implement a 'last seen' function in a django web app?
3,028,086
4
7
1,321
0
python,django,apache2
An approach might be: you create a middleware that does the following on process_response: check for a cookie called 'online', but only if the user is authenticated if the cookie is not there, set a cookie called 'online' with value '1' set the lifespan of the cookie to 10 minutes update the 'last_login' field of auth.User for this user with the current datetime now you have all currently logged in users in your auth.User table. All Users that have a last_login newer than datetime.now()-interval(15minutes) might be considered "online". The database will be written for every logged in user about every 10 minutes. Adjust the values "10" and "15" to your needs. The advantage here is that database writes are rare (according to your two numeric settings 10/15). And for speed optimization make sure that last_login is indexed, so a filter on this field including Count is really fast. Hope this helps.
0
0
0
0
2010-06-12T08:12:00.000
4
0.197375
false
3,027,973
0
0
1
4
I have a running django/apache2 + memcached app (ubuntu) and would like to keep track of logged in users that are online. What would be the best way to track this? I would prefer not writing to the database each time a logged in user loads a page; but what other options are there?
Where is the Google App Engine SDK path on OSX?
3,030,645
60
31
17,766
0
python,eclipse,google-app-engine,pydev
/usr/local/google_appengine - that's a symlink that links to the SDK.
0
1
0
0
2010-06-13T00:14:00.000
3
1.2
true
3,030,585
0
0
1
2
I need to know for creating a Pydev Google App Engine Project in Eclipse.
Where is the Google App Engine SDK path on OSX?
5,189,889
28
31
17,766
0
python,eclipse,google-app-engine,pydev
/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine
0
1
0
0
2010-06-13T00:14:00.000
3
1
false
3,030,585
0
0
1
2
I need to know for creating a Pydev Google App Engine Project in Eclipse.
is there any way to enforce the 30 seconds limit on local appengine dev server?
3,031,594
1
3
138
0
python,django,google-app-engine
It's possible, as Alex demonstrates, but it's not really a good idea: The performance characteristics of the development server are not the same as those of the production environment, so something that executes quickly locally may not be nearly as quick in production, and vice versa. Also, your user facing tasks should definitely not be so slow as to approach the 30 second limit.
0
1
0
0
2010-06-13T00:22:00.000
2
0.099668
false
3,030,593
0
0
1
1
Hey, i was wondering if there is a way to enforce the 30 seconds limit that is being enforced online at the appengine production servers to the local dev server? its impossible to test if i reach the limit before going production. maybe some django middlware?
uWSGI with Cherokee: first steps
5,033,390
1
2
2,309
0
python,wsgi,cherokee,uwsgi
There seems to be an issue with the 'make' method of installation on the uwsgi docs. Use 'python uwsgiconfig.py --build' instead. That worked for me. Cherokee, Django running on Ubuntu 10.10.
0
1
0
1
2010-06-13T03:16:00.000
3
0.066568
false
3,030,936
0
0
1
1
Has anyone tried using uWSGI with Cherokee? Can you share your experiences and what documents you relied upon the most? I am trying to get started from the documentation on both (uWSGI and Cherokee) websites. Nothing works yet. I am using Ubuntu 10.04. Edit: To clarify, Cherokee has been working fine. I am getting the error message: uWSGI Error, wsgi application not found So something must be wrong with my configurations. Or maybe my application.
Which programming language for compute-intensive trading portfolio simulation?
3,031,234
5
5
995
0
java,python,trading
Pick the language you are most familiar with. If you know them all equally and speed is a real concern, pick C.
0
0
0
1
2010-06-13T05:45:00.000
7
0.141893
false
3,031,225
0
0
1
6
I am building a trading portfolio management system that is responsible for production, optimization, and simulation of non-high frequency trading portfolios (dealing with 1min or 3min bars of data, not tick data). I plan on employing Amazon web services to take on the entire load of the application. I have four choices that I am considering as language. Java C++ C# Python Here is the scope of the extremes of the project scope. This isn't how it will be, maybe ever, but it's within the scope of the requirements: Weekly simulation of 10,000,000 trading systems. (Each trading system is expected to have its own data mining methods, including feature selection algorithms which are extremely computationally-expensive. Imagine 500-5000 features using wrappers. These are not run often by any means, but it's still a consideration) Real-time production of portfolio w/ 100,000 trading strategies Taking in 1 min or 3 min data from every stock/futures market around the globe (approx 100,000) Portfolio optimization of portfolios with up to 100,000 strategies. (rather intensive algorithm) Speed is a concern, but I believe that Java can handle the load. I just want to make sure that Java CAN handle the above requirements comfortably. I don't want to do the project in C++, but I will if it's required. The reason C# is on there is because I thought it was a good alternative to Java, even though I don't like Windows at all and would prefer Java if all things are the same. Python - I've read somethings on PyPy and pyscho that claim python can be optimized with JIT compiling to run at near C-like speeds... That's pretty much the only reason it is on this list, besides that fact that Python is a great language and would probably be the most enjoyable language to code in, which is not a factor at all for this project, but a perk. To sum up: real time production weekly simulations of a large number of systems weekly/monthly optimizations of portfolios large numbers of connections to collect data from There is no dealing with millisecond or even second based trades. The only consideration is if Java can possibly deal with this kind of load when spread out of a necessary amount of EC2 servers. Thank you guys so much for your wisdom.
Which programming language for compute-intensive trading portfolio simulation?
3,031,266
4
5
995
0
java,python,trading
Write it in your preferred language. To me that sounds like python. When you start running the system you can profile it and see where the bottlenecks are. Once you do some basic optimisations if it's still not acceptable you can rewrite portions in C. A consideration could be writing this in iron python to take advantage of the clr and dlr in .net. Then you can leverage .net 4 and parallel extensions. If anything will give you performance increases it'll be some flavour of threading which .net does extremely well. Edit: Just wanted to make this part clear. From the description, it sounds like parallel processing / multithreading is where the majority of the performance gains are going to come from.
0
0
0
1
2010-06-13T05:45:00.000
7
0.113791
false
3,031,225
0
0
1
6
I am building a trading portfolio management system that is responsible for production, optimization, and simulation of non-high frequency trading portfolios (dealing with 1min or 3min bars of data, not tick data). I plan on employing Amazon web services to take on the entire load of the application. I have four choices that I am considering as language. Java C++ C# Python Here is the scope of the extremes of the project scope. This isn't how it will be, maybe ever, but it's within the scope of the requirements: Weekly simulation of 10,000,000 trading systems. (Each trading system is expected to have its own data mining methods, including feature selection algorithms which are extremely computationally-expensive. Imagine 500-5000 features using wrappers. These are not run often by any means, but it's still a consideration) Real-time production of portfolio w/ 100,000 trading strategies Taking in 1 min or 3 min data from every stock/futures market around the globe (approx 100,000) Portfolio optimization of portfolios with up to 100,000 strategies. (rather intensive algorithm) Speed is a concern, but I believe that Java can handle the load. I just want to make sure that Java CAN handle the above requirements comfortably. I don't want to do the project in C++, but I will if it's required. The reason C# is on there is because I thought it was a good alternative to Java, even though I don't like Windows at all and would prefer Java if all things are the same. Python - I've read somethings on PyPy and pyscho that claim python can be optimized with JIT compiling to run at near C-like speeds... That's pretty much the only reason it is on this list, besides that fact that Python is a great language and would probably be the most enjoyable language to code in, which is not a factor at all for this project, but a perk. To sum up: real time production weekly simulations of a large number of systems weekly/monthly optimizations of portfolios large numbers of connections to collect data from There is no dealing with millisecond or even second based trades. The only consideration is if Java can possibly deal with this kind of load when spread out of a necessary amount of EC2 servers. Thank you guys so much for your wisdom.
Which programming language for compute-intensive trading portfolio simulation?
3,031,544
4
5
995
0
java,python,trading
I would pick Java for this task. In terms of RAM, the difference between Java and C++ is that in Java, each Object has an overhead of 8 Bytes (using the Sun 32-bit JVM or the Sun 64-bit JVM with compressed pointers). So if you have millions of objects flying around, this can make a difference. In terms of speed, Java and C++ are almost equal at that scale. So the more important thing for me is the development time. If you make a mistake in C++, you get a segmentation fault (and sometimes you don't even get that), while in Java you get a nice Exception with a stack trace. I have always preferred this. In C++ you can have collections of primitive types, which Java hasn't. You would have to use external libraries to get them. If you have real-time requirements, the Java garbage collector may be a nuisance, since it takes some minutes to collect a 20 GB heap, even on machines with 24 cores. But if you don't create too many temporary objects during runtime, that should be fine, too. It's just that your program can make that garbage collection pause whenever you don't expect it.
0
0
0
1
2010-06-13T05:45:00.000
7
1.2
true
3,031,225
0
0
1
6
I am building a trading portfolio management system that is responsible for production, optimization, and simulation of non-high frequency trading portfolios (dealing with 1min or 3min bars of data, not tick data). I plan on employing Amazon web services to take on the entire load of the application. I have four choices that I am considering as language. Java C++ C# Python Here is the scope of the extremes of the project scope. This isn't how it will be, maybe ever, but it's within the scope of the requirements: Weekly simulation of 10,000,000 trading systems. (Each trading system is expected to have its own data mining methods, including feature selection algorithms which are extremely computationally-expensive. Imagine 500-5000 features using wrappers. These are not run often by any means, but it's still a consideration) Real-time production of portfolio w/ 100,000 trading strategies Taking in 1 min or 3 min data from every stock/futures market around the globe (approx 100,000) Portfolio optimization of portfolios with up to 100,000 strategies. (rather intensive algorithm) Speed is a concern, but I believe that Java can handle the load. I just want to make sure that Java CAN handle the above requirements comfortably. I don't want to do the project in C++, but I will if it's required. The reason C# is on there is because I thought it was a good alternative to Java, even though I don't like Windows at all and would prefer Java if all things are the same. Python - I've read somethings on PyPy and pyscho that claim python can be optimized with JIT compiling to run at near C-like speeds... That's pretty much the only reason it is on this list, besides that fact that Python is a great language and would probably be the most enjoyable language to code in, which is not a factor at all for this project, but a perk. To sum up: real time production weekly simulations of a large number of systems weekly/monthly optimizations of portfolios large numbers of connections to collect data from There is no dealing with millisecond or even second based trades. The only consideration is if Java can possibly deal with this kind of load when spread out of a necessary amount of EC2 servers. Thank you guys so much for your wisdom.
Which programming language for compute-intensive trading portfolio simulation?
3,031,844
3
5
995
0
java,python,trading
Why only one language for your system? If I were you, I will build the entire system in Python, but C or C++ will be used for performance-critical components. In this way, you will have a very flexible and extendable system with fast-enough performance. You can find even tools to generate wrappers automatically (e.g. SWIG, Cython). Python and C/C++/Java/Fortran are not competing each other; they are complementing.
0
0
0
1
2010-06-13T05:45:00.000
7
0.085505
false
3,031,225
0
0
1
6
I am building a trading portfolio management system that is responsible for production, optimization, and simulation of non-high frequency trading portfolios (dealing with 1min or 3min bars of data, not tick data). I plan on employing Amazon web services to take on the entire load of the application. I have four choices that I am considering as language. Java C++ C# Python Here is the scope of the extremes of the project scope. This isn't how it will be, maybe ever, but it's within the scope of the requirements: Weekly simulation of 10,000,000 trading systems. (Each trading system is expected to have its own data mining methods, including feature selection algorithms which are extremely computationally-expensive. Imagine 500-5000 features using wrappers. These are not run often by any means, but it's still a consideration) Real-time production of portfolio w/ 100,000 trading strategies Taking in 1 min or 3 min data from every stock/futures market around the globe (approx 100,000) Portfolio optimization of portfolios with up to 100,000 strategies. (rather intensive algorithm) Speed is a concern, but I believe that Java can handle the load. I just want to make sure that Java CAN handle the above requirements comfortably. I don't want to do the project in C++, but I will if it's required. The reason C# is on there is because I thought it was a good alternative to Java, even though I don't like Windows at all and would prefer Java if all things are the same. Python - I've read somethings on PyPy and pyscho that claim python can be optimized with JIT compiling to run at near C-like speeds... That's pretty much the only reason it is on this list, besides that fact that Python is a great language and would probably be the most enjoyable language to code in, which is not a factor at all for this project, but a perk. To sum up: real time production weekly simulations of a large number of systems weekly/monthly optimizations of portfolios large numbers of connections to collect data from There is no dealing with millisecond or even second based trades. The only consideration is if Java can possibly deal with this kind of load when spread out of a necessary amount of EC2 servers. Thank you guys so much for your wisdom.
Which programming language for compute-intensive trading portfolio simulation?
3,035,998
5
5
995
0
java,python,trading
While I am a huge fan of Python and personaly I'm not a great lover of Java, in this case I have to concede that Java is the right way to go. For many projects Python's performance just isn't a problem, but in your case even minor performance penalties will add up extremely quickly. I know this isn't a real-time simulation, but even for batch processing it's still a factor to take into consideration. If it turns out the load is too big for one virtual server, an implementation that's twice as fast will halve your virtual server costs. For many projects I'd also argue that Python will allow you to develop a solution faster, but here I'm not sure that would be the case. Java has world-class development tools and top-drawer enterprise grade frameworks for parallell processing and cross-server deployment and while Python has solutions in this area, Java clearly has the edge. You also have architectural options with Java that Python can't match, such as Javaspaces. I would argue that C and C++ impose too much of a development overhead for a project like this. They're viable inthat if you are very familiar with those languages I'm sure it would be doable, but other than the potential for higher performance, they have nothing else to bring to the table. C# is just a rewrite of Java. That's not a bad thing if you're a Windows developer and if you prefer Windows I'd use C# rather than Java, but if you don't care about Windows there's no reason to care about C#.
0
0
0
1
2010-06-13T05:45:00.000
7
0.141893
false
3,031,225
0
0
1
6
I am building a trading portfolio management system that is responsible for production, optimization, and simulation of non-high frequency trading portfolios (dealing with 1min or 3min bars of data, not tick data). I plan on employing Amazon web services to take on the entire load of the application. I have four choices that I am considering as language. Java C++ C# Python Here is the scope of the extremes of the project scope. This isn't how it will be, maybe ever, but it's within the scope of the requirements: Weekly simulation of 10,000,000 trading systems. (Each trading system is expected to have its own data mining methods, including feature selection algorithms which are extremely computationally-expensive. Imagine 500-5000 features using wrappers. These are not run often by any means, but it's still a consideration) Real-time production of portfolio w/ 100,000 trading strategies Taking in 1 min or 3 min data from every stock/futures market around the globe (approx 100,000) Portfolio optimization of portfolios with up to 100,000 strategies. (rather intensive algorithm) Speed is a concern, but I believe that Java can handle the load. I just want to make sure that Java CAN handle the above requirements comfortably. I don't want to do the project in C++, but I will if it's required. The reason C# is on there is because I thought it was a good alternative to Java, even though I don't like Windows at all and would prefer Java if all things are the same. Python - I've read somethings on PyPy and pyscho that claim python can be optimized with JIT compiling to run at near C-like speeds... That's pretty much the only reason it is on this list, besides that fact that Python is a great language and would probably be the most enjoyable language to code in, which is not a factor at all for this project, but a perk. To sum up: real time production weekly simulations of a large number of systems weekly/monthly optimizations of portfolios large numbers of connections to collect data from There is no dealing with millisecond or even second based trades. The only consideration is if Java can possibly deal with this kind of load when spread out of a necessary amount of EC2 servers. Thank you guys so much for your wisdom.
Which programming language for compute-intensive trading portfolio simulation?
3,036,242
0
5
995
0
java,python,trading
It is useful to look at the inner loop of your numerical code. After all you will spend most of your CPU-time inside this loop. If the inner loop is a matrix operation, then I suggest python and scipy, but of the inner loop if not a matrix operation, then I would worry about python being slow. (Or maybe I would wrap c++ in python using swig or boost::python) The benefit of python is that it is easy to debug, and you save a lot of time by not having to compile all the time. This is especially useful for a project where you spend a lot of time programming deep internals.
0
0
0
1
2010-06-13T05:45:00.000
7
0
false
3,031,225
0
0
1
6
I am building a trading portfolio management system that is responsible for production, optimization, and simulation of non-high frequency trading portfolios (dealing with 1min or 3min bars of data, not tick data). I plan on employing Amazon web services to take on the entire load of the application. I have four choices that I am considering as language. Java C++ C# Python Here is the scope of the extremes of the project scope. This isn't how it will be, maybe ever, but it's within the scope of the requirements: Weekly simulation of 10,000,000 trading systems. (Each trading system is expected to have its own data mining methods, including feature selection algorithms which are extremely computationally-expensive. Imagine 500-5000 features using wrappers. These are not run often by any means, but it's still a consideration) Real-time production of portfolio w/ 100,000 trading strategies Taking in 1 min or 3 min data from every stock/futures market around the globe (approx 100,000) Portfolio optimization of portfolios with up to 100,000 strategies. (rather intensive algorithm) Speed is a concern, but I believe that Java can handle the load. I just want to make sure that Java CAN handle the above requirements comfortably. I don't want to do the project in C++, but I will if it's required. The reason C# is on there is because I thought it was a good alternative to Java, even though I don't like Windows at all and would prefer Java if all things are the same. Python - I've read somethings on PyPy and pyscho that claim python can be optimized with JIT compiling to run at near C-like speeds... That's pretty much the only reason it is on this list, besides that fact that Python is a great language and would probably be the most enjoyable language to code in, which is not a factor at all for this project, but a perk. To sum up: real time production weekly simulations of a large number of systems weekly/monthly optimizations of portfolios large numbers of connections to collect data from There is no dealing with millisecond or even second based trades. The only consideration is if Java can possibly deal with this kind of load when spread out of a necessary amount of EC2 servers. Thank you guys so much for your wisdom.
Eclipse + Django: How to get bytecode output when python source files change?
3,031,660
2
2
463
0
python,django,build-process,build,bytecode
You shouldn't ever need to 'compile' your .pyc files manually. This is always done automatically at runtime by the Python interpreter. In rare instances, such as when you delete an entire .py module, you may need to manually delete the corresponding .pyc. But there's no need to do any other manual compiling. What makes you think you need to do this?
0
0
0
1
2010-06-13T07:09:00.000
1
0.379949
false
3,031,383
0
0
1
1
Whenever I change my python source files in my Django project, the .pyc files become out of date. Of course that's because I need to recompile them in order to test them through my local Apache web server. I would like to get around this manual process by employing some automatic means of compiling them on save, or on build through Eclipse, or something like that. What's the best and proper way to do this?
Raising events and object persistence in Django
3,031,565
2
1
267
0
python,django
Something else to remember: You need to maintain a browser session with the remote site so that site knows which CAPTCHA you're trying to solve. Lots of webclients allow you to store your cookies and I'd suggest you dump them in the Django Session of the user you're doing the screen scraping for. Then load them back up when you submit the CAPTCHA. Here's how I see the full turn of events: User places search request Query remote site If not CAPTCHA, GOTO #10 Save remote cookies in local session Download image captcha (perhaps to session too?) Present CAPTCHA to your user and a form User Submits CAPTCHA You load up cookies from #4 and submit the form as a POST GOTO #3 Process the data off the page, present to user, high-five yourself.
0
0
0
0
2010-06-13T07:47:00.000
2
1.2
true
3,031,483
0
0
1
2
I have a tricky Django problem which didn't occur to me when I was developing it. My Django application allows a user to sign up and store his login credentials for a sites. The Django application basically allows the user to search this other site (by scraping content off it) and returns the result to the user. For each query, it does a couple of queries of the other site. This seemed to work fine but sometimes, the other site slaps me with a CAPTCHA. I've written the code to get the CAPTCHA image and I need to return this to the user so he can type it in but I don't know how. My search request (the query, the username and the password) in my Django application gets passed to a view which in turn calls the backend that does the scraping/search. When a CAPTCHA is detected, I'd like to raise a client side event or something on those lines and display the CAPTCHA to the user and wait for the user's input so that I can resume my search. I would somehow need to persist my backend object between calls. I've tried pickling it but it doesn't work because I get the Can't pickle 'lock' object error. I don't know to implement this though. Any help/ideas? Thanks a ton.
Raising events and object persistence in Django
6,689,964
0
1
267
0
python,django
request.session['name'] = variable will store it then, variable = request.session['name'] will retrieve it. Remember though, its not a database, just a simple session store and shouldn't be relied on for anything critical
0
0
0
0
2010-06-13T07:47:00.000
2
0
false
3,031,483
0
0
1
2
I have a tricky Django problem which didn't occur to me when I was developing it. My Django application allows a user to sign up and store his login credentials for a sites. The Django application basically allows the user to search this other site (by scraping content off it) and returns the result to the user. For each query, it does a couple of queries of the other site. This seemed to work fine but sometimes, the other site slaps me with a CAPTCHA. I've written the code to get the CAPTCHA image and I need to return this to the user so he can type it in but I don't know how. My search request (the query, the username and the password) in my Django application gets passed to a view which in turn calls the backend that does the scraping/search. When a CAPTCHA is detected, I'd like to raise a client side event or something on those lines and display the CAPTCHA to the user and wait for the user's input so that I can resume my search. I would somehow need to persist my backend object between calls. I've tried pickling it but it doesn't work because I get the Can't pickle 'lock' object error. I don't know to implement this though. Any help/ideas? Thanks a ton.
Why can't Django find my admin media files once I leave the built-in runserver?
3,032,552
2
3
1,064
0
python,django,django-admin
When I look into the source code of Django, I find out the reason. Somewhere in the django.core.management.commands.runserver module, a WSGIHandler object is wrapped inside an AdminMediaHandler. According to the document, AdminMediaHandler is a WSGI middleware that intercepts calls to the admin media directory, as defined by the ADMIN_MEDIA_PREFIX setting, and serves those images. Use this ONLY LOCALLY, for development! This hasn't been tested for security and is not super efficient. And that's why the admin media files can only be found automatically when I was using the test server. Now I just go ahead and set up the admin media url mapping manually :)
0
0
0
0
2010-06-13T14:18:00.000
3
1.2
true
3,032,519
0
0
1
1
When I was using the built-in simple server, everything is OK, the admin interface is beautiful: python manage.py runserver However, when I try to serve my application using a wsgi server with django.core.handlers.wsgi.WSGIHandler, Django seems to forget where the admin media files is, and the admin page is not styled at all: gunicorn_django How did this happen?
App Engine HTTP 500s
3,033,229
2
1
829
0
python,google-app-engine,http-error
I agree that the correlation between startup log messages and 500 errors is not necessarily causal. However, it could be and pocoa should take steps to ensure that his startup time is low and that time consuming tasks be deferred when possible. One log entry and one 500 error does not mean much, but a few with time correlated probably points to excessive startup costs.
0
1
0
0
2010-06-13T16:31:00.000
3
0.132549
false
3,033,009
0
0
1
1
This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application. I've handled all the situations, also DeadlineExceededError too. But sometimes I see these error messages in error logs. That request took about 10k ms, so it's not exceeded the limit too. But there is no other specific message about this error. All I know is that it returned HTTP 500. Is there anyone know the reason of these error messages? Thank you.
Storing task state between multiple django processes
3,036,073
0
0
537
0
python,django,transactions,multiprocessing,rabbitmq
This sounds brittle to me: You have a web app which posts to a queue and then inserts the initial state into the database. What happens if the consumer processes the message before the web app can commit the initial state? What happens if the web app tries to insert the new state while the DB is locked by the consumer? To fix this, the web app should add the initial state to the message and the consumer should be the only one ever writing to the DB. [EDIT] And you might also have an issue with logging. Check that races between the web app and the consumer produce the appropriate errors in the log by putting a message to the queue without modifying the DB. [EDIT2] Some ideas: How about showing just the number of pending tasks? For this, the web app could write into table 1 and the consumer writes into table 2 and the admin if would show the difference. Why can't the web app see the pending tasks which the consumer has in the queue? Maybe you should have two consumers. The first consumer just adds the task to the DB, commits and then sends a message to the second consumer with just the primary key of the new row. The admin iface could read the table while the second consumer writes to it. Last idea: Commit the transaction before you enqueue the message. For this, you simply have to send "commit" to the database. It will feel odd (and I certainly don't recommend it for any case) but here, it might make sense to commit the new row manually (i.e. before you return to your framework which handles the normal transaction logic).
0
1
0
0
2010-06-14T09:09:00.000
2
0
false
3,036,049
0
0
1
2
I am building a logging-bridge between rabbitmq messages and Django application to store background task state in the database for further investigation/review, also to make it possible to re-publish tasks via the Django admin interface. I guess it's nothing fancy, just a standard Producer-Consumer pattern. Web application publishes to message queue and inserts initial task state into the database Consumer, which is a separate python process, handles the message and updates the task state depending on task output The problem is, some tasks are missing in the db and therefore never executed. I suspect it's because Consumer receives the message earlier than db commit is performed. So basically, returning from Model.save() doesn't mean the transaction has ended and the whole communication breaks. Is there any way I could fix this? Maybe some kind of post_transaction signal I could use? Thank you in advance.
Storing task state between multiple django processes
3,036,410
0
0
537
0
python,django,transactions,multiprocessing,rabbitmq
Web application publishes to message queue and inserts initial task state into the database Do not do this. Web application publishes to the queue. Done. Present results via template and finish the web transaction. A consumer fetches from the queue and does things. For example, it might append to a log to the database for presentation to the user. The consumer may also post additional status to the database as it executes things. Indeed, many applications have multiple queues with multiple produce/consumer relationships. Each process might append things to a log. The presentation must then summarize the log entries. Often, the last one is a sufficient summary, but sometimes you need a count or information from earlier entries.
0
1
0
0
2010-06-14T09:09:00.000
2
0
false
3,036,049
0
0
1
2
I am building a logging-bridge between rabbitmq messages and Django application to store background task state in the database for further investigation/review, also to make it possible to re-publish tasks via the Django admin interface. I guess it's nothing fancy, just a standard Producer-Consumer pattern. Web application publishes to message queue and inserts initial task state into the database Consumer, which is a separate python process, handles the message and updates the task state depending on task output The problem is, some tasks are missing in the db and therefore never executed. I suspect it's because Consumer receives the message earlier than db commit is performed. So basically, returning from Model.save() doesn't mean the transaction has ended and the whole communication breaks. Is there any way I could fix this? Maybe some kind of post_transaction signal I could use? Thank you in advance.
Restarting IIS6 - Python
3,036,701
1
0
1,575
0
python,windows,django,iis,iis-6
I think that you can execute an iisreset via a commandline. I've never tried that with Django but it should work and be quite simple to implement.
0
0
0
0
2010-06-14T09:29:00.000
3
0.066568
false
3,036,157
0
0
1
1
I'm serving a Django app behind IIS 6. I'm wondering if I can restart IIS 6 within Python/Django and what one of the best ways to do would be. Help would be great!
Django admin, filter objects by ManyToMany reference
3,052,792
0
1
2,800
0
python,django,django-admin
Well, that's how I've done it. I made custom admin template "change_list.html". Custom template tag creates a list of all existing galleries. Filtering is made like this: class PhotoAdmin(admin.ModelAdmin): ... def queryset(self, request): if request.COOKIES.has_key("gallery"): gallery = Gallery.objects.filter(title_slug=request.COOKIES["gallery"]) if len(gallery)>0: return gallery[0].photos.all() return super(PhotoAdmin, self).queryset(request) Cookie is set with javascript.
0
0
0
0
2010-06-14T11:05:00.000
4
0
false
3,036,680
0
0
1
1
There's photologue application, simple photo gallery for django, implementing Photo and Gallery objects. Gallery object has ManyToMany field, which references Photo objects. I need to be able to get list of all Photos for a given Gallery. Is it possible to add Gallery filter to Photo's admin page? If it's possible, how to do it best?
Get number of results from Django's raw() query function
42,020,136
2
10
10,644
0
python,django,django-orm
Count Works on RawQuerySet ModelName.objects.raw("select 1 as id , COUNT(*) from modelnames_modelname")
0
0
0
0
2010-06-14T12:44:00.000
3
0.132549
false
3,037,273
0
0
1
1
I'm using a raw query and i'm having trouble finding out how to get the number of results it returns. Is there a way? edit .count() doesnt work. it returns: 'RawQuerySet' object has no attribute 'count'
Best practice- How to team-split a django project while still allowing code reusal
3,041,911
2
1
351
0
python,django,deployment
I doubt the amount of code reuse you can get between the two projects, given your organizational situation, is worth the headaches, organizational risks, and delay risks that it would entail -- after all your team can never rely on the other, since the ACME product needs to be rock solid, and therefore needs to be somewhat isolated of whatever mistakes/code bloopers the consultants make in their marketing side of the site. This being the case, I would, at most, have the ACME team sometimes release a few little underlying libraries for the other team's use... but even that is fraught, unless used with wildly severe constraints, since one of the bloopers the consultants may make is to code with dependencies on the library's implementation, so ACME basically cannot keep maintaining the library after releasing it for the consultants' use (ACME might think that keeping APIs constraints would be fine, but they can't deal with the other team's reuse-bloopers). Although one would need to know many specific details, it doesn't appear that the deep underlying commonality between the two teams' projects, at application layer, is all that much anyway (third party stable open-source projects providing common application-independent functionality can of course be used by either or both teams), so the costs of encouraging reuse would not correspond to commensurate returns anyway, from what we can judge looking from "out here".
0
0
0
0
2010-06-14T21:27:00.000
2
1.2
true
3,041,077
0
0
1
2
I know this sounds kind of vague, but please let me explain- I'm starting work on a brand new project, it will have two main components: "ACME PRODUCT" (think Gmail, Meebo, etc), and "THE SITE" (help, information, marketing stuff, promotional landing pages, etc lots of marketing-induced cruft). So basically the url /acme/* will load stuff in the uber cool ajaxy application, and every other URI will load stuff in the other site. Problem: "THE SITE" component is out of my hands, and will be handled by a consultants team that will work closely with marketing, And I and my team will work solely on the ACME PRODUCT. Question: How to set up the django project in such a way that we can have: Seperate releases. (They can push new marketing pages and functionality without having to worry about the state of our code. Maybe even separate Subversion "projects") Minimize impact (on our product) of whatever flying-unicorns-hocus-pocus the other team codes into the site. Still allow some code reusal. My main concern is that the ACME product needs to be rock solid, and therefore needs to be somewhat isolated of whatever mistakes/code bloopers the consultants make in their marketing side of the site. How have you handled this? Any ideas? Thanks!
Best practice- How to team-split a django project while still allowing code reusal
3,041,105
3
1
351
0
python,django,deployment
Django's componentization of apps means that you can have independent teams working on the various apps, with template tags and filters (and of course, normal Python functions) used for cross-app coupling.
0
0
0
0
2010-06-14T21:27:00.000
2
0.291313
false
3,041,077
0
0
1
2
I know this sounds kind of vague, but please let me explain- I'm starting work on a brand new project, it will have two main components: "ACME PRODUCT" (think Gmail, Meebo, etc), and "THE SITE" (help, information, marketing stuff, promotional landing pages, etc lots of marketing-induced cruft). So basically the url /acme/* will load stuff in the uber cool ajaxy application, and every other URI will load stuff in the other site. Problem: "THE SITE" component is out of my hands, and will be handled by a consultants team that will work closely with marketing, And I and my team will work solely on the ACME PRODUCT. Question: How to set up the django project in such a way that we can have: Seperate releases. (They can push new marketing pages and functionality without having to worry about the state of our code. Maybe even separate Subversion "projects") Minimize impact (on our product) of whatever flying-unicorns-hocus-pocus the other team codes into the site. Still allow some code reusal. My main concern is that the ACME product needs to be rock solid, and therefore needs to be somewhat isolated of whatever mistakes/code bloopers the consultants make in their marketing side of the site. How have you handled this? Any ideas? Thanks!
Where is Python language used?
3,043,222
2
45
123,495
0
python
Many websites uses Django or Zope/Plone web framework, these are written in Python. Python is used a lot for writing system administration software, usually when bash scripts (shell script) isn't up to the job, but going C/C++ is an overkill. This is also the spectrum where perl, awk, etc stands. Gentoo's emerge/portage is one example. Mercurial/HG is a distributed version control system (DVCS) written in python. Many desktop applications are also written in Python. The original Bittorrent was written in python. Python is also used as the scripting languages for GIMP, Inkscape, Blender, OpenOffice, etc. Python allows advanced users to write plugins and access advanced functionalities that cannot typically be used through a GUI.
0
0
0
0
2010-06-15T06:54:00.000
7
0.057081
false
3,043,085
1
0
1
2
I am a web developer and usually use PHP, JavaScript or MySQL. I have heard lot about Python. But I have no idea where it is used and why it is used. Just like PHP, ASP, ColdFusion, .NET are used to build websites, and C, C++, Java are used to build software or desktop apps. Where does Python fit in this? What can Python do that these other languages cannot do?
Where is Python language used?
3,043,192
1
45
123,495
0
python
Python is used for developing sites. It's more highlevel than php. Python is used for linux dekstop applications. For example, the most of Ubuntu configurations utilites are pythonic.
0
0
0
0
2010-06-15T06:54:00.000
7
0.028564
false
3,043,085
1
0
1
2
I am a web developer and usually use PHP, JavaScript or MySQL. I have heard lot about Python. But I have no idea where it is used and why it is used. Just like PHP, ASP, ColdFusion, .NET are used to build websites, and C, C++, Java are used to build software or desktop apps. Where does Python fit in this? What can Python do that these other languages cannot do?
Django: how to create sites dynamically?
8,602,597
0
1
737
0
python,django,sites
The django site framework will do that, but it can't server the site according to the domain name. You'll have to do that using you server such as Apache, Nginx, etc.
0
0
0
0
2010-06-15T14:19:00.000
2
0
false
3,046,036
0
0
1
1
I need to create an application for the company where I can create sites dynamically. For example, I need an admin interface (Django's admin is enough) where I can setup a new site and add some settings to it. Each site must hold a domain (domains can be manually added to apache conf, but if Django can handle it too would be awesome). Each site must be independent of the others, I mean, I shouldn't be able to see the data content of other sites but I can share same applications/models. I've seen the Django's Sites framework, but I'm not sure if it's possible to implement that way. Should I use Sites framework or create a new app that can handle sites better? What do you think?
Online job-searching is tedious. Help me automate it
3,048,460
1
7
567
0
python,ruby,regex,perl,nlp
Ok, this answer is probably not going to be helpful -- I will say that up front. But, in my opinion, merely thinking about the problem in this way is enough to get you hired at most places I've worked. My suggestion? Contact the hiring manager at any of the postings in which you have interest, tell them this is what you are doing. Tell them generically what you have coded so far, and ask for assistance in learning the patterns they use when writing their adverts. If I were on the receiving end of this letter, I think I would invite the person in for an interview.
0
0
0
0
2010-06-15T19:14:00.000
3
0.066568
false
3,048,268
1
0
1
2
Many job sites have broken searches that don't let you narrow down jobs by experience level. Even when they do, it's usually wrong. This requires you to wade through hundreds of postings that you can't apply for before finding a relevant one, quite tedious. Since I'd rather focus on writing cover letters etc., I want to write a program to look through a large number of postings, and save the URLs of just those jobs that don't require years of experience. I don't require help writing the scraper to get the html bodies of possibly relevant job posts. The issue is accurately detecting the level of experience required for the job. This should not be too difficult as job posts are usually very explicit about this ("must have 5 years experience in..."), but there may be some issues with overly simple solutions. In my case, I'm looking for entry-level positions. Often they don't say "entry-level", but inclusion of the words probably means the job should be saved. Next, I can safely exclude a job the says it requires "5 years" of experience in whatever, so a regex like /\d\syears/ seems reasonable to exclude jobs. But then, I realized some jobs say they'll take 0-2 years of experience, matches the exclusion regex but is clearly a job I want to take a look at. Hmmm, I can handle that with another regex. But some say "less than 2 years" or "fewer than 2 years". Can handle that too, but it makes me wonder what other patterns I'm not thinking of, and possibly excluding many jobs. That's what brings me here, to find a better way to do this than regexes, if there is one. I'd like to minimize the false negative rate and save all the jobs that seem like they might not require many years of experience. Does excluding anything that matches /[3-9]\syears|1\d\syears/ seem reasonable? Or is there a better way? Training a bayesian filter maybe? Edit: There's a similar, but harder problem, which would probably be more useful to solve. There are lots of jobs that just require an "engineering degree", as you just have to understand a few technical things. But searching for "engineering" gives you thousands of jobs, mostly irrelevant. How do I narrow this down to just those jobs that require any engineering degree, rather than particular degrees, without looking at each myself?
Online job-searching is tedious. Help me automate it
3,050,912
1
7
567
0
python,ruby,regex,perl,nlp
I developed a good parse and email routine for a couple of job websites when I was looking for work for myself and a couple of friends. I agree with the other posts, this is a great way to look at the problem. Just to drop a little info, I did it mostly in ruby, and used tor proxies and some other methods to make sure that I wouldn't be iced out of the job site. This sort of project is unlike usual scraping as you really can't afford to get kicked off a job board. In any case, I just have one piece of advice: forget about sorting and fine tuning this too intensely. Let the HR department do that for you and get your resume and credentials out everywhere. It's a statistical game, and you want to broadcast yourself and throw that net as widely as possible.
0
0
0
0
2010-06-15T19:14:00.000
3
0.066568
false
3,048,268
1
0
1
2
Many job sites have broken searches that don't let you narrow down jobs by experience level. Even when they do, it's usually wrong. This requires you to wade through hundreds of postings that you can't apply for before finding a relevant one, quite tedious. Since I'd rather focus on writing cover letters etc., I want to write a program to look through a large number of postings, and save the URLs of just those jobs that don't require years of experience. I don't require help writing the scraper to get the html bodies of possibly relevant job posts. The issue is accurately detecting the level of experience required for the job. This should not be too difficult as job posts are usually very explicit about this ("must have 5 years experience in..."), but there may be some issues with overly simple solutions. In my case, I'm looking for entry-level positions. Often they don't say "entry-level", but inclusion of the words probably means the job should be saved. Next, I can safely exclude a job the says it requires "5 years" of experience in whatever, so a regex like /\d\syears/ seems reasonable to exclude jobs. But then, I realized some jobs say they'll take 0-2 years of experience, matches the exclusion regex but is clearly a job I want to take a look at. Hmmm, I can handle that with another regex. But some say "less than 2 years" or "fewer than 2 years". Can handle that too, but it makes me wonder what other patterns I'm not thinking of, and possibly excluding many jobs. That's what brings me here, to find a better way to do this than regexes, if there is one. I'd like to minimize the false negative rate and save all the jobs that seem like they might not require many years of experience. Does excluding anything that matches /[3-9]\syears|1\d\syears/ seem reasonable? Or is there a better way? Training a bayesian filter maybe? Edit: There's a similar, but harder problem, which would probably be more useful to solve. There are lots of jobs that just require an "engineering degree", as you just have to understand a few technical things. But searching for "engineering" gives you thousands of jobs, mostly irrelevant. How do I narrow this down to just those jobs that require any engineering degree, rather than particular degrees, without looking at each myself?
Repoze.bfg or Grok
3,054,308
3
1
338
0
python,plone,zope
BFG doesn't have very much to do with Zope, except: it uses some Zope libraries internally. it uses a variant of ZPT as its built-in templating language. it uses some concepts, such as traversal, that will be familiar to Zope people. If you know Zope 3 very well, and you like it, you'll like Grok. If you want a framework maybe a bit more like Pylons, but slightly cleaner, and which uses some Zope technologies and concepts, you'll like BFG.
0
0
0
0
2010-06-15T22:10:00.000
2
1.2
true
3,049,431
0
0
1
1
I am about to take the head long plunge into Zope land and am wondering which framework would fit my needs better. I have some experience toying around with django and the primary reason I am switching to a zope-based framework is ZPT and also needing to occasionally do things with Plone. Both seem to be well run projects I am mainly wondering which would have the better learning overlap with Plone? Thanks in advance!
Django ORM and PostgreSQL connection limits
3,049,796
1
3
2,568
1
python,database,django,postgresql,django-orm
This could be caused by other things. For example, configuring Apache/mod_wsgi in a way that theoretically it could accept more concurrent requests than what the database itself may be able to accept at the same time. Have you reviewed your Apache/mod_wsgi configuration and compared limit on maximum clients to that of PostgreSQL to make sure something like that hasn't been done. Obviously this presumes though that you have managed to reach that limit in Apache some how and also depends on how any database connection pooling is set up.
0
0
0
0
2010-06-15T22:45:00.000
1
1.2
true
3,049,625
0
0
1
1
I'm running a Django project on Postgresql 8.1.21 (using Django 1.1.1, Python2.5, psycopg2, Apache2 with mod_wsgi 3.2). We've recently encountered this lovely error: OperationalError: FATAL: connection limit exceeded for non-superusers I'm not the first person to run up against this. There's a lot of discussion about this error, specifically with psycopg, but much of it centers on older versions of Django and/or offer solutions involving edits to code in Django itself. I've yet to find a succinct explanation of how to solve the problem of the Django ORM (or psycopg, whichever is really responsible, in this case) leaving open Postgre connections. Will simply adding connection.close() at the end of every view solve this problem? Better yet, has anyone conclusively solved this problem and kicked this error's ass? Edit: we later upped Postgresql's limit to 500 connections; this prevented the error from cropping up, but replaced it with excessive memory usage.
Which language should I use for Artificial intelligence on web projects
3,050,643
0
6
10,608
0
java,php,python,artificial-intelligence
Never use PHP for AI. Java or C/C++ is the best, but Python for fast development.
0
0
0
1
2010-06-16T02:59:00.000
9
0
false
3,050,450
0
0
1
7
I have to do one project for my thesis involving Artificial intelligence, collaborative filtering and machine learning methods. I only know PHP/mysq/JS, and there is not much AI stuff examples in PHP. There are some books on AI on internet but they use Java , Python. Now I have to apply AI techniques on web application. Which language should i choose java or python. I searhed on internet that I can call java classes inside my php so that can help as as I am very good at php I have also seen that python can also be used with php as well So which way should I go and roughly how much it will take me to learn java I have done java basics but that was 6 years ago
Which language should I use for Artificial intelligence on web projects
3,050,476
6
6
10,608
0
java,php,python,artificial-intelligence
Does it really matter which language your books use? I mean, you're not gonna copy-paste those examples. And you'll learn to recognize basic constructs (functions, loops, etc) pretty fast. It's not like learning to read Chinese. Talking about learning time, there's probably no definite answer to this question. I think the best is to look at examples of code both in java and python and see which seems 'nicer', easier and more familiar to you. Good luck!
0
0
0
1
2010-06-16T02:59:00.000
9
1
false
3,050,450
0
0
1
7
I have to do one project for my thesis involving Artificial intelligence, collaborative filtering and machine learning methods. I only know PHP/mysq/JS, and there is not much AI stuff examples in PHP. There are some books on AI on internet but they use Java , Python. Now I have to apply AI techniques on web application. Which language should i choose java or python. I searhed on internet that I can call java classes inside my php so that can help as as I am very good at php I have also seen that python can also be used with php as well So which way should I go and roughly how much it will take me to learn java I have done java basics but that was 6 years ago
Which language should I use for Artificial intelligence on web projects
3,051,952
3
6
10,608
0
java,php,python,artificial-intelligence
Which language should i choose java or python. Here are a few things to consider: java is more widely used (presumably more mature code "out there" to look at - but I haven't tested that out) python is more prolific (you write faster in python than in java), and from learning the language to writing the code that you want takes less in python than in java python is multi-paradigm, java is (almost) strictly OOP java is compiled (whereas python is scripted); this means that java finds your errors at compilation; python at execution - this can make a big difference, depending on your development style/practices java is more strictly defined and much more verbose than python. Where in java you have to formalize your contracts, in python you use duck-typing. In the end, the best you could do is set up a small project, write it in both languages and see what you end up preferring. You may also find some restrictions that you can't get around for one of the languages. In the end it's up to you :) Edit: that was not an exhaustive list and I tried to be as impartial as I could (but that ends here: I'd go with python :D)
0
0
0
1
2010-06-16T02:59:00.000
9
0.066568
false
3,050,450
0
0
1
7
I have to do one project for my thesis involving Artificial intelligence, collaborative filtering and machine learning methods. I only know PHP/mysq/JS, and there is not much AI stuff examples in PHP. There are some books on AI on internet but they use Java , Python. Now I have to apply AI techniques on web application. Which language should i choose java or python. I searhed on internet that I can call java classes inside my php so that can help as as I am very good at php I have also seen that python can also be used with php as well So which way should I go and roughly how much it will take me to learn java I have done java basics but that was 6 years ago
Which language should I use for Artificial intelligence on web projects
3,050,709
2
6
10,608
0
java,php,python,artificial-intelligence
You can use any language you like, as long as the server it's hosted on supports it. You can use HTML/JS as the user interface, and request results from the server with AJAX requests. What answers those requests would be your AI code, and that can be anything you want. PHP makes it really simple to answer AJAX requests. Since you are already familiar with it I would recommend that, although if your AI is very sophisticated you may want to go with something a little more efficient, like C/C++.
0
0
0
1
2010-06-16T02:59:00.000
9
0.044415
false
3,050,450
0
0
1
7
I have to do one project for my thesis involving Artificial intelligence, collaborative filtering and machine learning methods. I only know PHP/mysq/JS, and there is not much AI stuff examples in PHP. There are some books on AI on internet but they use Java , Python. Now I have to apply AI techniques on web application. Which language should i choose java or python. I searhed on internet that I can call java classes inside my php so that can help as as I am very good at php I have also seen that python can also be used with php as well So which way should I go and roughly how much it will take me to learn java I have done java basics but that was 6 years ago
Which language should I use for Artificial intelligence on web projects
3,264,444
0
6
10,608
0
java,php,python,artificial-intelligence
I believe Python is nice for this sort of tasks because of it's flexibility. Using the numpy/scipy libraries together with a nice plotting lib (chaco or matplotlib for instance) makes the workflow of working with the data and algorithms easy and you can lab around with the code in the live interpreter in an almost matlab-like manner. Change a line of code here, cleanse the data there and watch the whole thing live in a graph window without having to bother with recompilation etc. Once you settled on the algorithms it is fairly easy to profile the code and move hotspots into C/C++ or Fortran for instance if you are worried about performance. (you could even write the stuff in Jython and drop down into java for the performance-heavy bits of the code if you really like to be on the JVM platform)
0
0
0
1
2010-06-16T02:59:00.000
9
0
false
3,050,450
0
0
1
7
I have to do one project for my thesis involving Artificial intelligence, collaborative filtering and machine learning methods. I only know PHP/mysq/JS, and there is not much AI stuff examples in PHP. There are some books on AI on internet but they use Java , Python. Now I have to apply AI techniques on web application. Which language should i choose java or python. I searhed on internet that I can call java classes inside my php so that can help as as I am very good at php I have also seen that python can also be used with php as well So which way should I go and roughly how much it will take me to learn java I have done java basics but that was 6 years ago
Which language should I use for Artificial intelligence on web projects
47,068,977
0
6
10,608
0
java,php,python,artificial-intelligence
AI is not a language or a specific problem like summation or finding an average of some numbers. It's the intelligence which is going to be developed artificially. And to make a system intelligent especially a computer you can use any language that computer can understand and you are comfortable with (C, Java, Python, C++). A very simple AI example could be tic-tac-toe. This game could be made by using any language you would like to. The important thing is the algorithm that needs to be developed. AI is a vast area and it comprises of many things like Image processing, NLP, Machine learning, Psychology and more. And most importantly one has to be very strong in Mathematics, which is the most important and integral part of softcomputing. So again AI is not a language rather intelligent algorithm based on pure mathematics.
0
0
0
1
2010-06-16T02:59:00.000
9
0
false
3,050,450
0
0
1
7
I have to do one project for my thesis involving Artificial intelligence, collaborative filtering and machine learning methods. I only know PHP/mysq/JS, and there is not much AI stuff examples in PHP. There are some books on AI on internet but they use Java , Python. Now I have to apply AI techniques on web application. Which language should i choose java or python. I searhed on internet that I can call java classes inside my php so that can help as as I am very good at php I have also seen that python can also be used with php as well So which way should I go and roughly how much it will take me to learn java I have done java basics but that was 6 years ago
Which language should I use for Artificial intelligence on web projects
3,051,880
0
6
10,608
0
java,php,python,artificial-intelligence
Pretty much any language can be used to code pretty much anything - given the effort and will. But Python has more functional programming constructs which may be more useful when you are coding AI.
0
0
0
1
2010-06-16T02:59:00.000
9
0
false
3,050,450
0
0
1
7
I have to do one project for my thesis involving Artificial intelligence, collaborative filtering and machine learning methods. I only know PHP/mysq/JS, and there is not much AI stuff examples in PHP. There are some books on AI on internet but they use Java , Python. Now I have to apply AI techniques on web application. Which language should i choose java or python. I searhed on internet that I can call java classes inside my php so that can help as as I am very good at php I have also seen that python can also be used with php as well So which way should I go and roughly how much it will take me to learn java I have done java basics but that was 6 years ago
redirection follow by post
3,051,343
0
0
81
0
javascript,python
It can work like this: on air ticket booking system you have a html form pointing on certain airline booking website (by action parameter). If user submits data then data lands on airline booking website and this website proceed the request. Usuallly people want to get back to the first site. This can be done by sending return url with request data. Of course there must be an API on the airline booking site to handle such url. This is common mechanism when you do online payments, all kind of reservations, etc. Not sure about your idea to use ajax calls. Simple html form is enough here. Note that also making ajax calls between different domains can be recognized as attempt to access the restricted url.
0
0
1
0
2010-06-16T03:07:00.000
1
1.2
true
3,050,477
0
0
1
1
just wonder how those air ticket booking website redirect the user to the airline booking website and then fill up(i suppose doing POST) the required information so that the users will land on the booking page with origin/destination/date selected? Is the technique used is to open up new browser window and do a ajax POST from there? Thanks.
Parse (extract) DTMF in Python
3,050,536
1
2
6,174
0
python,dtmf
Do an FFT on the data. You should get spikes at the frequencies of the two tones.
0
0
0
0
2010-06-16T03:22:00.000
2
0.099668
false
3,050,528
1
0
1
1
If I have a recorded audio file (MP3), is there any way to get the figure out the DTMF tones that were recorded in pure Python? (If pure python is not available, then Java is okay too. The point being that it should be able to run in Google Appengine)
multiple custom app in django
3,053,690
0
0
72
0
python,django
You'll need to be a bit more specific. There's nothing magical about an app in Django - it's just a collection of models and views. If you need access to some of the models from one app in another app, just import them and use them as normal.
0
0
0
0
2010-06-16T13:03:00.000
1
0
false
3,053,442
0
0
1
1
I want to have two custom made app dealing with two different tasks. i have a page(template) where the data from the both app come together. how to deploy url for that, in the common urls.py so that the two app work together. how to integrate the views from both app to return data to same template simultaneously. is that possible? I found these situations in django books, but they have one custom made app and other one is built-in app. the apps are integrated in special way. can u help to solve my problem with 2 custom app.
Django : In a view how do I obtain the sessionid which will be part of the Set-Cookie header of following response?
3,054,422
1
0
501
0
python,django,cookies,django-authentication
I think you should be able to access this via request.session.session_key
0
0
0
0
2010-06-16T14:01:00.000
1
1.2
true
3,053,923
0
0
1
1
In case of views that contain login or logout, this sessionid is different from the one submitted in request's Coockie header. I need to retrieve it before returning response for some purpose. How can I do this ?
Passing variable urlname to url tag in django template
16,610,048
1
18
13,093
0
python,django,django-urls,django-templates
if you are using Django 1.5 and up, django-reversetags is not required anymore for just passing view names as variables into templates, to be used within the url tag. I was confused with the availability of django-reversetags, just thought of updating the matter correctly here.
0
0
0
0
2010-06-16T21:26:00.000
5
0.039979
false
3,057,318
0
0
1
1
What I'd like to do (for a recent changes 'widget' - not a django widget in this case) is pass a urlname into my template as a variable, then use it like so: {% url sitechangeobject.urlname %} Where urlname is a string containing a valid name for a url. Is this possible? The template keeps breaking saying it can't find sitechangeobject.urlname as a name (which is quite right, it doesn't exist). Is there any way to make it look inside that variable? There are other ways to solve this problem if not, just thought I'd check though. Thanks!
Jython project in Eclipse can't find the xml module, but works in an identical project
3,119,610
2
2
190
0
java,python,eclipse,jython,pydev
eclipse stores project data in files like .project .pydevprojct .classpath with checkin / checkout via svn it is possible to lost some of these files check your dot-files
0
0
1
0
2010-06-16T21:38:00.000
1
0.379949
false
3,057,382
0
0
1
1
I have two projects in Eclipse with Java and Python code, using Jython. Also I'm using PyDev. One project can import and use the xml module just fine, and the other gives the error ImportError: No module named xml. As far as I can tell, all the project properties are set identically. The working project was created from scratch and the other comes from code checked out of an svn repository and put into a new project. What could be the difference? edit- Same for os, btw. It's just missing some path somewhere...
A daemon to call a function every 2 minutes with start and stop capablities
3,057,550
4
1
549
0
python,django
There are a number of ways to achieve this. Assuming the correct server resources I would write a python script that calls function xyz "outside" of your django directory (although importing the necessary stuff) that only runs if /var/run/django-stuff/my-daemon.run exists. Get cron to run this every two minutes. Then, for your django functions, your start function creates the above mentioned file if it doesn't already exist and the stop function destroys it. As I say, there are other ways to achieve this. You could have a python script on loop waiting for approx 2 minutes... etc. In either case, you're up against the fact that two python scripts run on two different invocations of cpython (no idea if this is the case with mod_wsgi) cannot communicate with each other and as such IPC between python scripts is not simple, so you need to use some sort of formal IPC (like semaphores, files etc) rather than just common variables (which won't work).
0
1
0
0
2010-06-16T22:03:00.000
3
0.26052
false
3,057,507
0
0
1
2
I am working on a django web application. A function 'xyx' (it updates a variable) needs to be called every 2 minutes. I want one http request should start the daemon and keep calling xyz (every 2 minutes) until I send another http request to stop it. Appreciate your ideas. Thanks Vishal Rana
A daemon to call a function every 2 minutes with start and stop capablities
3,057,553
2
1
549
0
python,django
Probably a little hacked but you could try this: Set up a crontab entry that runs a script every two minutes. This script will check for some sort of flag (file existence, contents of a file, etc.) on the disk to decide whether to run a given python module. The problem with this is it could take up to 1:59 to run the function the first time after it is started. I think if you started a daemon in the view function it would keep the httpd worker process alive as well as the connection unless you figure out how to send a connection close without terminating the django view function. This could be very bad if you want to be able to do this in parallel for different users. Also to kill the function this way, you would have to somehow know which python and/or httpd process you want to kill later so you don't kill all of them. The real way to do it would be to code an actual daemon in w/e language and just make a system call to "/etc/init.d/daemon_name start" and "... stop" in the django views. For this, you need to make sure your web server user has permission to execute the daemon.
0
1
0
0
2010-06-16T22:03:00.000
3
0.132549
false
3,057,507
0
0
1
2
I am working on a django web application. A function 'xyx' (it updates a variable) needs to be called every 2 minutes. I want one http request should start the daemon and keep calling xyz (every 2 minutes) until I send another http request to stop it. Appreciate your ideas. Thanks Vishal Rana
What's the best option to process credit card payments in Django?
4,027,265
4
32
31,908
0
python,django,credit-card,payment
You can avoid PCI audits if the credit card details never touch your server... for example by using payment forms hosted on the servers of your chosen payment gateway provider. I have used SagePay here in the UK (and built Django connectors for their service from scratch - sorry not on github yet...) and they offer payment forms you can display in an iframe on your site so they look part of your own checkout page, specifically to avoid the PCI issues.
0
0
0
0
2010-06-16T22:30:00.000
4
0.197375
false
3,057,643
0
0
1
1
I need to process credit card payments on an app that provides a service outside the U.S. Given that Paypal it's not an option, I was wondering if there other services I could try. What would you recommend?
Does Python Django support custom SQL and denormalized databases with no Foreign Key relationships?
3,320,441
0
2
640
1
python,mysql,django
I concur with the 'no foreign keys' advice (with the disclaimer: I also work for Percona). The reason why it is is recommended is for concurrency / reducing locking internally. It can be a difficult "optimization" to sell, but if you consider that the database has transactions (and is more or less ACID compliant) then it should only be application-logic errors that cause foreign-key violations. Not to say they don't exist, but if you enable foreign keys in development hopefully you should find at least a few bugs. In terms of whether or not you need to write custom SQL: The explanation I usually give is that "optimization rarely decreases complexity". I think it is okay to stick with an ORM by default, but if in a profiler it looks like one particular piece of functionality is taking a lot more time than you suspect it would when written by hand, then you need to be prepared to fix it (assuming the code is called often enough). The real secret here is that you need good instrumentation / profiling in order to be frugal with your complexity adding optimization(s).
0
0
0
0
2010-06-17T23:07:00.000
5
0
false
3,066,255
0
0
1
3
I've just started learning Python Django and have a lot of experience building high traffic websites using PHP and MySQL. What worries me so far is Python's overly optimistic approach that you will never need to write custom SQL and that it automatically creates all these Foreign Key relationships in your database. The one thing I've learned in the last few years of building Chess.com is that its impossible to NOT write custom SQL when you're dealing with something like MySQL that frequently needs to be told what indexes it should use (or avoid), and that Foreign Keys are a death sentence. Percona's strongest recommendation was for us to remove all FKs for optimal performance. Is there a way in Django to do this in the models file? create relationships without creating actual DB FKs? Or is there a way to start at the database level, design/create my database, and then have Django reverse engineer the models file?
Does Python Django support custom SQL and denormalized databases with no Foreign Key relationships?
3,066,274
0
2
640
1
python,mysql,django
django-admin inspectdb allows you to reverse engineer a models file from existing tables. That is only a very partial response to your question ;)
0
0
0
0
2010-06-17T23:07:00.000
5
0
false
3,066,255
0
0
1
3
I've just started learning Python Django and have a lot of experience building high traffic websites using PHP and MySQL. What worries me so far is Python's overly optimistic approach that you will never need to write custom SQL and that it automatically creates all these Foreign Key relationships in your database. The one thing I've learned in the last few years of building Chess.com is that its impossible to NOT write custom SQL when you're dealing with something like MySQL that frequently needs to be told what indexes it should use (or avoid), and that Foreign Keys are a death sentence. Percona's strongest recommendation was for us to remove all FKs for optimal performance. Is there a way in Django to do this in the models file? create relationships without creating actual DB FKs? Or is there a way to start at the database level, design/create my database, and then have Django reverse engineer the models file?
Does Python Django support custom SQL and denormalized databases with no Foreign Key relationships?
3,066,360
0
2
640
1
python,mysql,django
You can just create the model.py and avoid having SQL Alchemy automatically create the tables leaving it up to you to define the actual tables as you please. So although there are foreign key relationships in the model.py this does not mean that they must exist in the actual tables. This is a very good thing considering how ludicrously foreign key constraints are implemented in MySQL - MyISAM just ignores them and InnoDB creates a non-optional index on every single one regardless of whether it makes sense.
0
0
0
0
2010-06-17T23:07:00.000
5
0
false
3,066,255
0
0
1
3
I've just started learning Python Django and have a lot of experience building high traffic websites using PHP and MySQL. What worries me so far is Python's overly optimistic approach that you will never need to write custom SQL and that it automatically creates all these Foreign Key relationships in your database. The one thing I've learned in the last few years of building Chess.com is that its impossible to NOT write custom SQL when you're dealing with something like MySQL that frequently needs to be told what indexes it should use (or avoid), and that Foreign Keys are a death sentence. Percona's strongest recommendation was for us to remove all FKs for optimal performance. Is there a way in Django to do this in the models file? create relationships without creating actual DB FKs? Or is there a way to start at the database level, design/create my database, and then have Django reverse engineer the models file?
django on appengine
13,855,137
0
1
253
0
python,django,google-app-engine
Appengine comes with built in Django, if you look under your (google_appengine/lib/django_1_3) lib dir you will see a few versions. You can define what version you want to be used in your app.yaml It isn't a full release of Django and if you do want to have full admin functionality of Django you might have to use something like nonrel but personally I would say its not necessary and you stand to gain more by getting to understand the underlying nosql structure of appengine, in particular the NDB model is very useful
0
1
0
0
2010-06-18T05:48:00.000
3
0
false
3,067,452
0
0
1
1
I am impressed with django.Am am currenty a java developer.I want to make some cool websites for myself but i want to host it in some third pary environmet. Now the question is can i host the django application on appengine?If yes , how?? Are there any site built using django which are already hosted on appengine?
Django DateField without year
3,067,477
1
10
4,685
0
python,django,datefield
A DateField is a whole date. If you only care about the month and day then use __month and __day when querying.
0
0
0
0
2010-06-18T05:48:00.000
3
0.066568
false
3,067,453
0
0
1
1
Is it possible to have a DateField without the year? Or will I have to use a CharField? I am using the admin to edit the models.
Display image in Django Form
3,068,886
1
4
1,365
0
python,django
This template responsibility to display this image in your case, I believe. If you form need to be able to send image related information (path, url..), you'll need to create a dedicated widget.
0
0
0
0
2010-06-18T10:27:00.000
2
0.099668
false
3,068,827
0
0
1
2
I need to display an image in a Django form. My Django form is quite simple - a single text input field. When I initialise my Django form in a view, I would like to pass the image path as a parameter, and the form when rendered in the template displays the image. Is is possible with Django forms or would i have to display the image separately? Thanks.
Display image in Django Form
3,068,909
1
4
1,365
0
python,django
If the image is related to the form itself, not to any field in particular, then you can make a custom form class and override one of as_table(), as_ul(), as_p() methods. Or you can just use a custom template instead of leaving the form to render itself. If it is field related then a custom widget is appropriate, as Pierre suggested.
0
0
0
0
2010-06-18T10:27:00.000
2
1.2
true
3,068,827
0
0
1
2
I need to display an image in a Django form. My Django form is quite simple - a single text input field. When I initialise my Django form in a view, I would like to pass the image path as a parameter, and the form when rendered in the template displays the image. Is is possible with Django forms or would i have to display the image separately? Thanks.