Q_Id
int64
2.93k
49.7M
CreationDate
stringlengths
23
23
Users Score
int64
-10
437
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
DISCREPANCY
int64
0
1
Tags
stringlengths
6
90
ERRORS
int64
0
1
A_Id
int64
2.98k
72.5M
API_CHANGE
int64
0
1
AnswerCount
int64
1
42
REVIEW
int64
0
1
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
15
5.1k
Available Count
int64
1
17
Q_Score
int64
0
3.67k
Data Science and Machine Learning
int64
0
1
DOCUMENTATION
int64
0
1
Question
stringlengths
25
6.53k
Title
stringlengths
11
148
CONCEPTUAL
int64
0
1
Score
float64
-1
1.2
API_USAGE
int64
1
1
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
15
3.72M
22,017,118
2014-02-25T14:28:00.000
3
0
1
0
0
python,multiprocessing,pool
0
33,544,728
0
2
0
false
0
0
You can use as many workers as you have memory for. That being said, if you set up a pool without any process flag, you'll get workers equal to the machine CPUs: From Pool docs: processes is the number of worker processes to use. If processes is None then the number returned by os.cpu_count() is used. If you're doing...
1
6
0
0
I am making use of Python's multiprocessor library and wondering what would be the maximum of worker processes I can call? E.g. I have defined async.pool = Pool(100) which would allow me to have max 100 async processes running at the same time, but I have no clue what would be the real maximum value for this? Does anyo...
Python multiprocessing: max. number of Pool worker processes?
0
0.291313
1
0
0
6,331
22,020,129
2014-02-25T16:24:00.000
4
0
1
1
0
ipython-notebook
0
22,020,213
0
2
0
true
0
0
One minute later and it occurs to me that the front page might not support even though the server does. Sure enough, http://localhost:5000/localfile/PythonReference.ipynb?create=1 renders the local notebook.
1
5
0
0
I've got nbviewer installed and working. I see it has a --localfiles option that takes a folder name. It says: "Serving local notebooks in /home/gb/S14/inclass, this can be a security risk" But I can't figure out the URL format to get it to look for the file there. The code adds a handler for /localfile/(.*) but that d...
How to make nbviewer display local files?
0
1.2
1
0
0
4,226
22,029,142
2014-02-26T00:21:00.000
2
0
0
0
0
python,scipy
1
22,044,916
0
1
0
true
0
0
Try scipy.odr. It allows to specify weights/errors in both input and response variable.
1
0
1
0
So I already know how to use scipy.optimize.curve_fit for normal fitting needs, but what do I do if both my x data and my y data both have error bars?
Scipy: Fitting Data with Two Dimensional Error
0
1.2
1
0
0
104
22,030,696
2014-02-26T02:47:00.000
0
0
0
0
0
python,django,content-management-system,django-cms
0
22,035,806
0
2
0
false
1
0
django CMS is a CMS on top of django. It supports multiple languages really well and plays nice together with your own django apps. The basic idea is that you define placeholders in your template and then are able to fill those placeholders with content plugins. A content plugin can be a anything from text, picture, tw...
1
1
0
1
I am new to Django, but heard it was promising when attempting to create a a custom CMS. I am looking to get started, but their seems to be a lack of documentation, tutorials, etc on how to actually get something like this going. I am curious if their are any books/tutorials/guides that can help me get started with CM...
Best way to build a custom Django CMS
0
0
1
0
0
2,589
22,051,158
2014-02-26T19:22:00.000
2
0
1
0
0
python,pip,easy-install
0
51,204,337
1
3
0
false
0
0
To uninstall pip in windows: Run command prompt as administrator Give the command easy_install -m pip This may not uninstall pip completely. So again give this command pip uninstall pip If by previous command pip got uninstalled then this command wont run, else it will completely remove pip Now check by giving command...
1
7
0
0
On Windows 7, I install pip with easy_install and want to install a lower version of pip. I want to remove the old version, but have no idea how to completely remove the pip installed by easy_install (or if there is a way to do it without going through easy_install, that is fine). How do I do this?
How to fully uninstall pip installed with easy_install?
1
0.132549
1
0
0
63,563
22,057,077
2014-02-27T01:15:00.000
-1
0
1
0
0
python,linux,tkinter,tk,python-2.6
0
22,057,396
0
3
0
false
0
1
Have you tried using pip-2.6 install package?
3
1
0
0
I installed Python 2.6 from source for software testing (2.7 was preinstalled on my Linux distro). However, I cannot import Tkinter within 2.6, I suppose because it doesn't know where to find Tk. How do I either help 2.6 find the existing Tkinter install or reinstall Tkinter for 2.6?
Installed Python from source and cannot import Tkinter - how to install?
0
-0.066568
1
0
0
417
22,057,077
2014-02-27T01:15:00.000
1
0
1
0
0
python,linux,tkinter,tk,python-2.6
0
22,058,494
0
3
0
true
0
1
I solved this by adding '/usr/lib/x86_64-linux-gnu' to lib_dirs in setup.py, then rebuilding python
3
1
0
0
I installed Python 2.6 from source for software testing (2.7 was preinstalled on my Linux distro). However, I cannot import Tkinter within 2.6, I suppose because it doesn't know where to find Tk. How do I either help 2.6 find the existing Tkinter install or reinstall Tkinter for 2.6?
Installed Python from source and cannot import Tkinter - how to install?
0
1.2
1
0
0
417
22,057,077
2014-02-27T01:15:00.000
1
0
1
0
0
python,linux,tkinter,tk,python-2.6
0
22,057,115
0
3
0
false
0
1
Install the TCL and Tk development files and rebuild Python.
3
1
0
0
I installed Python 2.6 from source for software testing (2.7 was preinstalled on my Linux distro). However, I cannot import Tkinter within 2.6, I suppose because it doesn't know where to find Tk. How do I either help 2.6 find the existing Tkinter install or reinstall Tkinter for 2.6?
Installed Python from source and cannot import Tkinter - how to install?
0
0.066568
1
0
0
417
22,067,766
2014-02-27T11:54:00.000
0
0
0
0
0
python,django,angularjs,heroku,architecture
0
22,103,027
0
2
0
false
1
0
What you guys think about architecture? This is a common Service Oriented Architecture with decoupled Clients. You just have REST endpoints on your backend, and any Client can consume those endpoints. You should also think about: Do you need RESTful service (RESTful == stateless, will you store any state on the serve...
1
0
0
1
Currently I am working on a portal which is exposed to end users. This portal is developed using Python 2.7, Django 1.6 and MySQL. Now we want to expose this portal as a mobile app. But current design does not support that as templates, views and database are tightly coupled with each other. So we decided to re-archit...
How to re-architect a portal for creating mobile app
0
0
1
0
0
183
22,071,291
2014-02-27T14:22:00.000
0
0
0
0
1
python,events,pyqt,pyside,qt-designer
0
22,102,393
0
2
0
false
0
1
Monkey Patching did the job, I dont know why I didn't taught of that
1
0
0
0
I am using PySide in a not-so-MVC fashion, meaning, I try as much as possible not to edit the generated .ui to .py file, I put my application logic in packages (models) and I have one module (.pyw file) more like a controller for them all to initialize and perform management. Not too best of practice but I'm doing fine...
Adding Event functions outside PyQt/PySide Generated Code
0
0
1
0
0
1,710
22,077,846
2014-02-27T18:57:00.000
5
0
0
0
0
python,html,tkinter
0
22,094,453
0
1
0
true
0
1
There is no support for viewing rendered HTML in a tkinter widget. There was a project (tkhtml) to build a modern web browser using tcl/tk (which is what powers tkinter), but the project never got past a very early alpha release and the last check-in was in 2009.
1
3
0
0
I would like to read a HTML and I show it on a Tkinter window. I would like to know if this is possible with any module and if it's how can I do it, as I'm totally lost finding solutions. Thanks in advance.
Read a HTML file and show it on a Tkinter window
1
1.2
1
0
0
3,286
22,087,875
2014-02-28T06:29:00.000
7
0
1
0
0
python,python-sphinx,sphinx-apidoc
0
22,088,341
0
1
0
true
0
0
First you run sphinx-quickstart and accept the defaults to set up your basic structure this is only done once and you edit the table of contents section of index.rst to point to your tutorials, give an introduction, etc. - the you at least outline your tutorials in separate .rst files. You also edit config.py to add a...
1
6
0
1
I want to use Sphinx to document a large project that is currently not well-documented. In particular I want to use sphinx-apidoc to produce the documentation from the code as I document it. However I also want to have some pages of tutorial on how to use the project etc., but it seems when I call sphinx-apidoc it gen...
What is the correct workflow in using Sphinx for Python project documentation?
1
1.2
1
0
0
2,050
22,106,380
2014-02-28T21:42:00.000
21
0
1
0
0
python,pypdf2
0
42,181,449
0
4
0
false
0
0
If you have pip, PyPDF2 is on the Python Package Index, so you can install it with the following in your terminal/command prompt: Python 2: pip install PyPDF2 Python 3: pip3 install PyPDF2
2
15
0
0
As a newbie... I am having difficulties installing pyPDF2 module. I have downloaded. Where and how do I install (setup.py) so I can use module in python interpreter?
How do I install pyPDF2 module using windows?
0
1
1
0
0
94,939
22,106,380
2014-02-28T21:42:00.000
1
0
1
0
0
python,pypdf2
0
33,626,099
0
4
0
false
0
0
Here's how I did it: After you have downloaded and installed Python (it usually installs under C:\Python** (** being python version - usually 27)), copy the extracted PyPDF2 contents to C:\Python** folder, after that enter in command prompt/terminal "cd C:\Python27\python.exe setup.py install". If you did everything r...
2
15
0
0
As a newbie... I am having difficulties installing pyPDF2 module. I have downloaded. Where and how do I install (setup.py) so I can use module in python interpreter?
How do I install pyPDF2 module using windows?
0
0.049958
1
0
0
94,939
22,110,562
2014-03-01T05:29:00.000
0
0
0
0
0
python,database,redis,redis-py
0
22,111,910
0
1
0
false
0
0
You cannot. The number of databases is not a dynamic parameter in Redis. You can change it by updating the Redis configuration file (databases parameter) and restarting the server. From a client (Python or other), you can retrieve this value using the "GET CONFIG DATABASES" command. But the "SET CONFIG DATABASES xxx" c...
1
1
0
0
I know that Redis have 16 databases by default, but what if i need to add another database, how can i do that using redis-py?
Insert a new database in redis using redis.StrictRedis()
0
0
1
1
0
460
22,121,368
2014-03-01T22:42:00.000
0
0
0
0
1
python,linux,django,sockets
0
22,125,431
0
3
0
false
1
0
You need the following two programs running at all times: The producer, which will populate the queue. This is the program that will collect the various messages and then post them on the queue. The consumer, which will process messages from the queue. This consumer's job is to read the message and do something with i...
1
4
0
0
I've been trying to make a decision about my student project before going further. The main idea is get disk usage data, active linux user data, and so on from multiple internal server and publish them with Django. Before I came to RabbitMQ I was thinking about developing a client application for each linux server and...
Using RabbitMQ with Django to get information from internal servers
0
0
1
0
0
3,991
22,122,506
2014-03-02T00:52:00.000
4
0
0
0
0
python,r,machine-learning,scikit-learn,svm
0
22,123,913
0
2
0
true
0
0
I do not have experiece with e1070, however from googling it it seems that it either uses or is based on LIBSVM (I don't know enough R to determine which from the cran entry). Scilearnkit also uses LIBSVM. In both cases the model is going to be trained by LIBSVM. Speed, scalability, variety of options available is goi...
2
1
1
0
Recently I was contemplating the choice of using either R or Python to train support vector machines. Aside from the particular strengths and weaknesses intrinsic to both programming languages, I'm wondering if there is any heuristic guidelines for making a decision on which way to go, based on the packages themselves....
What's the difference between using libSVM in sci-kit learn, or e1070 in R, for training and using support vector machines?
1
1.2
1
0
0
381
22,122,506
2014-03-02T00:52:00.000
0
0
0
0
0
python,r,machine-learning,scikit-learn,svm
0
22,189,863
0
2
0
false
0
0
Sometime back I had the same question. Yes, both e1070 and scikit-learn use LIBSVM. I have experience with e1070 only. But there are some areas where R is better. I have read in the past that Python does not handle categorical features properly (at least not right out of the box). This could be a big deal for some. I a...
2
1
1
0
Recently I was contemplating the choice of using either R or Python to train support vector machines. Aside from the particular strengths and weaknesses intrinsic to both programming languages, I'm wondering if there is any heuristic guidelines for making a decision on which way to go, based on the packages themselves....
What's the difference between using libSVM in sci-kit learn, or e1070 in R, for training and using support vector machines?
1
0
1
0
0
381
22,132,285
2014-03-02T19:27:00.000
1
0
1
0
0
python,loops,while-loop
0
22,132,302
0
5
0
false
0
0
That is not only python , that is in most of programming languages x=1; x+=1; x will be 2 x=1; x-=1; x will be 0 x=3; x*=2; x will be 6 x=6; x/=2; x will be 3
1
0
0
0
what does +=, -=, *= and /= stand for in Python? and how do you use it for while loop?
what does +=, -=, *= and /= stand for in Python?
0
0.039979
1
0
0
25,742
22,143,644
2014-03-03T10:02:00.000
0
0
0
0
0
python,arrays,numpy
0
37,731,398
0
5
0
false
0
0
They are very applicable in scientific computing. Right now, for instance, I am running simulations which output data in a 4D array: specifically | Time | x-position | y-position | z-position |. Almost every modern spatial simulation will use multidimensional arrays, along with programming for computer games.
5
1
1
0
I was surprised when I started learning numpy that there are N dimensional arrays. I'm a programmer and all I thought that nobody ever use more than 2D array. Actually I can't even think beyond a 2D array. I don't know how think about 3D, 4D, 5D arrays or more. I don't know where to use them. Can you please give me exa...
Examples on N-D arrays usage
0
0
1
0
0
141
22,143,644
2014-03-03T10:02:00.000
0
0
0
0
0
python,arrays,numpy
0
22,146,242
0
5
0
false
0
0
There are so many examples... The way you are trying to represent it is probably wrong, let's take a simple example: You have boxes and a box stores N items in it. You can store up to 100 items in each box. You've organized the boxes in shelves. A shelf allows you to store M boxes. You can identify each box by a index...
5
1
1
0
I was surprised when I started learning numpy that there are N dimensional arrays. I'm a programmer and all I thought that nobody ever use more than 2D array. Actually I can't even think beyond a 2D array. I don't know how think about 3D, 4D, 5D arrays or more. I don't know where to use them. Can you please give me exa...
Examples on N-D arrays usage
0
0
1
0
0
141
22,143,644
2014-03-03T10:02:00.000
1
0
0
0
0
python,arrays,numpy
0
22,144,505
0
5
0
false
0
0
A few simple examples are: A n x m 2D array of p-vectors represented as an n x m x p 3D matrix, as might result from computing the gradient of an image A 3D grid of values, such as a volumetric texture These can even be combined in the case of a gradient of a volume in which case you get a 4D matrix Staying with the g...
5
1
1
0
I was surprised when I started learning numpy that there are N dimensional arrays. I'm a programmer and all I thought that nobody ever use more than 2D array. Actually I can't even think beyond a 2D array. I don't know how think about 3D, 4D, 5D arrays or more. I don't know where to use them. Can you please give me exa...
Examples on N-D arrays usage
0
0.039979
1
0
0
141
22,143,644
2014-03-03T10:02:00.000
0
0
0
0
0
python,arrays,numpy
0
22,144,263
0
5
0
false
0
0
For example, a 3D array could be used to represent a movie, that is a 2D image that changes with time. For a given time, the first two axes would give the coordinate of a pixel in the image, and the corresponding value would give the color of this pixel, or a grey scale level. The third axis would then represent time. ...
5
1
1
0
I was surprised when I started learning numpy that there are N dimensional arrays. I'm a programmer and all I thought that nobody ever use more than 2D array. Actually I can't even think beyond a 2D array. I don't know how think about 3D, 4D, 5D arrays or more. I don't know where to use them. Can you please give me exa...
Examples on N-D arrays usage
0
0
1
0
0
141
22,143,644
2014-03-03T10:02:00.000
0
0
0
0
0
python,arrays,numpy
0
22,144,157
0
5
0
false
0
0
Practical applications are hard to come up with but I can give you a simple example for 3D. Imagine taking a 3D world (a game or simulation for example) and splitting it into equally sized cubes. Each cube could contain a specific value of some kind (a good example is temperature for climate modelling). The matrix can ...
5
1
1
0
I was surprised when I started learning numpy that there are N dimensional arrays. I'm a programmer and all I thought that nobody ever use more than 2D array. Actually I can't even think beyond a 2D array. I don't know how think about 3D, 4D, 5D arrays or more. I don't know where to use them. Can you please give me exa...
Examples on N-D arrays usage
0
0
1
0
0
141
22,146,944
2014-03-03T12:34:00.000
1
0
0
1
0
python,rabbitmq,celery
0
56,632,082
0
3
0
false
0
0
Celery can use several back-ends. If you are already using RabbitMQ, it makes that option attractive. These are however different concerns. Use a generic RabbitMQ client library such as pika to implement a consumer for your messages, then, if needed, use Celery to schedule tasks.
1
5
0
0
The celery docs suggest that Rabbit-MQ must act like a middleman, where it is used as a messaging platform. In my infrastructure, Rabbit-MQ is the primary server that serves me with some data every second. Now, whenever the data is served, I want Celery to do certain tasks. Now, this throws out the whole publisher-wo...
How to use celery to get messages from a rabbit-mq server?
0
0.066568
1
0
0
1,369
22,148,917
2014-03-03T14:10:00.000
0
0
0
0
0
python,pip,rackspace,iron.io,pyrax
0
22,153,710
0
2
0
false
0
0
It's difficult to know for sure what's happening without being able to see a traceback. Do you get anything like that which could be used to help figure out what's going on?
2
1
0
0
I created a Python script to use Rackspace's API (Pyrax) to handle some image processing. It works perfect locally, but when I upload it to Iron.io worker, it builds but does not import. I am using a Windows 8 pc, but my boss runs OS X and uploading the exact worker package, it works fine. So I'm thinking it's somethi...
pip "pyrax" dependency with iron worker
0
0
1
0
1
116
22,148,917
2014-03-03T14:10:00.000
2
0
0
0
0
python,pip,rackspace,iron.io,pyrax
0
22,153,804
0
2
0
false
0
0
I figured out that it was a bad Ruby install. No idea why, but reinstalling it worked.
2
1
0
0
I created a Python script to use Rackspace's API (Pyrax) to handle some image processing. It works perfect locally, but when I upload it to Iron.io worker, it builds but does not import. I am using a Windows 8 pc, but my boss runs OS X and uploading the exact worker package, it works fine. So I'm thinking it's somethi...
pip "pyrax" dependency with iron worker
0
0.197375
1
0
1
116
22,159,351
2014-03-03T22:58:00.000
2
0
1
0
0
python,text,machine-learning,classification,tf-idf
0
22,159,481
0
1
0
true
0
0
First, let's get some terminology clear. A term is a word-like unit in a corpus. A token is a term at a particular location in a particular document. There can be multiple tokens that use the same term. For example, in my answer, there are many tokens that use the term "the". But there is only one term for "the". ...
1
0
1
0
So I'm making a python class which calculates the tfidf weight of each word in a document. Now in my dataset I have 50 documents. In these documents many words intersect, thus having multiple same word features but with different tfidf weight. So the question is how do I sum up all the weights into one singular weight?
(Text Classification) Handling same words but from different documents [TFIDF ]
0
1.2
1
0
0
722
22,165,086
2014-03-04T07:01:00.000
0
0
0
0
0
python,web-scraping
0
22,165,257
0
1
0
true
1
0
robots.txt file does have limits. Its better to inform the owner of the site if you are crawling too often and read reserved rights at the bottom of the site. It is a good idea to provide a link, to the source of your content.
1
1
0
0
I am working on creating a web spider in python. Do i have to worry about permissions from any sites for scanning there content? If so, how do i get those? Thanks in advance
Permission to get the source code using spider
0
1.2
1
0
1
43
22,175,349
2014-03-04T14:56:00.000
0
1
0
1
0
python,bash,shell,emacs,ipython
0
22,208,324
0
2
0
false
0
0
After running your /etc/university/env.sh, start Emacs from this shell. Then the variables set before are known.
1
1
0
0
I'm working for a university and they have their own libraries and paths for python libraries. Every time I start ipython, I need to run a shell script (e.g. /etc/university/env.sh) The problem is that emacs doesn't recognize the env.sh file. When I do py-shell, emacs always envokes Python WITHOUT any pre-set environme...
how to load shell environment variables when Emacs starts py-shell?
0
0
1
0
0
392
22,177,872
2014-03-04T16:45:00.000
2
0
0
0
0
python,lxml,lxml.html
0
22,177,986
0
2
0
true
1
0
This will select the parent element of the XPath expression you gave: //*[@id="titleStoryLine"]/div/h4[text()="Genres:"]/..
1
2
0
0
How can we traverse back to parent in xpath? I am crawling IMDB, to obtain genre of films, I am using elem = hxs.xpath('//*[@id="titleStoryLine"]/div/h4[text()="Genres:"]') Now,the genres are listed as anchor links, which are siblings to this tag. how can this be achieved?
Traversing back to parent with lxml.html.xpath
0
1.2
1
0
1
405
22,215,361
2014-03-06T04:57:00.000
2
0
0
0
0
java,python,user-interface,photoshop
0
22,215,461
0
2
0
false
1
1
but how do I take what I made in Photoshop add some java or python code to it to make certain things happen No, you cannot expect things to happen magically, for that you need to learn front-end technologies like HTML, CSS, JavaScript etc and manually convert the UI which is in Photoshop to corresponding code. This ap...
1
0
0
0
so I am actually trying to get into software development and I currently have just spent a few days making a GUI in Photoshop. Now I know how to code in Java and Python but I have never implemented a GUI before. I am stuck on this because I know I can write the code and everything but how do I take what I made in Photo...
UI Designed in Photoshop for Software
0
0.197375
1
0
0
1,055
22,268,968
2014-03-08T11:53:00.000
1
1
0
0
0
python,web,mod-wsgi
0
22,933,666
0
1
0
false
1
0
You'll need JavaScript to do this Possibility 1, data generated by server - Make a static HTML page with an empty div. - Place a piece of Javascript code onto it that is run after the page is loaded. - The JavaScript will contain a timer that downloads the output of your script say every 5 seconds, using AJAX ands sets...
1
1
0
0
I have a Python application that I launch from a form using mod_wsgi. I would like to display in real time the output of the script, while it is running, to a web page. Does anybody know how I can do this?
Real time output of script on web page using mod_wsgi
0
0.197375
1
0
0
406
22,274,048
2014-03-08T19:35:00.000
0
0
1
0
0
python,events,event-handling,spss
0
22,282,456
0
1
0
false
0
0
You cannot catch events using the programmability or scripting apis. The only formatting in the Data Editor comes from variable formats (and column width) except for the special coloring using with missing data imputation. Tables in the Viewer, of course, have extensive cell formatting capabilities.
1
0
0
0
I want to write a hopefully short python script that would do things with the contents of a specially formatted text cell of an spss data table. How can I hook on the event that the user clicked into a data cell? How can I then get its value and do things I want? Does spss have clear-cut interface for doing this?
how to hook on a table cell in spss using python?
0
0
1
0
0
76
22,274,186
2014-03-08T19:45:00.000
1
0
0
0
0
python,matplotlib,color-mapping
0
22,274,333
0
1
0
true
0
0
imgshow takes two arguments vmin and vmax for the color scale. You could do what you want by putting the same vmin and vmax for both your subplots. To find vmin you can take the minimum between the minimum of all the values in your data (and same reasoning for vmax).
1
0
1
0
I want to do two subplots with imshow using the same colormap by which I mean: if points in both plots have the same color, they correspond to the same value. But how can I get imshow to use only 9/10 or so of the colormap for the first plot, because it's maximal value is only 9/10 of the maximal value in the second pl...
one colormap for multiple subplots with different maximum values
0
1.2
1
0
0
105
22,282,264
2014-03-09T12:39:00.000
0
0
0
0
1
python,django,forms,session
0
22,282,298
0
2
0
true
1
0
The user is never in request.session. It's directly on the request object as request.user.
1
0
0
0
I have a form where users are submitting data. One of the fields is "author" which i automatically fill in by using the {{ user }} variable in the template, it will have the username if the user is logged in and AnonymousUser if not. This {{ user }} is not part of the form, just text. When a user submits the form i nee...
User session object is not available on POST in django?
0
1.2
1
0
0
123
22,301,208
2014-03-10T13:16:00.000
-2
0
0
1
1
python,celery
0
29,481,481
0
2
0
false
0
0
Celery is not intended to run long tasks cause it blocks the worker for your task only. I recommend re-arranging your logic, making the task invoke itself instead of making the loop. Once shutdown is in progress, your current task will complete and will resume right at the same point where it stopped before celery shut...
1
4
0
0
I'm using celery 3.X and RabbitMQ backend. From time to time it needs to restart celery (to push a new source code update to the server). But there is a task with big loop and try/catch inside of the loop; it can takes a few hours to accomplish the task. Nothing critical will happen if I will stop it and will restart i...
Notify celery task to stop during worker shutdown
0
-0.197375
1
0
0
1,753
22,357,298
2014-03-12T16:07:00.000
1
0
0
0
0
python,twitter-bootstrap,hosting
0
22,357,361
0
2
1
false
1
0
Well, then use your ubuntu system, forward the right ports in your router and give your customers a link to your IPadres. I assume you use your ubuntu system as an webserver already for testing your site?
1
2
0
0
I'm developing a website in python (with django and GIT) for an association, and I am to a point where I need to share my work for approval from the team. I have around 50 people who need to be able to access my "website" 24/7. Apparently, free hosting is not the best way to do it (see answers to my original question)....
How can I share my website in progress to partner?
0
0.099668
1
0
0
122
22,358,713
2014-03-12T17:01:00.000
2
0
1
1
0
python-3.x
0
22,358,774
0
1
0
true
0
0
Each installation of Python comes with its own respective version if IDLE. I suggest you explore your Python installation folder, and find the version of IDLE you're looking for and create a shortcut to it, or add it to your environment variable list, so you can invoke a specific version from the command line.
1
0
0
0
I am using Windows 8. Python version 2.7.3 have been installed on my computer together with another software. Now I have installed python 3.3.5 and i want to use this version from now. But everytime I run Python IDLE it runs version 2.7.3. Even if I go to C:\Python33\Lib\idlelib\idle.pyw and run idle.pyw it runs with ...
How to set Python IDLE to use certain python version
0
1.2
1
0
0
271
22,360,412
2014-03-12T18:17:00.000
0
0
0
0
0
python,neural-network
0
22,360,726
0
1
0
true
0
0
Simply use a standard sigmoid/logistic activation function on the output neuron. sigmoid(x) > 0 forall real-valued x so that should do what you want. By default, many neural network libraries will use either linear or symmetric sigmoid outputs (which can go negative). Just note that it takes longer to train networks wi...
1
1
1
0
I am learning some model based on examples ${((x_{i1},x_{i2},....,x_{ip}),y_i)}_{i=1...N}$ using a neural network of Feed Forward Multilayer Perceptron (newff) (using python library neurolab). I expect the output of the NN to be positive for any further simulation of the NN. How can I make sure that the results of sim...
Python Neurolab - fixing output range
0
1.2
1
0
0
948
22,378,590
2014-03-13T12:25:00.000
0
1
0
0
1
python,c++,dll,swig
0
22,378,831
0
3
0
false
0
1
To use a library (static or dynamic), you need headers and library file .a, .lib... Its true for c++ and I think its the same for Python
2
0
0
0
I have a third party DLL (no header file) written in C++ and I am able to get the function prototype information from the developer, but it is proprietary and he will not provide the source. I've gone through the SWIG tutorial but I could not find anywhere specifying how to use SWIG to access any functions with only th...
SWIG C++ Precompiled DLL
1
0
1
0
0
1,508
22,378,590
2014-03-13T12:25:00.000
0
1
0
0
1
python,c++,dll,swig
0
22,389,172
0
3
0
false
0
1
SWIG cannot be used without the header files. Your only option is a lib like ctypes. If you find ctypes doesn't do it for you and you can't find alternative then post a question with why ctypes not useable in your case.
2
0
0
0
I have a third party DLL (no header file) written in C++ and I am able to get the function prototype information from the developer, but it is proprietary and he will not provide the source. I've gone through the SWIG tutorial but I could not find anywhere specifying how to use SWIG to access any functions with only th...
SWIG C++ Precompiled DLL
1
0
1
0
0
1,508
22,381,841
2014-03-13T14:32:00.000
4
0
1
0
1
python,dll
0
22,383,385
0
2
0
true
0
0
It's most probably a 32-bit or 64-bit issue. Try downloading proper version.
2
6
0
0
I have downloaded my code from bit-bucket which was made by my group member. It contain all the frameworks and python script folder. But when I run this code on my system it generates the following error: This program can't start because python27.dll is missing from your computer. Try reinstalling the program to fix...
Python27.dll File Missing - Exception
0
1.2
1
0
0
16,517
22,381,841
2014-03-13T14:32:00.000
3
0
1
0
1
python,dll
0
30,247,563
0
2
0
false
0
0
I also got this error when I copied my python environment from one computer to another. Both computers were 64 bit and the installation was 64 bit. What happens is that python installer updates Microsoft registry. When I simply copied the python files, the registry did not get updated, of course, resulting in the dll f...
2
6
0
0
I have downloaded my code from bit-bucket which was made by my group member. It contain all the frameworks and python script folder. But when I run this code on my system it generates the following error: This program can't start because python27.dll is missing from your computer. Try reinstalling the program to fix...
Python27.dll File Missing - Exception
0
0.291313
1
0
0
16,517
22,384,473
2014-03-13T16:11:00.000
0
0
0
0
0
python,django
0
22,384,701
0
1
0
false
1
0
Try to move your app name up to admin app in your INSTALLED_APPS settings.py tuple.
1
0
0
0
I have a Django project in which I have changed the default 'Django Administration' text in the header. Now I have implemented translation of strings that django knows about, but I cannot figure out how to translate this title. I put the translation function in models.py but it doesn't change when I change Language. I'...
Where do I put the specific translation functions in Django App?
0
0
1
0
0
90
22,391,805
2014-03-13T21:54:00.000
0
0
0
1
0
python,linux,bash,file-io
0
22,392,153
0
4
0
false
0
0
There are various command line applications that would be able to accomplish this when working together. For example, you could cat all the files one after another, grep -v the patterns you don't want, redirecting >> to a new file. In effect this is doing the same thing as your Python script would do, because every lin...
1
0
0
0
I have a number of huge delimited text files containing information logged by date. Some of the files overlap slightly with each other by date (which I don't want since it leads to duplicates). I know what the overlapping dates are so I want to be able to go through some of the files and delete each of the rows that co...
deleting rows in linux
0
0
1
0
0
115
22,404,358
2014-03-14T11:58:00.000
2
0
0
0
0
javascript,python,angularjs,google-app-engine,jinja2
0
22,408,064
0
2
0
false
1
0
Since you are already going to build an Angular app for the front-end, why not make the whole architecture RESTful? That way the front-end Angular app will be in charge of presentation and the server of just the data. You can pass data between the server and front-end through JSON which has the benefit of not needing t...
1
0
0
0
I am programming a small web app on GAE using python webapp2 framework. What I want to achieve is displaying server data to the html view through javascript or angularjs. Actually the app draws some graph using d3.js based on the server data. I know I can use $http.get to retrieve the data from server. But this way I n...
How to transfer html view data or (Python) server data to Angular or Javascript?
1
0.197375
1
0
0
586
22,413,763
2014-03-14T19:10:00.000
-1
0
1
0
0
python,regex,expression
0
22,430,200
0
6
0
false
0
0
So I was actually able to get it to work like this : [a-z]\w+.
2
0
0
0
I'd like to combine the regular expressions \w+ and [a-z] together in Python to only accept a word that is all lowercase, but cannot seem to figure out the right way to do that. Does anyone know how?
Combining regular expressions in Python
0
-0.033321
1
0
0
449
22,413,763
2014-03-14T19:10:00.000
1
0
1
0
0
python,regex,expression
0
22,413,846
0
6
0
true
0
0
If you only want lowercase words, all you need is [a-z]+ \w includes uppercase letters, digits, and underscore
2
0
0
0
I'd like to combine the regular expressions \w+ and [a-z] together in Python to only accept a word that is all lowercase, but cannot seem to figure out the right way to do that. Does anyone know how?
Combining regular expressions in Python
0
1.2
1
0
0
449
22,425,631
2014-03-15T15:19:00.000
0
0
0
0
0
python,iphone,nscache,memory-optimization
0
22,482,214
0
1
1
false
1
0
Maybe you should use NSData to retrieve data from your service instead of NSCache. NSCache is for temporary objects, however NSData is used to move data between applications (from your service to your app) Description of NSCache by Apple: An NSCache object is a collection-like container, or cache, that stores key-valu...
1
1
0
0
My service return up to 500 objects at time i've notice that my iphone application is crashing when the amount of data goes over 60 objects. to workaround this issue I'm running a query that brings back only the top 40 results but that is slower than just returning the entire data what are the best practices and how c...
How many objects should I retrieve from server and How many can be stored in NSCache?
1
0
1
0
0
54
22,438,569
2014-03-16T15:06:00.000
1
0
0
0
1
algorithm,python-3.x,message-passing
0
22,452,071
0
1
0
false
0
1
The issue is trying to give an absolute value to the priority. Rather you need to build a relative priority data structure for each call. This way you can say that hit() is highest priority for super-shields then shields then hull. The mod would then simply need to change the hit sound effects for the hull or add an ad...
1
0
0
0
I'm writing a prototype for the tactical spaceship combat in a game I'm working on. The basic idea of the part I'm working on right now is that a 'ship' object (which represents a single individual ship) contains a list of 'system' objects. When a ship is first initialized, it calls an initialize() function on each of ...
Algorithm design for systems on a spaceship taking messages
0
0.197375
1
0
0
112
22,449,304
2014-03-17T08:02:00.000
2
0
0
1
0
python,macos,python-imaging-library
1
22,470,752
1
2
0
false
0
0
following line helped me. sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow
1
2
0
0
When I try to install PIL library on Macosx 10.9.2, it's giving following error, how to install it. $: sudo pip install pillow cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prot...
how to install PIL on Macosx 10.9?
0
0.197375
1
0
0
751
22,453,554
2014-03-17T11:51:00.000
3
0
0
0
0
python,widget,tkinter,label,styling
0
22,455,831
0
2
0
false
0
1
There is nothing you can do with the label widget -- it only supports a single font and single color for the entire label. However, you can easily substitute a canvas or text widget anywhere you need this feature. There's no reason why you can't use a text widget that is one line tall and a dozen or so characters wide.
1
2
0
0
I'm wondering how I can change the font of a Python Tkinter label widget so that half the displayed text is bold and half is not without having to use two labels. The text for the widget is assigned prior to the label actually being created and stored in a variable so I need some kind of flag presumably to tell it how ...
How to change font style for part of a tkinter label
1
0.291313
1
0
0
9,774
22,456,509
2014-03-17T14:07:00.000
1
0
0
0
0
python,sdk,render,maya,autodesk
0
22,980,455
0
1
0
true
0
1
I was able to do some of the things by parsing the file using basic Python and then extracting the things I needed. The V-Ray API has a proprietary license, and there is no open source way to access the .vrscene I decided to try with a trial version of the SDK, and by using the SDK you will be able to find a nice Pyth...
1
0
0
0
I'm developing some Python scripts to read/parse/process some .vrscene files. From others' examples, I can see that there is a Python SDK for VRay called vrayutils. I want to get this information from the SettingsOutput object. From a .vrscene file I want to get the total frame numbers. Does anyone know where I can get...
Getting access to VRay Python SDK
0
1.2
1
0
0
1,560
22,495,767
2014-03-19T03:42:00.000
1
0
0
0
0
python,django,session,flask,server-side
0
22,520,376
0
2
0
false
1
0
Celery is a great solution, but it can be overpowered for many setups. If you just need tasks to run periodically (once an hour, once a day, etc) then consider just using cron. There's a lot less setup and it can get you quite far.
1
0
0
0
I have searched the forums for my question but im either searching for a thing naming it wrongly or the question is hard which i really doubt. I am developing a web-app which would have an web-interface written in one of the MVC frameworks like django or even flask and allow user to login, will identify users session a...
Server side python code runing continuosly per session
0
0.099668
1
0
0
183
22,498,877
2014-03-19T07:18:00.000
0
1
1
0
1
python,migration,dynamic-typing
0
22,498,955
0
5
0
false
0
0
One of the tradeoffs between statically and dynamically typed languages is that the latter require less scaffolding in the form of type declarations, but also provide less help with refactoring tools and compile-time error detection. Some Python IDEs do offer a certain level of type inference and help with refactoring,...
1
4
0
0
I'm learning python and came into a situation where I need to change the behvaviour of a function. I'm initially a java programmer so in the Java world a change in a function would let Eclipse shows that a lot of source files in Java has errors. That way I can know which files need to get modified. But how would one do...
Tracking changes in python source files?
0
0
1
0
0
696
22,553,659
2014-03-21T08:26:00.000
2
0
0
1
0
python,celery,celery-task,flower
0
22,554,555
0
1
0
true
0
0
I found i out. It is the matter of setting the persistant flag in command running celery flower.
1
1
0
0
I started to use celery flower for tasks monitoring and it is working like a charm. I have one concern though, how can i "reload" info about monitored tasks after flower restart ? I use redis as a broker, and i need to have option to check on tasks even in case of unexpected restart of service (or server). Thanks in ad...
Celery Flower - how can i load previous catched tasks?
0
1.2
1
0
0
1,345
22,563,386
2014-03-21T15:49:00.000
3
0
0
0
1
android,python,kivy
0
22,563,987
0
1
0
true
0
1
What do you mean by 'window'? In the practical sense, you can easily create different screens with kivy and switch between them, e.g. to have a menu screen, settings screen, game screen etc. Is this the kind of thing you mean? More generally, you can easily achieve any particular windowing behaviour you want within kiv...
1
0
0
0
I'm evaluating Kivy for android development. I need to know if is it possible to create an application with multiple windows using Kivy. I dont know for sure how android works with this kind of approach. In c#, windows forms, we have a main window and from that we open/close another forms. How can I accomplish this app...
Kivy Multiple windows
1
1.2
1
0
0
1,083
22,564,503
2014-03-21T16:40:00.000
0
0
0
0
0
python,sql,oracle,pandas,cx-oracle
0
53,431,165
0
7
0
false
0
0
kind of complicated but possible. I have seen it once. You need to create a javaclass inside oracle database. This class calls a .py file in the directory which contains it. create a procedure that calls the java class of item 1. in your sql query, call the procedure of item 2 whenever you need it.
1
18
0
0
Is it possible to call Python within an Oracle procedure? I've read plenty of literature about the reverse case (calling Oracle SQL from Python), but not the other way around. What I would like to do is to have Oracle produce a database table, then I would like to call Python and pass this database table to it in a Dat...
Calling Python from Oracle
1
0
1
1
0
12,854
22,590,811
2014-03-23T12:18:00.000
1
0
0
0
0
python,c++,opencv,numpy
0
22,591,329
0
1
0
true
0
0
there is no question at all, - use cv2 the old cv api, that wraps IplImage and CvMat is being phased out, and will be no more available in the next release of opencv the newer cv2 api uses numpy arrays for almost anything, so you can easily combine it with scipy, matplotlib, etc.
1
1
1
0
I've recently started using openCV in python. I've come across various posts comparing cv and cv2 and with an overview saying how cv2 is based on numpy and makes use of an array (cvMat) as opposed to cv makes use of old openCV bindings that was using Iplimage * (correct me if i'm wrong). However I would really like kn...
Can anyone in detail explain how cv and cv2 are different and what makes cv2 better and faster than cv?
1
1.2
1
0
0
230
22,591,947
2014-03-23T14:08:00.000
1
0
1
0
0
c,stack,pypy,vm-implementation,rpython
0
22,592,504
0
1
0
true
0
0
That depends. Do you want to push the string, or a pointer to a string? If it's the former, you have a problem, because the string will have variable length, unlike a pointer or a number. If it's the latter, you have to consider memory management aside from your stack.
1
0
0
0
I'm making a stack based virtual machine in RPython using the PyPy toolchain to convert the RPython to C. So far I have 4 instructions. EOP - End of Program EOI - End of Instruction PUSH - Push item onto the stack PRINT - Print the top of the stack My question is, how do you push a String to the top of the stack. Is ...
Stack Machine with Strings
0
1.2
1
0
0
393
22,604,620
2014-03-24T08:46:00.000
0
0
0
0
0
python,openerp
0
22,627,251
0
1
0
false
1
0
The user can add fields, models, can customize the views etc from client side. These are in Settings/Technical/Database Structure, here you can find the menus Fields, Models etc where the user can add fields. And the views can be customized in Settings/Technical/User Interface.
1
0
0
0
I have been developing modules in OpenERP-7 using Python on Ubuntu-12.04. I want to give my users a feature by which they will have the ability to create what ever fields they want to . Like they will set the name, data_type etc for the field and then on click , this field will be created. I dont have any idea how this...
How to code in openerp so that user can create his fields?
0
0
1
0
0
103
22,619,506
2014-03-24T20:04:00.000
2
0
0
0
0
python,opencv,image-processing,numpy,scikit-image
0
22,619,589
0
2
0
false
0
0
Here is a list of ideas I can think of: get the np.sum() and if it is lower than a threshold, then consider it almost black calculate np.mean() and np.std() of the image, an almost black image is an image that has low mean and low variance
2
0
1
0
How can i see in if a binary image is almost all black or all white in numpy or scikit-image modules ? I thought about numpy.all function or numpy.any but i do not know how neither for a total black image nor for a almost black image.
How can i check in numpy if a binary image is almost all black?
0
0.197375
1
0
0
1,554
22,619,506
2014-03-24T20:04:00.000
2
0
0
0
0
python,opencv,image-processing,numpy,scikit-image
0
22,619,838
0
2
0
true
0
0
Assuming that all the pixels really are ones or zeros, something like this might work (not at all tested): def is_sorta_black(arr, threshold=0.8): tot = np.float(np.sum(arr)) if tot/arr.size > (1-threshold): print "is not black" return False else: print "is kinda black" return...
2
0
1
0
How can i see in if a binary image is almost all black or all white in numpy or scikit-image modules ? I thought about numpy.all function or numpy.any but i do not know how neither for a total black image nor for a almost black image.
How can i check in numpy if a binary image is almost all black?
0
1.2
1
0
0
1,554
22,621,259
2014-03-24T21:46:00.000
3
0
0
0
0
python,ios,xcode,python-requests,kivy
0
22,622,162
0
1
0
true
0
1
I don't know how kivy-ios manages different modules, but in the absence of anything else you can simply copy the requests module into your app dir so it's included along with everything else.
1
3
0
0
I finally have some idea how to build Kivy app in Xcode with help of Kivy-ios. But Xcode and mac environment is new to me. My issue is: how to compile other python modules that required for my application. There is 'build-all.sh' in 'kivy-ios/tools' that builds standard things, but how to add some other module. In part...
Compile custom module for Kivy-ios
0
1.2
1
0
0
462
22,624,070
2014-03-25T01:55:00.000
0
0
0
0
0
python,wxpython,wxwidgets
0
22,635,854
0
1
0
true
0
1
Selected items in wxListCtrl, wxListBox and so on always use the system background selection colour, it can't be changed.
1
0
0
0
I'm trying to set a custom background for selected items in wxPython 2.8. I cannot figure out how to do so. I've tried SetItemBackground with no luck.
Setting selection background in ListCtrl
0
1.2
1
0
0
209
22,633,008
2014-03-25T11:19:00.000
1
0
1
0
0
python,permutation,combinatorics
0
22,666,834
0
2
0
true
0
0
I believe that a block cipher, like AES, provides exactly this functionality.
1
4
0
0
I'm not sure whether this is possible even theoretically; but if it is, I'd like to know how to do it in Python. I want to generate a big, random permutation cheaply. For example, say that I want a permutation on range(10**9). I want the permutation to be uniform (i.e. I want the numbers to be all over the place withou...
Python: Generating a big uniform permutation cheaply
1
1.2
1
0
0
151
22,634,264
2014-03-25T12:13:00.000
0
0
0
1
0
python
1
22,634,599
0
2
0
false
0
0
You can run any python command from cmd using Python.exe -c //code For example, Python.exe -c print(10*10) will print 100 to your console. Does this help? Your question is a little unclear, sorry.
1
0
0
0
I would like to launch a python program.exe to test it from another python code i,e launch it on the cmd (myprogram.exe -a arg1 -b arg2) and eventually get the error message it can print or any console output does anyone have an idea how to do this? thanks EDIT Actually I launch it with os.popen(command) but what I w...
launch a python program with it's arguments on cmd and get the output messages python
0
0
1
0
0
47
22,636,894
2014-03-25T14:01:00.000
0
0
0
0
0
python,router
0
22,789,614
0
1
0
true
0
0
Its possible by using route add command in linux
1
1
0
0
Is it possible to switch between interfaces in Python program? I will have eth0 and wlan0 connection, both are different routers. I'm using boto to upload images to AWS server. And I need to upload using router with fast upload speed and for other downloads I need to use another interface which is connected to a router...
Use different interfaces (eth0 and wlan0) for sending and receiving in Python program
1
1.2
1
0
1
409
22,689,597
2014-03-27T13:47:00.000
0
1
1
0
0
python,c++,excel,automation,ms-word
0
22,691,619
0
1
1
false
0
0
MS-Word has extensive programming capabilities built in ("Visual Basic for Applications (VBA)" These exact same programming capabilities are available to applications you write in any language, including C++, that can access Word via COM. Depending on your needs, it could be possible to fill in an entire Word document ...
1
0
0
0
Ok for my work we handle a lot of calculation documents. All of these have coversheets and revlogs that must be generated. We can easily create an excel file that has most of the information needed to fill in the forms but automating the actual process of filling in these forms that are premade in word has proven trick...
What would be the best way to automate filling in a premade form in word
0
0
1
0
0
602
22,702,428
2014-03-28T01:16:00.000
1
0
0
0
0
python-2.7,numpy,scipy,cluster-analysis
0
22,731,897
0
2
0
false
0
0
k-means is exclusively for coordinates. And more precisely: for continuous and linear values. The reason is the mean functions. Many people overlook the role of the mean for k-means (despite it being in the name...) On non-numerical data, how do you compute the mean? There exist some variants for binary or categorial d...
1
2
1
0
I have a list of dates I'd like to cluster into 3 clusters. Now, I can see hints that I should be looking at k-means, but all the examples I've found so far are related to coordinates, in other words, pairs of list items. I want to take this list of dates and append them to three separate lists indicating whether they...
Clustering a list of dates
0
0.099668
1
0
0
7,440
22,719,863
2014-03-28T17:48:00.000
0
0
0
0
1
python,networkx
0
24,051,792
0
1
0
false
0
0
I had to change the seed inside every class I used.
1
1
1
0
I am using the community module to extract communities from a networkx graph. For the community module, the order in which the nodes are processed makes a difference. I tried to set the seed of random to get consistent results but that is not working. Any idea on how to do this? thanks
Fix the seed for the community module in Python that uses networkx module
0
0
1
0
1
165
22,764,927
2014-03-31T14:55:00.000
0
0
0
0
0
python,tkinter
0
46,719,809
0
4
0
false
0
1
To get rid of a GUI window I used the following in my code. window.destroy() and the following to bring it up again. nameoffunction() window.lift()
1
3
0
0
anyone know how to hide python GUI Tkinter, I 've created keylogger, for GUI I used python module Tkinter , I want to add button called HIDE, so when user click it it will hide GUI , and when user press key like CTRL+E , it should unhide GUI....?
How To Hide Tkinter python Gui
0
0
1
0
0
11,986
22,775,423
2014-04-01T01:54:00.000
1
0
1
0
0
python,python-2.7
0
22,775,536
0
2
0
true
0
0
"Data driven programming": store your questions in a data file, and your program just needs the required logic to load and present them.
1
0
0
0
I am making a program that asks a user a lot of questions, and I have each question defined at the top of my file. Unfortunately because of the ridiculous number of questions I need to have, the file has become extremely packed and difficult to navigate. The questions are organized by different sections, so I thought...
How to manage many variables
0
1.2
1
0
0
115
22,785,010
2014-04-01T11:49:00.000
6
0
0
1
0
python,apache-spark
0
23,485,718
0
2
0
false
0
0
I started a new Python project in PyDev, then went into Project -> Properties -> PyDev - PYTHONPATH -> External libraries. I added a "source path" entry for /path/to/spark/spark-0.9.1/python This allowed PyDev to see all Spark-related code and provide auto complete, etc. Hope this helps.
1
1
0
0
how do i use python for a Spark program in eclipse? I've installed PyDev plugin in eclipse and installed Python on the system but how do i use PySpark.
Starting up PySpark for using python with Spark in eclipse
0
1
1
0
0
6,907
22,800,258
2014-04-02T02:12:00.000
0
0
1
0
1
python,multithreading,python-3.x
0
22,852,404
0
1
0
true
0
0
In my case, the best way to do this seems to be to maintain a running worker process, and send the code to it on an as-needed basis. If the process acts up, I kill it and then start a new one immediately to avoid any delay the next time.
1
0
0
0
I'm writing a program in which I want to evaluate a piece of code asynchronously. I want it to be isolated from the main thread so that it can raise an error, enter an infinite loop, or just about anything else without disrupting the main program. I was hoping to use threading.Thread, but this has a major problem; I ca...
Isolating code with a Python thread
0
1.2
1
0
0
301
22,807,281
2014-04-02T09:35:00.000
0
0
0
0
0
python-2.7,tcl
0
22,811,026
0
2
0
false
0
0
Surya, you should have a look at the ncgi and htmlparse packages in tcllib to extract the information you need. Joachim
1
0
0
0
I want to take input from the webpage, parse the data submitted using python or tcl and start the script execution based on the inputs given. Please suggest me a solution, how it can be done. I am not sure whether some web server need to be started for this. Thanks in Advance. Regards, Surya
Read input from the webpage, parse the data submitted using python or tcl and start the script execution based on the inputs given
0
0
1
0
1
514
22,811,844
2014-04-02T12:41:00.000
1
1
0
1
0
python,c++,linux,input,keyboard
0
22,812,228
0
2
0
false
0
0
The most generic solution is to use pseudo-terminals: you connect tttyn to the standard in and standard out of the program you want to monitor, and use pttyn to read and write to it. Alternatively, you can create two pipes, which you connect to the standard in and standard out of the program to be monitored before doin...
1
2
0
0
I work on a project to control my PC with a remote, and a infrared receptor on an Arduino. I need to simulate keyboard input with a process on linux who will listen arduino output and simulate keyboard input. I can dev it with Python or C++, but i think python is more easy. After many search, i found many result for......
Simulate keyboard input linux
0
0.099668
1
0
0
2,879
22,826,006
2014-04-03T01:08:00.000
4
0
1
0
0
python,jenkins
0
22,840,336
0
3
0
false
0
0
Any output to stdout from a process spawned by Jenkins should be captured by Console Output. One caveat is that it won't be displayed until a newline character is printed, so make sure your lines are terminated. If you are launching python in some weird way that dis-associates it from Jenkins parent process, then I can...
2
11
0
0
I have a Python script print strings. Now when run it in Jenkins I didn't see the printed strings in Jenkins Builds' Console Output. Anyway to achieve that?
how to get python print result in jenkins console output
0
0.26052
1
0
0
15,615
22,826,006
2014-04-03T01:08:00.000
16
0
1
0
0
python,jenkins
0
51,525,067
0
3
0
true
0
0
Try using -u (unbuffered) option when running the python script. python -u my_script.py
2
11
0
0
I have a Python script print strings. Now when run it in Jenkins I didn't see the printed strings in Jenkins Builds' Console Output. Anyway to achieve that?
how to get python print result in jenkins console output
0
1.2
1
0
0
15,615
22,831,520
2014-04-03T08:10:00.000
8
0
0
0
0
python,excel,python-2.7,xlwt
0
22,837,578
0
3
0
true
0
0
OK, after searching the web, I realized that with xlwt it's not possible to do it, but with XlsxWriter it's possible and very easy and convenient.
1
9
0
0
I'm using xlwt to create tables in excel. In excel there is a feature format as table which makes the table have an automatic filters for each column. Is there a way to do it using python?
how to do excel's 'format as table' in python
0
1.2
1
1
0
10,141
22,850,591
2014-04-03T23:05:00.000
2
0
1
1
0
c#,python
0
22,850,707
0
1
0
true
0
0
I think it may be because things like anti-virus software are hooked into kernel-mode as drivers and can intercept user-mode input and intervene. The anti-virus may be hooked into the kernel APIs for process management, and reject calls through the process APIs to kill a process with the same PID as itself. If this is...
1
1
0
0
I want to make a repeated question. how to prevent that someone stop an application with the task manager. I now that is posible, if you try to kill avastui.exe form the task manager the task manager say "the operation could not be completed acces denied" and it happens when de service of avast is on, when you stop th...
How to prevent an app from being killed in windows task manager?
0
1.2
1
0
0
1,098
22,852,845
2014-04-04T03:14:00.000
2
0
0
0
0
django,python-2.7
0
22,856,740
0
2
0
true
1
0
I recently had something similar to do. I have for each domain a specific setting file with an unique SITE_ID and also a wsgi file per site. Then in my http.conf (I'm using apache on webfaction) i set up multiple VirtualHost instances, each pointing out to the specific wsgi file. My configuration looks something like t...
1
1
0
0
I have an app that shows products available in the US. If i want to change the country, I simply modify the value of a variable in my settings.py file. Now... each country I serve needs to have its own site, e.g. example.co.uk, example.ca, etc. They'll all be hosted on the same server and use the same database. The vie...
Multiple websites using the same app - how to set this up?
0
1.2
1
0
0
60
22,872,888
2014-04-04T20:58:00.000
1
0
0
0
0
python,django,apache,security,permissions
0
24,634,526
0
1
0
false
1
0
In regards to serving the application from your home directory, this is primarily preference based. However, deployment decisions may be made depending on the situation. For example, if you have multiple users making use of this server to host their website, then you would likely have the files served from their home d...
1
4
0
0
I'm just about getting started on deploying my first live Django website, and I'm wondering how to set the Ubuntu server file permissions in the optimal way for security, whilst still granting the permissions required. Firstly a question of directories: I'm currently storing the site in ~/www/mysite.com/{Django apps}, ...
Security optimal file permissions django+apache+mod_wsgi
1
0.197375
1
1
0
1,003
22,877,052
2014-04-05T05:40:00.000
8
0
0
1
1
eclipse,google-app-engine,python-2.7
1
23,118,828
0
1
0
true
1
0
This is clearly a bug, but there's a possible workaround: In a .py file in your project, right-click and go to "Run As." Then, select "Python Run" (not a custom configuration). Let it run and crash or whatever this particular module does. Now, go look at your run configurations - you'll see one for this run. You ca...
1
4
0
0
I had trouble to run the pyDev Google App run on Eclipse. I can't create a new run configuration and I get this error message: Path for project must have only one segment. Any ideas about how to fix it? I am running Eclipse Kepler on Ubuntu 13.10
pydev Google App run Path for project must have only one segment
0
1.2
1
0
0
1,009
22,879,518
2014-04-05T10:17:00.000
2
0
1
0
0
python,class,inheritance
0
22,879,590
0
2
0
true
0
0
Let's say you have a class called Animal. In this class you have a method called walk, that prints "Animal is walking" Now you have 2 other classes: 1. Class Bird that is inherited from Animal. You can now add an additional method to it: fly. This will print that a bird can fly. 2. Class Monkey that is inherited from A...
1
2
0
0
I'm struggling with how I should interpret class inheritance. What does it actually do? As far as I know, it allows your class to: Use the inherited class function/methods Use the inherited class local variables (self variables) Does this go both ways? If something is inherited, will it be able to read his inheriter...
What does inheritance actually do in Python?
0
1.2
1
0
0
80
22,884,351
2014-04-05T17:37:00.000
0
0
0
0
0
python,python-2.7,graphics,pygame,turtle-graphics
0
31,048,800
0
2
0
false
0
1
There is a series of books on Python Graphics called "Python Graphics for Games" (Amazon). It covers vector drawing and animation. Author Mike Ohlson de Fine.
1
0
0
0
I have to make a computer graphics project on "Vote for better Nation" using python in a week..I have a knowledge of pygame but don't know how to create a particular object(like small cartoon man)..And then how to make it move..So please help me if anyone knows how to make a moving object.. Sorry For The English Thank ...
Computer Graphics with python
0
0
1
0
0
1,621
22,897,243
2014-04-06T17:12:00.000
0
0
0
0
0
python,pandas,linear-regression
0
22,897,471
0
2
0
false
0
0
as far as I know, there is no way to put this all at once in the optimized Fortran library, LAPACK, since each regression is it's own independent optimization problem. note that the loop over 4 items is not taking any time relative to the regression itself, that you need to fully compute because each regression is an i...
1
0
1
0
I have y - a 100 row by 5 column Pandas DataFrame I have x - a 100 row by 5 column Pandas DataFrame For i=0,...,4 I want to regress y[:,i] against x[:,i]. I know how to do it using a loop. But is there a way to vectorise the linear regression, so that I don't have the loop in there?
Perform n linear regressions, simultaneously
1
0
1
0
0
472
22,910,772
2014-04-07T11:14:00.000
0
0
1
0
0
python,json,rest,python-2.7,simplehttpserver
0
22,915,936
0
2
0
true
0
0
The issue was that I hadn't closed the zipfile object before I tried to return it. It appeared there was a lock on the file. To return a zip file from a simple http python server using GET, you need to do the following: Set the header to 'application/zip' self.send_header("Content-type:", "application/zip") Create th...
1
0
0
0
I created a simple threaded python server, and I have two parameters for format, one is JSON (return string data) and the other is zip. When a user selects the format=zip as one of the input parameters, I need the server to return a zip file back to the user. How should I return a file to a user on a do_GET() for my ...
Issue with Python Server Returning File On GET
1
1.2
1
0
1
257
22,913,080
2014-04-07T12:56:00.000
0
0
0
0
0
python,django
0
22,915,407
0
1
0
true
1
0
The Django CMS is a totally different environment. You can't install it on top of your current project. So if you want your models inside django cms you have to migrate them manually to the new enviroment. Maybe their are solutions for it but I'm not aware of them.
1
0
0
0
I'm totally new to Python and I've been learning how to use Django and it's admin functionality to work with my models. My question really is how, if I were to install Django CMS, would work with the admin? My understanding it limited so I wanted to check as I'm struggling to know if it will still show the model's that...
If I install Django CMS will it still show my current work in Django admin
0
1.2
1
0
0
34
22,939,260
2014-04-08T13:56:00.000
1
0
1
0
0
python,itertools
0
22,940,159
0
5
0
false
0
0
To find all assignments of N balls to M slots: if N is 0 then leave all M slots empty otherwise, if M is 1, then put all N balls to the only slot otherwise For each i in 0 .. N put i balls in M-th slot, and find all assignments of remaining N-i balls to remaining M-1 slots
1
2
0
0
I'm trying to find a way, using built-in functions, to list every way to organize N balls in M slots. The balls can stack in the slots. For example: N = 2, M = 3 -> {|0|1|1|, |1|0|1|, |1|1|0|, |2|0|0|, |0|2|0|, |0|0|2|} itertools.permutations() is part of the puzzle, but how can you go through all possible stacks of ...
Every way to organize N objects in M list slots
0
0.039979
1
0
0
1,779
22,939,822
2014-04-08T14:18:00.000
0
0
0
0
0
python,amazon-web-services,boto,amazon-sqs
0
23,070,269
0
1
0
false
0
0
install the newest version of boto (2.27 or more, lower versions have an issue with unicode strings) send it as unicode, and you will succeed
1
0
0
0
I'm trying to send this string on Python SQS: "Talhão", with no quotes. How do I do that? Thanks!
Amazon SQS Python/boto: how do I send messages with accented characters?
0
0
1
0
1
95
22,940,269
2014-04-08T14:35:00.000
1
0
0
0
0
python,gtk
0
22,942,890
0
1
0
true
0
1
You don't use get_path_at_pos. It is meant for cases where you handle the button presses directly (which you should avoid unless you really have good reasons to do so). Simply use gtk_icon_view_get_selected_items (C) or the pygtk equivalent iconview.get_selected_items() which gives you a list (in C a GList) of currentl...
1
0
0
0
I am building a file browser using Gtk.IconView in python. I am trying to find the path of an icon selected using " selection-changed" signal using gtk.IconView.get_path_at_pos(x,y). The docs are mum on how to obtain the (x,y). How do I find them? using python 2.7 and pygtk 2.24
Finding Mouse click position in IconView in GTK
0
1.2
1
0
0
84
22,949,966
2014-04-08T23:11:00.000
1
0
0
0
0
python,numpy
0
22,949,986
0
5
0
false
0
0
If you want an inner product then use numpy.dot(x,x) for outer product use numpy.outer(x,x)
1
13
1
0
I'm working with numpy in python to calculate a vector multiplication. I have a vector x of dimensions n x 1 and I want to calculate x*x_transpose. This gives me problems because x.T or x.transpose() doesn't affect a 1 dimensional vector (numpy represents vertical and horizontal vectors the same way). But how do I ca...
dot product of two 1D vectors in numpy
0
0.039979
1
0
0
11,187
22,951,806
2014-04-09T02:39:00.000
1
0
1
0
0
python,json,database,performance,security
0
22,951,848
0
1
0
false
1
0
I don't think efficiency should be part of your calculus. I don't like either of your proposed designs. One table? That's not normalized. I don't know what data you're talking about, but you should know about normalization. Multiple copies? That's not scalable. Every time you add a user you add a table? Sounds lik...
1
0
0
0
I'm trying to store user data for a website in Python I'm making. Which is more efficient: -Storing all the user data in one huge table -Storing all the user data in several tables, one per user, in one database. -Storing each user's data in a XML or JSON file, one file per user. Each file has a unique name based on ...
Storing user data in one big database or in a different file for each user - which is more efficient?
0
0.197375
1
1
0
242
22,964,033
2014-04-09T13:27:00.000
2
0
0
0
0
python-2.7,sqlite,max
0
22,964,138
0
1
0
true
0
0
That's a compile-time parameter for SQLite itself. As in, you'll need to recompile the SQLite library in order to change it. Nothing you can do in Python will be able to overcome this.
1
1
0
0
So I have a sqlite3 db, which I access from Python (2.7), where I would like to store more than the by default allowed 2.000 columns. I understand that there is a setting or command, SQLITE_MAX_COLUMN, which I can alter, so that my database can store up to ~32.000 columns. My question is how do I in practice set the ma...
How to actually change the maximum number of columns in SQLITE
1
1.2
1
1
0
1,019
22,969,365
2014-04-09T17:08:00.000
1
1
0
1
0
python,celery
0
23,090,632
0
1
0
true
0
0
The solution for me was to restart redis after the time update, and also restart celerybeat. That combination seems to work.
1
1
0
0
I'm trying to test out some periodic tasks I'm running in Celery, which are supposed to run at midnight of the first day of each month. To test these, I have a cron job running every few minutes which bumps the system time up to a few minutes before midnight on the last day of the month. When the clock strikes midnight...
Celery periodic tasks: testing by modifying system time
0
1.2
1
0
0
283
22,989,689
2014-04-10T13:38:00.000
1
0
0
0
1
python,django,foreign-key-relationship
0
22,990,016
0
2
0
false
1
0
There are (at least) two ways to accomplish it: More elegant solution: Use a TicketProfile class which has a one-to-one relation to Ticket, and put the Client foreign key into it. Hacky solution: Use a many-to-many relation, and manually edit the automatically created table and make ticket_id unique.
1
5
0
0
My django project uses django-helpdesk app. This app has Ticket model. My app got a Client model, which should have one to many relationship with ticket- so I could for example list all tickets concerning specific client. Normally I would add models.ForeignKey(Client) to Ticket But it's an external app and I don't wan...
How to add many to one relationship with model from external application in django
0
0.099668
1
0
0
564
22,993,206
2014-04-10T16:02:00.000
0
0
1
0
0
python,emacs
0
22,996,440
0
3
0
false
0
0
Open a newline with C-j, you should get the indentation.
2
1
0
0
I'm using emacs 24.3 and Ubuntu 12.04 LTS. How do I make emacs automatically indent lines in Python, like in IDLE? Currently, it does not do that. Also, in general, how would I do this for any programming language, say, Java or c++?
How to make emacs automatically indent Python code?
0
0
1
0
0
4,538
22,993,206
2014-04-10T16:02:00.000
3
0
1
0
0
python,emacs
0
23,000,155
0
3
0
false
0
0
Try electric-indent-mode. It will be ebabled by default in Emacs-24.4. But note that the version in 24.3 probably doesn't work too well in python-mode buffers.
2
1
0
0
I'm using emacs 24.3 and Ubuntu 12.04 LTS. How do I make emacs automatically indent lines in Python, like in IDLE? Currently, it does not do that. Also, in general, how would I do this for any programming language, say, Java or c++?
How to make emacs automatically indent Python code?
0
0.197375
1
0
0
4,538