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
26,142,468
2014-10-01T13:23:00.000
0
0
0
0
0
python,django,geodjango,django-countries
0
26,143,098
0
2
0
false
1
0
Personally I would set a generic flag as a fallback (django flag perhaps?) if user does not set their country, and to be fair there must be a reason if user doesn't. Or you can simply make that country field mandatory. And assuming that person in that country based on their existing IP just doesn't sound right. Imagine...
1
0
0
0
I am using django-countries to get a flag from the CountryField and it works. However, some users don't have a country set on their profiles, but I still have to display a flag. My idea was to get a country from IP and then get a flag from the country or anything similar to that. Unfortunately, this is not happening in...
Python/Django get country flag from IP
1
0
1
0
0
1,719
26,157,625
2014-10-02T09:07:00.000
1
0
0
0
0
mysql,django,python-2.7
0
26,158,170
0
1
0
false
1
0
It doesn't make sense to create a new database for each organization. Even if the number of customers or organizations grows to the hundreds or thousands, keeping data in a single database is your best option. Edit: Your original concern was that an increase in the number of organizations would impact performance. Well...
1
0
0
0
In my project there is two models ,ORGANISATION and CUSTUMER .Here what i am doing is while i am adding new customer to the organisation i save the organisation_id to the table CUSTOMER .But now i am worrying about the performance of my project when the database becomes huge. So now i am planning to create new database...
django multiple database for multiple organisation in a single project
0
0.197375
1
1
0
181
26,178,035
2014-10-03T11:19:00.000
0
0
0
0
0
python,machine-learning,scikit-learn
0
38,604,808
0
2
0
false
0
0
The above answer was too short, outdated and might result in misleading. Using score method could only give accuracy (it's in the BaseEstimator). If you want the loss function, you could either call private function _get_loss_function (defined in the BaseSGDClassifier). Or accessing BaseSGDClassifier.loss_functions cl...
1
0
1
1
I'm using an SGDClassifier in combination with the partial fit method to train with lots of data. I'd like to monitor when I've achieved an acceptable level of convergence, which means I'd like to know the loss every n iterations on some data (possibly training, possibly held-out, maybe both). I know this information i...
Way to compute the value of the loss function on data for an SGDClassifier?
0
0
1
0
0
1,528
26,178,633
2014-10-03T12:07:00.000
0
0
0
0
0
python,django,database,sqlite
0
26,179,396
0
2
0
false
1
0
You could also use fixtures. And generate fixtures for your app. Dependes on what you're planing to do with them. You'll just make a loaddata after that.
1
0
0
0
How can i create Django sqlite3 dump file (*.sql) using terminal? There is a fabric fabfile.py with certain dump scripts, but when i try to use fab command next massage shows up: The program 'fab' is currently not installed. To run fab please ask your administrator to install the package 'fabric'. But there are fabri...
Django sqlite3 database dump
0
0
1
1
0
1,114
26,199,115
2014-10-05T02:35:00.000
0
0
0
0
0
python,windows,console,pyqt,exe
0
26,208,237
0
1
0
false
0
1
The best solution is in the post linked to in a comment to your post, but on Windows you can also set a property on a shortcut that starts the app, to have the console minimized. It still shows in taskbar, there id you need it, can be handy in some situations(like during dev to use same script as user will, but not hav...
1
0
0
0
I create an exe executable of my application made ​​in pyqt, and everything went well, but when I run the exe in windows before opening the application opens a console and while the application is open that console is also. I need someone to tell me how to make the console does not come out, or at least not visible. I'...
The exe executable of my application, also opens a console
0
0
1
0
0
50
26,211,308
2014-10-06T07:04:00.000
0
0
0
0
0
python,twitter,machine-learning,classification,nltk
0
29,718,799
0
1
1
false
0
0
The thing is that how do I even generate/create a training data for such a huge data I would suggest finding a training data set that could help you with the categories you are interested in. So let's say price related articles, you might want to find a training data set that is all about price related articles and ...
1
1
1
0
So I have some 1 million lines of twitter comments data in csv format. I need to classify them in certain categories like if somebody is talking about : "product longevity", "cheap/costly", "on sale/discount" etc. As you can see I have multiple classes to classify these tweets data into. The thing is that how do I ev...
preclassified trained twitter comments for categorization
0
0
1
0
0
149
26,280,838
2014-10-09T14:19:00.000
0
0
0
0
0
python,math,signal-processing
0
26,286,979
0
3
0
false
0
0
Assuming that you've loaded multiple readings of the PSD from the signal analyzer, try averaging them before attempting to find the bandedges. If the signal isn't changing too dramatically, the averaging process might smooth away any peaks and valleys and noise within the passband, making it easier to find the edges. T...
1
0
1
0
The data that i have is stored in a 2D list where one column represents a frequency and the other column is its corresponding dB. I would like to programmatically identify the frequency of the 3db points on either end of the passband. I have two ideas on how to do this but they both have drawbacks. Find maximum point ...
How can I find the break frequencies/3dB points from a bandpass filter frequency sweep data in python?
0
0
1
0
0
1,113
26,282,986
2014-10-09T16:04:00.000
4
0
1
1
0
python
0
36,884,696
0
2
0
false
0
0
Python 2 and 3 can safely be installed together. They install most of their files in different locations. So if the prefix is /usr/local, you'll find the library files in /usr/local/lib/pythonX.Y/ where X.Y are the major and minor version numbers. The only point of contention is generally is the file python itself, whi...
1
4
0
0
My OS is CentOS 7.0. It's embedded python version is 2.7, and I want to update it to Python 3.4. when input the print sys.path output is: ['', '/usr/lib/python2.7/site-packages/setuptools-5.8-py2.7.egg', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/l...
how to update python 2.7 to python 3 in linux?
0
0.379949
1
0
0
20,066
26,302,718
2014-10-10T15:18:00.000
0
0
0
1
0
python,apache,deployment,openerp,mod-wsgi
0
26,330,930
0
1
0
false
1
0
The schedulers don't work when running through wsgi because your Odoo instances are just workers. AFAIK you just run a standalone instance on a 127.0.0.1 port and it runs your scheduled tasks.
1
0
0
0
When I deploy openerp/odoo using mod_wsgi, I found my schedulers stop working, can any one help how can I get my cron/schedulers working. If I deploy it using mod_proxy it will solve the issue but I want to deploy using mod_wsgi.
odoo mod_wsgi schedulers not working
0
0
1
0
0
246
26,304,413
2014-10-10T16:57:00.000
0
0
0
0
0
python,django
0
26,305,048
0
1
0
false
1
0
When you say "procedures" i guess you're talking about pages (or views in Django). So I would implement a single "app" to do that. Remember a project is composed of apps. When you create a project a main app (with the same name of the project) is created. This is a good place to code the procedures you said. Think of a...
1
1
0
0
I'm learning Django but it's difficult to me to see how should I divide a project into apps? I've worked on some Java EE systems, almost for procedures for government and all that stuff but I just can't see how to create a Django project for this purposes? For example, if you should have to do a web app for making easi...
Django apps structure
0
0
1
0
0
73
26,311,022
2014-10-11T04:20:00.000
0
0
0
0
0
android,python,adb,monkeyrunner
0
26,311,559
0
1
0
true
1
0
You are trying to install an APK which is intended for a higher version onto API level 8 and thus the package manager refuses to install it. It has nothing to do with adb or monkeyrunner.
1
0
0
0
I've downloaded an APK onto a Velocity Cruz Tablet running Android 2.2.1 (API Level 8), and I'm trying to install it via whatever I can manage to make work. I already had ADT on my computer (Windows 8.1 if this helps) for API Level 19 for use with my phone. So I used the SDK Manager to get API Level 8. I can't for the ...
Android - ADB/MonkeyRunner Setting API Levels
0
1.2
1
0
0
225
26,315,848
2014-10-11T14:44:00.000
1
0
0
0
0
python,button,user-interface,python-3.x,tkinter
0
26,315,912
0
2
0
false
0
1
You need a variable in a global or class instance scope and a function that has access to the scope of the variable that increments the variable when called. Set the function as the command attribute of the Button so that the function is called when the button is clicked.
1
0
0
0
So I am writing a program for school, and I have to make a maths quiz, the quiz needs to be out of 10 questions. I have made a button that is defined with a command that generates a new questions, clears the text box, get the answer from the dictionary, and inserts the new question into the textbox. At the moment the...
How to count the number of times a button is clicked Python(tkinter)
0
0.099668
1
0
0
17,843
26,316,273
2014-10-11T15:34:00.000
0
1
0
0
0
python,heroku,importerror,psycopg2
1
26,317,020
0
1
0
false
1
0
You could keep the psycopg2 directory in the same directory of apps, but that's actually a hack and you should try fix on installing psycopg2 on Heroku.
1
1
0
0
I have deployed my local python web service project to Heroku. I have all my dependencies in requirement.txt file. But, one module psycopg2 is not getting installed properly and I am getting installation error. So, I removed it from requirement.txt and thought I will push everything to heroku first, and then I will man...
How to manually copy folder to /app/.heroku/python/lib/python2.7/site-packages/?
0
0
1
0
0
248
26,318,326
2014-10-11T19:16:00.000
1
0
0
0
1
android,segmentation-fault,android-browser,qpython,pyjnius
0
26,428,421
0
2
0
true
1
1
Apparently, this happens just in console mode, so in other QPython mods it works fine.
1
3
0
0
I'm new developer in QPython (experienced with python), I want to open an url with user's default browser. I tried AndroidBrowser().open("...") but, to my surprise, I got Segmentation Fault! So I said OK, let's try to open it manually as activity, then I tried to import jnius and got Segmentation Fault as well. Any sug...
Open a URL with default broswer?
0
1.2
1
0
0
1,277
26,319,382
2014-10-11T21:22:00.000
3
0
1
0
0
python,fonts,truetype
0
26,319,577
0
1
0
false
0
1
It's pretty tricky to do analytically. One way is trial and error. Choose a large font size and render the layout to see whether it fits Use bisection algorithm to converge on the largest font that fits
1
0
0
0
I'm trying to adequate the FontSize of my text into a width-height specific context. For instance, if I got a image (512x512 pixels) and I got for instance 140 characters. What would be the ideal FontSize? In the above case, a 50 pixels Fontsize seems to be ok but what happened if there's a lot more text? the text wil...
Calculate fontsize
0
0.53705
1
0
0
376
26,323,942
2014-10-12T10:03:00.000
3
0
1
0
1
python
1
26,324,214
0
1
0
true
0
1
Do not use import to implement application logic. In your use case, a room is the classic example of an object in object-oriented programming. You should have a class Room which defines the functionality for rooms. Individual rooms are instances of that class (later you can add subclasses, but I would not worry about t...
1
0
0
0
I was thinking of making a text-based game about detectives, case-solving, with complete freedom, loads of variables, etc. But before I get serious with it I need to know how to make rooms. E.g. you start in the hall and you type in "Go kitchen" and you go to the kitchen. I have achieved this by using import file whe...
How best to implement rooms for a text-based game?
0
1.2
1
0
0
486
26,349,503
2014-10-13T21:56:00.000
0
0
0
0
0
python,emacs,pdb
0
26,373,563
0
1
0
true
0
0
Normally there is no "=>" inserted at all. What there is instead is a "=>" that is displayed but which is not part of the buffer's content. Are you sure it's really in the code and are you sure you can delete it as if it were normal text?
1
0
0
0
I'm trying to learn how to use pdb in emacs. I run emacs in console mode and in my python file I have something like import pdb and pdb.set_trace() at the beginning of the file. I use C-c C-c to execute the buffer and pdb starts running. It works fine except that I end up with a => inserted into my code on the line tha...
Using pdb in emacs inserts => into my code
0
1.2
1
0
0
105
26,355,152
2014-10-14T07:35:00.000
0
0
0
0
0
python-2.7,scrapy,web-crawler
0
26,378,448
0
2
0
false
1
0
For this we have to make a list in fields_to_export in the BaseItemExporter class field_iter = ['Offer', 'SKU', 'VendorCode'] like this and then have to pass this list in the field
1
0
0
0
I have to crawl data from a web page in a specfic order as liked i declared fields in my item class and then have to put them in csv file.problem now occuring is there its stores data not in specfic order as like its scrapping data of any field and putting in csv file but i want it should store data as i declared in my...
How to store data crawled in scrapy in specfic order?
0
0
1
0
0
262
26,358,511
2014-10-14T10:26:00.000
1
0
0
0
0
python,django,templates,variables
0
26,358,812
0
2
0
false
1
0
You can add variables to context
1
0
0
0
I have a django and I wrote some views. I know how to pass my variables to template, but I also has some external modules with their own views, which I wont modify. Please help me understand how can I get one of my object "Menu.objects.all()" exist in all templates? So for example a I have django-registration and i wan...
Make an object exists in all templates
0
0.099668
1
0
0
58
26,358,543
2014-10-14T10:28:00.000
-3
0
1
0
0
javascript,python
0
26,358,654
0
2
0
false
1
0
If you use an IDE such as phpstorm, it can easily find variables for you. I don't see the use in programming something in Python to do this.
1
1
0
0
I have directory with many JaveScript files. Here I want to scan each file and want to replace each JavaScript variable with string like 'str1', 'str2', 'str3', ..., 'strn' and so on. My question is: how to identify a JavaScript variable? Doubts: If I say keyword after var is a variable, however there is no compulsion...
How to search for JavaScript variables in a file, using Python?
0
-0.291313
1
0
0
1,278
26,375,763
2014-10-15T06:21:00.000
2
1
1
0
1
python,z3,z3py
0
26,385,910
0
1
1
true
0
0
Using Z3 over Python is generally pretty slow. It includes parameter checks and marshaling (_coerce_expr among others). For scalability you will be better of using one of the other bindings or bypass the Python runtime where possible.
1
4
0
0
I am using Z3 Python bindings to create an And expression via z3.And(exprs) where exprs is a python list of 48000 equality constraints over boolean variables. This operation takes 2 seconds on a MBP with 2.6GHz processor. What could I be doing wrong? Is this an issue with z3 Python bindings? Any ideas on how to opti...
Why is z3.And() slow?
0
1.2
1
0
0
283
26,391,208
2014-10-15T20:09:00.000
1
0
0
0
0
javascript,python,templates,pyramid
0
26,392,168
0
1
0
false
1
0
This was a red herring; the URL was wrong but the log file mentioned a missing template so I was focused in the wrong direction. I had to get a custom redirection piece of code from one of the developers on this project and I have it working now.
1
0
0
0
I'm adding a page to a complex Pyramid-based app that uses Handlebar templates. I need a file download URL that doesn't need a template, but the system is giving me a 404 code for missing template anyway. How do I tell a view at configuration time "do not use a handlebar template with this one?"
Pyramid app with handlebar.js: I don't need a template for this view; how to disable?
0
0.197375
1
0
0
68
26,393,540
2014-10-15T23:00:00.000
0
0
0
1
1
python,parallel-processing,rabbitmq,celery,django-celery
0
26,732,448
0
1
0
false
1
0
If queuing up your tasks takes longer than the task, how about you increase the scope of the tasks so they operate on N files at a time. So instead of queuing up 1000 tasks for 1000 files. You queue up 10 tasks that operate on 100 files at a time. Make your task take a list of files, rather than a file for input. Then ...
1
0
0
0
I'm having a major problem in my celery + rabbitmq app where queuing up my jobs is taking longer than the time for my workers to perform jobs. No matter how many machines I spin up, my queuing time will always overtake my task time. This is because I have one celery_client script on one machine doing all the queuing (c...
The time to queue tasks in celery bottlenecks my application - how to parallelize .delay()?
0
0
1
0
0
349
26,413,505
2014-10-16T20:39:00.000
0
1
0
0
0
python,c++,linux,signals,paramiko
0
26,413,679
0
1
0
false
0
0
The best way I can think of to do this is to run both of them in a web server. Use something like Windows Web Services for C++ or a native CGI implementation and use that to signal the python script. If that's not a possibility, you can use COM to create COM objects on both sides, one in Python, and one in C++ to handl...
1
1
0
0
I'm working on developing a test automation framework. I need to start a process(a C++ application) on a remote linux host from a python script. I use the python module "paramiko" for this. However my c++ application takes sometime to run and complete the task assigned to it. So till the application completes processi...
Can a "C++ application signal python script on completion"?
1
0
1
0
0
331
26,442,403
2014-10-18T17:10:00.000
1
0
0
0
0
python,numpy,random-sample,normal-distribution,mixture-model
0
26,565,108
0
2
0
false
0
0
Since for sampling only relative proportion of the distribution matters, scaling preface or can be thrown away. For diagonal covariance matrix, one can just use the covariance submarine and mean subvector that has dimensions of missing data. For covariance with off-diagonal elements, the mean and std dev of a sampling ...
1
1
1
0
I want to sample only some elements of a vector from a sum of gaussians that is given by their means and covariance matrices. Specifically: I'm imputing data using gaussian mixture model (GMM). I'm using the following procedure and sklearn: impute with mean get means and covariances with GMM (for example 5 components)...
Sampling parts of a vector from gaussian mixture model
0
0.099668
1
0
0
1,040
26,479,903
2014-10-21T06:04:00.000
1
0
0
0
0
python,web.py
0
26,498,875
0
1
0
false
1
0
Use web.data().
1
0
0
0
My situation is : A server send a request to me, the request's contentType is 'text/xml', and the request content is an xml. First I need to get the request content. But when I use 'web.input()' in 'POST' function, I couldn't get any message, the result just is ''. I know web.py can get form data from a request, so how...
web.py how to get message from request when the contentType is 'text/xml'
0
0.197375
1
0
1
86
26,479,928
2014-10-21T06:06:00.000
1
1
1
0
0
python
0
26,480,045
0
2
0
true
0
0
If you're doing from os import environ, then you'll reference it as environ. If you do import os, it's os.environ. So depending on your needs, the second option might be better. The first will look better and read easier, whereas the second avoids namespace pollution.
1
0
0
0
in myModule.py I am importing environ from os , like from os import environ since I am only using environ, but when I do dir(myModule) it shows environ as publicly visible , how ever should it be imported as protected assuming some other project may also have its own environ function ?
when importing functions from inside builtins like os or sys is it good practice to import as protected?
0
1.2
1
0
0
114
26,480,008
2014-10-21T06:12:00.000
2
0
0
0
0
python,sockets,flask,twisted,pythonanywhere
0
26,503,901
0
2
0
false
0
0
It depends what sort of connection your clients need to make to the server. PythonAnywhere supports WSGI, which means "normal" HTTP request/response interactions -- GET, POST, etc. That works well for "traditional" web pages or web apps. If your client side needs dynamic, two-way connections using non-HTTP protocols,...
1
3
0
1
I'm building a turn-based game and I'm hoping to implement client-server style networking. I really just need to send the position of a couple of objects and some other easily encodable data. I'm pretty new to networking, although I've coded some basic stuff in socket and twisted. Now, though, I need to be able to send...
Using PythonAnywhere as a game server
0
0.197375
1
0
0
889
26,487,648
2014-10-21T13:14:00.000
1
0
0
1
1
python,django,django-chronograph
0
26,487,761
0
3
0
false
1
0
I would suggest you to configure cron to run your command at specific times/intervals.
2
0
0
0
I need to run a specific manage.py commands on an EC2 instance every X minutes. For example: python manage.py some_command. I have looked up django-chronograph. Following the instructions, I've added chronograph to my settings.py but on runserver it keeps telling me No module named chronograph. Is there something I'm m...
Run specific django manage.py commands at intervals
0
0.066568
1
0
0
368
26,487,648
2014-10-21T13:14:00.000
0
0
0
1
1
python,django,django-chronograph
0
26,488,221
0
3
0
false
1
0
First, install it by running pip install django-chronograph.
2
0
0
0
I need to run a specific manage.py commands on an EC2 instance every X minutes. For example: python manage.py some_command. I have looked up django-chronograph. Following the instructions, I've added chronograph to my settings.py but on runserver it keeps telling me No module named chronograph. Is there something I'm m...
Run specific django manage.py commands at intervals
0
0
1
0
0
368
26,488,595
2014-10-21T14:00:00.000
0
0
1
0
0
python,64-bit,32bit-64bit,py2exe,32-bit
0
26,672,009
0
1
0
true
0
0
You should install the 32-bit python (in a separate directory, you can do it on the same machine). Install 32-bit py2exe for this 32-bit Python installation plus all Python packages that you need. Then you can build a 32-bit eecutable.
1
1
0
0
I need to make an 32bit exe file using py2exe. The problem is that my machine and Python are 64bit. Is there some simple way how to make 32bit using 64bit Python and py2exe? I heard that I should uninstall py2exe and install new py2exe 32bit, can this help me? EDIT: If 32bit py2exe works, can I install 32bit py2exe nex...
32bit exe on 64bit Python using py2exe
0
1.2
1
0
0
803
26,503,035
2014-10-22T08:17:00.000
1
0
1
0
0
python,ruby,scripting,powershell-2.0
0
26,507,747
0
1
0
true
0
0
Best answer is 'write tests'. For purely syntactical checking with some code correctness, like calling a function which does not exist like you are describing, pylint is probably the best tool. Install it with pip install pylint.
1
0
0
0
This question applies to dynamically interpreted code, I guess In detail Say I have a set of data processing projects that depend on a common module called tools. Down the road of development, I find out that I want to change the interface of one of the functions or methods in tools. This interface-change might not be ...
Checking all code paths in a project written in a scripting language for syntax-correctness
0
1.2
1
0
0
83
26,509,319
2014-10-22T14:02:00.000
2
0
0
0
0
python,arrays,numpy,svm,libsvm
0
26,509,674
0
1
0
true
0
0
The svmlight format is tailored to classification/regression problems. Therefore, the array X is a matrix with as many rows as data points in your set, and as many columns as features. y is the vector of instance labels. For example, suppose you have 1000 objects (images of bicycles and bananas, for example), featurize...
1
1
1
0
I have a numpy array for an image and am trying to dump it into the libsvm format of LABEL I0:V0 I1:V1 I2:V2..IN:VN. I see that scikit-learn has a dump_svmlight_file and would like to use that if possible since it's optimized and stable. It takes parameters of X, y, and file output name. The values I'm thinking about ...
How to convert numpy array into libsvm format
0
1.2
1
0
0
2,922
26,526,365
2014-10-23T10:43:00.000
0
1
1
0
1
python,python-2.7,amazon-ec2,module,snappy
0
26,531,727
0
1
0
true
0
0
I just found python-snappy on github and installed it via python. Not a permanent solution, but at least something.
1
0
0
0
I downloaded Snappy library sources for working with compression and everything was great on one machine, but it didn't work on another machine. They have completely same configurations of hardware/OS + python 2.7.3. All I was doing is "./configure && make && make install". There were 0 errors during any of these pro...
Python cant see installed module
0
1.2
1
0
0
95
26,529,779
2014-10-23T13:56:00.000
3
0
0
0
0
doxygen,python-sphinx,documentation-generation,dymola
0
26,543,595
0
1
0
true
0
0
If you mean the Modelica model code, how does the HTML export in Dymola work for you? What's missing? If you mean the C code generated by Dymola, the source code generation option enables more comments in the code.
1
1
0
0
since I could not find an answer to my question neither here nor in other forums, I decided to ask it to the community: Does anybody know if and how it is possible to realize automatic documentation generation for code generated with Dymola? The background for this e. g. is that I want/need to store additional informat...
Automatic documentation generation for Dymola code
1
1.2
1
1
0
274
26,575,729
2014-10-26T17:18:00.000
0
0
0
0
0
python,amazon-web-services,boto,emr,amazon-emr
0
72,334,675
0
2
0
false
0
0
bootstrap script executed once the cluster started (first time or at the beginning), however AWS provide ssh to master and other nodes there you can write shell script,install libs, packages, python program , git clone your repo etc... Hope this may be helpful. Amit
2
17
0
0
I have one EMR cluster which is running 24/7. I can't turn it off and launch the new one. What I would like to do is to perform something like bootstrap action on the already running cluster, preferably using Python and boto or AWS CLI. I can imagine doing this in 2 steps: 1) run the script on all the running instanc...
AWS EMR perform "bootstrap" script on all the already running machines in cluster
1
0
1
0
0
2,264
26,575,729
2014-10-26T17:18:00.000
6
0
0
0
0
python,amazon-web-services,boto,emr,amazon-emr
0
35,529,652
0
2
0
false
0
0
Late answer, but I'll give it a shot: That is going to be tough. You could install Amazon SSM Agent and use the remote command interface to launch a command on all instances. However, you will have to assign the appropriate SSM roles to the instances, which will require rebuilding the cluster AFAIK. However, any future...
2
17
0
0
I have one EMR cluster which is running 24/7. I can't turn it off and launch the new one. What I would like to do is to perform something like bootstrap action on the already running cluster, preferably using Python and boto or AWS CLI. I can imagine doing this in 2 steps: 1) run the script on all the running instanc...
AWS EMR perform "bootstrap" script on all the already running machines in cluster
1
1
1
0
0
2,264
26,595,519
2014-10-27T19:39:00.000
0
0
0
0
0
python,eclipse,numpy,pydev
1
26,625,834
0
1
0
false
0
0
I recommend you to either use the setup.py from the downloaded archive or to download the "superpack"-executable for windows, if you work on windows anyway. In PyDev, i overcame problems with new libraries by using the autoconfig button. If that doesn't work, another solution could be deleting and reconfiguring the pyt...
1
1
1
0
Although I've been doing things with python by myself for a while now, I'm completely new to using python with external libraries. As a result, I seem to be having trouble getting numpy to work with PyDev. Right now I'm using PyDev in Eclipse, so I first tried to go to My Project > Properties > PyDev - PYTHONPATH > Ext...
Using numpy with PyDev
0
0
1
0
0
2,141
26,617,865
2014-10-28T20:27:00.000
0
0
0
0
0
python,django,cas
0
26,826,648
0
1
0
false
1
0
Turns out django-cas handles TGT using django sessions. However, for validation of the service ticket, you have to manually make a validation request including the ST(service ticket) granted after login and the service being accessed.
1
0
0
0
I'm using CAS to provide authentication for a number of secure services in my stack. The authentication front-end is implemented using Django 1.6 and the django-cas module. However, I'm reading around and I don't seem to get information on how django-cas handles Ticket Granting Tickets and also validation of service ti...
Django CAS and TGT(Ticket Granting Tickets) and service ticket validation
0
0
1
0
0
477
26,649,495
2014-10-30T09:38:00.000
-1
0
0
0
0
python,web.py
0
26,651,096
0
2
0
false
1
0
web.py runs CherryPy as the web server and it has support for handling requests with chunked transfer coding. Have you misread the documentation?
1
1
0
0
I am using web.py to run a server. I need to get a request from a remote server, however, the request sends me a data with Chunked Transfer Coding. I can use web.ctx.env['wsgi.input'].read(1000) to get the data. But this is not what I need since I don't know the length of the data (because it is chunked). But if I use...
Python: how to read 'Chunked Transfer Coding' from a request in web.py server
0
-0.099668
1
0
1
599
26,657,334
2014-10-30T15:39:00.000
0
0
0
0
1
python,numpy,scipy,windows64
1
62,499,396
0
14
0
false
0
0
Follow these steps: Open CMD as administrator Enter this command : cd.. cd.. cd Program Files\Python38\Scripts Download the package you want and put it in Python38\Scripts folder. pip install packagename.whl Done You can write your python version instead of "38"
2
31
1
0
I found out that it's impossible to install NumPy/SciPy via installers on Windows 64-bit, that's only possible on 32-bit. Because I need more memory than a 32-bit installation gives me, I need the 64-bit version of everything. I tried to install everything via Pip and most things worked. But when I came to SciPy, it co...
Installing NumPy and SciPy on 64-bit Windows (with Pip)
0
0
1
0
0
131,918
26,657,334
2014-10-30T15:39:00.000
0
0
0
0
1
python,numpy,scipy,windows64
1
44,685,941
0
14
0
false
0
0
for python 3.6, the following worked for me launch cmd.exe as administrator pip install numpy-1.13.0+mkl-cp36-cp36m-win32 pip install scipy-0.19.1-cp36-cp36m-win32
2
31
1
0
I found out that it's impossible to install NumPy/SciPy via installers on Windows 64-bit, that's only possible on 32-bit. Because I need more memory than a 32-bit installation gives me, I need the 64-bit version of everything. I tried to install everything via Pip and most things worked. But when I came to SciPy, it co...
Installing NumPy and SciPy on 64-bit Windows (with Pip)
0
0
1
0
0
131,918
26,698,805
2014-11-02T11:30:00.000
0
0
1
0
0
python,c++,windows,boost-python
1
26,714,852
0
2
0
false
0
0
I just got an answer from one of my colleagues who told me had the exact same problem. The solution was indeed downloading and installing a version of vcredist_x86.exe, but the trick is to find the exact right one. Apparently you can get to a page somewhere from where you can choose the right version. Sorry for not bei...
1
1
0
0
I've downloaded pythonxy (2.7.6.1) on my new 64 bit Windows machine (Windows 7 Enterprise, SP1). When I try to run python, I get an error saying the side-by-side configuration was incorrect. WinPython 32 bit (2.7.6.3) shows the same behavior, WinPython 64 bit is fine. However, I badly need to compile Python modules wi...
32 bit python on 64 bit windows machine
0
0
1
0
0
1,442
26,700,204
2014-11-02T14:08:00.000
0
0
0
0
0
python,sockets,port,zeromq
0
26,716,452
0
2
0
false
0
0
Having read details about ZeroRPC-python current state, the safest option to solve the task would be to create a central LotterySINGLETON, that would receive <-REQ/REP-> send a next free port# upon an instance's request. This approach is isolated from ZeroRPC-dev/mod(s) modifications of use of the otherwise stable Zero...
1
3
0
0
I am using ZeroRPC for a project, where there may be multiple instances running on the same machine. For this reason, I need to abe able to auto-assign unused port numbers. I know how to accomplish this with regular sockets using socket.bind(('', 0)) or with ZeroMQ using the bind_to_random_port method, but I cannot fig...
ZeroRPC auto-assign free port number
1
0
1
0
1
346
26,722,127
2014-11-03T20:00:00.000
2
0
0
1
0
python,google-app-engine,google-bigquery,google-cloud-datastore
0
26,722,516
0
2
0
false
1
0
There is no full working example (as far as I know), but I believe that the following process could help you : 1- You'd need to add a "last time changed" to your entities, and update it. 2- Every hour you can run a MapReduce job, where your mapper can have a filter to check for last time updated and only pick up those...
1
2
0
0
Currently, I'm using Google's 2-step method to backup the datastore and than import it to BigQuery. I also reviewed the code using pipeline. Both methods are not efficient and have high cost since all data is imported everytime. I need only to add the records added from last import. What is the right way of doing it? ...
Import Data Efficiently from Datastore to BigQuery every Hour - Python
0
0.197375
1
1
0
541
26,726,950
2014-11-04T02:49:00.000
-2
0
0
0
0
python,numpy,matrix,indexing,pygame
0
26,727,002
0
2
0
false
0
0
set a bool to checks every turn if someone has won. if it returns true, then whosever turn it is has won so, for instance, it is x turn, he plays the winning move, bool checks if someone has won,returns true, print out (player whose turn it is) has won! and end game.
1
1
1
0
My assignment is Tic-Tac_Toe using pygame and numpy. I Have almost all of the program done. I just need help understanding how to find if a winner is found. I winner is found if the summation of ANY row, column, or diagonal is equal to 3. I have two 3x3 matrices filled with 0's. Let's call them xPlayer and oPlayer. Th...
Summation of every row, column and diagonal in a 3x3 matrix numpy
0
-0.197375
1
0
0
1,887
26,733,418
2014-11-04T10:57:00.000
2
0
0
0
0
python,algorithm,classification,extraction
0
29,713,740
0
1
0
false
0
0
One approach would be to take the least RMS energy value of the signal as a parameter for classification. You should use a music segment, rather than using the whole music file for classification.Theoretically, the part of the music of 30 sec, starting after the first 30 secs of the music, is best representative for ge...
1
5
1
0
I'm developing a little tool which is able to classify musical genres. To do this, I would like to use a K-nn algorithm (or another one, but this one seems to be good enough) and I'm using python-yaafe for the feature extraction. My problem is that, when I extract a feature from my song (example: mfcc), as my songs are...
Processing musical genres using K-nn algorithm, how to deal with extracted feature?
0
0.379949
1
0
0
449
26,735,790
2014-11-04T13:00:00.000
0
1
0
0
0
python,pycharm,pytest
0
27,827,622
0
2
0
true
0
0
Answer to own question: I installed pyCharm again (for other reasons) and now it uses utrunner.py. It is much faster if I run Run 'Unittest test_foo', since not this does not collect all tests before running the test. Problem solved.
1
0
0
0
If I do Run Unittest .... test_foo in PyCharm it takes quite long to run the test, since all tests get collected first. PyCharm uses py.test -k to run the test. Since we have more than 1000 tests, collecting them takes some time (about 1.2 seconds). Often the test itself needs less time to execute! Since I use this ver...
py.test -k: collecting tests takes too much time
0
1.2
1
0
0
1,778
26,743,435
2014-11-04T19:30:00.000
0
0
0
0
0
python,django
0
26,743,769
0
2
0
false
1
0
By others, do you mean someone on your local network or someone on internet. On local network its very easy, instead starting the local developmnet server by python manage.py runserver you can do python manage.py runserver 10.1.0.123:8000 (assuming 10.1.0.123 is your system's ip), then people on you local network ca...
1
0
0
0
A bit of a beginner question.Iv just started learning Django and can pretty much create basic stuff .Now when I want to access my website on my computer I just type in the local URL and I can access the site,other links etc. If I want to show this to someone else how would I do it?..They wouldn't be able to just type i...
Django site-external access
1
0
1
0
0
290
26,749,349
2014-11-05T03:43:00.000
2
0
1
0
0
python,linked-list
0
26,749,431
0
1
0
true
0
0
It sounds like you have some sort of hash to get a shortlist of possibilities, so, you hash your key to a small-ish number, e.g. 0-256 (as an example, it might hash to 63). You can then go directly to your data at index 63. Because you might have more than one item that hashes to 63, your entry for 63 will contain a li...
1
0
0
0
My teacher wants us to recreate the dict class in Python using tuples and linkedlists (for collisions). One of the methods is used to return a value given a key. I know how to do this in a tuple ( find the key at location[0] and return location[1]) but I have no idea how I would do this in the case of a collision. Any ...
Using tuples in a linked list in python
0
1.2
1
0
0
1,152
26,783,510
2014-11-06T15:44:00.000
0
0
0
0
0
python,google-app-engine,google-cloud-datastore
0
26,784,116
0
1
0
true
1
0
When you create your entity do this: MyModel(id=emailAddress).put() then use get_by_id user = MyModel.get_by_id(emailAddress)
1
0
0
0
I define my model ndb in python. I want to use the email address of a user as the key, how do I do that? user is passing in the email address through an html form. I have everything setup and working. I just don't know how to specify that the email address string is the key.
use email address as datastore key using python app engine
0
1.2
1
0
0
98
26,812,282
2014-11-08T00:25:00.000
2
0
1
0
0
python
1
26,812,299
0
4
0
false
0
0
os.path.expanduser will help you
1
0
0
0
I am trying to read a file in another directory. My current script is in path/to/dir. However, I want to read a file in ~/. I'm not sure how to do this. I tried f = open("~/.file") but I am getting an error IOError: [Errno 2] No such file or directory: '~/.file'
Reading a file in home directory from another directory
0
0.099668
1
0
0
134
26,831,593
2014-11-09T18:20:00.000
0
0
0
0
1
python,numpy,wxpython
0
26,832,062
0
1
0
true
0
1
You can use pyqt or pyside, but I would recommend pyqtgraph which is excellent for this sort of thing. You can build your ui in pyside and use pyqtgraph to manage image output
1
0
0
0
guys, I am trying to find a python GUI library that can show and process 16bit greyscale image easily. I need to modify pixels. I have tried wxpython. It can show the images. But when I tried to convert a numpy array with single channel 16bit data to a string and loaded it in wxImage, it showed me that invalid buffer s...
Python GUI library to show 16bit greyscale image
0
1.2
1
0
0
377
26,837,554
2014-11-10T05:49:00.000
0
0
1
0
0
python
0
26,847,891
0
3
0
false
0
0
The modular and extensible solution is to put YamlParser in its own source file, and simply put the import yaml statement at the beginning. Any code which tries to import this code will fail if the required module yaml is missing.
1
1
0
0
I have classes in a Python project that depend on an external packages. I would like these classes to be created only if their dependencies are available. For example, how can I have a class YamlParser which only exists if yaml can be imported?
create a class only if a package is available on the system
0
0
1
0
0
78
26,848,683
2014-11-10T16:44:00.000
0
0
1
0
0
python,sockets,socketserver
0
26,849,719
0
1
0
true
0
0
SocketServer will work for you. You create one SocketServer per port you want to listen on. Your choice is whether you have one listener that handles the client/server connection plus per file connections (you'd need some sort of header to tell the difference) or two listeners that separate client/server connection and...
1
0
0
0
I've come to the realization where I need to change my design for a file synchronization program I am writing. Currently, my program goes as follows: 1) client connects to server (and is verified) 2) if the client is verified, create a thread and begin a loop using the socket the client connected with 3) if a file on t...
Can I use the Python SocketServer class for this implementation?
0
1.2
1
0
1
158
26,855,274
2014-11-11T00:01:00.000
0
0
1
0
1
python,utf-8
0
26,855,540
0
4
0
false
0
0
I got the answer: my console needed to be restarted. I use Spyder(from Python x,y) for development and this error occcured, so beware. UPDATE: Spyder console seems to suck, because to get it to work, I had to use string.encode('latin1') and (now here's the catch) OPEN A NEW CONSOLE! If I try to reuse my already open co...
2
0
0
0
i´m working with python version 2.7 and I need to know how to print utf-8 characters. Can anyone help me? ->I already tried putting # coding: iso-8859-1 -*- on top, ->using encode like print "nome do seu chápa".encode('iso-8859-1') also doesn't work and even -> using print u"Nâo" doesn't work
python 2.7 - how to print with utf-8 characters?
0
0
1
0
0
4,338
26,855,274
2014-11-11T00:01:00.000
0
0
1
0
1
python,utf-8
0
26,855,341
0
4
0
false
0
0
A more complete response. Strings have two types in Python 2, str and unicode. When using str, you are using bytes so you can write them directly to files like stdout. When using unicode, it has to be serialized or encoded to bytes before writing to files. So, what happens here? print "nome do seu chápa".encode('iso-88...
2
0
0
0
i´m working with python version 2.7 and I need to know how to print utf-8 characters. Can anyone help me? ->I already tried putting # coding: iso-8859-1 -*- on top, ->using encode like print "nome do seu chápa".encode('iso-8859-1') also doesn't work and even -> using print u"Nâo" doesn't work
python 2.7 - how to print with utf-8 characters?
0
0
1
0
0
4,338
26,881,673
2014-11-12T07:42:00.000
2
0
1
0
0
ipython,xshell
0
26,924,407
0
1
0
true
0
0
According to the response from technical support team of XSHELL, it seems xshell does not support interactive shell currently. how can I enter interactive console of iPython in xshell? In cmd of windows, when I type "ipython", it will bring me to the interactive console automatically. However, in xshell, I've tried...
1
1
0
0
I just begin to use xshell in Windows 7, it looks good, but how can I enter interactive console of iPython in xshell? In cmd of windows, when I type "ipython", it will bring me to the interactive console automatically. However, in xshell, I've tried several command like "ipython", "ipython console", all of them would n...
how to start iPython in xshell
0
1.2
1
0
0
262
26,889,459
2014-11-12T14:33:00.000
1
0
1
0
0
python,garbage-collection
0
26,889,994
0
1
0
true
0
0
It looks like gc.get_objects is what you want. Be careful using DEBUG_LEAK as it implies DEBUG_SAVEALL. DEDUG_SAVEALL causes all unreferenced objects to be saved in gc.garbage rather than freed. This means the number of objects tracked by the garbage collector can only increase. Additionally gc.get_objects does not ret...
1
1
0
0
I'm currently debugging a memory leak in a Python program. Since none of my objects have a __del__ method, I'm assuming the issue is some sort of global variable that continues to accumulate references to reachable objects. Also, when I run using gc.debug(gc.DEBUG_LEAK), I see a lot of gc: collectable messages, but n...
Get count of reachable live objects
0
1.2
1
0
0
492
26,915,644
2014-11-13T18:12:00.000
1
0
0
0
0
python,protocol-buffers
0
26,941,801
0
1
0
true
0
0
I wouldn't recommend trying to monkey-patch the encoding functions. You will almost certainly break something. What you can do is write an independent function which encodes a protobuf in an arbitrary way via reflection. For an example of this, see the text_format.py module in Protobufs itself. This module encodes and ...
1
0
0
0
I'm writing a python app that already has the protobuf messages defined. However, we need to use a custom wire format (I believe that's the correct term). How do you (in python) override the base encoding functions? I've looked in encoder.py and that's a maze of nested functors. So what do I need to monkey patch (or w...
how to use custom encoding/decoding with Google Protobuf
0
1.2
1
0
0
819
26,923,372
2014-11-14T05:15:00.000
0
0
0
0
1
python,data-mining,orange
0
28,112,745
0
1
0
false
0
0
In my case this error was due to an old version of numpy being installed prior to installing Orange on a windows install. The Orange installer did not upgrade numpy even though for some widgets it requires it (the discretize widget being one of them which then fails to load silently^). Uninstalling numpy and rerunning...
1
0
0
0
In ORANGE - I found that the Discretize widget is missing in my installation - where do I go to load it?
Missing widget - how do I load one (Discretize)
0
0
1
0
0
228
26,939,090
2014-11-14T21:22:00.000
0
0
0
1
0
python,windows,shell,unix
0
26,939,339
0
2
0
false
0
0
You have to install Unix Bash for Windows, but not sure if it works correctly ... Better solution is install or virtualize some Linux distribution.
1
0
0
0
I tried using some Unix command using the subprocess module on my Python interpreter installed on a windows 7 OS. However, it errors out saying command not found. It does recognize Windows commands though. Can I somehow use Unix commands in here too? Thanks, Vishal
How to run Unix commands in python installed on a windows machine?
0
0
1
0
0
1,284
26,948,469
2014-11-15T17:16:00.000
0
0
1
0
0
python,django,pycharm
0
27,120,852
0
1
0
false
1
0
(Using PyCharm 4.0) Go to Tools --> Deployment --> and either select an existing server connection or create a new one. Under the Mappings tab, you can associate a local path with a remote path. I keep my Django project folder mapped to the one on the server. Once you hit OK, go back to Tools --> Deployment, and you ...
1
1
0
0
I have an existing django project on an AWS instance. I have copied my Python files to my local machine. PyCharm is configured to use the Python interpreter on the remote machine. The django file references are, naturally, not resolved by PyCharm, since the django files are not on the local machine. Is the usual pro...
With PyCharm, how do I reference django files when using remote AWS interpreter?
1
0
1
0
0
215
26,965,450
2014-11-17T04:17:00.000
2
0
1
1
0
python,macos,pip,easy-install
0
26,965,467
0
2
0
true
0
0
There's an easy way around it - use pip2 or pip2.7 or pip-2.7 for Python 2, and pip3 or pip3.4 or pip-3.4 for Python 3. Both version ship with easy_install, but Python 2 does not contain pip by default - you have to install it yourself.
1
3
0
0
I am a non-programmer who started to learn Python. My Mac OS X Yosemite shipped with Python 2.7.6. I installed Python 3.4.2 too. If I use pip or easy_install in the terminal to install a package, how do I know which Python I installed the package in? It seems Python 3.4.2 shipped with pip and easy_install, but I think ...
Which version of Python did pip or easy_install refer to by default?
0
1.2
1
0
0
163
27,001,985
2014-11-18T19:04:00.000
0
0
1
0
0
python,python-3.x,import,module,anaconda
0
27,034,348
0
2
0
false
0
0
As a side note, If you want to keep this functionality and move to a more script-like environment I would suggest using something like Spyder IDE. It comes with an editor linked with the IPython console that supports all the same magics as the IPython notebook.
2
2
0
0
I'm interested in creating physics simulations with Python so I decided to download Anaconda. Inside of an IPython notebook I can use the pylab module to plot functions, for example, with ease. However, if I try to import pylab in a script outside of IPython, it won't work; Python claims that the pylab module doesn't e...
Using Anaconda modules outside of IPython
0
0
1
0
0
238
27,001,985
2014-11-18T19:04:00.000
1
0
1
0
0
python,python-3.x,import,module,anaconda
0
27,002,473
0
2
0
false
0
0
I bet it will work if you use Anaconda's Python distribution. Try running ./anaconda/bin/python and importing it from that Python session.
2
2
0
0
I'm interested in creating physics simulations with Python so I decided to download Anaconda. Inside of an IPython notebook I can use the pylab module to plot functions, for example, with ease. However, if I try to import pylab in a script outside of IPython, it won't work; Python claims that the pylab module doesn't e...
Using Anaconda modules outside of IPython
0
0.099668
1
0
0
238
27,014,098
2014-11-19T10:10:00.000
0
0
1
0
1
python,macos,button,crash,python-idle
0
45,559,740
0
2
0
false
0
0
I got the similar problem, Try British pc keyboard it works for me
1
0
0
0
I am running OS X 10.9.5, and IDLE w/ Python 3.4.1. When I press the buttons for (¨/^) or (´/`), IDLE crashes and the program closes. This causes me to lose changes to files, as well as time. My fellow students using Mac experience the same problem. Anyone know how I can fix this?
IDLE crashes for certain buttons on Mac
0
0
1
0
0
3,590
27,021,617
2014-11-19T16:14:00.000
2
0
1
1
0
python,bash,fastq
0
27,021,713
0
2
0
false
0
0
You can try find . -name "*.fastq" | xargs your_bash_script.sh, which use find to get all the files and apply your script to each one of them.
1
0
0
0
I have a directory with 94 subdirectories, each containing one or two files *.fastq. I need to apply the same python command to each of these files and produce a new file qc_*.fastq. I know how to apply a bash script individually to each file, but I'm wondering if there is a way to write a bash script to apply the comm...
applying the same command to multiple files in multiple subdirectories
1
0.197375
1
0
0
115
27,031,912
2014-11-20T04:43:00.000
0
0
1
0
0
python,indentation
0
29,987,945
0
3
0
false
0
0
If you are using Eclipse IDE, there are two formatting options available that can be used to accomplish this, accessed from the Source Menu. a) "Source > Convert space-tabs to tabs" or b) "Source > Convert tabs to space-tabs" I was able to format code that had 2 spaces instead of a tab using the first option. You sim...
1
8
0
0
I am a beginner at Python and have made the mistake of mixing spaces and tabs for indentations. I see people use reindent.py, but I have no idea how to use it. please explain in the simplest way possible without trying to use too fancy words and dumb it down as best as possible as I am a beginner. Thanks.
HOWTO: Use reindent.py for dummies
1
0
1
0
0
17,316
27,034,666
2014-11-20T08:11:00.000
0
0
1
1
0
python,eclipse
0
27,035,599
1
3
0
false
1
0
Had this same problem a few days ago. You might have downloaded the wrong version of PyDev for your python version (2.7.5 or something is my python version, but I downloaded PyDev for version 3.x.x) 1) Uninstall your current version PyDev 2) you have to install the correct version by using the "Install New Software", ...
1
3
0
0
I have Java version 7 and had installed PyDev version 3.9 from Eclipse Marketplace..but it's not showing up in New project or in Windows perspective in Eclipse..Can some one please tell me what i need to do ???
PyDev not appearing in Eclipse after install
0
0
1
0
0
7,516
27,053,070
2014-11-21T02:12:00.000
0
0
1
0
0
java,python
0
40,499,350
0
2
0
false
1
0
Use the add_library function: add_library("sound")
2
1
0
0
Im using processing in python mode but I want to use the processing library sound. But I dont know how to import this into my program in python syntax. In java its like this: Import processing.sound.*; Thanks
How to use java libraries in python processing
0
0
1
0
0
390
27,053,070
2014-11-21T02:12:00.000
0
0
1
0
0
java,python
0
28,146,057
0
2
0
false
1
0
You can use add_library(processing.sound). I used it with g4p library
2
1
0
0
Im using processing in python mode but I want to use the processing library sound. But I dont know how to import this into my program in python syntax. In java its like this: Import processing.sound.*; Thanks
How to use java libraries in python processing
0
0
1
0
0
390
27,066,366
2014-11-21T16:50:00.000
6
0
0
0
0
python,django,server
0
27,074,081
0
10
0
false
1
0
well it seems that it's a bug that django hadn't provided a command to stop the development server . I thought it have one before~~~~~
5
52
0
0
I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development?
django development server, how to stop it when it run in background?
0
1
1
0
0
122,154
27,066,366
2014-11-21T16:50:00.000
3
0
0
0
0
python,django,server
0
27,066,460
0
10
0
false
1
0
As far as i know ctrl+c or kill process is only ways to do that on remote machine. If you will use Gunicorn server or somethink similar you will be able to do that using Supervisor.
5
52
0
0
I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development?
django development server, how to stop it when it run in background?
0
0.059928
1
0
0
122,154
27,066,366
2014-11-21T16:50:00.000
1
0
0
0
0
python,django,server
0
50,886,343
0
10
0
false
1
0
From task manager you can end the python tasks that are running. Now run python manage.py runserver from your project directory and it will work.
5
52
0
0
I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development?
django development server, how to stop it when it run in background?
0
0.019997
1
0
0
122,154
27,066,366
2014-11-21T16:50:00.000
-3
0
0
0
0
python,django,server
0
53,480,387
0
10
0
false
1
0
You can Quit the server by hitting CTRL-BREAK.
5
52
0
0
I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development?
django development server, how to stop it when it run in background?
0
-0.059928
1
0
0
122,154
27,066,366
2014-11-21T16:50:00.000
4
0
0
0
0
python,django,server
0
66,500,994
0
10
0
false
1
0
Ctrl+c should work. If it doesn't Ctrl+/ will force kill the process.
5
52
0
0
I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development?
django development server, how to stop it when it run in background?
0
0.07983
1
0
0
122,154
27,081,314
2014-11-22T19:06:00.000
0
0
0
0
0
python,snmp,conceptual,mib,pysnmp
0
27,083,747
0
1
0
false
0
0
Manager needs to know the variables to query for something specific. The variables can be identified by OIDs or MIB objects names. MIBs give Manager information such as: Human friendly symbolic names associated with the OIDs Types of values associated with particular OIDs Hints on variable access permissions that are ...
1
0
0
0
I am fairly new to the SNMP protocol and have only been introduced to it recently in my computer networking course. I understand how the manager sends Gets, Sets, GetNext, GetBulk and all that, it will catch Traps and such. One thing I don't entirely understand is the MIB From what I gather, the MIB is chillen on an a...
Trouble grasping MIBs with PySNMP
0
0
1
0
0
329
27,081,784
2014-11-22T19:51:00.000
0
0
1
0
0
python,dictionary,statistics
0
27,081,959
0
4
0
false
0
0
assuming you use Scipy to calculate the Z-score and not manually from scipy import stats d = {'keys':values, ...} dict_values = d.values() z = stats.zscore(dict_values) This will return a Numpy array with your z scores
1
1
0
0
I have a dictionary, for which I want to calculate all values to zscores. Now I do know how to how to compute the zscore of an array, but have no idea how to do this for a dictionary. Does anybody have some tips? Thanks!
Python: Calculate all values of dictionary to z-scores
0
0
1
0
0
2,411
27,091,319
2014-11-23T16:30:00.000
0
0
0
0
0
ipython,classification,decision-tree,nearest-neighbor,cross-validation
0
27,095,449
0
1
0
false
0
0
I assume here that you mean the value of k that returns the lowest error in your wine quality model. I find that a good k can depend on your data. Sparse data might prefer a lower k whereas larger datasets might work well with a larger k. In most of my work, a k between 5 and 10 have been quite good for problems with...
1
2
1
0
I am working on a UCI data set about wine quality. I have applied multiple classifiers and k-nearest neighbor is one of them. I was wondering if there is a way to find the exact value of k for nearest neighbor using 5-fold cross validation. And if yes, how do I apply that? And how can I get the depth of a decision tre...
Using cross-validation to find the right value of k for the k-nearest-neighbor classifier
1
0
1
0
0
185
27,115,526
2014-11-24T22:41:00.000
0
0
1
1
1
python,linux,ipython,redhat
0
27,115,695
0
4
0
false
0
0
You have your $PATH fine, as you can run python without specifying full path, aka /usr/bin/python. You get 2.6.6 in Ipython directory because it has python executable in it, named, wild guess - python. 2.7.5 is installed system-wide. To call 2.7.5 from the Ipython dir, use full path /usr/bin/python, or whatever which ...
2
1
0
0
I have installed (or so I think) python 2.7.5. When I type "Python --version" I get python2.7.5 I've narrowed this down to: When I run "python" in a terminal in my /Home/UsrName/ directory it is version 2.7.5 However when I run "python" in a terminal in /Home/UserName/Downloads/Ipython directory I get 2.6.6 I went in...
how to get python 2.7 into the system path on Redhat 6.5 Linux
0
0
1
0
0
18,214
27,115,526
2014-11-24T22:41:00.000
0
0
1
1
1
python,linux,ipython,redhat
0
27,116,633
0
4
0
false
0
0
I think I know what is happening - abarnert pointed out that the cwd (".") may be in your path which is why you get the local python when you're running in that directory. Because the cwd is not normally setup in the global bashrc file (/etc/bashrc) it's probably in your local ~/.bashrc or ~/.bash_profile. So edit thos...
2
1
0
0
I have installed (or so I think) python 2.7.5. When I type "Python --version" I get python2.7.5 I've narrowed this down to: When I run "python" in a terminal in my /Home/UsrName/ directory it is version 2.7.5 However when I run "python" in a terminal in /Home/UserName/Downloads/Ipython directory I get 2.6.6 I went in...
how to get python 2.7 into the system path on Redhat 6.5 Linux
0
0
1
0
0
18,214
27,117,461
2014-11-25T01:47:00.000
2
0
1
1
0
python,file-io,cmd,notepad++
0
27,117,505
0
2
0
false
0
0
In the properties of the shortcut that you use to start Notepad++, you can change its working directory, to whichever directory you're more accustomed to starting from in Python. You can also begin your python program with the appropriate os.chdir() command.
1
1
0
0
Not a major issue but just an annoyance I've come upon while doing class work. I have my Notepad++ set up to run Python code straight from Notepad++ but I've noticed when trying to access files I have to use the full path to the file even given the source text file is in the same folder as the Python program being run....
Python program needs full path in Notepad++
0
0.197375
1
0
0
510
27,135,428
2014-11-25T19:49:00.000
0
0
0
0
0
python,django,admin,manytomanyfield
0
27,135,554
0
4
0
false
1
0
The Django Admin select menus use the unicode value of the model instance to populate things like menus. Whatever your __unicode__ method returns should be what is in the select menu.
1
2
0
0
I have "Articles" and "Modules" apps. Inside "Modules" app there is model which have to display articles and they're linked by ManyToManyField in "Modules". My question is how to modify text value in select field in Django admin? As default it displays names of articles, but i want also some information from Article mo...
How to modify Django admin ManyToManyField text?
0
0
1
0
0
579
27,145,014
2014-11-26T09:05:00.000
0
0
1
0
0
javascript,python,processing
0
49,843,328
0
1
0
false
1
0
At the moment there is no straightforward way to do this. But some workarounds can be found. For example, since Processing's python mode is using Jython language (Python on JVM) you can do the following: Compile the Jython code to Java bytecode Decompile Java bytecode to real Java code Use processing.js to make the sk...
1
4
0
0
The title says it all. I spent a lot of time designing a sketch in Processing using the Python language. Now, I would like to put the sketch on a webpage. Of course, I could just translate the sketch from python language to javascript and use a javascript library for processing. However, this would be a very lengthy pr...
Is there a way to integrate a processing sketch written in Python in a webpage?
1
0
1
0
0
144
27,170,958
2014-11-27T12:34:00.000
0
0
1
0
0
python,python-sphinx
0
59,568,068
0
3
0
false
0
0
I use :py:obj: instead. :py:attr: won't work for me when the property is in another page.
1
16
0
0
How can I reference a method, decorated with @property? For simple methods, :py:meth: is working fine, but not for properties: it does not create a link to them.
Sphinx documentation: how to reference a Python property?
0
0
1
0
0
6,984
27,177,721
2014-11-27T19:37:00.000
1
0
0
0
0
python-3.x,tf-idf,lda,topic-modeling,gensim
0
27,378,733
0
1
0
false
0
0
id2word must map each id (integer) to term (string). In other words, it must support id2word[123] == 'koala'. A plain Python dict is the easiest option.
1
3
1
0
I have a tf-idf matrix already, with rows for terms and columns for documents. Now I want to train a LDA model with the given terms-documents matrix. The first step seems to be using gensim.matutils.Dense2Corpus to convert the matrix into the corpus format. But how to construct the id2word parameter? I have the list of...
Training a LDA model with gensim from some external tf-idf matrix and term list
0
0.197375
1
0
0
505
27,192,467
2014-11-28T16:11:00.000
3
0
0
0
0
python,random,spatial,coordinate
0
27,192,613
0
1
0
true
0
1
There's a lot that's unspecified in your question, such as what distribution you want to use. For the sake of this answer, I'll assume a uniform distribution. The straightforward way to handle an arbitrary volume uniform distribution is to choose three uniformly random numbers as coordinates in the range of the boundin...
1
0
1
0
I would like to generate a uniformly random coordinate that is inside a convex bounding box defined by its (at least) 4 vertices (for the case of a tetrahedron). Can someone suggest an algorithm that I can use? Thanks! If a point is generated in a bounding box, how do you detect whether or not it is outside the geomet...
Generate a random point in space (x, y, z) with a boundary
0
1.2
1
0
0
1,463
27,192,905
2014-11-28T16:39:00.000
1
0
1
0
0
ipython,ipython-notebook
0
27,229,741
0
3
0
true
0
0
I didn't find how to get the previous content cell in a cell. But I found another solution, creating a custom magic notebook function to capture the cell content and work with that.
1
5
0
0
Is it possible in an IPython-Notebook cell to get the previous (above) cell content ? I can see previous output with %capture magic function but I don't find how to get the previous cell content.
IPython Notebook previous cell content
1
1.2
1
0
0
3,415
27,193,835
2014-11-28T17:56:00.000
0
1
0
0
0
qpython
0
27,197,253
0
2
0
false
0
1
The comment from Yulia V got me thinking, maybe I just needed to append the location of "Scripts" to the sys.path, and Yep, that worked fine!! Thanks Yulia!
2
0
0
0
With QPython on Kindle fire .. I use QEdit to write & save a .py file .. say bob.py .. But when I switch to Console, I can't IMPORT from bob .. Can someone tell me how to do this? John (new to QPython)
How to import from saved QPython file?
0
0
1
0
0
1,136
27,193,835
2014-11-28T17:56:00.000
0
1
0
0
0
qpython
0
27,209,867
0
2
0
false
0
1
I think you can save the module file into the same directory which you script locates or /sdcard/com.hipipal.qpyplus/lib/python2.7/site-packages/
2
0
0
0
With QPython on Kindle fire .. I use QEdit to write & save a .py file .. say bob.py .. But when I switch to Console, I can't IMPORT from bob .. Can someone tell me how to do this? John (new to QPython)
How to import from saved QPython file?
0
0
1
0
0
1,136
27,194,932
2014-11-28T19:32:00.000
2
1
1
0
0
python
0
30,282,342
0
2
0
false
0
0
You run your .py files just like you would if you were running the python commandline in windows. ex. python myfile.py Open a SSH terminal from your python devbox and type it in the cmd line and you're all set.
1
2
0
0
I just started with learning Python 3.4.x. I really want to keep learning and developing on all devices. That's why I'm using Codeanywhere. But the problem is I don't know how to execute a .py file in Codeanywhere. Is there a method to do it? Thanks
How do I run python in Codeanywhere?
0
0.197375
1
0
0
9,516
27,198,697
2014-11-29T03:58:00.000
1
0
1
0
0
python,linux,sockets,video,udp
0
27,199,731
0
1
0
true
0
0
If you are to send a video(with audio) to a peer in the network, you would better use RTP(Real time Transfer Protocol) which works on top of UDP. RTP provides feature of timestamps and profile which help you syncronize the audio and video sent through two ports.
1
0
0
0
I am doing a project on media (more like a video conferencing). The problem is , although I am able to send text/string data from one peer to another, I am still not sure about video files. Using gstreamer, I am able to capture video stream from my webcam and doing the encoding/coding (H.264) , I am able to write the ...
python - how to have video file(data) into list?
0
1.2
1
0
1
73
27,204,134
2014-11-29T15:58:00.000
0
1
0
0
0
python,serialization,raspberry-pi
0
64,522,252
0
3
0
false
0
0
It's the cable. Check the USB cable. All of that yanking
1
1
0
0
I'm making a code where the pi gets a serial input from a usb-serial board(From the sparkfun RFID starter kit), how can I make this work? error Traceback (most recent call last): File "main", line 22, in ser = s.Serial('ttyUSB0', 9600, timeout=10000) File "/usr/lib/python2.7/dist-packages/serial/serialutil....
ttyUSB0 not found on Raspberry Pi
0
0
1
0
0
9,230
27,207,643
2014-11-29T22:02:00.000
1
0
0
0
0
python,performance,tkinter,syntax-highlighting,lexical-analysis
0
27,210,959
0
1
1
false
0
1
One possible answer is to do something like Idle does. As a user hits each key, its custom incremental parser tags identifiers that are a keyword, builtin, or def/class name*. It also tags delimited char sequences that are a string or comment. I does what can be done quickly enough. For example, if one types printer ...
1
0
0
0
I'm trying to implement syntax highlighting for text in a Text widget. I use an external library to lexically analyse the text and give me the tokenised text. After that I go over all the words in the text and apply tag to their position in the text widget so that I can style each word. My concern now is how do I dea...
Efficiently applying text widget tags in tkinter text widgets
0
0.197375
1
0
0
228
27,208,926
2014-11-30T01:01:00.000
1
0
0
0
0
c#,.net,dll,ironpython
0
27,233,826
0
1
0
true
1
1
You can try replicating what "works for me". Create a solution containing: python project (ironpython) C# project Add a reference to desired oracle library (Oracle.DataAccess.dll) to C# project using the standard VS mechanism. C# project should also contains a post build step to copy the resulting dll and pdb into th...
1
0
0
0
I want to debug separate pieces of my application in Visual Studio 2012. I have C# executable which works with Oracle.DataAccess dll. It works fine. Within it IronPython runtime is invoked and it works fine too. Within these IronPython modules object from main C# application is invoked and it works fine with Oracle dll...
DLL loading (C#/IronPython/C#) in VS2012
0
1.2
1
0
0
390
27,217,051
2014-11-30T19:08:00.000
0
0
0
0
0
python,opengl,webgl,ipython,vispy
0
27,259,240
0
1
0
true
0
0
This looks like a good use-case for Vispy indeed. You'd need to use a PointVisual for the nodes, and a LineVisual for the edges. Then you can update the edges in real time as the simulation is executed. The animation would also work in the IPython notebook with WebGL. Note that other graphics toolkits might also work f...
1
0
1
0
So I have a particular task I need help with, but I was not sure how to do it. I have a model for the formation of ties between a fixed set of network nodes. So I want to set up a window or visualization that shows the set of all nodes on some sort of 2-dimensional or 3-dimensional grid. Then for each timestep, I want ...
network animation with static nodes in python or even webgl
1
1.2
1
0
0
308
27,226,551
2014-12-01T10:39:00.000
1
1
0
1
0
python,perl,ubuntu,automation,perl-module
0
27,242,918
0
1
0
false
0
0
The main thing to understand is that each tab has a different instance of terminal running, more importantly a different instance of shell (just thought I would mention as it didnt seem like you were clear about that from your choice of words). So "passing control" in such a scenario could most probably entail inter-pr...
1
0
0
0
I am trying to automate a scenario in which, I have a terminal window open with multiple tabs open in it. I am able to migrate between the tabs, but my problem is how do i pass control to another terminal tab while i run my perl script in a different tab. Example: I have a terminal open with Tab1,Tab2,Tab3,Tab4 open in...
How do i pass on control on to different terminal tab using perl?
0
0.197375
1
0
0
134
27,255,560
2014-12-02T17:36:00.000
1
0
0
0
0
python,machine-learning,language-features,feature-selection
0
27,256,151
0
1
0
true
0
0
You either need to under-sample the bigger class (take a small random sample to match the size of the smaller class), over-sample the smaller class (bootstrap sample), or use an algorithm that supports unbalanced data - and for that you'll need to read the documentation. You need to turn your words into a word vector. ...
1
2
1
0
I have been trying to build a prediction model using a user’s data. Model’s input is documents’ metadata (date published, title etc) and document label is that user’s preference (like/dislike). I would like to ask some questions that I have come across hoping for some answers: There are way more liked documents than d...
Training a Machine Learning predictor
1
1.2
1
0
0
232
27,259,478
2014-12-02T21:38:00.000
4
0
0
0
0
python,excel,openpyxl
1
27,280,801
0
1
0
true
0
0
In openpyxl cells are stored individually in a dictionary. This makes aggregate actions like deleting or adding columns or rows difficult as code has to process lots of individual cells. However, even moving to a tabular or matrix implementation is tricky as the coordinates of each cell are stored on each cell meaning ...
1
1
0
0
I'm trying to delete cells from an Excel spreadsheet using openpyxl. It seems like a pretty basic command, but I've looked around and can't find out how to do it. I can set their values to None, but they still exist as empty cells. worksheet.garbage_collect() throws an error saying that it's deprecated. I'm using t...
Delete cells in Excel using Python 2.7 and openpyxl
0
1.2
1
1
0
2,658