Q_Id
int64
337
49.3M
CreationDate
stringlengths
23
23
Users Score
int64
-42
1.15k
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
Tags
stringlengths
6
105
A_Id
int64
518
72.5M
AnswerCount
int64
1
64
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
6
11.6k
Available Count
int64
1
31
Q_Score
int64
0
6.79k
Data Science and Machine Learning
int64
0
1
Question
stringlengths
15
29k
Title
stringlengths
11
150
Score
float64
-1
1.2
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
8
6.81M
36,049,768
2016-03-17T00:54:00.000
0
0
0
0
java,python,angularjs,django,django-cms
36,055,522
1
false
1
0
No, it's not possible. django CMS is a standard Django application, that requires a standard kind of Django environment. It can't do anything except as part of a Django project. There's nothing to stop you configuring your web server so that some requests (by URL) go to the Django project while the others are handled ...
1
0
0
I have a project with a Java backend and Angular-based frontend and I'd like to utilize Django-cms. Is this possible to do with a non-Django project? I've been looking over the documentation, but I can't find an explicit 'yes' or 'no'. I can't wrap my head around how I'd integrate, what seem to me, two very different p...
Django-cms with non-django-based project
0
0
0
52
36,051,134
2016-03-17T03:26:00.000
30
0
1
0
python,json,pandas
52,089,783
4
false
0
0
Looping over indices is very inefficient. A faster technique: df['json'] = df.apply(lambda x: x.to_json(), axis=1)
1
22
1
I have a dataframe in pandas and my goal is to write each row of the dataframe as a new json file. I'm a bit stuck right now. My intuition was to iterate over the rows of the dataframe (using df.iterrows) and use json.dumps to dump the file but to no avail. Any thoughts?
Pandas row to json
1
0
0
43,885
36,051,581
2016-03-17T04:17:00.000
2
0
0
1
python,django,amazon-web-services,ssh
36,051,700
1
false
0
0
The advice against using ssh comes from a well-meaning bunch that wants us all to create reproducible configurations that don't require administrators to login in order to periodically tweak the config. It also becomes another interface that must be secured. Ideally, everything you need is independent of ssh because y...
1
0
0
as I'm using aws I'm looking into two tutorials just to make sure I do it right. and I'm at a step to do eb init, and it asks "do you want ssh for your instance?" one tutorial says I should say yes and the other says i should put no...isn't ssh the one that connects my laptop with amazon's network shouldn't I put yes f...
do you want ssh for your instance?
0.379949
0
1
35
36,053,119
2016-03-17T06:28:00.000
1
0
1
1
python,macos,tkinter,crash,python-idle
47,341,459
3
false
0
0
I found a fix! One that doesn't require changing monitor settings. In IDLE: Options Menu > Configure Extensions > CallTips > set to FALSE Then restart. Took much research to find that super simple solution... the problem is caused not by an error in IDLE but by an error in the mac's Tcl/Tk code when calltips are called...
1
1
0
Ok, I realize this may be an extremely nuanced question, but it has been bugging me for a while. I like the simple scripting interface of IDLE, but it keeps crashing on me when: (1) I am coding on an external monitor and (2) I type the parenthesis button, "(". IDLE never crashes for me for any other reason than this v...
Why does Python's IDLE crash when I type a parenthesis on Mac?
0.066568
0
0
1,732
36,053,762
2016-03-17T07:10:00.000
2
0
1
0
python,automated-tests,calabash
36,055,080
2
false
0
0
There is no Calabash client for python.
1
0
0
I am a newbie to calabash and I wish to write the calabash step definitions in python. Does calabash supports Python? If yes, Please share the links/Tutorials.
Does Calabash supports Python?
0.197375
0
0
568
36,054,602
2016-03-17T07:58:00.000
0
0
0
0
python,python-3.x,post,network-programming,python-requests
36,056,276
1
true
0
0
Here there are two different answers. The one is for the case where you want to specify the NIC to send the request and the other is for what you're asking: find the correct NIC. For the second answer, I can only say that it depends. Are these NICs on the same network / subnet? Are they bonded? If they are on a diffe...
1
1
0
I have machine with multiple NICs that can be connected to one net, to different nets or every other possible way. Python script that uses requests module to send POST/GET requests to the server is ran on that machine. So, the question is next: how can I know in python script from which interface requests will be sent?
Python 3: how to get nic from which will be sent packets to certain ip?
1.2
0
1
204
36,059,066
2016-03-17T11:22:00.000
0
0
1
0
python,python-3.x
36,060,129
1
false
0
0
Q1. A better solution could be: pop enqueue dequeue push By do this, you get 4*n operations. For instance, let be stack: 1, 2, 3 (with 1 as the top) Let be s the stack and q the queue. q.enqueue(s.pop()), so now s = [2, 3] and q = [1] q.enqueue(s.pop()), so now s = [3] and q = [1, 2] q.enqueue(s.pop()), so now s =...
1
0
0
Question 1 You have an abstract stack with n entries and an empty abstract queue (to help). Approximately how many calls are needed to determine n? The stack needs to be unchanged afterwards. Question 2 Same question, but you start with an abstrack queue and have an empty abstrack stack. My reasoning Pop from stack ...
Number of calls to determine size of stack/queue
0
0
0
234
36,062,523
2016-03-17T13:50:00.000
0
0
1
0
python,pandas,python-3.5
36,587,035
1
false
0
0
You should try typing in python3 instead of python because, you are running v3.x on Python and the command python runs v2.7 according to me.
1
0
0
First of all I'm new to python and using 3.5 version when trying to install pandas usingpip install pandasit is showing error as pip is not recognized as an internal or external command by using other command to install some packages,py -3.5 -m pip install SomePackageit shows me error could not find a version that sati...
error for pandas installation and update of pip in python 3.5 windows
0
0
0
479
36,063,280
2016-03-17T14:20:00.000
0
0
0
0
python,data-structures,tree,chat,chatbot
36,063,802
1
false
0
0
I think it's difficult.Your way is too simple to reach your demand. First, how do you judge the answer that users respond is positive or negative? How about the user answering "Who are you?" If the answer users respond is also simple ,it might work.Just search in the tree to find the answer to the user's repond. Maybe ...
1
0
0
I'm trying to represent a conversation as a series of decisions for a chatbot I'm building. I'm not sure if a tree is the best data structure of this, but it was the first that came to mind. For example, the chatbot may ask the user "How are you?", to which the user might respond positively or negatively. If the user r...
Tree Data Structure for Conversation
0
0
1
572
36,072,330
2016-03-17T21:50:00.000
0
0
1
0
python,mqtt,paho
36,074,456
1
false
0
0
As Cory hints in the comment above, I didn't really have my interpreter correctly selected. I was configuring the "Build, Execution, Deployment" Python Console - and not the project's interpreter (as I should have been). Once I configured the project interpreter to point at my homebrew installation of python, all was...
1
0
0
I have a bit of code that connects fine with the paho mqtt client from my OSX bash shell. When I attempt to run the same code directly from within PyCharm, I receive the error below - the exception seems to happen within wrap_socket. I'm new to these tools, but I believe that both environments are pulling Python 2.7.1...
SSL Error when connecting with paho mqtt client -
0
0
0
386
36,073,457
2016-03-17T23:24:00.000
0
0
0
0
python-2.7,turtle-graphics
36,073,624
1
true
0
1
With the 2.7.11 python shell it won't let use use the features of the turtle module. Sorry
1
0
0
When I try to use the turtle module with the python 2.7.11 shell, the turtle graphics window that does not respond. Can I use the python 2.7.11 shell with the turtle module?
Can I use python 2.7 shell with the turtle module?
1.2
0
0
138
36,075,166
2016-03-18T02:35:00.000
20
0
1
1
python-2.7,anaconda
36,079,150
2
true
0
0
Your PATH is pointing to the original Python executable. You have to update your PATH. (Assuming Windows 7) Right-click on Computer, the Properties, the Advanced system settings, then click the Environment Variables... button. The lower window has the system variables. Scroll down until you find Path, select it, and cl...
1
18
0
I have both Anaconda and Python 2.7 installed on my Windows machine. Right now the command "python" points to Python 2.7, but I'd like instead for it to point to Anaconda's python. How do I set this up?
How do I set Anaconda's python as my default python command?
1.2
0
0
63,145
36,081,370
2016-03-18T10:00:00.000
1
0
0
0
python,algorithm,machine-learning,random-forest,decision-tree
36,081,837
1
false
0
0
Q1 You shouldn't remove the features from M. Otherwise it will not be able to detect some types of relationships (ex: linear relationships) Maybe you can stop earlier, in your condition it might go up to leaves with only 1 sample, this will have no statistical significance. So it's better to stop at say, when the numb...
1
2
1
I'm doing a Random Forest implementation (for classification), and I have some questions regarding the tree growing algorithm mentioned in literature. When training a decision tree, there are 2 criteria to stop growing a tree: a. Stop when there are no more features left to split a node on. b. Stop when the node has ...
Random forest tree growing algorithm
0.197375
0
0
586
36,082,717
2016-03-18T11:02:00.000
0
0
0
0
python,sqlite,user-defined-functions
36,083,671
1
true
0
0
UDFs are available only in the connection that created them. You'd have to write your own command-line shell in Python.
1
0
0
If I create an UDF in python with sqlite3.create_function, can I call that function from SQLite command line?
Calling python UDF from SQLite command line
1.2
0
0
192
36,085,002
2016-03-18T12:57:00.000
2
0
0
0
python,python-3.x,tkinter
36,085,149
1
true
0
1
1> Define you button outside the eventHandler of the radiobutton. inside the event handler only grid/pack it,whenever the radiobutton is pressed. In this way the button will not be defined multiple times. N.B. Use fix row & column with the grid if you need.
1
0
0
I have two questions regarding tkinter that I cant seem to find the answer too. 1) I currently have 2 radio buttons. I have programmed them in such a way that when one of them is clicked another definition is called and that creates a regular button on the screen. Now my problem is, if the user toggles between the bot...
Doubts about checking if button is already displayed and making a list of radio buttons
1.2
0
0
26
36,086,330
2016-03-18T13:58:00.000
1
0
0
0
python,scipy,spyder
36,104,821
1
false
0
0
You can use lsq_linear which is available in scipy version 0.17.
1
1
1
I am using the nnls algorithm from scipy and am shocked to find that I cannot control the final tolerance, as can be done in Matlab using Tolx i.e, termination tolerance. Modifying the Fortran code or even reading it is extremely hard. I am only new to python since a month. I need to do $\| A x - b\|_2 \leq \epsilon\...
Scipy nnls algorithm does not have termination tolerance option
0.197375
0
0
129
36,087,488
2016-03-18T14:53:00.000
0
0
0
1
python,linux,cpu
36,087,597
1
false
0
0
Maybe try to to use time.sleep() and play around with how long to sleep in between calculations?
1
1
0
I'd like to know how to generate a controlled CPU load on Linux using shell or python script. By controlled load I mean creating a process that consumes a specified amount of CPU cycles (e.g., 20% of available CPU cycles). I wrote a python script that does some dummy computation like generating N random integers and s...
How to create controlled CPU load on Linux?
0
0
0
151
36,088,267
2016-03-18T15:27:00.000
1
1
0
0
python,excel
36,088,981
2
false
0
0
Check out Openpyxl for the excel and SMTP for the emails, can use schedule to schedule it everyday, shouldn't be hard.
1
1
0
Firstly I do apologies if my question might sound silly or irrelevant. I do not have a high level in any kind of coding language. I am currently using( playing around with python) and I was wondering if I can automate a process that I deal with every day and I currently do manually. I have an excel spreadsheet that I ...
Sorting an excel file and sending a daily email using python
0.099668
0
0
412
36,090,844
2016-03-18T17:35:00.000
1
0
1
0
python
36,090,877
6
false
0
0
On a list, bool(l) is equivalent to len(l) > 0. It's not any(bool(i) for i in l) or some such test that looks at the items in the list.
1
0
0
I understand the intuition of how bool([]) is False. But the why is bool([[]]), bool([[[]]]), etc are all True? What's the logic behind this?
bool() operator on nested lists which are empty
0.033321
0
0
57
36,092,591
2016-03-18T19:15:00.000
1
0
0
0
python,google-app-engine,google-cloud-datastore,google-search-api,geohashing
36,110,881
2
true
1
0
Geohashing does not have to be inaccurate at all. It's all in the implementation details. What I mean is you can check the neighbouring geocells as well to handle border-cases, and make sure that includes neighbours on the other side of the equator. If your use case is finding other entities within a radius as you sugg...
1
1
0
I am creating an appEngine application in python that will need to perform efficient geospatial queries on datastore data. An example use case would be, I need to find the first 20 posts within a 10 mile radius of the current user. Having done some research into my options, I have found that currently what seems like...
Geohashing vs SearchAPI for geospatial querying using datastore
1.2
1
0
326
36,092,706
2016-03-18T19:22:00.000
0
0
0
0
python,django,admin,models
36,094,120
2
false
1
0
If you set editable=False in the field properties, the field will be read-only in admin. For example: language = models.ForeignKey(Language, editable=False)
1
1
0
I want to know if there's some easy way to have 2 models, for example Language, and Word. And we have another model Translation that has the string of the translation and both Models are referenced with a Foreign Key. Imagine I have 2 languages, English and Spanish. Is there some way to make always appear every languag...
How can I use all objects in a table as a label - input in a model in Django's Admin?
0
0
0
73
36,093,839
2016-03-18T20:40:00.000
1
0
0
0
python,tkinter
68,903,355
4
false
0
1
The default background color of tkinter is #f0f0f0. Hope this helps ;)
2
14
0
Simple question, have parsed numerous search results, haven't found a simple answer. I set a very urgent button to red if something is not found so users click it first. Once clicked, I want to set the background back to normal like button.config(bg=''). I tried 'grey' but it's not the right color. What do I set it ...
How to reset background color of a python tkinter button?
0.049958
0
0
15,651
36,093,839
2016-03-18T20:40:00.000
7
0
0
0
python,tkinter
44,747,033
4
false
0
1
The default colour for buttons is SystemButtonFace. I am not sure how many versions of Windows this spans back to, but it is the default system colour for buttons. You can find the default colours by using @Bryan Oakley's answer above, and then print() it to the console.
2
14
0
Simple question, have parsed numerous search results, haven't found a simple answer. I set a very urgent button to red if something is not found so users click it first. Once clicked, I want to set the background back to normal like button.config(bg=''). I tried 'grey' but it's not the right color. What do I set it ...
How to reset background color of a python tkinter button?
1
0
0
15,651
36,094,613
2016-03-18T21:33:00.000
0
0
1
0
python,pycharm
36,094,761
1
true
0
0
I think I'm an idiot. Looks like when opening directories/projects, if I don't choose the correct directory with the git metadata for the repo, it doesn't show the color differences. Mods can close this question since this is due to operator error/stupidity.
1
0
0
I'm using Pycharm for my python projects. I don't know what happened but it used to show in the left margin/gutter which lines are new and which lines were from the original file. I didn't (knowingly) change anything in my preferences so I don't know why it's not coloring the differences anymore. I've checked Editor...
Pycharm color scheme for lines changed in file
1.2
0
0
445
36,094,957
2016-03-18T22:02:00.000
0
1
0
0
python,kodi
45,115,405
2
false
0
0
You have to write xbmc.executebuitin("XBMC.CECToggleState()"), not kodi.executebuitin("XBMC.CECToggleState()"), and please upgrade your kodi from isengard to a stable version (i.e, Kyrpton).
1
0
0
I have written a home automation script for controlling lights, music on kodi, and my TV. I have everything working except for turning off the TV. I have mapped my keyboard.xml file within kodi to recognize the "CECToggleState", and this works fine, but I would like to trigger this inside a python script. In the pa...
kodi.executebuiltin() not working in Kodi: Isengard
0
0
0
1,149
36,095,385
2016-03-18T22:37:00.000
11
0
1
0
macos,python-3.x,ipython,anaconda,pypi
36,314,335
5
false
0
0
Edit your file ~/.condarc and take out the lines that include pypi.*. These are not valid conda channels.
1
5
0
recently i installed the anaconda but when i'm open it i got this error: Error fetching package index Could not find URL: https://pypi.python.org/pypi/osx-64/ also when i'm using the commandconda install ... i got Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata: .....Error: Could not fi...
conda error: could not found url
1
0
0
6,515
36,095,800
2016-03-18T23:14:00.000
1
0
0
0
python,apache,cookies,mod-wsgi,sign
36,096,173
1
false
1
0
The best (read: easiest) way to go about this is with session variables. That said, in lieu of session variable functionality you would get with a framework, you can implement your own basic system. 1) Generate a random Session id 2) send a cookie to browser 3) Json or pickle encode your variables 4a) save encoded stri...
1
0
0
I'm developing a web app using my own framework that I created using mod_wsgi. I want to avoid using dependencies such as Django or Flask, just to have a short script, It actually won't be doing much. I have managed to authenticate user using LDAP, from a login page, the problem is that I don't want the user to authent...
Keep user signed in using mod_wsgi
0.197375
0
0
127
36,096,703
2016-03-19T01:11:00.000
0
0
0
1
python,amazon-web-services,flask,docker,docker-compose
36,165,474
1
true
1
0
I found the problem. Locally i am running it on a vagrant virtual machine on a windows computer. It looks like because windows is not a case sensitive file system, when the python gettext() function was looking for en_US, i was passing it en_us, which it found on windows. But on AWS, it did not because it was running l...
1
0
0
I have a flask app that is using flask-babel to translate text. I have created a docker container for it all to run in. And i have verified multiple times that both are being run and built exactly the same way. When i put the app on my local docker container (using a vagrant linux machine). The translations work fine. ...
Flask-Babel won't translate text on AWS within a docker container, but does locally
1.2
0
0
163
36,100,141
2016-03-19T09:41:00.000
3
0
0
0
php,python,html,web2py
36,105,590
1
true
1
0
Persisting file upload fields would requiring knowing the paths to the files on the user's local machine, and browsers do not allow this as it would be a security vulnerability. There are a few alternative approaches that you could take, but web2py does not include built-in functionality to implement them. One option w...
1
1
0
I have developed a web portal using web2py. The portal has a input form that is to be filled by user. There are 5 steps in the form. At the last step there are bunch of file uploads fields. If a user encounters form validation error after filling the form, he has to again upload the file from upload fields. Because fi...
Persist file upload html forms in web2py
1.2
0
0
119
36,103,027
2016-03-19T14:37:00.000
-1
1
1
0
python,python-3.x,import,virtualenv,pytest
36,103,485
2
true
0
0
make sure that you have installed packages through pycharm, if it don't list your package, it means that you install your package in other place, go to file > setting > project:[NAME] >interpreter to check it. then yo can use "+" to install package
2
1
0
I'm writing my first test for a class where I imported an external packages ( installed via pip in the venv ). I'm using PyCharm as an IDE and it the package in question is listed there under the project interpreter ( the venv ) as well as when I type pip freeze in console. Now I want to run a run-tests.sh file and whe...
virtualenv doesnt find installed module when running tests [Pytest]
1.2
0
0
1,225
36,103,027
2016-03-19T14:37:00.000
0
1
1
0
python,python-3.x,import,virtualenv,pytest
36,103,970
2
false
0
0
fixed it myself. for some dubious reason pytest and my venv did have a problem. reinstalled pytest within my virtual env via pip install pytest
2
1
0
I'm writing my first test for a class where I imported an external packages ( installed via pip in the venv ). I'm using PyCharm as an IDE and it the package in question is listed there under the project interpreter ( the venv ) as well as when I type pip freeze in console. Now I want to run a run-tests.sh file and whe...
virtualenv doesnt find installed module when running tests [Pytest]
0
0
0
1,225
36,104,410
2016-03-19T16:49:00.000
0
0
1
0
python-2.7
36,119,138
2
false
0
0
I found this and it's working ! variable = "mymodule" module = __ import__(variable,globals(),locals(),[],-1) ... module.myfunction() # where function is the name of the function inside mymodule.py
1
0
0
Hello dear programmers Python language. I have a question about importing modules in another module with Python 2.7. I want to know how to import a .py module in the form of a variable. In fact, I would like to import a module based on the needs of my main module to limit the memory usage of the computer. For example, ...
import a module with a variable
0
0
0
80
36,104,521
2016-03-19T16:59:00.000
0
0
0
0
python,mysql,database,orm
36,104,630
2
false
0
0
Is there a reason why some of the machine cannot be connected to the internet? If you really can't, what I would do is setup a database and the Python app on each machine where data is collected/generated. Have each machine use the app to store into its own local database and then later you can create a dump of each da...
1
2
0
I'm completely new to managing data using databases so I hope my question is not too stupid but I did not find anything related using the title keywords... I want to setup a SQL database to store computation results; these are performed using a python library. My idea was to use a python ORM like SQLAlchemy or peewee t...
Python ORM - save or read sql data from/to files
0
1
0
963
36,106,216
2016-03-19T19:33:00.000
5
0
0
1
python,rabbitmq,celery,scalability
36,731,024
1
true
0
0
First of all - GIL - that should not be a case, since more machines should go faster. But - please check if load goes only on one core of the server... I'm not sure if whole Celery is good idea in your case. That is great software, with a lot of functionality. But, if that is not needed, it is better to use something ...
1
9
0
We are using celery to make third party http calls. We have around 100+ of tasks which simply calls the third party HTTP API calls. Some tasks call the API's in bulk, for example half a million requests at 4 AM in morning, while some are continuous stream of API calls receiving requests almost once or twice per second....
Optimizing Celery for third party HTTP calls
1.2
0
0
894
36,106,945
2016-03-19T20:47:00.000
10
0
0
0
python,django,git,security,github
36,107,082
1
true
1
0
In general, and as long as your settings.py does not include sensitive information, uploading your Django project to GitHub will not compromise your super user account. Your user information is stored in your database, which should not be included in your Git repository. The most likely situation where this might be a ...
1
5
0
Will uploading my Django project to GitHub make my superuser (created with python manage.py createsuperuser) vulnerable? I used a sensitive password with the superuser I created and I do not want it to be compromised by uploading the source code to GitHub. The website itself does not contain any sensitive code.
Is it safe to upload my Django project to GitHub?
1.2
0
0
3,430
36,106,958
2016-03-19T20:48:00.000
0
1
0
0
python,python-3.x,z3,z3py
36,107,304
1
false
0
0
Interesting point. There isn't any particular support for this in Z3. What are the known techniques in this area?
1
0
0
Does Z3 have the ability to do power mod arithmetic? For instance, if I'm placing in expressions of the sort x ** y % z, is there a way to tell Z3 that it is this type of expression, similar to how python has the function pow(x,y,z)? My assumption is that would open up solving options (such as modular inverse).
Z3 Power Modulo Statements
0
0
0
1,168
36,115,491
2016-03-20T15:11:00.000
0
0
1
0
python,windows,psycopg2
69,657,488
1
false
0
0
pip install psycopg this worked for me, don't mention version i.e (pip install psycopg2)
1
0
0
I try to use pip install psycopg2 on windows10 and python3.5, but it show me below error message. how can i fix it ? Command "d:\desktop\learn\python\webcatch\appserver\webcatch\scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users\16022001\AppData\Local\Temp\pip-build-rsorislh\psycopg2\setup.py';ex...
pip install psycopg2 error
0
1
0
329
36,118,490
2016-03-20T19:31:00.000
0
0
0
0
python,tweepy
55,508,308
4
false
1
0
i am using below code this works fine .. if(api.show_friendship(source_screen_name='venky6amesh', target_screen_name='vag')): print("the user is not a friend of ") try: api.create_friendship(j) print('success') except tweepy.TweepError as e: ...
1
0
0
I am trying to find, do I follow someone or not. I realized that although it is written in official Tweepy document, I cannot use API.exists_friendship anymore. Therefore, I tried to use API.show_friendship(source_id/source_screen_name, target_id/target_screen_name) and as the document said it returns me friendship obj...
Checking friendship in Tweepy
0
0
1
3,016
36,122,612
2016-03-21T03:19:00.000
2
0
1
0
python,ruby,rubygems,pip,virtualenv
36,122,740
1
true
0
0
bundler is generally used to lock dependency versions for a project (e.g. the gem versions). rbenv and rvm (there are several others too) are two common approaches to managing multiple versions of Ruby. A feature these provide (at least rvm does) is gemsets: these are a way to isolate your gem directories (so you may h...
1
1
0
As title, python use virtualenv to isolate pip libraries for each python application. Ruby has gem, how does it prevent library version conflicts without a virtual environment.
Python use virtualenv to prevent library version conflicts. How ruby does it?
1.2
0
0
299
36,122,859
2016-03-21T03:51:00.000
1
1
0
0
python,audio,raspberry-pi,chromecast
41,686,041
1
false
1
0
I've been testing notifications with pychromecast. I've got a delay of 7 sec. Since you can't play a local file, but only a file hosted on a webserver, I guess the chromecast picks up the file externally. Routing is via google's servers, which is what google does with all its products.
1
6
0
My 10 year old and I are implementing a project which calls for audio to be played by a Chromecast Audio after a physical button is pressed. She is using python and pychromecast to connect up to a chromecast audio. The audio files are 50k mp3 files and hosted over wifi on the same raspberry pi running the button tool...
Expected Chromecast Audio Delay?
0.197375
0
1
657
36,124,212
2016-03-21T06:09:00.000
0
0
1
0
python,list,python-2.7,dictionary
36,126,303
3
false
0
0
As it says in the other answer you should probably use zip. But if you want to avoid other third party libraries you can do it manually by calling a for loop on each element and adding to your dictionary manually.
1
0
0
I have two lists ['a', 'b', 'c'] and [[1,2,3], [4,5,6]] I am expecting an output {'a':[1,4], 'b':[2,5], 'c':[3,6]} without using a for loop.
Convert a list and list of list to a dict in python
0
0
0
67
36,132,350
2016-03-21T13:28:00.000
15
0
1
0
python,pip,python-wheel
36,132,442
2
true
0
0
It is. Actually .whl files are just zip archives, so you can just extract their content and play with libraries path variable to make it work. Yet it is really bad practice.
1
31
0
Is it possible to install a Python wheel without using pip? I always have issues with installing with pip, so I usually install libraries manually by copying and pasting. I'm wondering if there is a way to do wheel files in a similar manner.
Install python wheel file without using pip
1.2
0
0
62,707
36,136,637
2016-03-21T16:31:00.000
1
1
0
0
python-2.7,image-processing,python-imaging-library,rgb
36,137,059
2
false
0
0
Pretty much any image processing library provides means for reading pixel values. The simplest and most efficient way is indeed iterating over all pixels checking if any value is 0 for all pixels. Of course many libraries also provide convenient tools for extracting color planes and calculating average pixel values. Bu...
1
0
0
I'm looking over a number of images with missing aspects, namely missing either red, green or blue channels (which have been removed accidentally by an automated process before I was give the images). I need to fine the valid images. Is there a quick way of checking to see if an image has all three (R, G & B) channels?...
Validate existance of RGB channels
0.099668
0
0
212
36,137,671
2016-03-21T17:19:00.000
0
0
1
0
python,pycharm
66,121,944
14
false
0
0
In my case I accidentally added a huge image to git (it weights about 1GB). This error only showed when I tried to make a commit. When I unmarked the image from git, the error stopped appearing.
8
30
0
I've recently started getting an out of memory error while using PyCharm 5.0.4 The message is: There's not enough memory to perform the requested operation. Please increase Xmx setting and shutdown PyCharm for change to take effect. I've already increased the value to 1024 MB, and to my knowledge nothing has changed ...
PyCharm Running Out of Memory
0
0
0
54,138
36,137,671
2016-03-21T17:19:00.000
0
0
1
0
python,pycharm
65,258,189
14
false
0
0
I'm using Windows 10 and suddenly this message started popping up a lot, and even freezing Pycharm. My solution was delete the temporal files. Windows + r: run/ or just write run, and execute: %temp%, then delete all of the files.
8
30
0
I've recently started getting an out of memory error while using PyCharm 5.0.4 The message is: There's not enough memory to perform the requested operation. Please increase Xmx setting and shutdown PyCharm for change to take effect. I've already increased the value to 1024 MB, and to my knowledge nothing has changed ...
PyCharm Running Out of Memory
0
0
0
54,138
36,137,671
2016-03-21T17:19:00.000
0
0
1
0
python,pycharm
63,554,834
14
false
0
0
In my case, I had printed tons of output while running a cell. Pycharm could not cope up with this and constantly asked me to increase memory (even if I increased in). I opened up the .ipynb file in notepad and deleted all the outputs. It worked. Try to look for pieces of text titled as "outputs": [ { "name": "stdout",...
8
30
0
I've recently started getting an out of memory error while using PyCharm 5.0.4 The message is: There's not enough memory to perform the requested operation. Please increase Xmx setting and shutdown PyCharm for change to take effect. I've already increased the value to 1024 MB, and to my knowledge nothing has changed ...
PyCharm Running Out of Memory
0
0
0
54,138
36,137,671
2016-03-21T17:19:00.000
6
0
1
0
python,pycharm
38,981,056
14
true
0
0
Reinstalling PyCharm fixed this problem for me.
8
30
0
I've recently started getting an out of memory error while using PyCharm 5.0.4 The message is: There's not enough memory to perform the requested operation. Please increase Xmx setting and shutdown PyCharm for change to take effect. I've already increased the value to 1024 MB, and to my knowledge nothing has changed ...
PyCharm Running Out of Memory
1.2
0
0
54,138
36,137,671
2016-03-21T17:19:00.000
0
0
1
0
python,pycharm
54,034,335
14
false
0
0
Running your script with Python Console in PyCharm might keep all previously used variables in memory and does not exit from the console. Thus, repeatedly running the script might cause out of memory or can't allocate memory in GPU or CPU. I realized this while debugging my tensorflow code. If you are not sure, go to R...
8
30
0
I've recently started getting an out of memory error while using PyCharm 5.0.4 The message is: There's not enough memory to perform the requested operation. Please increase Xmx setting and shutdown PyCharm for change to take effect. I've already increased the value to 1024 MB, and to my knowledge nothing has changed ...
PyCharm Running Out of Memory
0
0
0
54,138
36,137,671
2016-03-21T17:19:00.000
1
0
1
0
python,pycharm
52,000,414
14
false
0
0
I simply cut some of the folders including some results (txt files) from my project and saved them in another directory. Now, I do not get the "out-of-memory" error and the changes can be committed successfully.
8
30
0
I've recently started getting an out of memory error while using PyCharm 5.0.4 The message is: There's not enough memory to perform the requested operation. Please increase Xmx setting and shutdown PyCharm for change to take effect. I've already increased the value to 1024 MB, and to my knowledge nothing has changed ...
PyCharm Running Out of Memory
0.014285
0
0
54,138
36,137,671
2016-03-21T17:19:00.000
4
0
1
0
python,pycharm
62,092,089
14
false
0
0
The issue for me was the css plugin installed in Pycharm. Removing it fixed the problem. To remove, go to the Project Interpreter in Pycharm preferences.
8
30
0
I've recently started getting an out of memory error while using PyCharm 5.0.4 The message is: There's not enough memory to perform the requested operation. Please increase Xmx setting and shutdown PyCharm for change to take effect. I've already increased the value to 1024 MB, and to my knowledge nothing has changed ...
PyCharm Running Out of Memory
0.057081
0
0
54,138
36,137,671
2016-03-21T17:19:00.000
31
0
1
0
python,pycharm
44,632,871
14
false
0
0
What worked for me when I ran into this "Out of Memory" problem was clearing the cache. ("File -> Invalidate Caches / Restart...") It's been a couple days and no further problems. Before, it was happening five or ten minutes after starting PyCharm, even with me not doing anything on PyCharm other than look at it. I'...
8
30
0
I've recently started getting an out of memory error while using PyCharm 5.0.4 The message is: There's not enough memory to perform the requested operation. Please increase Xmx setting and shutdown PyCharm for change to take effect. I've already increased the value to 1024 MB, and to my knowledge nothing has changed ...
PyCharm Running Out of Memory
1
0
0
54,138
36,138,958
2016-03-21T18:32:00.000
0
0
1
0
python,python-3.x,download,pyscripter
42,111,717
1
false
0
0
Best solution for Windows 10, 1 Download Python from python.org 32-bit or 64-bit, Default installation Location C:\Python. 2 Download PySCript 32-bit or 64-bit, 3 Install PyScript into your computer, choose Installation Location C:\Python27\PyScripter Finished
1
0
0
I am trying to download PyScripter on Windows 10. First time round I went into the official Python site downloaded Python 3.5.1 and got PyScripter with it and I'm thinking that all is fine with the world. But then when I attempted to open pyscripter I get: Error: Python could not be properly initialized. We must quit....
Pyscripter Download
0
0
0
2,139
36,141,010
2016-03-21T20:32:00.000
1
0
1
0
python,python-2.7,tkinter
36,141,286
1
false
0
1
Each instance of Tk is separate from any other instance of Tk. It gets its own copy of an underlying tcl interpreter. Two instance of Tk in the same process means you have two active tcl interpreters. As a general rule you should only ever have exactly one instance of Tk, but I suppose if you fully understand how they...
1
1
0
I have been learning how to make GUIs with Tkinter and a question has occurred to me. As I'm testing the program, I often end up building the code while an instance of it already exists in the background. Are these two independent of each other in terms of performing their functions? I've always read that when I create...
Is each instance of Tk() class running independent of each other?
0.197375
0
0
291
36,141,570
2016-03-21T21:04:00.000
3
0
0
0
python,amazon-web-services,amazon-ec2,apache-spark,amazon-emr
36,143,671
2
true
1
0
EMR provides a simple to use Hadoop/spark as service. You just have to select the components you want to be installed (spark, hadoop), their versions, how many machines you want to use and a couple other options and then it installs everything for you. Since you are students I assume you don't have experience in automa...
1
1
1
We are students that are working on a graduation project related to the Data Science, we are developing a Recommender Engine using Spark with python (Pyspark) with Android Application (Interface for the users) and we have a faced a lot of roadblocks, one of them was how to keep the Spark script up and running on a clou...
Spark running on EC2 vs EMR
1.2
0
0
3,688
36,142,371
2016-03-21T21:55:00.000
1
0
1
0
bioinformatics,biopython
36,158,674
2
false
0
0
Sorry for adding another answer, but my reputation is not good enough for just adding comments... To elaborate on peterjc's answer, accepting lists as input is the intended behaviour of pairwise2 (and now I understand what it may be good for...). And you are right, it's also about the gap_char argument: Since your are ...
1
0
0
I have RNA sequences that contain different modified nucleotides and residues. Some of them for example N79, 8XU, SDG, I. I want to pairwise align them using biopython's pairwise2.align.localms. Is it possible to make input not as a string but as list for example in order to accurately account for these modified bases?...
Nucleotides separator in the pairwise sequence alignment bio python
0.099668
0
0
324
36,142,418
2016-03-21T21:59:00.000
3
0
0
0
python,django,django-rest-framework
36,162,477
2
false
1
0
The short answer: In my case, I was accidentally sending my PATCH to the list URL, rather than the put/patch URL. The longer answer: I found that the problem isn't that one project has different defaults for allowed_methods, it's that the action_map and allowed_methods properties of the ViewSet change based on which o...
1
3
0
The company I work for has 2 projects that use django and DRF 3. both projects have a ViewSet that extends ModelViewSet both ViewSets do not explicitly define the allowed_methods property and are just using whatever DRF figures should be the default both ViewSets do not override or define any handler methods (creat...
How does django-rest-framework decide what the default `allowed_methods` should be for a `ModelViewSet`?
0.291313
0
0
1,242
36,143,032
2016-03-21T22:44:00.000
1
0
1
0
python,file,input
36,143,321
1
false
0
0
In most cases there is no time when it is better to create a temporary file and save the user input (which I am assuming is from an input prompt) to it and the read the input from the file. That is just complicating the input process and slowing down your code. You should simply store the input as normal in a variable....
1
0
0
When does it become worth it to export the user input to a file? and If you did export user input to a file, would you place it in the folder you are in then erase it at the end of the script?
Python: when is user input too heavy?
0.197375
0
0
54
36,143,420
2016-03-21T23:17:00.000
0
0
0
0
python,redis
36,143,898
3
false
0
0
Unfortunately I think that there isn't simple answer to that - it depends on constraints that you actually have and how you calculate cost of such processing. In some cases memory is more valuable than processing time in other cases it's the opposite. First - make sure if you have to worry about such optimisation at al...
1
2
0
I have a list of ids. For each id, I do a web request, which returns the name associated with the id. Then this key/value (id/name) pair is added to a dictionary. Once this is done, I add the dictionary to redis using hmset. I'm wondering if it would be better to simply add each key/value pair to redis right after each...
Which redis method is better: calling HSET multiple times or calling HMSET once?
0
0
0
924
36,144,018
2016-03-22T00:12:00.000
0
0
0
0
python,django,forms,permissions,verify
36,146,532
1
false
1
0
You have several ways to do it: UI level: when the search field is focused you can say through an alert or other mechanism to notify users you are not allowed to search. Server level: assuming your user is logged in or has an account you can verify the user in the search request and return a response where you state y...
1
0
0
So I have lots of forms that aren't attached to models, like a search form. I don't want people to be able to access these without first verifying their account through an email. How is the best way to limit their ability to do this? Is it through custom permissions? If so, how do I go about this? Thank you so much!
Django: Making custom permissions
0
0
0
41
36,152,435
2016-03-22T10:52:00.000
0
0
1
0
python,python-unicode
54,100,721
2
false
0
0
sys.getsizeof Can differ on different computers. However I think this can solve your issues. Take the size of a string for example and subtract the size of an empty string. import sys def get_size_of_string(s): return sys.getsizeof(s)-sys.getsizeof("") a=get_size_of_string("abc") print (a)
1
2
0
sys.getsizeof is returning different size for a unicode string on different versions of python. sys.getsizeof(u'Hello World') return 96 on Python 2.7.3 and returns 72 on Python 2.7.11
python sys.getsizeof method returning different sizes on different versions of python
0
0
0
423
36,153,748
2016-03-22T11:55:00.000
0
0
0
0
python,django,django-migrations
60,474,730
34
false
1
0
The possible reason could be deletion of the existing db file and migrations folder you can use python manage.py makemigrations <app_name> this should work. I once faced a similar problem.
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
0
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
1
0
0
0
python,django,django-migrations
60,492,787
34
false
1
0
One more edge case and solution: I added a boolean field, and at the same time added an @property referencing it, with the same name (doh). Commented the property and migration sees and adds the new field. Renamed the property and all is good.
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
0.005882
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
0
0
0
0
python,django,django-migrations
60,585,192
34
false
1
0
If you have the managed = True in yout model Meta, you need to remove it and do a migration. Then run the migrations again, it will detect the new updates.
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
0
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
-1
0
0
0
python,django,django-migrations
62,388,011
34
false
1
0
The Best Thing You can do is, Delete the existing database. In my case, I were using phpMyAdmin SQL database, so I manually delete the created database overthere. After Deleting: I create database in PhpMyAdmin, and doesn,t add any tables. Again run the following Commands: python manage.py makemigrations python manage...
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
-0.005882
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
1
0
0
0
python,django,django-migrations
62,203,936
34
false
1
0
Try registering your model in admin.py, here's an example:- admin.site.register(YourModelHere) You can do the following things:- 1. admin.site.register(YourModelHere) # In admin.py 2. Reload the page and try again 3. Hit CTRL-S and save 4. There might be an error, specially check models.py and admin.py 5. Or, at ...
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
0.005882
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
9
0
0
0
python,django,django-migrations
36,972,913
34
false
1
0
There are sometimes when ./manage.py makemigrations is superior to ./manage.py makemigrations <myapp> because it can handle certain conflicts between apps. Those occasions occur silently and it takes several hours of swearing to understand the real meaning of the dreaded No changes detected message. Therefore, it is ...
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
1
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
-1
0
0
0
python,django,django-migrations
61,434,419
34
false
1
0
Well, I'm sure that you didn't set the models yet, so what dose it migrate now ?? So the solution is setting all variables and set Charfield, Textfield....... and migrate them and it will work.
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
-0.005882
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
6
0
0
0
python,django,django-migrations
58,637,080
34
false
1
0
Another possible reason is if you had some models defined in another file (not in a package) and haven't referenced that anywhere else. For me, simply adding from .graph_model import * to admin.py (where graph_model.py was the new file) fixed the problem.
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
1
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
11
0
0
0
python,django,django-migrations
57,418,764
34
false
1
0
Make sure your app is mentioned in installed_apps in settings.py Make sure you model class extends models.Model
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
1
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
80
0
0
0
python,django,django-migrations
47,740,087
34
false
1
0
My problem (and so solution) was yet different from those described above. I wasn't using models.py file, but created a models directory and created the my_model.py file there, where I put my model. Django couldn't find my model so it wrote that there are no migrations to apply. My solution was: in the my_app/models/...
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
1
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
0
0
0
0
python,django,django-migrations
64,500,819
34
false
1
0
Another possibility is you squashed some migrations and applied the resulting one, but forgot to remove the replaces attribute from it.
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
0
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
2
0
0
0
python,django,django-migrations
52,953,891
34
false
1
0
I solved that problem by doing this: Erase the "db.sqlite3" file. The issue here is that your current data base will be erased, so you will have to remake it again. Inside the migrations folder of your edited app, erase the last updated file. Remember that the first created file is: "0001_initial.py". For example: I...
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
0.011764
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
0
0
0
0
python,django,django-migrations
55,265,330
34
false
1
0
You should add polls.apps.PollsConfig to INSTALLED_APPS in setting.py
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
0
0
0
202,787
36,153,748
2016-03-22T11:55:00.000
-1
0
0
0
python,django,django-migrations
57,435,023
34
false
1
0
First of all, make sure your app is registered in the Installed_app in the setting.py Then the above answer works perfectly fine
14
227
0
I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it for this app when I created it. After debugging, I found that it is not creating migration because the migrations packag...
Django - makemigrations - No changes detected
-0.005882
0
0
202,787
36,155,061
2016-03-22T12:59:00.000
0
1
0
0
python,numpy,scipy
36,157,336
1
false
0
0
Never mind, it is absolutely possible to pass a set of complex coefficients to freqz, I got confused because I tried to plot the response without specifying I wanted the absolute value of h, which rendered the warning: ComplexWarning: Casting complex values to real discards the imaginary part. Trap for young players l...
1
0
1
I'm trying to analyse an asymmetric FIR filter with complex coefficients. I know I can use the numpy function freqz to analyse the frequency response of an FIR or IIR-filter with real coefficients. At the moment I'm just using a regular FFT of the FIR filter and I use fftshift to put the negative frequencies in front o...
How to use freqz to get response of complex FIR filter
0
0
0
631
36,156,353
2016-03-22T13:55:00.000
4
0
1
1
python-2.7,pickle
36,156,896
1
true
0
0
Actually, I tried importing cPickle and it worked. But I don't know why the error "could not find any downloads that satisfy the requirement cPickle". I will appreciate if someone can provide reason. Also as commented by mike cleared my doubt. "cPickle is installed when python itself is installed -- it's part of the...
1
1
0
I am working on ubuntu 14.04. Python version: 2.7.6. I am trying to install cPickle, but I am getting error: "could not find any downloads that satisfy the requirement cPickle" I tried via, pip and apt-get as well. What might be reason, has this package been removed completely?
Installing cPickle fails
1.2
0
0
7,478
36,157,634
2016-03-22T14:49:00.000
2
0
1
0
python,json,dictionary
36,157,867
3
false
0
0
Sadly the json library does not have any incremental writing facilities, and therefore cannot do what you want. That's clearly going to be a very large file - would some other representation be more appropriate? Otherwise the best suggestion I can make is to dump each list entry to an in-memory structure and write them...
1
16
0
I am writing a program, which requires me to generate a very large json file. I know the traditional way is to dump a dictionary list using json.dump(), but the list just got too big that even the total memory + swap space cannot hold it before it is dumped. Is there anyway to stream it into a json file, i.e., write th...
How to incrementally write into a json file
0.132549
0
0
8,576
36,158,037
2016-03-22T15:06:00.000
2
0
0
0
android,python-2.7,firebase,kivy,buildozer
36,160,691
1
true
0
1
The multiprocessing module is not supported in Android due to incompatibilities with bionic (Android's libc). I would suggest trying to use the Firebase Android SDK via pyjnius, or just make web requests using Kivy's UrlRequest or via Twisted - it's just a REST API, after all.
1
0
0
I have python 2.7.6, the newest kivy and buildozer installed. Now I want to use firebase for python, downloaded by: sudo pip install python-firebase. I can add this to the requirements in the buildozer.spec file as python-firebase. This all works fine and in the folder .buildozer/applibs/ I got: firebase, python_fire...
Implement python-firebase in android
1.2
0
0
1,125
36,159,706
2016-03-22T16:15:00.000
0
0
0
0
django,python-2.7,django-models,db2
36,159,818
2
false
1
0
DB2 uses so-called two part names, schemaname.objectname. Each object, including tables, can be referenced by the entire name. Within a session there is the current schema which by default is set to the username. It can be changed by the SET SCHEMA myschema statement. For your question there are two options: 1) Refere...
1
2
0
In Django database username is used as schema name. In DB2 there is no database level users. OS users will be used for login into the database. In my database I have two different names for database user and database schema. So in django with db2 as backend how can I use different schema name to access the tables? EDIT...
django-db2 use different schema name than database username
0
1
0
688
36,160,713
2016-03-22T17:01:00.000
1
1
1
0
python,pytest
36,162,206
4
false
0
0
I don't think that would be possible. assert is a statement (and not a function) in Python and has a predefined behavior. It's a language element and cannot just be modified. Changing the language cannot be the solution to a problem. Problem has to be solved using what is provided by the language There is one thing you...
1
6
0
I'd like to a log some information to a file/database every time assert is invoked. Is there a way to override assert or register some sort of callback function to do this, every time assert is invoked? Regards Sharad
Is there a way to override default assert in pytest (python)?
0.049958
0
0
2,627
36,161,221
2016-03-22T17:26:00.000
1
1
0
0
python,raspberry-pi,raspbian
36,163,083
4
false
0
0
None of the Raspberry Pi models have a built-in real time clock.
1
3
0
I work with Raspberry Pi 2 model B v1.1 and I searched about a RTC to keep time even in the case of a power outage or a loss of internet connection. I found that I must buy a RTC chip with a battery. But recently I heard that my Raspberry Pi already contains a RTC. But is it right? If so, where is its location? I don't...
Does the Raspberry Pi 2 model B v1.1 have an internal RTC?
0.049958
0
0
547
36,166,485
2016-03-22T22:31:00.000
2
0
0
1
python,linux,anaconda,midi,music21
36,364,217
1
false
1
0
First of all, are you sure you have a midi player? Timidity is a good option. Check if you have it installed, and if you doesn't, just use sudo apt-get install timidity Once installed, the path you need should be '/usr/bin/timidity'
1
2
0
I'm using Ubuntu 14.04 64bit. I don't know what to set on path to application. I have installed music21 in anaconda3, but I got output as follows: music21.converter.subConverters.SubConverterException: Cannot find a valid application path for format midi. Specify this in your Environment by calling environment.set(No...
How to set application path in music21
0.379949
0
0
1,301
36,176,502
2016-03-23T11:09:00.000
1
0
0
0
python,sockets,tcp,server
36,176,937
1
true
0
0
I was thinking of implementing some form of message passing from the client that tells the server which task it should perform. That's exactly what you need: an application protocol. A socket (assuming a streaming Internet socket, or TCP) is a stream of bytes, nothing more. To give those bytes any meaning, you need a ...
1
1
0
I am currently implementing a socket server using Python's socketServer module. I am struggling to understand how a client 'signals' the server to perform certain tasks. As you can tell, I am a beginner in this area. I have looked at many tutorials, however, these only tell you how to perform singular tasks in the ser...
how does a server execute different tasks based on client input?
1.2
0
1
70
36,177,561
2016-03-23T11:58:00.000
1
1
1
0
python,properties,uml
36,178,271
3
false
0
0
Good practice is what works on your project. In order to model Python properties you can add stereotyped getter and setter operations which indicate their use. The link between attribute and operation is usually done via a naming convention. Some tools offer internal linkage to make attributes properties with getters a...
2
5
0
What is a good practice to model Python properties in a UML class diagram? Properties themselves are class objects, their getter and setter are class functions. From Outside the class they look like instance attributes. So, how would you suggest to present that in my class diagram?
How to model python properties in UML diagram
0.066568
0
0
3,265
36,177,561
2016-03-23T11:58:00.000
0
1
1
0
python,properties,uml
36,177,829
3
false
0
0
It really depends what kind of template your UML tool uses. In some tools there is a Properties box along the common Attributes and Methods boxes. The UML notation states that attributes are written in lower camelcase, you could write properties in upper camelcase. They would also differ visually because of the public ...
2
5
0
What is a good practice to model Python properties in a UML class diagram? Properties themselves are class objects, their getter and setter are class functions. From Outside the class they look like instance attributes. So, how would you suggest to present that in my class diagram?
How to model python properties in UML diagram
0
0
0
3,265
36,178,187
2016-03-23T12:26:00.000
1
1
0
0
python,angularjs,selenium,testing,protractor
36,178,367
2
false
1
0
Protractor is based off using Selenium webdrivers. If you have an Angular app for your entire front-end, I would go with Protractor. If you are going to have a mixed front-end environment, you may want to go with Selenium only.
1
0
0
I recently came to know about protractor framework which provides end to end testing for angular applications. I would like to know, which test framework suits better for following webstack, either selenium or protractor Angular, Python and MongoDB. I am going to use mozilla browser only. Can anyone please provide yo...
For E2E Testing: which is better selenium or protractor for following web stack (Angular, Python and MongoDB)?
0.099668
0
1
548
36,180,049
2016-03-23T13:48:00.000
1
1
0
0
python,signal-processing,fft
36,180,355
1
false
0
0
Measure the peak to peak distance in seconds and divide 60 by that number. For instance 0.5 seconds peak to peak = 60/0.5 = 120 bpm. This will work to some extent on regular dance music but on other types will be not so good Sorry I completely misunderstood your question. The above is how to do it on a wave form like ...
1
1
0
I have performed an FFT of a wav file, plotted a graph of this, and have used peak utils to get the peaks and printed these out one after the other. How do I go from here to getting the songs BPMs (beats per minute)? Do I need to perform an IFFT? As I am assuming I need to get back to a time context. Or is there anothe...
How to get the BPM once FFT and peak detection has been performed
0.197375
0
0
1,519
36,180,066
2016-03-23T13:49:00.000
11
0
0
0
python,caching,flask,flask-cache,flask-caching
50,083,102
2
false
1
0
For cache.cached(), use cache.delete() to delete specific cache, pass the cache key (default to view/<request.path>). For cache.memoize(), use cache.delete_memoized() to delete specific cache, pass the cache key (default to function name with or without args). Use cache.clear() to delete all the cache data.
2
7
0
I am using Flask cache in my API in python. Currently I am using the decorator @app.cache.memoize(cache_memoize_value) and I flush it by calling app.cache.delete_memoized(view) The problem is that with memoize it will be cached for n views and not for a specific amount of time. If I want to specify a timeout for the ca...
Delete specific cache in Flask-Cache or Flask-Caching
1
0
0
9,332
36,180,066
2016-03-23T13:49:00.000
3
0
0
0
python,caching,flask,flask-cache,flask-caching
36,309,686
2
true
1
0
It's in fact pretty easy and I should have tried this before. Like for the cached decorator, you can specify a value in the memoized decorator. But instead of doing this: @app.cache.memoize(cache_memoize_value) You need to do this @app.cache.memoize(timeout=cache_memoize_value)
2
7
0
I am using Flask cache in my API in python. Currently I am using the decorator @app.cache.memoize(cache_memoize_value) and I flush it by calling app.cache.delete_memoized(view) The problem is that with memoize it will be cached for n views and not for a specific amount of time. If I want to specify a timeout for the ca...
Delete specific cache in Flask-Cache or Flask-Caching
1.2
0
0
9,332
36,183,552
2016-03-23T16:24:00.000
0
0
1
0
python-2.7,pip
36,185,194
1
false
0
0
I resolved this by upgrading pip, making my 2.6 pip utilize python 2.7 instead. For whatever reason, both pip and pip2.7 were upgraded. Then I reinstalled pip using yum package manager so it is now 2.6
1
0
0
I have multiple versions of pip and python on my CentOS. When I type pip2.7 install --upgrade pip it becomes clear that pip2.7 is trying to upgrade a different version of pip as the path to the pip it is trying to upgrade is not the same as the path yielded by which pip2.7 How do I make pip upgrade the proper pip and n...
pip{version} install --upgrade pip
0
0
0
579
36,185,274
2016-03-23T17:49:00.000
0
1
0
0
django,python-2.7,sandbox,malware-detection
36,680,726
2
false
1
0
Do you have TEMPLATE_DIR and TEMPLATE_LOADERS in your settings.py file. I faced the same issues too. Once you do this, it will work.
1
0
0
I installed last Cuckoo version on my physical machine Ubuntu 15.10 and I configured cuckoo following official guide. I have problem with web gui: TemplateDoesNotExist at / and it tries to search dashboard template in usr/lib/python2.7/dist-packages/django/contrib/auth/templates/dashboard/index.html (with File does no...
Cuckoo Error: TemplateDoesNotExist at /
0
0
0
587
36,187,372
2016-03-23T19:45:00.000
1
0
0
0
python
37,614,849
2
false
0
0
In order to receive data from a client/server via TCP in python using sockets: someData = sock.recv(1024)
1
0
0
I'm trying to setup a basic socket program using TCP connections in Python, such as creating a socket, binding it to a specific address and port, as well as sending and receiving a HTTP packet. I'm having trouble receiving the request message from the client. I'm using the following: message = serverSocket.receive But ...
Python Socket Setup
0.099668
0
1
73
36,187,784
2016-03-23T20:09:00.000
0
0
1
0
python,indentation,spyder
60,243,036
3
false
0
0
On Mac w/ Spyder 4.0.1, it's Python -> Preference -> Editor -> Source Code (tab) -> Indentation characters
3
21
0
I am using the Spyder editor for Python. I need to change the indentation setting (e.g., let "tab" mean "4 spaces"). How do I accomplish this?
Changing indentation settings in the Spyder editor for Python
0
0
0
44,366
36,187,784
2016-03-23T20:09:00.000
33
0
1
0
python,indentation,spyder
36,188,174
3
true
0
0
Spyder v. 4.0 or higher: Tools >>> Preferences >>> Editor >>> Source code >>> Indentation characters Other versions: Tools >>> Preferences >>> Editor >>> Advanced settings >>> Indentation characters
3
21
0
I am using the Spyder editor for Python. I need to change the indentation setting (e.g., let "tab" mean "4 spaces"). How do I accomplish this?
Changing indentation settings in the Spyder editor for Python
1.2
0
0
44,366
36,187,784
2016-03-23T20:09:00.000
0
0
1
0
python,indentation,spyder
52,976,555
3
false
0
0
go to >>>Tools in the menu bar Preferences >>> Editor >>> Advanced settings >>> Indentation characters set indentation characters: to "4 spaces" hurray! Mission accomplished
3
21
0
I am using the Spyder editor for Python. I need to change the indentation setting (e.g., let "tab" mean "4 spaces"). How do I accomplish this?
Changing indentation settings in the Spyder editor for Python
0
0
0
44,366
36,189,453
2016-03-23T21:55:00.000
2
0
1
1
python,gcc,theano
36,189,588
1
false
0
0
Edit Distutils config file C:\Python2.7\Lib\distutils\distutils.cfg (Create the file if it already does not exist). Add the following to the file: [build] compiler = mingw32 This should work.
1
1
0
I have Windows 10 and Python 2.7 installed. When I run IDLE I find this: Python 2.7.10 (default, Oct 14 2015, 16:09:02) [MSC v.1500 32 bit (Intel)] I want the default compiler here to be MinGW's GCC (I already installed MinGW) becaue I cannot import Theano with the MSC compiler I tried all the tutorials out there and ...
How to change Python default compiler to GCC?
0.379949
0
0
3,595
36,190,341
2016-03-23T23:00:00.000
0
0
1
0
python,cx-freeze
64,798,966
1
false
0
0
I had this same issue and found some troubleshooting steps to fix the problem: Change the version number in setup.py. Change the name of the init.py (or whatever your first file is called.) Change the name in setup.py to match. Copy your files into a separate folder along with the setup.py and rerun there.
1
4
0
I have built a Cx Freeze exe from python code. Code worked fine. I recently modified one .py file and rebuilt the exe. Dragged the entire build directory over to another computer for use and it looked as though it was using an older version of the code. Rebuilt, retried. Same thing. Ended up moving over the new up...
CX_Freeze exe references old pyc file?
0
0
0
141
36,191,804
2016-03-24T01:38:00.000
2
0
1
0
javascript,python,json
36,191,835
1
true
0
0
JSON uses " to wrap strings, not ', thus 'foo' is not valid JSON string.
1
0
0
I'm storing some information in Base64 encoded python lists, then decode them in javascript. However it does not parse my "list" as an array (the syntax is the same) because it gives me this error: SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data So it turns out, myString = "['foo']...
Weird error on trying to parse an stringed array with JSON
1.2
0
1
36
36,192,319
2016-03-24T02:37:00.000
2
0
1
0
python,boolean,namedtuple
36,192,392
3
true
0
0
In theory, yes, but you can't create an empty instance of any useful namedtuple, because when you create a namedtuple type, you have to specify the number of elements up front. So the only way you can have an empty namedtuple is to have a namedtuple type that is always empty, in which case it serves no purpose.
1
0
0
When a Python tuple is used in a boolean context, it is considered True if and only if it is not empty. Does the same apply to instances of collections.namedtuple?
Python namedtuple in a boolean context
1.2
0
0
719
36,193,159
2016-03-24T04:11:00.000
13
0
1
0
python,docx,python-docx
36,194,547
2
true
0
0
Short answer is no, because the page breaks are inserted by the rendering engine, not determined by the .docx file itself. However, certain clients place a <w:lastRenderedPageBreak> element in the saved XML to indicate where they broke the page last time it was rendered. I don't know which do this (although I expect Wo...
1
10
0
I am trying to create a program in python that can find a specific word in a .docx file and return page number that it occurred on. So far, in looking through the python-docx documentation I have been unable to find how do access the page number or even the footer where the number would be located. Is there a way to ...
Page number python-docx
1.2
0
0
14,423