Q_Id int64 337 49.3M | CreationDate stringlengths 23 23 | Users Score int64 -42 1.15k | Other int64 0 1 | Python Basics and Environment int64 0 1 | System Administration and DevOps int64 0 1 | Tags stringlengths 6 105 | A_Id int64 518 72.5M | AnswerCount int64 1 64 | is_accepted bool 2
classes | Web Development int64 0 1 | GUI and Desktop Applications int64 0 1 | Answer stringlengths 6 11.6k | Available Count int64 1 31 | Q_Score int64 0 6.79k | Data Science and Machine Learning int64 0 1 | Question stringlengths 15 29k | Title stringlengths 11 150 | Score float64 -1 1.2 | Database and SQL int64 0 1 | Networking and APIs int64 0 1 | ViewCount int64 8 6.81M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4,596,093 | 2011-01-04T16:46:00.000 | 0 | 0 | 0 | 1 | python,django,google-app-engine | 4,601,330 | 1 | true | 1 | 0 | Yes, this should be possible. Your solution might look something like this:
A user creates a new group.
You generate some random questions and store them in a list for that group.
More users join that group.
You start showing the questions to the users by selecting the first question in that groups list.
Once all u... | 1 | 1 | 0 | I am very new to Google App Engine and Python. I am building a web application using Python and Django which is based on questions and multiple answers. Once the users are logged in to the website, they will be provided with random questions from a datastore.
What my requirement is, if certain users want to form a grou... | Same question to multiple remote users with different login | 1.2 | 0 | 0 | 132 |
4,596,817 | 2011-01-04T18:04:00.000 | 3 | 0 | 0 | 0 | python,django,eclipse,django-admin,django-permissions | 4,596,968 | 1 | true | 1 | 0 | Where did it go?
When you incrementally change your database by dropping tables and running syncdb, the PK of the application table are reflected in the auth_permission table can change.
Don't do "incremental" surgery if you can avoid it.
Extract your data.
Drop your database.
Rerun syncdb to rebuild it.
Reload your... | 1 | 2 | 0 | I'm not quite sure what to make of this. I'm using Django in eclipse. I made a new django project, and copied the code from a previous django project into this one. I ran syncdb to set up the database. I went to the admin page to recreate my groups, but I noticed that some of the permissions were missing from the l... | Django - some permissions are missing in admin tool | 1.2 | 0 | 0 | 2,169 |
4,596,908 | 2011-01-04T18:14:00.000 | 2 | 0 | 1 | 0 | python,clutter | 5,718,120 | 1 | true | 0 | 0 | Turns out there's a signal - "completed". | 1 | 0 | 0 | Is there any way to know when a timeline has finished in Python-Clutter, so that I can do something and then run another timeline? Can I use .join() on it like timers in PyGTK? | Python Clutter: Know when a timeline is done? | 1.2 | 0 | 0 | 136 |
4,596,962 | 2011-01-04T18:19:00.000 | 0 | 0 | 0 | 0 | python,pydot | 4,597,838 | 7 | true | 0 | 1 | I'm afraid pydot uses graphviz to render the graphs. I.e., it runs the executable and loads the resulting image.
Bottom line - no, you cannot avoid creating the file. | 1 | 28 | 0 | I am trying to display a simple graph using pydot.
My question is that is there any way to display the graph without writing it to a file as currently I use write function to first draw and then have to use the Image module to show the files.
However is there any way that the graph directly gets printed on the screen ... | Display graph without saving using pydot | 1.2 | 0 | 0 | 27,874 |
4,597,080 | 2011-01-04T18:34:00.000 | 2 | 0 | 0 | 0 | python,gnome,screensaver | 4,597,542 | 1 | true | 0 | 1 | gnome-screensaver doesn't integrate with the screensavers any more than with a small config file that sets the name, some other properties, and a command to execute to start the screensaver. This is documented in the gnome-screensaver FAQ.
The program that gets started needs to get the Window ID from the environment (X... | 1 | 2 | 0 | I've created a little screensaver-type program with Python, and I'd like to get it working properly under gnome-screensaver. The documentation is all written for C, and there don't appear to be libraries for Python. Is there any way to get this working? | Gnome-Screensaver with Python? | 1.2 | 0 | 0 | 567 |
4,598,204 | 2011-01-04T20:40:00.000 | 0 | 1 | 0 | 0 | python,email,text,cgi,attachment | 4,598,568 | 2 | false | 0 | 0 | Are you using smtplib and email.mime.multipart modules? the attach() method of the MIMEMultipart class accepts chunk of data to be attached, not a file. | 1 | 1 | 0 | I am trying to send an email using python that has the standard To From, body, etc. However this is where my question comes in. My python script takes information in a string and manipulates it(adds,removes, formats, etc) I am trying to take this output and send it as an attachment on-the-fly. I know I can dump the out... | python CGI email dynamic output as a text file attachment | 0 | 0 | 0 | 566 |
4,599,166 | 2011-01-04T22:34:00.000 | 2 | 0 | 1 | 0 | python,py2exe | 4,599,330 | 4 | true | 0 | 0 | There's no way to protect anything completely against reverse engineering. Some things you can do:
distribute the .pyc files. This requires slightly more effort to reverse engineer
Use an obfuscator (there aren't a lot of these out there and I haven't found any I would call first class)
Write critical sections (maybe... | 1 | 0 | 0 | Greetings!
So contrary to my last question I think I was pursuing the wrong method. Basically I need to be able to compile a Python script without fear of any common leecher to obtain my source code and begin usage of it themselves. Now I know Python is a open source language not meant for being protected but there mus... | Python: Compiling Script Safely? | 1.2 | 0 | 0 | 1,382 |
4,599,835 | 2011-01-05T00:30:00.000 | 1 | 0 | 1 | 0 | python,binary,io | 4,599,892 | 6 | false | 0 | 0 | This looks a lot like HW so I will not give exact code.
but here is enough information
You dont need to read the whole file into memory for changing the first 4 bytes
Open the file in mode 'r+b'
Use f.seek(0) to seek to the begining
Write 4 bytes of data using f.write('ABCD')
Close the file | 1 | 11 | 0 | THIS SHOULD BE EASY! But i've been unable to find the answer to this question.
Using python, I want to read a binary file into memory, modify the first four bytes of the file, and then write the file back.
There has to be a simple way to edit four measly bytes! right? | Simple edit to a binary file in python | 0.033321 | 0 | 0 | 21,380 |
4,599,936 | 2011-01-05T00:54:00.000 | 1 | 0 | 1 | 0 | python,windows,macos,python-2.x | 49,460,563 | 5 | false | 0 | 0 | On windows, they both are working fine if i try writing a file with either of the two(\r or \n) python interprets it as a line break in both the cases. While using "\r\n", it is interpreted as a double line break.(Python 3 on windows) | 1 | 40 | 0 | I have a python script that gave different output when run on a Windows machine and when run on a Mac. On digging deeper, I discovered that it was because when Python read in line breaks on the Mac (from a file), it read in \r\n, while somehow in Windows the \r disappears.
Thus, if I change every \n in the script to \r... | Handling \r\n vs \n newlines in python on Mac vs Windows | 0.039979 | 0 | 0 | 90,985 |
4,600,938 | 2011-01-05T04:53:00.000 | 6 | 0 | 0 | 0 | python,django | 4,601,203 | 3 | true | 1 | 0 | If you have to update each record with a different value, then of couse you have to iterate over each record. If you wish to do update them all with the same value, then just use the update method of the queryset. | 1 | 1 | 0 | How can I update multiple records in a queryset efficiently?
Do I just loop over the queryset, edit , and call save() for each one of them? Is it equivalent to psycopg2's executemany? | Django: how can I update more than one record at once? | 1.2 | 1 | 0 | 6,395 |
4,601,148 | 2011-01-05T05:37:00.000 | 1 | 0 | 0 | 0 | python,django,pinax | 4,601,235 | 3 | false | 1 | 0 | Depends on your server(s).
Do all the sites have access to the same DB? Then use dcrodjer's answer.
If not, you can implement a OAuth style Single Signon Service, that the other sites authenticate against.
Ex:
site1.example.com
site2.example.com
site3.example.com
siteN.example.com
Would auth against oauth.example.co... | 1 | 3 | 0 | How can I create a single log-in and profile for a network of three sites using Django?
I have a network of three sites and instead of having the user create a profile at each of the three sites, I'd like the user to only need to register one time, and then be able to use all three.
Is there an elegant solution to this... | How can I create a single log-in and profile for a network of three sites using Django? | 0.066568 | 0 | 0 | 121 |
4,601,788 | 2011-01-05T07:38:00.000 | 5 | 0 | 0 | 0 | python,django | 4,609,941 | 3 | false | 1 | 0 | To add a little more detail to the other answers, the equivalent of Ruby gems are Python "eggs". I don't know Ruby so I'm not sure how exact that equivalence is, but eggs are basically the install files for Python packages - they give Python information about which packages are installed. The egg is typically created... | 1 | 7 | 0 | Are there such things as Django gems - plugins , like there are Ruby gems ,
like auth management plugin, etc. | Are there such things as Django gems - plugins , like there are Ruby gems | 0.321513 | 0 | 0 | 2,981 |
4,604,777 | 2011-01-05T13:52:00.000 | 2 | 0 | 1 | 0 | python | 4,604,828 | 3 | false | 0 | 0 | The newline you are looking for might be added implicitly: watch out for Python's print statement. It automatically adds a newline if the last argument is not followed by a comma. | 1 | 1 | 0 | Want to find piece of the code, written in python, which adds a new line inside some function.
For which character I have to search? For \n ?
Thanks. | New line in python? | 0.132549 | 0 | 0 | 4,792 |
4,604,814 | 2011-01-05T13:56:00.000 | 40 | 0 | 0 | 0 | python,django,django-models | 4,604,988 | 3 | false | 1 | 0 | If you specify null=True on the model field then the value will be stored as NULL in the database if the user does not provide a value. | 3 | 79 | 0 | I need to have my Django application allow me to have a default value of NULL set for a certain model field. I've looked over the null, blank, and default parameters, but it's not very clear what combination of the three I need to use to get the desired effect. I've tried setting default=NULL but it threw an error. If ... | Django Model Field Default to Null | 1 | 0 | 0 | 80,656 |
4,604,814 | 2011-01-05T13:56:00.000 | 134 | 0 | 0 | 0 | python,django,django-models | 4,604,826 | 3 | true | 1 | 0 | Try default=None. There is no NULL in python. | 3 | 79 | 0 | I need to have my Django application allow me to have a default value of NULL set for a certain model field. I've looked over the null, blank, and default parameters, but it's not very clear what combination of the three I need to use to get the desired effect. I've tried setting default=NULL but it threw an error. If ... | Django Model Field Default to Null | 1.2 | 0 | 0 | 80,656 |
4,604,814 | 2011-01-05T13:56:00.000 | 20 | 0 | 0 | 0 | python,django,django-models | 55,348,386 | 3 | false | 1 | 0 | blank=True
allows you to input nothing (i.e "", None) and keep it empty.
null=True
means the database row is allowed to be NULL.
default=None
sets the field to None if no other value is given. | 3 | 79 | 0 | I need to have my Django application allow me to have a default value of NULL set for a certain model field. I've looked over the null, blank, and default parameters, but it's not very clear what combination of the three I need to use to get the desired effect. I've tried setting default=NULL but it threw an error. If ... | Django Model Field Default to Null | 1 | 0 | 0 | 80,656 |
4,605,062 | 2011-01-05T14:20:00.000 | 1 | 0 | 1 | 0 | python,nlp,language-detection | 4,606,959 | 5 | false | 0 | 0 | Altough not as good as Google's own, I have had good results using Apache Nutch LanguageIdentifier which comes with its own pretrained ngram models. I had quite good results on a large (50GB pdf, text-mostly) corpus of real-world data in several languages.
It is in Java, but I'm sure you can reread the ngram profiles f... | 1 | 8 | 0 | I'm looking for a simple way to detect whether a short excerpt of text, a few sentences, is English or not. Seems to me that this problem is much easier than trying to detect an arbitrary language. Is there any software out there that can do this? I'm writing in python, and would prefer a python library, but something ... | Detecting whether or not text is English (in bulk) | 0.039979 | 0 | 0 | 6,869 |
4,605,243 | 2011-01-05T14:37:00.000 | 0 | 1 | 0 | 0 | python,web,yahoo | 4,605,453 | 6 | false | 1 | 0 | If they're different pages, they can easily be created by different software. So if a mail application written in Java offers a link to an address book, the address book can easily be Python--that's just a matter of configuring the server.
If you need an addressbook component within the mail application, that's a bit m... | 4 | 0 | 0 | I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python.
Now initially i was thinking that if i build the website then i have to use one language either php or java or asp or anything.
But i am confused how can we make make separate modules in ... | Is it possible to use different technologies in one website | 0 | 0 | 0 | 99 |
4,605,243 | 2011-01-05T14:37:00.000 | 2 | 1 | 0 | 0 | python,web,yahoo | 4,605,394 | 6 | true | 1 | 0 | Phisical architecture of web application can be different from the logical one visible through browser. Basically it is achieved by putting front web server (think of apache with mod_proxy, but it can be any other moder web server supporting reverse proxying) and mounting web application servers (java/python/whatever) ... | 4 | 0 | 0 | I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python.
Now initially i was thinking that if i build the website then i have to use one language either php or java or asp or anything.
But i am confused how can we make make separate modules in ... | Is it possible to use different technologies in one website | 1.2 | 0 | 0 | 99 |
4,605,243 | 2011-01-05T14:37:00.000 | 0 | 1 | 0 | 0 | python,web,yahoo | 4,605,290 | 6 | false | 1 | 0 | I know in Ruby on Rails, you can execute bash commands.
Example: puts ls | 4 | 0 | 0 | I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python.
Now initially i was thinking that if i build the website then i have to use one language either php or java or asp or anything.
But i am confused how can we make make separate modules in ... | Is it possible to use different technologies in one website | 0 | 0 | 0 | 99 |
4,605,243 | 2011-01-05T14:37:00.000 | 1 | 1 | 0 | 0 | python,web,yahoo | 4,605,266 | 6 | false | 1 | 0 | You can use any language to provide a web service, so you can for example provide a REST/SOAP web service that returns JSON or XML. The web service can be written in any language, and the language used to interact with the web service can be any language, as all languages nowadays have JSON and XML parsers.
You can set... | 4 | 0 | 0 | I was watching the tutorials for python and the guy told that he coded the Address books and spell checker for yahoo mail in python.
Now initially i was thinking that if i build the website then i have to use one language either php or java or asp or anything.
But i am confused how can we make make separate modules in ... | Is it possible to use different technologies in one website | 0.033321 | 0 | 0 | 99 |
4,605,870 | 2011-01-05T15:33:00.000 | 2 | 0 | 0 | 0 | python,eclipse,aptana | 4,606,261 | 2 | false | 0 | 0 | In Eclipse, this indicates an outgoing uncommitted change in CVS. Since Aptana is Eclipse based, I assume its the same thing.
You can change the decorator to something else (e.g. I have mine change the text to a different color) but that's the default.
See Window -> Preferences -> Team -> CVS -> Label Decorations, "... | 2 | 1 | 0 | I'w wondering what it means when Aptana IDE displays an > in the beginning of file and folder names in the File explorer? | Aptana; What does the ">" in front of file/folder names mean in the File explorer? | 0.197375 | 0 | 0 | 326 |
4,605,870 | 2011-01-05T15:33:00.000 | 2 | 0 | 0 | 0 | python,eclipse,aptana | 4,606,268 | 2 | true | 0 | 0 | The '>' character could mean incoming or outgoing changes (not sure about the direction) to version control systems.
Otherwise look for decorators in preferences (possibly label decorators, but not sure). | 2 | 1 | 0 | I'w wondering what it means when Aptana IDE displays an > in the beginning of file and folder names in the File explorer? | Aptana; What does the ">" in front of file/folder names mean in the File explorer? | 1.2 | 0 | 0 | 326 |
4,605,884 | 2011-01-05T15:36:00.000 | 1 | 0 | 1 | 1 | python,windows,scheduled-tasks | 4,605,975 | 1 | true | 0 | 0 | You could set python.exe as the program, and pass your script to it as an argument. | 1 | 1 | 0 | I'm used to using Windows Server 2003 and to run my Python scripts as a scheduled task I simply followed the below steps: Opened Scheduled Tasks > Add Scheduled Task > Next > select Python > Next > Name the task, daily > supplied start time > supplied username and password to run the task.
Server 2008 looks a bit diffe... | Creating a Scheduled Task in Windows Server 2008 | 1.2 | 0 | 0 | 2,379 |
4,606,986 | 2011-01-05T17:15:00.000 | 3 | 0 | 1 | 0 | python,exception,exception-handling | 4,606,998 | 1 | true | 0 | 0 | There is no way to get a full list of exception a function can raise. You can look in the documentation, some functions list the exceptions they raise. | 1 | 1 | 0 | How can I have a clean list of exceptions that a standard function/method can raise ? Without that, how can I anticipate the behavior of a function ?
Thanks. | How to retrieve the list of exceptions of a function or a method | 1.2 | 0 | 0 | 108 |
4,607,343 | 2011-01-05T17:46:00.000 | 4 | 1 | 0 | 0 | python,cron | 4,607,368 | 6 | false | 0 | 0 | cron will absolutely run the script again. You need to think this through a little more carefully than just "sleep" and "email every 10 minutes."
You need to write out your use cases.
System sends message and user does something.
System sends message and user does nothing. Why email the user again? What does 2 ema... | 4 | 1 | 0 | I wrote a python script to monitor a log file on a CentOS server for a specific value and send an email when it finds it. It runs as a cron every 5 minutes.
My question is what is the best way to put this script to sleep after it has sent the first email. I don't want it to be sending emails every 5 mins, but it need... | How to sleep a python script running as a cronjob? | 0.132549 | 0 | 0 | 1,999 |
4,607,343 | 2011-01-05T17:46:00.000 | 1 | 1 | 0 | 0 | python,cron | 4,608,337 | 6 | false | 0 | 0 | When your scripts sends email, make it also create a txt file "email_sent.txt". Then make it check for existence of this txt file before sending email. If it exists, don't send email. If it does not exist, send email and create the text file.
The text files serves as an indicator that email has already been sent and it... | 4 | 1 | 0 | I wrote a python script to monitor a log file on a CentOS server for a specific value and send an email when it finds it. It runs as a cron every 5 minutes.
My question is what is the best way to put this script to sleep after it has sent the first email. I don't want it to be sending emails every 5 mins, but it need... | How to sleep a python script running as a cronjob? | 0.033321 | 0 | 0 | 1,999 |
4,607,343 | 2011-01-05T17:46:00.000 | 3 | 1 | 0 | 0 | python,cron | 4,607,608 | 6 | true | 0 | 0 | @Lennart, @S. Lott: I think the question was somewhat the other way around - the script runs as a cron job every five minutes, but after sending an error-email it shouldn't send another for at least an hour (even if the error state persists).
The obvious answer, I think, is to save a self-log - for each problem detecte... | 4 | 1 | 0 | I wrote a python script to monitor a log file on a CentOS server for a specific value and send an email when it finds it. It runs as a cron every 5 minutes.
My question is what is the best way to put this script to sleep after it has sent the first email. I don't want it to be sending emails every 5 mins, but it need... | How to sleep a python script running as a cronjob? | 1.2 | 0 | 0 | 1,999 |
4,607,343 | 2011-01-05T17:46:00.000 | 0 | 1 | 0 | 0 | python,cron | 4,607,451 | 6 | false | 0 | 0 | You are running it every five minutes. Why would you sleep it? Just exit. If you want to make sure it doesn't send email every five minutes, then make the program only send an email if there is anything to send.
If you sleep it for an hour, and run it every five minutes, after an hour you'll have 12 copies running (an... | 4 | 1 | 0 | I wrote a python script to monitor a log file on a CentOS server for a specific value and send an email when it finds it. It runs as a cron every 5 minutes.
My question is what is the best way to put this script to sleep after it has sent the first email. I don't want it to be sending emails every 5 mins, but it need... | How to sleep a python script running as a cronjob? | 0 | 0 | 0 | 1,999 |
4,609,956 | 2011-01-05T22:43:00.000 | 2 | 1 | 0 | 0 | c++,python,java-me,symbian,inbox | 4,612,488 | 3 | true | 1 | 0 | Reading message from inbox in j2me is not possible
if you want to read sms then you can send message using particular port and
your j2me application should listen on that port
otherwise you can go with symbian c++ where it is possible. | 2 | 2 | 0 | How can I access the SMS inbox from an application (on Symbian s60)? Us it possible with j2me? How about C++ or Python? | access to sms inbox | 1.2 | 0 | 0 | 939 |
4,609,956 | 2011-01-05T22:43:00.000 | 2 | 1 | 0 | 0 | c++,python,java-me,symbian,inbox | 4,611,971 | 3 | false | 1 | 0 | In j2me, you can't access the native message box related stuff like Inbox, Sent Message or etc. But it is possible in c++. I don't know about python. | 2 | 2 | 0 | How can I access the SMS inbox from an application (on Symbian s60)? Us it possible with j2me? How about C++ or Python? | access to sms inbox | 0.132549 | 0 | 0 | 939 |
4,610,074 | 2011-01-05T22:59:00.000 | 4 | 0 | 0 | 0 | python,tkinter | 4,611,229 | 3 | true | 0 | 1 | You can get the character (and thus, the line number) at a pixel position using an index of @x,y (eg: @0,0 for the top-left-most visible character). Since you know the width and height of the widget (using the winfo_width and winfo height methods) you can calculate what lines are at the bottom of the widget too.
You ca... | 1 | 1 | 0 | Is there any way to get what lines are currently visible in a Tkinter text widget? I'm trying to make a scrollbar.
Currently I'm trying to coordinate my scroll bar with the other methods of scrolling (ie, the arrow keys and scroll wheel). So that when I scroll with the arrow keys or mouse, my bar scrolls too. | Visible lines in Tkinter text widget | 1.2 | 0 | 0 | 1,674 |
4,610,205 | 2011-01-05T23:15:00.000 | 5 | 1 | 0 | 1 | python,scripting,automation,tar | 4,610,327 | 2 | true | 0 | 0 | Don't think of a tar file as a database that you can read/write -- it's not. A tar file is a concatenation of files. To modify a file in the middle, you need to rewrite the rest of the file. (for files of a certain size, you might be able to exploit the block padding)
What you want to do is process the tarball file ... | 1 | 2 | 0 | I want to write a (preferably python) script to modify the content of one file in a gzipped tar file. The script must run on FreeBSD 6+.
Basically, I need to:
open the tar file
if the tar file has _MY_FILE_ in it:
if _MY_FILE_ has a line matching /RE/ in it:
insert LINE after the matching line
rewrite the content in... | How can I modify a file in a gzipped tar file? | 1.2 | 0 | 0 | 6,217 |
4,610,698 | 2011-01-06T00:31:00.000 | 1 | 0 | 0 | 0 | python,database,sqlite,orm,sqlalchemy | 4,612,684 | 2 | true | 0 | 0 | Yes, SQLAlchemy will help you to be independent on what SQL database you use, and you get a nice ORM as well. Highly recommended. | 2 | 2 | 0 | I have a project coming up that involves a desktop application (tournament scoring for an amateur competition) that probably 99+% of the time will be a single-user on a single machine, no network connectivity, etc. For that, sqlite will likely work beautifully. For those other few times when there are more than one p... | creating a database-neutral app in python | 1.2 | 1 | 0 | 245 |
4,610,698 | 2011-01-06T00:31:00.000 | -1 | 0 | 0 | 0 | python,database,sqlite,orm,sqlalchemy | 4,610,735 | 2 | false | 0 | 0 | I don't see how those 2 use cases would use the same methods. Just create a wrapper module that conditionally imports either the sqlite or sqlalchemy modules or whatever else you need. | 2 | 2 | 0 | I have a project coming up that involves a desktop application (tournament scoring for an amateur competition) that probably 99+% of the time will be a single-user on a single machine, no network connectivity, etc. For that, sqlite will likely work beautifully. For those other few times when there are more than one p... | creating a database-neutral app in python | -0.099668 | 1 | 0 | 245 |
4,611,369 | 2011-01-06T03:03:00.000 | 5 | 1 | 1 | 0 | python,compilation,eval,exec | 4,611,385 | 2 | false | 0 | 0 | Certainly, various Lisp environments have had this capability for decades. A Lisp compiler typically works on a per-function basis, and the compiler and runtime system work hand in hand.
When asked to eval something, the Lisp runtime environment will pass the list (a data structure) to the compiler for compiling. The c... | 2 | 5 | 0 | Can the equivalent of eval and exec exist in a compiled language? If so, how would they be compiled (roughly speaking)? | If Python's exec and eval were compiled? | 0.462117 | 0 | 0 | 453 |
4,611,369 | 2011-01-06T03:03:00.000 | 5 | 1 | 1 | 0 | python,compilation,eval,exec | 4,611,394 | 2 | true | 0 | 0 | For starters, python is a compiled language, it just does the compilation at runtime. That being said, all that you need to do to implement eval in any other compiled language is to be able to run the compiler (and dynamically load object code) - you can do this in Python (and a litany of other languages) easily becau... | 2 | 5 | 0 | Can the equivalent of eval and exec exist in a compiled language? If so, how would they be compiled (roughly speaking)? | If Python's exec and eval were compiled? | 1.2 | 0 | 0 | 453 |
4,611,373 | 2011-01-06T03:04:00.000 | 2 | 0 | 1 | 0 | python,speech-recognition,speech,speech-to-text | 4,611,395 | 2 | false | 0 | 0 | pyspeech seems to be merely a python interface to the regular Windows speech APIs. Most likely you'd create some method of treating mp3 playback as an audio source for that speech API to listen to. | 1 | 6 | 0 | I'd like to transcribe mp3 (speech-to-text) using the pyspeech API. I don't know if this is possible, though.
Is it? How? | pyspeech (python) - Transcribe mp3 files? | 0.197375 | 0 | 0 | 7,026 |
4,613,251 | 2011-01-06T09:02:00.000 | 3 | 0 | 0 | 0 | python,django,data-structures | 4,613,300 | 2 | true | 1 | 0 | You don't need a table per stock symbol, you just need one of the fields in the table to be the stock symbol. The table might be called StockPrices and its fields might be
ticker_symbol - the stock ticker symbol
time - the time of the stock quote
price - the price of the stock at that time
As long as ticker_symbol is... | 1 | 0 | 0 | I'm developing a web app that uses stock data. The stock data can be stored in:
Files
DB
The structure of the data is simple: there's a daily set and a weekly set. If files are used, then I can store a file per symbol/set, such as GOOGLE_DAILY and GOOGLE_WEEKLY. Each set includes a simple list of (Date, open/hight/l... | Help needed with db structure | 1.2 | 1 | 0 | 81 |
4,613,888 | 2011-01-06T10:21:00.000 | 3 | 1 | 1 | 1 | python,scripting,programming-languages | 4,613,922 | 1 | true | 0 | 0 | If you want to execute code generated by some tool it could be useful to be able to pipe the generated into your interpreter/compiler..
Simply support it ;) Checking if stdin is a tty or not is not hard anyway. | 1 | 1 | 0 | Taking e.g. Python as a good example of a modern scripting language, it has the option of reading a program (as opposed to input data for the program) from stdin. The REPL is the obvious use case where stdin is a terminal, but it's also designed to handle the scenario where it's not a terminal.
What use cases are there... | Script from stdin use case | 1.2 | 0 | 0 | 104 |
4,614,552 | 2011-01-06T11:46:00.000 | 3 | 1 | 0 | 1 | python,github,distribution,distutils,easy-install | 4,615,208 | 1 | true | 1 | 0 | If you know, that "pip" works, why don't you just use "pip"? "pip" can not only install from a package index, but also from a local source directory. Just use pip install . instead of python setup.py install.
Concerning your impression, it is indeed wrong. "pip" and "distribute" are altogether different projects wit... | 1 | 2 | 0 | I built a small micro framework for our web service / web app and have it hosted it in a private repository on github.
I've added the private github repo in the dependency_links and have verified that it exists in dependency_links.txt
When I execute python setup.py install, I get unknown url type: git+ssh, so I looked... | Has anyone gotten distribute to work correctly with github, specifically private repositories? | 1.2 | 0 | 0 | 816 |
4,615,299 | 2011-01-06T13:20:00.000 | 8 | 1 | 0 | 1 | python,linux,ubuntu,packages | 4,615,378 | 1 | true | 0 | 0 | You are confusing two completely separate things.
Aptitude, of which apt_get is one part, is the Ubuntu system-wide package manager. It has packages for absolutely everything - applications, libraries, system utils, whatever. They may not be the latest versions, as packages are usually only updated for each separate Ub... | 1 | 2 | 0 | I have just started using Ubuntu as my first Linux, have a couple of question.
What is the difference between easy_install and apt-get?
How do I update my packages with packages installed in both these ways?
They are under pythonpath right? | what is the difference between easy_install and apt-get | 1.2 | 0 | 0 | 1,284 |
4,616,361 | 2011-01-06T15:10:00.000 | 16 | 0 | 1 | 0 | python,multithreading,signals | 4,616,691 | 4 | true | 0 | 0 | If you set newthread.daemon = True before starting each thread, the threads will automatically be killed when the main thread exits. That's not precisely what you were asking, but from what you've described, it sounds like it could be worth knowing. | 2 | 9 | 0 | I have a threaded application written in Python, and whenever an interrupt is received via Ctrl+C or sometimes with kill, the application will hang. A stack trace is presented from one thread, but the application remains in the foreground, and I usually have to background it with Ctrl+Z then attempt to kill it.
What is... | Handling Signals in Python Threads | 1.2 | 0 | 0 | 20,419 |
4,616,361 | 2011-01-06T15:10:00.000 | 5 | 0 | 1 | 0 | python,multithreading,signals | 4,616,567 | 4 | false | 0 | 0 | The way I worked around this issue was to make a module that could kept a list of threads. The module also had a method that killed every thread in that list. I registered this method to be called when the SIGINT signal was received. Lastly, I created a wrapper class for Thread that would automatically add the created ... | 2 | 9 | 0 | I have a threaded application written in Python, and whenever an interrupt is received via Ctrl+C or sometimes with kill, the application will hang. A stack trace is presented from one thread, but the application remains in the foreground, and I usually have to background it with Ctrl+Z then attempt to kill it.
What is... | Handling Signals in Python Threads | 0.244919 | 0 | 0 | 20,419 |
4,616,934 | 2011-01-06T16:06:00.000 | 3 | 0 | 0 | 1 | python,google-app-engine,google-cloud-datastore | 4,625,277 | 3 | false | 1 | 0 | As Nick pointed out, it can be done and it won't be a straight forward implementation.
I would suggest using the Amazon EC2 service for video conversion and Amazon S3 for storing of videos while using App Engine for creating a fast reliable and unbelievably scalable front-end. | 1 | 4 | 0 | I am going to work on a video website where users/admin will be able to upload the videos and play them using some opensource javascript player. However, I want to know if it is a good idea to start this kind of project on google app engine considering its limitations to server and store the data.
What are the issues ... | Video website on google application engine | 0.197375 | 0 | 0 | 2,593 |
4,618,298 | 2011-01-06T18:22:00.000 | 3 | 0 | 1 | 0 | python,random,vim | 4,618,362 | 11 | false | 0 | 0 | On many systems the sort shell command takes -R to randomize its input. | 1 | 40 | 0 | Everything is in the title. I'm wondering if any one knows a quick and with reasonable memory demands way of randomly mixing all the lines of a 3 million lines file. I guess it is not possible with a simple vim command, so any simple script using Python. I tried with python by using a random number generator, but did n... | Randomly mix lines of 3 million-line file | 0.054491 | 0 | 0 | 29,176 |
4,619,168 | 2011-01-06T19:51:00.000 | 5 | 0 | 0 | 1 | python,windows,linux | 4,619,230 | 6 | false | 0 | 0 | Chmod is your friend.
However I question your design. Why do you want to have priviledges at such high levels of file systems. You know every user has a home dir and ther is always dir for configuration on both Windows and Linux.
What you do is a bad practice. | 5 | 0 | 0 | I have a python gui that access files on windows as C:\data and C:\MyDIR all outside my doc's.
On, a linux sys i created /data and /MyDIR.
My gui cant access. I foresee always using C:\data and C:\MyDIR on both systems.
How do I fix code or Linux permissions to have access to both dir and sub directories. | Migrating to Linux from Windows | 0.16514 | 0 | 0 | 484 |
4,619,168 | 2011-01-06T19:51:00.000 | 1 | 0 | 0 | 1 | python,windows,linux | 4,619,239 | 6 | false | 0 | 0 | i created \data and \MyDIR
First, no you didn't. Paths use / in linux, not \.
Second, do NOT create directories in the root directory unless you know exactly what you're doing. True, you're not going to hurt anything by doing this, but it's extremely bad practice and should be avoided except for specific cases.
Linux ... | 5 | 0 | 0 | I have a python gui that access files on windows as C:\data and C:\MyDIR all outside my doc's.
On, a linux sys i created /data and /MyDIR.
My gui cant access. I foresee always using C:\data and C:\MyDIR on both systems.
How do I fix code or Linux permissions to have access to both dir and sub directories. | Migrating to Linux from Windows | 0.033321 | 0 | 0 | 484 |
4,619,168 | 2011-01-06T19:51:00.000 | 1 | 0 | 0 | 1 | python,windows,linux | 4,619,237 | 6 | false | 0 | 0 | First of all, maybe you meant to say /data and /MyDIR.
Second, they're direct children of /, the root filesystem, which is reserved to the superuser (root) and people who know what they're doing.
Unfortunately the Windows world doesn't enforce nor encourage good practices, so you were able to create those two directori... | 5 | 0 | 0 | I have a python gui that access files on windows as C:\data and C:\MyDIR all outside my doc's.
On, a linux sys i created /data and /MyDIR.
My gui cant access. I foresee always using C:\data and C:\MyDIR on both systems.
How do I fix code or Linux permissions to have access to both dir and sub directories. | Migrating to Linux from Windows | 0.033321 | 0 | 0 | 484 |
4,619,168 | 2011-01-06T19:51:00.000 | 0 | 0 | 0 | 1 | python,windows,linux | 4,619,321 | 6 | false | 0 | 0 | Where did you create those directories in your Linux? Under $HOME? You can determine your path separator using the string 'sep' from the os module, that is, os.sep, then acct according to its return value. Comes to my mind sth like:
import os
dirs = [os.sep + "data", os.sep + "MyDIR"]
But all depends on what you want t... | 5 | 0 | 0 | I have a python gui that access files on windows as C:\data and C:\MyDIR all outside my doc's.
On, a linux sys i created /data and /MyDIR.
My gui cant access. I foresee always using C:\data and C:\MyDIR on both systems.
How do I fix code or Linux permissions to have access to both dir and sub directories. | Migrating to Linux from Windows | 0 | 0 | 0 | 484 |
4,619,168 | 2011-01-06T19:51:00.000 | 1 | 0 | 0 | 1 | python,windows,linux | 4,619,238 | 6 | false | 0 | 0 | The linux filesystem uses / as root. You can't use \data and \MyDir because \ does not mean anything. Moreover, the default owner of / is the user named root. Commonly you work with a different user than root on the machine.
So by default, you don't have the permission to write or to create something in / .
Choose anot... | 5 | 0 | 0 | I have a python gui that access files on windows as C:\data and C:\MyDIR all outside my doc's.
On, a linux sys i created /data and /MyDIR.
My gui cant access. I foresee always using C:\data and C:\MyDIR on both systems.
How do I fix code or Linux permissions to have access to both dir and sub directories. | Migrating to Linux from Windows | 0.033321 | 0 | 0 | 484 |
4,619,392 | 2011-01-06T20:15:00.000 | 0 | 0 | 0 | 0 | python,mysql,virtual-machine | 4,621,472 | 3 | false | 0 | 0 | Do you want it synced in realtime?
Why not just connect the guest's mysql process to the host? | 2 | 1 | 0 | Im setting a VM.
Both host and VM machine have Mysql.
How do keep the VM Mysql sync'd to to the host Mysql.
Host is using MYsql 5.5 on XP.
VM is Mysql 5.1 on Fedora 14.
1) I could DUMP to "shared," Restore. Not sure if this will work.
2) I could network Mysql Host to Mysql VM. Not how to do this
How would I do thi... | How to Sync MySQL with python? | 0 | 1 | 0 | 2,319 |
4,619,392 | 2011-01-06T20:15:00.000 | 1 | 0 | 0 | 0 | python,mysql,virtual-machine | 4,619,503 | 3 | true | 0 | 0 | You can use mysqldump to make snapshots of the database, and to restore it to known states after tests.
But instead or going into the complication of synchronizing different database instances, it would be best to open the host machine's instance to local network access, and have the applications in the virtual machin... | 2 | 1 | 0 | Im setting a VM.
Both host and VM machine have Mysql.
How do keep the VM Mysql sync'd to to the host Mysql.
Host is using MYsql 5.5 on XP.
VM is Mysql 5.1 on Fedora 14.
1) I could DUMP to "shared," Restore. Not sure if this will work.
2) I could network Mysql Host to Mysql VM. Not how to do this
How would I do thi... | How to Sync MySQL with python? | 1.2 | 1 | 0 | 2,319 |
4,620,340 | 2011-01-06T21:56:00.000 | 0 | 0 | 0 | 0 | python,mysql | 9,090,731 | 3 | false | 0 | 0 | MySQLDb is faster while SQLAlchemy makes code more user friendly -:) | 3 | 2 | 0 | I know of PyMySQLDb, is that pretty much the thinnest/lightest way of accessing MySql? | What is the fastest/most performant SQL driver for Python? | 0 | 1 | 0 | 2,598 |
4,620,340 | 2011-01-06T21:56:00.000 | 5 | 0 | 0 | 0 | python,mysql | 4,620,669 | 3 | false | 0 | 0 | The fastest is SQLAlchemy.
"Say what!?"
Well, a nice ORM, and I like SQLAlchemy, you will get your code finished much faster. If your code then runs 0.2 seconds slower isn't really gonna make any noticeable difference. :)
Now if you get performance problems, then you can look into improving the code. But choosing the ... | 3 | 2 | 0 | I know of PyMySQLDb, is that pretty much the thinnest/lightest way of accessing MySql? | What is the fastest/most performant SQL driver for Python? | 0.321513 | 1 | 0 | 2,598 |
4,620,340 | 2011-01-06T21:56:00.000 | 3 | 0 | 0 | 0 | python,mysql | 4,620,433 | 3 | false | 0 | 0 | The lightest possible way is to use ctypes and directly call into the MySQL API, of course, without using any translation layers. Now, that's ugly and will make your life miserable unless you also write C, so yes, the MySQLDb extension is the standard and most performant way to use MySQL while still using the Python Da... | 3 | 2 | 0 | I know of PyMySQLDb, is that pretty much the thinnest/lightest way of accessing MySql? | What is the fastest/most performant SQL driver for Python? | 0.197375 | 1 | 0 | 2,598 |
4,620,479 | 2011-01-06T22:10:00.000 | 0 | 0 | 1 | 0 | php,python,video,video-processing | 4,620,588 | 2 | false | 0 | 0 | Would you consider an animated GIF to be a video? If so use imagemagick! | 1 | 0 | 0 | Is there some library to generate a video from pictures and text? Something like animoto.com does but much simplier.
I basically want to set one picture, and fade in and out text over that picture and make a video out of that.
I am looking for something to run from php or python, video format is not so important. | Library to create videos from pictures and text? | 0 | 0 | 0 | 1,302 |
4,621,447 | 2011-01-07T00:28:00.000 | 3 | 0 | 1 | 0 | python,string,mkdir | 4,621,460 | 3 | false | 0 | 0 | construct your paths with os.path, then it's platform agnostic and you'll avoid these issues.
For example, mkdir(os.path.join(r"C:\", "6"))
or os.path.join(r"D:\", "main", "folder", "red", "34") | 1 | 1 | 0 | I had a bad problem with these two: "\" and "/" in Windows, obviously :\
I need to replace all \ occurrence in /, so I can use replace() because doesn't work with this "\6" for example.
What I have to do? I want "only" use mkdir() to replicate a structure of folders (without files) from one location to another. So I u... | From backslash to slash (to create folders named with number) | 0.197375 | 0 | 0 | 5,295 |
4,621,726 | 2011-01-07T01:26:00.000 | 1 | 0 | 0 | 0 | python,django,path | 4,622,144 | 3 | false | 1 | 0 | I'm guessing when you include a class in the django installed apps it's copied somewhere, but where?
That's completely a wrong guess.
A better guess is that your download directory is on your Python path.
Somehow you had two copies (or more) of the module.
You've deleted some, but not all of the copies.
Keep searching... | 2 | 0 | 0 | I'm using the Django Registration class, it's great, but the last version shipped with an issue and it's no longer updated
I've installed it on my path (downloaded it then python setup.py install) then added it to my projects installed apps
I'm on debian, and It's copied itself to /usr/lib/python2.5/site-packages/regis... | Django installed apps location for classes on system path | 0.066568 | 0 | 0 | 651 |
4,621,726 | 2011-01-07T01:26:00.000 | 1 | 0 | 0 | 0 | python,django,path | 4,623,663 | 3 | true | 1 | 0 | I would suggest that you try the following workflow:
Create a new virtualenv for every project you start (use --no-site-packages)
Install all your dependencies (including django) in the project's virtualenv
Use pip install -e to install things you need to have an editable version of.
Alternatively, fork the project, a... | 2 | 0 | 0 | I'm using the Django Registration class, it's great, but the last version shipped with an issue and it's no longer updated
I've installed it on my path (downloaded it then python setup.py install) then added it to my projects installed apps
I'm on debian, and It's copied itself to /usr/lib/python2.5/site-packages/regis... | Django installed apps location for classes on system path | 1.2 | 0 | 0 | 651 |
4,622,111 | 2011-01-07T02:52:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,ide,editor | 4,622,125 | 5 | false | 0 | 0 | Eclipse with the official google appenine plugin and the pydev plugin. | 1 | 4 | 0 | Which editor or IDE do you use when you edit Python scripts? Especially when you are working on Google App Engine.
Do you know any editor/IDE which support Syntax highlighting and auto-completion for Google App Engine modules?
Thanks in advance for any suggestion. | Which editor/IDE is the best for editing Python scripts for Google App Engine? | 0.039979 | 0 | 0 | 2,971 |
4,622,234 | 2011-01-07T03:20:00.000 | 0 | 0 | 1 | 0 | python | 4,626,438 | 6 | false | 0 | 0 | Carl, whenever you write data into a file what Python actually does is buffer the data and then does its I/O operation with the file (writing the data into the file). This operation is called 'flushing' (the buffers). You have to make sure you are close()ing the opened file, if not, buffer won't be flushed and thus you... | 1 | 22 | 0 | I have a list: ['1','2','3'] and want to convert it to 1,2,3 i.e. no brackets or quotation marks. | How to convert a list to a csv in python | 0 | 0 | 0 | 89,415 |
4,622,988 | 2011-01-07T06:18:00.000 | 2 | 0 | 0 | 0 | python,algorithm | 4,623,782 | 4 | false | 0 | 0 | Make a dict {graticule: [users]} (a "graticule" is a block of 1 degree latitude x 1 degree longitude; so you can basically just round the values). To find nearby users, first get users from the same and adjacent graticules (since the target could be near an edge), then filter them with a basic bounding-box test (i.e. w... | 1 | 4 | 0 | I have a python program sitting in server side managing user location informations, each friend has a pair of (longtitude, latitude), given a (longtitude, latitude) point, how I can find the nearby(say within 5KM) friends efficiently?
I have 10K users online...
Thanks.
Bin | algorithm to find the nearby friends? | 0.099668 | 0 | 1 | 2,000 |
4,623,008 | 2011-01-07T06:21:00.000 | 6 | 0 | 1 | 0 | python,virtualenv | 4,623,250 | 3 | false | 0 | 0 | It sound like what your really after is a way to bundle up a particular python installation and script into a distributable package. You can do the following:
Download, compile and install python into a project directory (ie. python-toolchain)
Create a prefix script (toolchain) that will take a relative path and upda... | 2 | 18 | 0 | I want to create a private, self-contained Python environment that doesn't link back to system libraries (the way virtualenv does) and also includes its own versions of standard C/C++ libraries for Python packages that are simply wrappers for these libraries (PIL and libjpeg, for example).
I've seen commercial apps tha... | What's the best way to make a private, self-contained python environment? | 1 | 0 | 0 | 9,370 |
4,623,008 | 2011-01-07T06:21:00.000 | 1 | 0 | 1 | 0 | python,virtualenv | 4,623,023 | 3 | false | 0 | 0 | Try cx_Freeze or py2exe. They're used to package Python apps to make them redistributable, and include all the packages/libraries that it depends on. | 2 | 18 | 0 | I want to create a private, self-contained Python environment that doesn't link back to system libraries (the way virtualenv does) and also includes its own versions of standard C/C++ libraries for Python packages that are simply wrappers for these libraries (PIL and libjpeg, for example).
I've seen commercial apps tha... | What's the best way to make a private, self-contained python environment? | 0.066568 | 0 | 0 | 9,370 |
4,623,031 | 2011-01-07T06:24:00.000 | 0 | 0 | 0 | 0 | wxpython | 4,623,890 | 2 | false | 0 | 1 | thanks for ur reply
got it now..i was missing style keyword ..earliar it has not given error thats why
didnot found it
self.ln = wx.StaticLine(self, -1, size=(4,479),style=wx.LI_VERTICAL) | 1 | 4 | 0 | i am trying below code still it is giving me horizontal line..i am missing something?
self.ln = wx.StaticLine(self,-1,wx.Point(620,0), wx.Size(687,7),wx.LI_VERTICAL)
self.ln.SetForegroundColour(wx.Colour(255,0,255)) | How to draw vertical line using wxpython | 0 | 0 | 0 | 6,448 |
4,623,047 | 2011-01-07T06:26:00.000 | 1 | 1 | 0 | 0 | c#,java,c++,python,c | 4,623,129 | 1 | false | 0 | 1 | From the viewpoint of a normal program (i.e., not a device driver) a Wi-Fi connection is just a network connection -- not noticeably different from (for example) a wired Ethernet connection.
Real-time graphing and digital signal processing libraries are probably a little less common, but not much. "Real time" is one of... | 1 | 1 | 0 | Simply, I'm developing a wireless ECG (electrocardiogram, or EKG from the German Elektrokardiogramm) and I need to choose the best language for a desktop application that allows the following:
wireless transmission of data over WiFi
real-time graphing of ECG data signal
a good DSP library
Thanks. | ECG/EKG software language advice | 0.197375 | 0 | 0 | 883 |
4,623,930 | 2011-01-07T09:01:00.000 | 0 | 0 | 1 | 0 | xcode,boost-python | 4,627,509 | 1 | true | 0 | 1 | I'v finally found this error. buid boost python with
./bjam toolset=darwin-4.2 architecture=x86 address-model=32 link=static threading=multi runtime-link=static
did the job, as i am on i86 arch. | 1 | 0 | 0 | i' have downloaded boost 1.45.0, installed Python 3.1.3 on my mac.
I have the build Boost with Python succesfully.
For this i had to edit my "project-config.jam" and add "using python : 3.1 : /Library/Frameworks/Python.framework/Versions/3.1;" into it.
At this point all seems to be allright.
Now when i try to use this ... | Linker issue with boost python on Xcode | 1.2 | 0 | 0 | 380 |
4,624,970 | 2011-01-07T11:22:00.000 | 27 | 0 | 0 | 0 | python,numpy | 19,825,314 | 12 | false | 0 | 0 | Another approach (more words, less code) that may help:
The locations of local maxima and minima are also the locations of the zero crossings of the first derivative. It is generally much easier to find zero crossings than it is to directly find local maxima and minima.
Unfortunately, the first derivative tends to "am... | 1 | 152 | 1 | Can you suggest a module function from numpy/scipy that can find local maxima/minima in a 1D numpy array? Obviously the simplest approach ever is to have a look at the nearest neighbours, but I would like to have an accepted solution that is part of the numpy distro. | Finding local maxima/minima with Numpy in a 1D numpy array | 1 | 0 | 0 | 290,777 |
4,625,108 | 2011-01-07T11:38:00.000 | 1 | 0 | 0 | 0 | python,python-3.x,tkinter | 4,625,172 | 2 | false | 0 | 1 | I'm not sure what you mean by "storing an object". The canvas gives each thing you draw an id, but you don't have to store it. You can't prevent the canvas from assigning an id to the object but are free to completely ignore it.
What problem are you trying to solve where you perceive this to be an issue?
[edit] To clar... | 1 | 1 | 0 | Is there a way to draw to ttkinter.Canvas like javascript or .NET canvas?
I.E drawline() without storing an object for that line which can be manipulated later. | Using tkinter.Canvas stateless-ly | 0.099668 | 0 | 0 | 248 |
4,625,835 | 2011-01-07T13:18:00.000 | 2 | 0 | 0 | 0 | python,django,oracle,django-models,model | 6,583,775 | 1 | true | 1 | 0 | The solution was to add an index. | 1 | 2 | 0 | I work with Oracle Database and lastest Django but when i use the default user model is the query very slow
what can i do? | how can i optimize a django oracle connection? | 1.2 | 1 | 0 | 305 |
4,625,844 | 2011-01-07T13:19:00.000 | -3 | 0 | 1 | 0 | python,google-app-engine,jquery | 4,625,942 | 3 | false | 0 | 0 | I believe you need to create a route for the app engine, and call that route with jQuery.
--EDIT-- The below turns out to be really really untrue, so don't mind it!!! I'm not going to remove it 'cause that would be lame. I have done some work with the Python SDK and tiny bit with the Java SDK, and doing so I felt the P... | 1 | 1 | 0 | i am learning python with GAE and for interface use jquery so i want to know calling python function using jquery. | how to call python function using jquery? | -0.197375 | 0 | 0 | 1,919 |
4,626,356 | 2011-01-07T14:18:00.000 | 1 | 0 | 0 | 1 | python,hadoop,mapreduce,hadoop-plugins | 4,980,434 | 4 | false | 0 | 0 | If you are already writing your mapper and reducer in Python, I would consider using Dumbo where such an operation is straightforward. The sequence of your map reduce jobs, your mapper, reducer etc. are all in one python script that can be run from the command line. | 1 | 7 | 0 | I am in scenario where I have two mapreduce jobs. I am more comfortable with python and planning to use it for writing mapreduce scripts and use hadoop streaming for the same. is there a convenient to chain both the jobs following form when hadoop streaming is used?
Map1 -> Reduce1 -> Map2 -> Reduce2
I've heard a lot o... | Chaining multiple mapreduce tasks in Hadoop streaming | 0.049958 | 0 | 0 | 7,633 |
4,626,726 | 2011-01-07T14:53:00.000 | 0 | 0 | 0 | 1 | python,linux,sockets,network-traffic | 4,630,096 | 3 | false | 0 | 0 | Why would the INADDR_ANY IP address fail? It shouldn't. From my point of view, something else is missing in your picture. What happens if you try, except the code block, using (errno, string) to get a more descriptive error msg. | 2 | 1 | 0 | I've got a Python library I am trying to debug (pyzeroconf). The following code returns '34' as if the data was sent down the socket but I can't see those packets on 2 different wireshark equipped PCs.
bytes_sent = self.socket.sendto(out.packet(), 0, (addr, port))
I am at the point where I need to understand what's goi... | tracing Linux socket calls? | 0 | 0 | 0 | 2,163 |
4,626,726 | 2011-01-07T14:53:00.000 | 1 | 0 | 0 | 1 | python,linux,sockets,network-traffic | 4,626,823 | 3 | false | 0 | 0 | I'm quite sure this not what you expect, but can help:
strace -f -F python myscript.py
strace dump the system calls of a generic program. | 2 | 1 | 0 | I've got a Python library I am trying to debug (pyzeroconf). The following code returns '34' as if the data was sent down the socket but I can't see those packets on 2 different wireshark equipped PCs.
bytes_sent = self.socket.sendto(out.packet(), 0, (addr, port))
I am at the point where I need to understand what's goi... | tracing Linux socket calls? | 0.066568 | 0 | 0 | 2,163 |
4,628,424 | 2011-01-07T17:33:00.000 | 1 | 0 | 1 | 0 | python,multithreading,apache | 4,632,468 | 1 | false | 0 | 0 | Why don't start these threads in the background? Why do they need to be part of the webserver? I would suggest that you write some scripts that either sit idle in the background all the time, or are called periodically by a cron job. The python scripts could lookup info in the database or even use a file to indicate... | 1 | 0 | 0 | I don't need the threads to be aware of each other. They just need to preform a task that shouldn't take more than two or three seconds tops. What can I do to guarantee that the tread will not be killed before the task is completed. Also, I need to use the occasionally timer thread. The timer is only for a minute but I... | Worried about threading in python on apache server | 0.197375 | 0 | 0 | 132 |
4,628,610 | 2011-01-07T17:52:00.000 | 0 | 0 | 0 | 0 | python,http,urllib2 | 4,629,038 | 3 | false | 0 | 0 | Depending on what kind of authentication is required, you can send the Authorization headers manually by adding them to your request before you send out a body. | 1 | 2 | 0 | I am trying access a REST API.
I can get it working in Curl/REST Client (the UI tool), with preemptive authentication enabled.
But, using urllib2, it doesn't seem to support this by default and I can't find a way to turn it on.
Thanks :) | does urllib2 support preemptive authentication authentication? | 0 | 0 | 1 | 2,937 |
4,628,922 | 2011-01-07T18:27:00.000 | 25 | 0 | 1 | 0 | c++,python,linux,json,scons | 4,629,086 | 3 | true | 0 | 0 | Here's what I did:
apt-get install scons
wget "http://downloads.sourceforge.net/project/jsoncpp/jsoncpp/0.5.0/jsoncpp-src-0.5.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fjsoncpp%2F&ts=1294425421&use_mirror=freefr"
tar -xvzf jsoncpp-src-0.5.0.tar.gz
cd jsoncpp-src-0.5.0
scons platform=linux-gcc
jsoncpp doesn'... | 1 | 13 | 0 | I am trying to build jsoncpp on Ubuntu 10.x - however the 'instructions' are at times vague. For example, it is not clear exactly which folder the scons.py file needs to reside in before the lib can be built.
Can someone outline the steps required to build the jsoncpp library? on Linux, or failing that, if anyone is aw... | building jsoncpp (Linux) - an instruction for us mere mortals? | 1.2 | 0 | 0 | 14,935 |
4,630,564 | 2011-01-07T21:41:00.000 | 2 | 0 | 0 | 0 | python,django,django-forms | 4,630,577 | 1 | true | 1 | 0 | Yes - take a look at self.instance from inside your form's clean method. | 1 | 0 | 0 | Is there a way to access the database object from the django form cleaner? Or at least the URL to which the form data was posted? If I can get the URL, I can query for the database object.
My use case is that, I have a form that should raise an error if the database object from which the form was generated is in some p... | Accessing database objects in Django form cleaner | 1.2 | 0 | 0 | 90 |
4,630,723 | 2011-01-07T22:07:00.000 | 4 | 0 | 1 | 0 | python,random | 4,630,743 | 5 | false | 0 | 0 | To guarantee that there will be the same number of zeros and ones you can generate a list containing n/2 zeros and n/2 ones and shuffle it with random.shuffle.
For small n, if you aren't happy that the result passes your acceptance criteria (e.g. not too many consecutive equal numbers), shuffle again. Be aware that doi... | 2 | 1 | 1 | Here's the problem: I try to randomize n times a choice between two elements (let's say [0,1] -> 0 or 1), and my final list will have n/2 [0] + n/2 [1]. I tend to have this kind of result: [0 1 0 0 0 1 0 1 1 1 1 1 1 0 0, until n]: the problem is that I don't want to have serially 4 or 5 times the same number so often. ... | Using Python for quasi randomization | 0.158649 | 0 | 0 | 588 |
4,630,723 | 2011-01-07T22:07:00.000 | 1 | 0 | 1 | 0 | python,random | 4,630,745 | 5 | false | 0 | 0 | Having 6 1's in a row isn't particularly improbable -- are you sure you're not getting what you want?
There's a simple Python interface for a uniformly distributed random number, is that what you're looking for? | 2 | 1 | 1 | Here's the problem: I try to randomize n times a choice between two elements (let's say [0,1] -> 0 or 1), and my final list will have n/2 [0] + n/2 [1]. I tend to have this kind of result: [0 1 0 0 0 1 0 1 1 1 1 1 1 0 0, until n]: the problem is that I don't want to have serially 4 or 5 times the same number so often. ... | Using Python for quasi randomization | 0.039979 | 0 | 0 | 588 |
4,634,171 | 2011-01-08T13:52:00.000 | 0 | 1 | 0 | 0 | php,python,email | 4,634,184 | 2 | false | 0 | 0 | You could read up to the first blank line, use those as additional headers, then send the rest in the body. | 1 | 1 | 0 | Is it possible to send a MIME message as it is, without adding any headers? For example, if I have a correct MIME message with all headers and content saved to a text file, is it possible to use the contents of this file without modification and send it via SMTP?
Apparently both python's SMTP.sendmail and PHP smtp::mai... | Sending a MIME email prepared beforehand (in PHP or Python) | 0 | 0 | 1 | 161 |
4,635,033 | 2011-01-08T17:08:00.000 | 5 | 0 | 0 | 1 | python,django,asynchronous,twisted | 4,635,379 | 3 | true | 1 | 0 | On my system, RabbitMQ running with pretty reasonable defaults is using about 2MB of RAM. Celeryd uses a bit more, but not an excessive amount.
In my opinion, the overhead of RabbitMQ and celery are pretty much negligible compared to the rest of the stack. If you're processing jobs that are going to take several minut... | 2 | 6 | 0 | All: I'm seeking input/guidance/and design ideas. My goal is to find a lean but reliable way to take XML payload from an HTTP POST (no problems with this part), parse it, and spawn a relatively long-lived process asynchronously.
The spawned process is CPU intensive and will last for roughly three minutes. I don't expe... | Async spawing of processes: design question - Celery or Twisted | 1.2 | 0 | 0 | 1,689 |
4,635,033 | 2011-01-08T17:08:00.000 | 0 | 0 | 0 | 1 | python,django,asynchronous,twisted | 4,635,409 | 3 | false | 1 | 0 | I'll answer this question as though I was the one doing the project and hopefully that might give you some insight.
I'm working on a project that will require the use of a queue, a web server for the public facing web application and several job clients.
The idea is to have the web server continuously running (no need ... | 2 | 6 | 0 | All: I'm seeking input/guidance/and design ideas. My goal is to find a lean but reliable way to take XML payload from an HTTP POST (no problems with this part), parse it, and spawn a relatively long-lived process asynchronously.
The spawned process is CPU intensive and will last for roughly three minutes. I don't expe... | Async spawing of processes: design question - Celery or Twisted | 0 | 0 | 0 | 1,689 |
4,635,372 | 2011-01-08T18:15:00.000 | 0 | 0 | 0 | 0 | python,flash,hook | 4,636,338 | 2 | true | 0 | 0 | Although in theory anything is possible, I don't see how you in any reasonable way can inspect the running state of a Flash program from Python.
It might be possible if Flash have some sort of debug mode, where you can attach to the process and inspect it that way. I don't know if it does. But look into Flash debuggers... | 2 | 2 | 0 | I have a .swf file that is running, I want to be able to call its internal function and modify/fetch its variable values.
How can I do this with python? | Is it posible to hook a .swf and call it's functions with python? If so, how? | 1.2 | 0 | 0 | 933 |
4,635,372 | 2011-01-08T18:15:00.000 | 0 | 0 | 0 | 0 | python,flash,hook | 54,529,617 | 2 | false | 0 | 0 | Yes,it's possible to do it with Python,but you have to hack the swf first,this might not be what Python can do easily. | 2 | 2 | 0 | I have a .swf file that is running, I want to be able to call its internal function and modify/fetch its variable values.
How can I do this with python? | Is it posible to hook a .swf and call it's functions with python? If so, how? | 0 | 0 | 0 | 933 |
4,637,190 | 2011-01-09T01:31:00.000 | 0 | 0 | 0 | 0 | python,bitmap,performance | 4,637,207 | 3 | false | 0 | 1 | One thing I might suggest is using Python's built-in array class (http://docs.python.org/library/array.html), with a type of 'B'. Coding will be simplest if you use one byte per pixel, but if you want to save memory, you can pack 8 to a byte, and access using your own bit manipulation. | 2 | 3 | 1 | i want to implement 1024x1024 monochromatic grid , i need read data from any cell and insert rectangles with various dimensions, i have tried to make list in list ( and use it like 2d array ), what i have found is that list of booleans is slower than list of integers.... i have tried 1d list, and it was slower than 2d ... | Python Fast monochromatic bitmap | 0 | 0 | 0 | 651 |
4,637,190 | 2011-01-09T01:31:00.000 | 2 | 0 | 0 | 0 | python,bitmap,performance | 4,637,284 | 3 | false | 0 | 1 | Raph's suggestin of using array is good, but it won't help on CPython, in fact I'd expect it to be 10-15% slower, however if you use it on PyPy (http://pypy.org/) I'd expect excellent results. | 2 | 3 | 1 | i want to implement 1024x1024 monochromatic grid , i need read data from any cell and insert rectangles with various dimensions, i have tried to make list in list ( and use it like 2d array ), what i have found is that list of booleans is slower than list of integers.... i have tried 1d list, and it was slower than 2d ... | Python Fast monochromatic bitmap | 0.132549 | 0 | 0 | 651 |
4,637,886 | 2011-01-09T05:47:00.000 | 4 | 0 | 0 | 0 | python,mysql | 4,656,098 | 2 | false | 0 | 0 | There exists a SELECT ... FOR UPDATE that allows you to lock the rows from being read by another transaction but I believe the records have to exist in the first place. Then you can do as you say, and unlock it once you commit.
In your case I think the best approach is to simply set a unique constraint on the username... | 1 | 2 | 0 | I know that with an InnoDB table, transactions are autocommit, however I understand that to mean for a single statement? For example, I want to check if a user exists in a table, and then if it doesn't, create it. However there lies a race condition. I believe using a transaction prior to doing the select, will ensure ... | How do you create a transaction that spans multiple statements in Python with MySQLdb? | 0.379949 | 1 | 0 | 363 |
4,638,806 | 2011-01-09T11:07:00.000 | 0 | 0 | 0 | 0 | python,pydot | 4,844,143 | 1 | true | 0 | 1 | I found out that writing the string in unicode representation shows mathematical symbols as edges...
For example you can write node = pydot.Node("ε",shape = "ellipse", style="filled", fillcolor="turquoise")
Using this we get epsilon as label of the node....
Similarly we can get rest of the mathematical symbols.... | 1 | 1 | 0 | I am having problem with drawing in pydot.
The problem lies in defining the layout of the nodes created. Currently everything is drawn vertically and is not spread. This gives me the problem of going down to see the nodes created.
Is there any way I can define the nodes to be created horizontally whenever they are ver... | changing layout and inserting mathematical symbols with pydot | 1.2 | 0 | 0 | 419 |
4,640,809 | 2011-01-09T18:05:00.000 | 2 | 0 | 1 | 0 | java,python,c,haskell,vm-implementation | 4,640,829 | 8 | false | 0 | 0 | There's no "need", any of these languages provide compilers that directly emit the machine code to implement the semantics of their language in a given architecture.
The idea of a virtual machine is to abstract away the architectural differences between all the different hardware and software manufacturers so that deve... | 6 | 26 | 0 | So, for example, Python and Java have a VM, C and Haskell do not. (Correct me if I'm wrong)
Thinking about what languages on both sides of the line have, I can't find the reason. Java is static in a lot of ways, while Haskell provides a lot of dynamic features. | What is a VM and why do dynamic languages need one? | 0.049958 | 0 | 0 | 6,313 |
4,640,809 | 2011-01-09T18:05:00.000 | 2 | 0 | 1 | 0 | java,python,c,haskell,vm-implementation | 4,640,832 | 8 | false | 0 | 0 | Java and python can be compiled in a way that maintains platform independance. This holds even for C#. Advantages are that VMs are able to convert this mostly strongly typed bytecode into very good platform specific code with relativ low overhead. Since Java is intended to "build once - run anywhere", the JVM has been ... | 6 | 26 | 0 | So, for example, Python and Java have a VM, C and Haskell do not. (Correct me if I'm wrong)
Thinking about what languages on both sides of the line have, I can't find the reason. Java is static in a lot of ways, while Haskell provides a lot of dynamic features. | What is a VM and why do dynamic languages need one? | 0.049958 | 0 | 0 | 6,313 |
4,640,809 | 2011-01-09T18:05:00.000 | 4 | 0 | 1 | 0 | java,python,c,haskell,vm-implementation | 4,640,861 | 8 | false | 0 | 0 | A VM (Virtual Machine) is actually a tool for a language designer to avoid some complexity in writing the implementation of a language.
Basically is a specification of a virtual computer and how each piece of said computer will interact with the other. You can code some assumptions in this specification that can be us... | 6 | 26 | 0 | So, for example, Python and Java have a VM, C and Haskell do not. (Correct me if I'm wrong)
Thinking about what languages on both sides of the line have, I can't find the reason. Java is static in a lot of ways, while Haskell provides a lot of dynamic features. | What is a VM and why do dynamic languages need one? | 0.099668 | 0 | 0 | 6,313 |
4,640,809 | 2011-01-09T18:05:00.000 | 2 | 0 | 1 | 0 | java,python,c,haskell,vm-implementation | 4,642,119 | 8 | false | 0 | 0 | Imagine you created a programming language: you figured out the language semantics and developed a nice syntax.
However, a textual representation isn't enough: Having to parse text again and again when executing a program is inefficient, so it's natural to add an in-memory binary representation. Couple that with a cust... | 6 | 26 | 0 | So, for example, Python and Java have a VM, C and Haskell do not. (Correct me if I'm wrong)
Thinking about what languages on both sides of the line have, I can't find the reason. Java is static in a lot of ways, while Haskell provides a lot of dynamic features. | What is a VM and why do dynamic languages need one? | 0.049958 | 0 | 0 | 6,313 |
4,640,809 | 2011-01-09T18:05:00.000 | 4 | 0 | 1 | 0 | java,python,c,haskell,vm-implementation | 4,641,378 | 8 | false | 0 | 0 | A virtual machine is basically an interpreter that interprets a language closer to machine code. When real machine interprets real machine code, Virtual Machine interprets a made-up machine code. Some VM-s interpret machine code of an actual computer - these are called emulators.
It's easier to write an interpreter for... | 6 | 26 | 0 | So, for example, Python and Java have a VM, C and Haskell do not. (Correct me if I'm wrong)
Thinking about what languages on both sides of the line have, I can't find the reason. Java is static in a lot of ways, while Haskell provides a lot of dynamic features. | What is a VM and why do dynamic languages need one? | 0.099668 | 0 | 0 | 6,313 |
4,640,809 | 2011-01-09T18:05:00.000 | 29 | 0 | 1 | 0 | java,python,c,haskell,vm-implementation | 4,640,820 | 8 | false | 0 | 0 | It's nothing to do with static vs. dynamic.
Rather, it's about becoming independent from the underlying hardware platform ("build once, run everywhere" - in theory...)
Actually, it's nothing to do with the language, either. One could write a C compiler that generates bytecode for the JVM. One could write a Java compi... | 6 | 26 | 0 | So, for example, Python and Java have a VM, C and Haskell do not. (Correct me if I'm wrong)
Thinking about what languages on both sides of the line have, I can't find the reason. Java is static in a lot of ways, while Haskell provides a lot of dynamic features. | What is a VM and why do dynamic languages need one? | 1 | 0 | 0 | 6,313 |
4,641,187 | 2011-01-09T19:19:00.000 | 1 | 1 | 1 | 0 | php,python,image,image-processing,image-manipulation | 4,641,208 | 5 | false | 1 | 0 | Possibly neither; it depends on what you want to do.
Both PHP and Python are scripting languages, and are therefore not suited for high-performance numerical routines (which most image processing requires). However, they both have a number of image-processing libraries available for them, the innards of which are prob... | 4 | 3 | 0 | I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help.
Let me know your thoughts! | PHP or Python for Image Processing? | 0.039979 | 0 | 0 | 2,343 |
4,641,187 | 2011-01-09T19:19:00.000 | 2 | 1 | 1 | 0 | php,python,image,image-processing,image-manipulation | 4,641,228 | 5 | false | 1 | 0 | One cannot suggest much without knowing the kind of image processing you have in mind.
If you just want to do some generic rotate/resize/etc then I guess there isn't much difference.
If you want to do something more complex, then study the libraries and decide which fits best for your particular task.
If you want to d... | 4 | 3 | 0 | I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help.
Let me know your thoughts! | PHP or Python for Image Processing? | 0.07983 | 0 | 0 | 2,343 |
4,641,187 | 2011-01-09T19:19:00.000 | 0 | 1 | 1 | 0 | php,python,image,image-processing,image-manipulation | 4,641,242 | 5 | false | 1 | 0 | It really depends on what you want to do with the images. You probably should just use a batch or similar script to run a command that does the processing your looking for.
Between the two languages, I would go with python. The command line interface for php is only a recent addition, while python was designed primaril... | 4 | 3 | 0 | I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help.
Let me know your thoughts! | PHP or Python for Image Processing? | 0 | 0 | 0 | 2,343 |
4,641,187 | 2011-01-09T19:19:00.000 | 1 | 1 | 1 | 0 | php,python,image,image-processing,image-manipulation | 4,641,248 | 5 | false | 1 | 0 | Python is more clean and readable.
For image processing there is the imageMagic library available for Python and PHP too.
If you want to do some other complex image processing, which cannot by done using a library and you still want to do it in Python or PHP, then Python is defenitely the answer as Python can be extend... | 4 | 3 | 0 | I am writing an application for image processing. I am just wondering which programming language would be the best fit. Python or PHP. This process is system based not web based so I am just thinking if Python could be of more help.
Let me know your thoughts! | PHP or Python for Image Processing? | 0.039979 | 0 | 0 | 2,343 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.