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
19,791,353
2013-11-05T14:30:00.000
8
0
1
0
python,ruby,linker,interpreted-language,compiled-language
19,791,553
2
true
0
0
An interpreted language is more or less a large configuration for an executable that is called interpreter. That executable (e. g. /usr/bin/python) is the program which actually runs. It then reads the script it shall execute (e. g. /home/alfe/bin/factorial.py) and executes it, in the simplest form line-by-line. Duri...
2
10
0
In compiled languages, the source code is turned into object code by the compiler and the different object files (if there are multiple files) are linked by the linker and loaded into the memory by the loader for execution. If I have an application written using an interpreted language (for eg., ruby or python) and if...
Linking and Loading in interpreted languages
1.2
0
0
2,957
19,791,570
2013-11-05T14:41:00.000
3
0
0
1
python,django,perl,rabbitmq,celery
19,791,772
2
false
1
0
The easiest way to execute a Perl script from Celery would probably be a thin wrapper written in Python that runs the script as a subprocess.
1
0
0
I have a need to execute PERL scripts through a Django web interface. The user will select the parameters of the script and execute it. I am wondering if it is possible to use Celery/RabbitMQ to execute these script as Celery tasks? If so, would I need to modify the PERL script? Would I have to write RabbitMQ code int...
How to execute PERL scripts in Django using async tasker like Celery?
0.291313
0
0
555
19,793,448
2013-11-05T16:08:00.000
2
1
0
0
python,http,get,httprequest
19,793,524
2
true
0
0
Write a C module that does everything. Or fire up a profiler to find out in which part of the code the time is spent exactly and then fix that. Just as guideline: Python should be faster than the network, so the HTTP request code probably isn't your problem. My guess is that you do something wrong but since you don't p...
1
0
0
I'm developing a python script and I need to find the fastest way for getting a JSON from remote server. Currently I'm using requests module, but still requesting JSON is the slowest part of the script. So, what is the fastest way for python HTTP GET request? Thanks for any answer.
Fastest way for python HTTP GET request
1.2
0
1
2,147
19,794,979
2013-11-05T17:21:00.000
0
0
0
0
python,django,sqlalchemy,pyramid,wsgi
19,795,569
1
false
1
0
I place my SQLAlchemy/SQLSoup connections at models.py, because it is related to persistence (and to the "model" layer of Model-View-Whatever). You can even replace the Django ORM with SQLAlchemy if you are not using applications relying on the first like django.contrib.admin or django.contrib.auth.
1
1
0
I'm plugging some framework agnostic code of mine into Django instead of Pyramid. It uses SQLAlchemy and has a customized session factory object for getting db sessions. In pyramid, I instantiate this at server start up in the main app method and attach it to the registry so that all other parts of my app can get at it...
Where to instantiate shared thread objects in Django, equiv of pyramid registry?
0
0
0
152
19,795,589
2013-11-05T17:57:00.000
1
0
0
0
python,zabbix
19,806,257
2
false
0
0
I use zabbix_api to do navigate through zabbix catalogs, get hosts, get host, get host's items, etc. Though I didn't try to get the data with python, I don't see why it shouldn't work. I do get data from PHP using PhpZabbixApi. Any specific problems you've run into?
1
4
0
Intro I have a cluster to monitor using Zabbix 2.0, everything works fine and I have all the data I need on Zabbix, but the way zabbix displays the data is not optimal for our use case. At the same time I have a python app running with a web front end I can use to create a more refined way of displaying Zabbix's data. ...
using zabbix API to create a grid view from python
0.099668
0
1
1,002
19,798,153
2013-11-05T20:20:00.000
12
0
0
0
python,pandas,dataframe,vectorization
37,336,872
11
false
0
0
Probably simplest explanation the difference between apply and applymap: apply takes the whole column as a parameter and then assign the result to this column applymap takes the separate cell value as a parameter and assign the result back to this cell. NB If apply returns the single value you will have this value inst...
1
624
1
Can you tell me when to use these vectorization methods with basic examples? I see that map is a Series method whereas the rest are DataFrame methods. I got confused about apply and applymap methods though. Why do we have two methods for applying a function to a DataFrame? Again, simple examples which illustrate the u...
Difference between map, applymap and apply methods in Pandas
1
0
0
436,006
19,799,605
2013-11-05T21:42:00.000
0
0
0
0
python,python-2.7,beautifulsoup,mysql-python
19,801,757
1
false
1
0
If you have 2 versions of python installed on your system, then you've somehow installed one library in each of them. You either need to install both libraries in both versions of python (which 2 seperate versions of pip can do), or need to setup your PYTHONPATH environment variable to allow loading of modules from add...
1
0
0
I have two different python programs. One of the program uses the python BeautifulSoup module, the other uses the MySQLdb module. When I run the python files individually, I have no problem and the program run fine and give me the desired output. However I need to combine the two programs so to achieve my ultimate goa...
Modules not Working across different python versions
0
1
0
50
19,799,893
2013-11-05T21:59:00.000
0
0
0
0
python,pandas
19,800,482
1
false
0
0
I suppose you could create another column that is the Hour and subtract the time in question and get the absolute (unsigned) value that you could then do the min function on.. It is not code but I think the logic is right (or at least close.. after you find the mins,, then you can select them and then do your resample....
1
1
1
I'm using pandas to get hourly data from a dataset with fifteen minute sampling intervals. My problem using the resample('H', how='ohlc') method is that it provides values within that hour and I want the value closest to the hour. For instance, I would like to take a value sampled at 2:55 instead of one from 3:10, bu...
Using Pandas to get the closest value to a timestamp
0
0
0
630
19,801,783
2013-11-06T00:25:00.000
3
0
1
0
python
19,801,875
3
true
0
0
I bet your data source actually has hours from 0 through 24 inclusive. Check that. It's a "dumb idea" to distinguish between midnight "at the start of a day" and midnight "at the end of a day". If so, then as @Amadan said, 24 really means 00:00 the next day. How to deal with it depends on the exact (exhaustive) deta...
1
5
0
I have a data source that contains datetime's I'm reading in Python. The program always dies on the 24th hour, since python holds dates 0-23 not 1-24. Considering I get a string like '2012/15/01 24', what is the best way to handle this? I could use regular expressions to pull out the date convert that to a date time, ...
Parse datetime with hours 1-24 instead of 0-23
1.2
0
0
6,629
19,801,968
2013-11-06T00:44:00.000
-1
0
1
0
python,python-3.x,pycharm
19,802,042
4
false
0
0
Try install python 3.3 ( maybe it's help you). Do you have win64 or win32?
1
0
0
I am a beginner to Python and have begun by using the PyCharm IDE. Whenever I run a program, I get a long list of errors in the console that goes like: Exception in thread pydevd.CheckAliveThread: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/threading.p...
PyCharm, Python3.4
-0.049958
0
0
2,889
19,803,591
2013-11-06T03:33:00.000
0
0
0
0
python,django,django-south
19,804,412
2
false
1
0
First thing you must run initial migration. python manage.py schemamigration --initial You are getting this error because of your project structure or there is some issue with your south package .try to remove and reinstalling south. You need to see that there should not be any extra .py file in your migration folder.
1
1
0
I am trying to learn Django by setting up one of the projects I found on github. Afetr I ran the syncdb command it showed Not synced (use migrations): - django_extensions - djangoratings - profiles - guardian (use ./manage.py migrate to migrate these). When I am running "python manage.py migrate app" , it gives A...
South Migration Error
0
0
0
666
19,806,519
2013-11-06T07:41:00.000
0
0
1
0
python,multiprocessing
19,808,614
1
false
0
0
You're overestimating multiprocessing. It uses os.fork() to make new processes (which is fast) but then it uses pickle to pass all data back and forth. On Windows, not having fork(), it is a worst hack: new processes are started and initialized by running the same code as the parent program, hoping that nothing too b...
1
0
0
When I use Pooling in python does each process create its own copy of the given data exactly or it extracts the interest region? Is there any way to limit those processes to copy only the interest region for each ?
Do python multiprocessing pools share memory or they convey their own exact copies into another memory space?
0
0
0
51
19,811,702
2013-11-06T12:06:00.000
2
1
1
0
python,unit-testing
19,811,744
1
true
0
0
The best way is probably to use a coverage tool. It will tell you how much of your code is called at least one time by a test.
1
1
0
Is there a standard method to check if all functions of all files that are included in a test have a testcase? So if I have script_1.py, script_2.py and script_3.py with corresponding test_script_1.py, test_script_2.py and test_script_3.py, how can I check that every function in script_x.py gets called at least ones by...
How to check that all functions have a test case?
1.2
0
0
52
19,815,949
2013-11-06T15:23:00.000
0
0
0
0
python,django
65,434,713
4
false
1
0
if you just want to set an initial value in the form, form = MyForm(initial={'field': field_var})
1
4
0
I'm using a forms.ModelForm to set a model's attributes. For one of the attributes, I'd like to set a default value, and I want to handle it in the form, thus no default=value on the model attribute in the model class. On the form, though, I don't want to show the user the value, not even a hidden value, therefore, I ...
How to set form field default value without showing the field in django forms?
0
0
0
6,103
19,820,306
2013-11-06T18:50:00.000
0
0
0
0
python,selenium,selenium-webdriver,phantomjs
45,224,165
1
false
1
0
set load images equals to false , which will definitely help you to increase the speed of phantomJS.
1
1
0
I've been using selenium in python to drive phantomjs. The problem is that it is quite slow. I'm beginning to think that it is selenium that is slow, not the core phantomjs functionality of emulating a browser, Javascript and all. Is there a more direct way to drive phantom that is faster?
phantomjs vs selenium performance
0
0
1
1,072
19,821,425
2013-11-06T19:50:00.000
0
0
0
0
python,numpy,scipy,nearest-neighbor
70,856,990
5
false
0
0
The fastest way to do this is X[tuple(index.T)], where X is the ndarray with the elements and index is the ndarray of indices wished to be retrieved.
1
48
1
I have a numpy array, filtered__rows, comprised of LAS data [x, y, z, intensity, classification]. I have created a cKDTree of points and have found nearest neighbors, query_ball_point, which is a list of indices for the point and its neighbors. Is there a way to filter filtered__rows to create an array of only points ...
How to filter numpy array by list of indices?
0
0
0
89,890
19,827,404
2013-11-07T03:19:00.000
0
0
1
1
python,eclipse,ide,pydev
20,275,034
9
false
0
0
![Kepler Pydev config] I had to spend lot of time to figure out why it is not working. But ultimately did. Download 2.8.2 zip instead and unzip in dropins folder as shown. Start eclipse with -clean option
2
21
0
I've been using PyDev within Eclipse on my Mac for about two years now. Updated Eclipse today, and suddenly PyDev is completely missing. Tried everything, included a complete uninstall and fresh install, but although PyDev shows up as installed in the menu, it appears nowhere else. PyDev version: 3.0.0.201311051910 Ecl...
Pydev Not Recognized in Eclipse
0
0
0
27,038
19,827,404
2013-11-07T03:19:00.000
0
0
1
1
python,eclipse,ide,pydev
20,405,349
9
false
0
0
I debugged a python project (imported before). The Pydev menu has reappeared by only changing the current perspective to "Debug". I think opening the Pydev perspective through Window > Open Perspective > Other ... > Pydev would also create the Pydev menu.
2
21
0
I've been using PyDev within Eclipse on my Mac for about two years now. Updated Eclipse today, and suddenly PyDev is completely missing. Tried everything, included a complete uninstall and fresh install, but although PyDev shows up as installed in the menu, it appears nowhere else. PyDev version: 3.0.0.201311051910 Ecl...
Pydev Not Recognized in Eclipse
0
0
0
27,038
19,829,516
2013-11-07T06:39:00.000
2
0
1
1
python,windows,python-2.7,cmd
19,829,607
3
false
0
0
You can check registry by: HKLM SOFTWARE\Python\PythonCore\${PYTHON_VERSION}\InstallPath or HKCU
1
30
0
I am trying to get the installed path of python? Any idea how to get the python installed path from command line in windows. I don't want to set the environment variable? Thanks,
how to get python installed path from command line
0.132549
0
0
85,755
19,829,799
2013-11-07T06:59:00.000
0
0
0
0
python,django,tastypie
19,831,689
1
false
1
0
Turns out the clients in question override urls.py to include their apps. I replaced the API url pattern with a custom one and it seems to work.
1
1
0
I have a django based CMS system I am working on and it uses tastypie. While all resources native to the CMS are registered in a separate file imported later into urls.py some of the clients using the system require loading their own custom apps. Is there some way to register an additional resource without changing the...
How do I register tastypie resources from external app?
0
0
0
38
19,831,205
2013-11-07T08:37:00.000
0
0
1
0
python
19,831,313
5
false
0
0
Read the base folder path and stored into variable and move to sub folder and process the text file using chdir and base path change the directory and read the sub folder once again.
1
0
0
so I'm a rookie at programming and I'm trying to make a program in python that basically opens a text file with a bunch of columns and writes the data to 3 different text files based on a string in the row. As my program stands right now, I have it change the directory to a specific output folder using os.chdir so it ...
How to move in and out of folders in python
0
0
0
403
19,842,701
2013-11-07T17:32:00.000
0
0
1
1
python,windows
19,843,644
3
true
0
0
Assumptions: You mention python(w).exe and cmd, so you're most likely on windows. You probably selected "use python 2.n" somewhere in your IDE (whichever one you may use). That works fine as long as you ONLY execute your scripts from there. From any arbitrary other place on your system, windows (or any other OS) makes...
1
1
0
a) I have a code that works fine if I choose Python 2.5 but it gives me errors when using python 2.7. I have easily fixed the problem in windows by choosing python 2.5 as the default program. But, it seems that cmd does not follow this change. How could I fix this? b) what is the difference between running a script usi...
Choosing a different python version to run code
1.2
0
0
473
19,844,558
2013-11-07T19:09:00.000
2
0
1
0
python,string,python-3.x
19,844,624
4
false
0
0
Use the index method to get the first occurrence of #. If the index method allows a starting position, use the position of the first # + 1 for the start. If it doesn't, make a copy of the string starting at position of first # + 1 (possibly a copy and then a substring).
1
2
0
But I need the index of the second time appearance. It is like I have a string "asd#1-2#qwe" I can simply use index method to find the index value of first #, which is 3. But now I wanna get the index of second #, which should be 7.
How to find a index of an item in a string?
0.099668
0
0
99
19,848,191
2013-11-07T22:40:00.000
0
0
0
0
python,oracle,connection-pooling
19,848,278
1
false
0
0
Let the database handle the pool. . . it's smarter than you'll be, and you'll leverage every bug fix/performance improvement Oracle's installed base comes up with.
1
4
0
Situation: I have a requirement to use connection pooling while connecting to Oracle database in python. Multiple python applications would use the helper connection libraries I develop. My Thought Process: Here I can think of two ways of connection pooling: 1) Let connection pool be maintained and managed by database...
Application vs Database Resident Connection Pool
0
1
0
622
19,849,506
2013-11-08T00:28:00.000
1
0
1
0
python,ruby,lua,2d-games
19,849,546
2
false
0
0
No. It might be possible to use the JVM versions of the languages to create JVM classes, then JAR them up. I have never used any of them besides jRuby. Why use three similar scripting languages at the same time? It's like eating pasta with mashed potatoes and bread.
2
1
0
I'm started programming not too long ago. I use a little of Python, Lua, and Ruby. Is it possible to compile all three scripts into one executable using py2exe, py2app, or py2deb? If not, which one should I use for game development, and if anyone has any type of resources to study off of, I really would mind learning m...
How to use together!? Python, Lua, and Ruby?
0.099668
0
0
1,013
19,849,506
2013-11-08T00:28:00.000
1
0
1
0
python,ruby,lua,2d-games
19,849,593
2
true
0
0
Combining them all into one executable is hard. Combining them into one application, not so hard. Let's take py2app as an example. It builds an OS X application bundle—a directory full of files. There's a complete Python interpreter with a custom standard library in the Frameworks subdirectory. And your application's P...
2
1
0
I'm started programming not too long ago. I use a little of Python, Lua, and Ruby. Is it possible to compile all three scripts into one executable using py2exe, py2app, or py2deb? If not, which one should I use for game development, and if anyone has any type of resources to study off of, I really would mind learning m...
How to use together!? Python, Lua, and Ruby?
1.2
0
0
1,013
19,851,323
2013-11-08T03:55:00.000
1
0
0
0
python,web-applications,flask
19,851,945
1
false
1
0
Yes. What would be the problem exactly? Personally I would recommend setting up an Nginx server at both ends to serve the file from the filesystem. Using Flask for hosting files is a waste of resources.
1
0
0
I have two Flask servers A and B. My user is on machine C. A is the public interface machine. The user wants to retrieve a 500GB octet-stream from B, but only the public interface on A is exposed. So I'd like something where: User on machine C sends GET request to server A, request gets routed to server B, server B re...
forwarding large files on servers
0.197375
0
0
39
19,851,498
2013-11-08T04:17:00.000
0
0
1
0
python,floating-point-precision
19,851,584
2
false
0
0
i am not sure if it is right, if you find the number of digits in the input and then multiplying the input with required powers of 10 gives you mantissa.
1
0
0
I need to convert a user inputted float into a 5 digit number that has no decimals to calculate the mantissa and exponent of the float Example :- a input of: 12 Mantissa: 12000 Exponent: -3 but I can only find information on math.frexp(x) which I cant use for my assignment. Basically I need a way to convert the users...
Float should have 5 leading numbers and no decimals
0
0
0
73
19,851,780
2013-11-08T04:47:00.000
4
0
1
0
python,eclipse,adt,pydev
19,976,691
2
true
1
0
The non-obvious answer here is that JDK 7 needs to be installed. Otherwise, the PyDev installation succeeds but then silently is hidden in Eclipse. I just went through this, and getting JDK 7 fixes it right up.
2
3
0
I tried to setup PyDev on my ADT/eclipse. I am wondering the installation did not prompt any errors but I could not see pydev plugin after restarting ADT. Moreover I tried to extract plugin files in to eclipse>plugin folder for pydev it did not work either. Any solutions or ideas for it to work on ADT.
PyDev is installed but does not show up in ADT
1.2
0
0
960
19,851,780
2013-11-08T04:47:00.000
0
0
1
0
python,eclipse,adt,pydev
19,902,911
2
false
1
0
You need to run Eclipse as an administartor when you do the Pydev (or any other) install.
2
3
0
I tried to setup PyDev on my ADT/eclipse. I am wondering the installation did not prompt any errors but I could not see pydev plugin after restarting ADT. Moreover I tried to extract plugin files in to eclipse>plugin folder for pydev it did not work either. Any solutions or ideas for it to work on ADT.
PyDev is installed but does not show up in ADT
0
0
0
960
19,854,866
2013-11-08T08:47:00.000
0
0
0
1
python,desktop,os.system,mstsc
29,933,838
1
false
0
0
To close one of the mstsc, you should know the pid of it. If you are opening mstsc.exe from a python script itself, then you could capture the pid of that instance. p = Popen('C:\Windows\System32\mstsc.exe "connection.rdp"') print p.pid Then kill the exe using pid.
1
1
0
I want to automate closing the remote desktop application using python. I open the remote desktop using mstsc. When I do os.system("TASKKILL /F /IM mstsc.exe") It is killing all the remote desktop applications that are open. Is there a way I can specify through python which remote desktop it has to close. I have 2 or m...
how to close remote desktop window using python
0
0
0
1,415
19,859,282
2013-11-08T12:37:00.000
2
0
1
0
python,string
61,931,265
19
false
0
0
This probably isn't the best approach in Python, but as a Haskeller this lambda/map approach made perfect sense to me and is very short: anydigit = lambda x: any(map(str.isdigit, x)) Doesn't need to be named of course. Named it could be used like anydigit("abc123"), which feels like what I was looking for!
1
277
0
Most of the questions I've found are biased on the fact they're looking for letters in their numbers, whereas I'm looking for numbers in what I'd like to be a numberless string. I need to enter a string and check to see if it contains any numbers and if it does reject it. The function isdigit() only returns True if ALL...
Check if a string contains a number
0.02105
0
0
536,944
19,864,484
2013-11-08T16:55:00.000
3
0
0
0
python,pygame
19,864,546
1
false
0
1
You probably shouldn't be trying to launch a new instance of your game. You should create a reset method which can be called to restart everything. It would clear all variables, set the game state back to the start, etc.
1
0
0
I am trying to develop GUI for a who wants to be a millionaire game using pygame. If the user is presented with the welcome screen and clicks new game, it should clear the welcome screen and bring up the main game screen. I tried using os.system('xxx.py') but it doesnt stay on, it just flashes and goes off. Any ideas ...
Clear previous screen to show next screen pygame
0.53705
0
0
208
19,865,347
2013-11-08T17:44:00.000
3
0
0
0
python,opencv
19,867,945
1
true
0
0
No I think there is something else that is the problem. Docs say: cv2.getAffineTransform Calculates an affine transform from three pairs of the corresponding points. The problem is you are giving it 125 pairs of points. It only wants 3 pairs of point correspondences. This is of course the number of correspondences n...
1
1
1
I'm trying to use the cv2.getAffineTransform(src,dst) function in openCV, but it crashes because my inputs are arrays containing 125 pairs of x,y coordinates and getAffineTransform wants its input to have three columns. Can I just concat a row full of zeros onto my array or is there a special transformation I should do...
Converting x,y coordinates into a format for getAffineTransform?
1.2
0
0
935
19,867,190
2013-11-08T19:37:00.000
2
0
1
1
c++,python,c,delphi,.obj
19,867,378
1
false
0
1
Delphi generated .obj files cannot be consumed by Python because Python doesn't consume .obj files. You'd need to compile them to a library at the very least. At which point, emitting .obj files is pointless – you may as well just output a full module. I conclude that you'll need to compile your Delphi code to a librar...
1
3
0
I have a lot of code in Delphi I would like to use in python. In Delphi XE is an option to generate C / C + + files. obj Can I generate these files. Obj in Delphi and use it in python code python code to use it. obj will still be cross-platform? thank you
delphi code compiled to obj files to be used in python
0.379949
0
0
245
19,870,149
2013-11-08T23:09:00.000
0
0
1
0
python,json
19,870,206
6
false
1
0
any seralizer/deserializer/parser is a potential security threat to the application It is true on the serverside as long as you write seralizer/deserializer/parser by yourself. As long as you use standard library you can trust its programmers.
6
0
0
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
0
0
0
768
19,870,149
2013-11-08T23:09:00.000
0
0
1
0
python,json
19,870,208
6
false
1
0
You never know what the parser does inside. A parsing itself is a possible security threat, although the developers try to do their best to avoid it. For a stable library that's been developed for a long time, there's nearly no danger.
6
0
0
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
0
0
0
768
19,870,149
2013-11-08T23:09:00.000
3
0
1
0
python,json
19,870,248
6
true
1
0
JSON data can only contain basic types: strings, numbers, Booleans, null, objects, and lists. This means that properly formatted JSON data poses no risk at all to your application, unless you are doing something silly like executing that code with eval(). So if valid JSON is not an issue, the question becomes "can a c...
6
0
0
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
1.2
0
0
768
19,870,149
2013-11-08T23:09:00.000
0
0
1
0
python,json
19,870,358
6
false
1
0
Yes. You should be paranoid. Just because the parsers are trusted does't mean you can't screw up.
6
0
0
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
0
0
0
768
19,870,149
2013-11-08T23:09:00.000
0
0
1
0
python,json
19,870,379
6
false
1
0
Well... to take any user input is potentially dangerous, especially when using external libraries you don't know well. For instance, it's simple to demonstrate how a quicksort algorithm poorly implemented can be used to a Denial of Service attack by feeding it tailored data that leads all iterations to an O(n²). Does t...
6
0
0
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
0
0
0
768
19,870,149
2013-11-08T23:09:00.000
1
0
1
0
python,json
19,870,187
6
false
1
0
In general that blurb is true, but is dependent on how security-enabled/conscious the parser and its developers are. The json module itself has been vetted for a long time, and does not do anything that would compromise the security of the server.
6
0
0
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
0.033321
0
0
768
19,883,186
2013-11-09T21:15:00.000
1
0
0
0
python,django
19,883,259
2
false
1
0
Simply the module won't be found when you try to run your project. You can run 'python' in your command line and try to 'import django' if it returns an error then django isn't found it means that django isn't installed on the current machine.
1
4
0
I've built a small project on my system. After building the project, I put it on a USB drive, and copied to another system. When I run the project, how can it detect if django is installed in the system or if the system has all of the the requirements for the project? For example, I made a blog example project on a lap...
How can a django project detect if the system has django installed?
0.099668
0
0
262
19,886,791
2013-11-10T06:01:00.000
2
0
1
0
python
19,887,048
3
false
1
0
python is the language, I guess you mean some web platform like django. however, there is no javascript / css management tool at part of the platform.
1
1
0
Coming from C#, management of -all- dependencies was done using NuGet. In Python, PIP is used to manage python packages. Is there any de facto standard for managing Javascript and CSS library dependencies?
How do Python developers manage Javascript/CSS library dependencies?
0.132549
0
0
220
19,892,934
2013-11-10T17:46:00.000
0
0
0
0
python,openerp
19,897,059
1
false
1
0
All the sales done through post is registered in post.order. If you are creating orders from an external source other than pos, you can create the order in this table and call the confirm bottom action. Rest changes in all other table will be done automatically..
1
0
0
I got one table in which modifications are made :-account_bank_statement, what other tables are needed for the point of sale and if i make a sale in which tables modifications are made.I want to make a sale but not through the pos provided.
In which tables changes are made in openERP when an items is sold at Point of sale
0
1
0
49
19,894,995
2013-11-10T20:48:00.000
1
0
1
0
python,eclipse,pydev
43,474,460
18
false
0
0
If anybody has Eclipse Neon, this is how I fixed it: From the Window menu > Perspective > Customize Check Pydev Debug and the sub-items you're interested in. Now you can see the Pydev on the Menu bar.
9
29
0
After installing the latest version of Pydev on eclipse it is not showing under the list of available perspectives. Eclipse does however list pydev as being installed which seems weird to me. I would also like to add that I installed pydev through the standard method (Through the "install new software" option under he...
Pydev Perspective Not Showing After Install For Eclipse
0.011111
0
0
43,566
19,894,995
2013-11-10T20:48:00.000
0
0
1
0
python,eclipse,pydev
43,308,288
18
false
0
0
In my case, while installing the plugin, I had forgotten to click on a checkbox to trust a certificate, then I installed it again, checked the checkbox and it worked.
9
29
0
After installing the latest version of Pydev on eclipse it is not showing under the list of available perspectives. Eclipse does however list pydev as being installed which seems weird to me. I would also like to add that I installed pydev through the standard method (Through the "install new software" option under he...
Pydev Perspective Not Showing After Install For Eclipse
0
0
0
43,566
19,894,995
2013-11-10T20:48:00.000
0
0
1
0
python,eclipse,pydev
45,366,759
18
false
0
0
I had the problem too, and I solved it just by waiting for eclipse to download all files, it takes some time. When the downloads are completed eclipse will remind you to restart, if you see that remind you have succeeded.
9
29
0
After installing the latest version of Pydev on eclipse it is not showing under the list of available perspectives. Eclipse does however list pydev as being installed which seems weird to me. I would also like to add that I installed pydev through the standard method (Through the "install new software" option under he...
Pydev Perspective Not Showing After Install For Eclipse
0
0
0
43,566
19,894,995
2013-11-10T20:48:00.000
0
0
1
0
python,eclipse,pydev
43,186,346
18
false
0
0
I faced this issue. My environment looked like this Windows 7 Enterprise (64 bit) Eclipse SDK 4.2 Python 3.6.1 Pydev 5.2 JRE 1.8.0_111 In the above configuration the PyDev plugin didn't show up. I did the following: Installed the jdk 1.8 (64 bit) Installed Eclipse Neon Installed the Pydev plugin using the Plugin m...
9
29
0
After installing the latest version of Pydev on eclipse it is not showing under the list of available perspectives. Eclipse does however list pydev as being installed which seems weird to me. I would also like to add that I installed pydev through the standard method (Through the "install new software" option under he...
Pydev Perspective Not Showing After Install For Eclipse
0
0
0
43,566
19,894,995
2013-11-10T20:48:00.000
0
0
1
0
python,eclipse,pydev
71,694,673
18
false
0
0
I installed Eclipse IDE for Java Developers (setup by Oomph) into the folder 'C:\Program Files' with administrator privileges on Windows. After manually renaming/moving the Eclipse installation folder and installing PyDev, it did not show up as Perspective. A possible solution is to run Eclipse as administrator and to ...
9
29
0
After installing the latest version of Pydev on eclipse it is not showing under the list of available perspectives. Eclipse does however list pydev as being installed which seems weird to me. I would also like to add that I installed pydev through the standard method (Through the "install new software" option under he...
Pydev Perspective Not Showing After Install For Eclipse
0
0
0
43,566
19,894,995
2013-11-10T20:48:00.000
1
0
1
0
python,eclipse,pydev
37,609,949
18
false
0
0
in my case, you need to use jdk 1.8, if the pydev is 5.0.0.
9
29
0
After installing the latest version of Pydev on eclipse it is not showing under the list of available perspectives. Eclipse does however list pydev as being installed which seems weird to me. I would also like to add that I installed pydev through the standard method (Through the "install new software" option under he...
Pydev Perspective Not Showing After Install For Eclipse
0.011111
0
0
43,566
19,894,995
2013-11-10T20:48:00.000
2
0
1
0
python,eclipse,pydev
25,865,042
18
false
0
0
For Ubuntu users: Check for Java version ($ java -version). If it is 1.6.0, please upgrade it to 1.7.0 ($ sudo apt-get install openjdk-7-jdk) Also, run the command $ sudo update-alternatives --config java Restart Eclipse and Pydev will show up in the preferences.
9
29
0
After installing the latest version of Pydev on eclipse it is not showing under the list of available perspectives. Eclipse does however list pydev as being installed which seems weird to me. I would also like to add that I installed pydev through the standard method (Through the "install new software" option under he...
Pydev Perspective Not Showing After Install For Eclipse
0.022219
0
0
43,566
19,894,995
2013-11-10T20:48:00.000
2
0
1
0
python,eclipse,pydev
20,583,817
18
false
0
0
I had the same problem; it seems I was using Eclipse with Java 1.6 instead of with Java 1.7 as required by PyDev. The fix, for PyDev 3.1.0 on Linux at least, is to start Eclipse with the Java 1.7 binary. Two ways to do this: updating the default Java installation for the system to 1.7 or edit the eclipse.ini to poin...
9
29
0
After installing the latest version of Pydev on eclipse it is not showing under the list of available perspectives. Eclipse does however list pydev as being installed which seems weird to me. I would also like to add that I installed pydev through the standard method (Through the "install new software" option under he...
Pydev Perspective Not Showing After Install For Eclipse
0.022219
0
0
43,566
19,894,995
2013-11-10T20:48:00.000
3
0
1
0
python,eclipse,pydev
40,831,132
18
false
0
0
update Java version. Install the new java. Go to Eclipse-> Preference-> Java -> Intalled JRE -> Check latest java (1.8) -> Apply. Restart Eclipse
9
29
0
After installing the latest version of Pydev on eclipse it is not showing under the list of available perspectives. Eclipse does however list pydev as being installed which seems weird to me. I would also like to add that I installed pydev through the standard method (Through the "install new software" option under he...
Pydev Perspective Not Showing After Install For Eclipse
0.033321
0
0
43,566
19,896,763
2013-11-10T23:52:00.000
0
0
1
0
java,c++,python,eclipse
19,897,203
2
false
0
0
Could it be in a hidden working set? In the Project Explorer, expand the menu (downward arrow on top right) and in Select Working Set, make sure all working sets are selected.
1
0
0
all. I've read the existing threads on this topic. My understanding is that if I use different workspaces in Eclipse, I should be able to save the same project name. But I'm not able to and not sure why. In Windows 7, I have Eclipse Kepler (Java) installed with the C++ and Python plugins. I created three workspaces: ...
Eclipse. Different Workspaces. Can't save same project name
0
0
0
427
19,896,904
2013-11-11T00:08:00.000
2
0
0
0
python,algorithm,latitude-longitude
19,896,958
2
false
0
0
You might want to look into spatial data structures like the k-d tree or quadtree, which are optimized to answer queries of the form "what points are close to some test point p?" There are lots of good references for and implementations of these data structures online, and you might be able to use some of them to solve...
1
1
0
I am given a file with interesting locations in some cities in the united states. in another file, I am given a lot of data for train/taxi pickups. I would like to know of an easy to implement algorithm to find if one of these pickup locations is within some x kilometers / miles from one of the interesting locations. I...
Algorithm to find if location (latitude , longitude) is within radius range of a given location (latitude, longitude)
0.197375
0
0
2,476
19,896,965
2013-11-11T00:16:00.000
2
0
0
0
python,performance,wxpython,scintilla
19,897,133
1
true
0
1
Use GetFirstVisibleLine() to determine the first visible line. Lines are numbered starting at zero. Use LinesOnScreen() to determine how many lines are visible on the screen. You can use GetLine(line) to get a string of an individual line.
1
2
0
I am still working on my text editor, and now I want to make it run faster. So I thought I may somehow get currently visible text, and parse it as I want. So is there a way to get currently visible lines? P.S. Or maybe there is another way to increase StyledTextCtrl's performance? Thanks.
wxPython - StyledTextCtrl get currently visible lines
1.2
0
0
273
19,898,967
2013-11-11T04:42:00.000
3
0
0
0
python,flask,wtforms,flask-wtforms
25,145,753
2
false
1
0
A great question. This is what we do (flask backend, jquery frontend): use jquery.forms plugin to ajax forms. Pretty solid mature code. Shortcoming, cannot send json encoded data, only form-urlencoded. Receives plain or json data. use wtfroms for form validation. Very mature codebase. tried to use wtforms-json for ac...
1
16
0
I accustomed of using WTForms by means of Flask-WTF in my flask application. Doing server side validation is trivial. But how do I leverage this server validation to become a field level, ajax, client side validation? So, when user tab to another input fields, my application can directly goes on validating it and give ...
How to use WTForms in Ajax validation?
0.291313
0
0
8,644
19,900,202
2013-11-11T06:32:00.000
2
0
1
0
python,pandas,numpy
50,679,155
10
false
0
0
Just to add to all other answers, one can also use df.info() to get whats the data type of each column.
1
129
1
Is there a better way to determine whether a variable in Pandas and/or NumPy is numeric or not ? I have a self defined dictionary with dtypes as keys and numeric / not as values.
How to determine whether a column/variable is numeric or not in Pandas/NumPy?
0.039979
0
0
132,614
19,901,351
2013-11-11T07:53:00.000
1
0
1
1
python
19,901,418
3
false
0
0
If you are using Linux, you can try this: (cmdpid=$BASHPID; (sleep 60; kill $cmdpid) & exec YOUR_COMMAND) for example, if you want to execute a program named script.py: (cmdpid=$BASHPID; (sleep 60; kill $cmdpid) & exec python script.py)
1
0
0
I have python script and want to stop work or kill proccess after 60 second of execution . not just stop work , kill or die proccess. Don't find a good reference for this . P.S: Kill python script itself (like a timer with first line of script to kill script after a time) P.S2: I'm on windows and want compile it to .ex...
Kill Python script after 60 second in simplest way
0.066568
0
0
1,157
19,901,647
2013-11-11T08:14:00.000
1
0
0
1
python,ubuntu,debian,deb,lintian
20,292,610
2
false
1
0
For future reference, here's what I did. I generated and packaged the .pyo files into their own tar.gz file In the postinst script, the tar.gz file is extracted, and the tar.gz file is deleted In the postrm script, the pyo files are deleted. This isn't the nicest solution in the world, but it works with Debian/Ubuntu...
1
4
0
I have written a proprietary application that needs to install some .pyo files. When I create a .deb from the app, lintian complains that package-installs-python-bytecode. I tried adding an override, but apparently this tag is marked as non-overridable by ftp-master-auto-reject.profile in /usr/share/lintian/profiles/de...
Over-riding Debian/Ubuntu's lintian profile
0.099668
0
0
683
19,904,687
2013-11-11T11:01:00.000
2
0
0
0
python,qt,pdf-generation,pyqt4
19,905,659
1
true
0
1
You can use QPixmap.grabWidget to capture you main window widget and QPrinter to produce a pdf file. A QPainter is needed to draw the pixmap to the printer.
1
1
0
I'm working on an app that will display an image and some text. But I want to export the whole QT interface as a PDF (By pressing on a button on the UI itself). All the text and all the images just as it appears on the UI. Now if that isn't possible, maybe I can some how automatically create a jpg, save it and then som...
Creating a PDF from a QT application
1.2
0
0
1,204
19,906,736
2013-11-11T12:46:00.000
0
0
0
0
python,qt,user-interface,pyqt
63,035,982
3
false
0
1
Nicolescu's answer is perfect and working. When you open popup/modal(QWidgets.QWidget) window, and want to disable parent window activiy, until the child is open, just use hist example. def init(self): self.setWindowModality(QtCore.Qt.ApplicationModal))
1
5
0
I have created a QMainWindow in python with Qt library. When user clicks on the close button, I'm prompting a warning QMessageBox (Yes/No). I want to fully disable main window's functionality until user chooses yes or no -to the second window-. (I want something like "freezing" the main window.) I have tried "self.setE...
disable window functionality in pyqt
0
0
0
6,641
19,907,723
2013-11-11T13:35:00.000
0
0
0
1
python,eclipse,pydev
31,271,138
4
false
0
0
I had the same problem, I opened Eclipse as admin and it worked... don't know if it helps
1
0
0
I'd like install pydev in eclipse by following method, all of them fails: using update site, errors happens in the installation, looks like a firewall issue. download the pydev zip file, and extract to the eclipse folder, not working ( could not find it in preference after restart eclipse) download hte pydev zip file...
Can't install pydev in eclipse
0
0
0
9,571
19,913,092
2013-11-11T18:17:00.000
1
1
0
0
python,mocking,simulation,raspberry-pi,gpio
25,086,750
2
false
0
0
IF you just don't want to trust a software layer, you could try manually setting the pin high: The GPIO pins on the Raspberry Pi work with a voltage of 3.3VDC. Pins 1 & 17 on the P1-GPIO header outputs 3.3VDC. You could CAREFULLY try to connect a jumper from Pin 1 or 17 to the GPIO input pin you want to test. Connect ...
1
5
0
I'm new on Raspberry Pi and I would to know how can we simulate/mock the sensors (or GPIO) so I can test just my python code, mocking the Highs and Lows of the pins? Thanks in advance!
Simulate Raspberry Pi GPIO signal
0.099668
0
0
6,042
19,913,421
2013-11-11T18:38:00.000
0
1
0
0
python,pymc
19,960,199
1
false
0
0
You can create custom StepMethods to perform any kind of sampling you like. See the docs for how to create your own.
1
3
1
Is there an easy way to use PyMC's MCMC algorithms to efficiently sample a parameter space for a frequentists analysis? I'm not interested in the point density (for Bayesian analysis), but rather want a fast and efficient way to sample a multidimensional parameter space, so I would like to trace all tested points (i.e....
Using MCMC from PyMC as an efficient sampler for frequentist analysis?
0
0
0
155
19,916,729
2013-11-11T21:53:00.000
0
1
1
1
python,cpython,python-internals
70,165,436
4
false
0
0
When we run the python programs: 1_python source code compile with Cpython to the bytecode (bytecode is the binary file with .pyc format which seralize with marshal and it is set of stack structures that solve with pvm) 2_then the pvm (python virtual machine/python interpreter) is stackbase machine (the machine which s...
1
65
0
I am trying to understand how Python works (because I use it all the time!). To my understanding, when you run something like python script.py, the script is converted to bytecode and then the interpreter/VM/CPython–really just a C Program–reads in the python bytecode and executes the program accordingly. How is this b...
How exactly is Python Bytecode Run in CPython?
0
0
0
14,342
19,919,547
2013-11-12T01:59:00.000
17
0
0
0
python,django,django-admin,admin
21,247,209
1
false
1
0
In python, modules can be loaded from within a package's __init__.py; it doesn't need to be a file in the same directory. If you look in django/contrib/admin/__init__.py you will see: from django.contrib.admin.sites import AdminSite, site So then if you look in django/contrib/admin/sites.py you will see: site = AdminSi...
1
11
0
In my urls.py, I have a line of codes of ('include(admin.site.urls). But I cannot find the source file in the setup dir of python like ..\site-packages\django\contrib\admin Where are they?
where can i find the source file of 'admin.site.urls'?
1
0
0
11,132
19,920,246
2013-11-12T03:18:00.000
0
0
1
0
python-2.7
19,920,270
2
false
0
0
Do you mean to tell you the last time you entered anything or a specific word? If it's a specific one, make a dictionary where you use words as keys, and then store the time there.
1
0
0
I have been recently working with Python, and I wish to make a program that tells me how long was the last time I inputted something without it closing (e.g. The first thing I input is the word "foo". After 15 minutes, I input foo again, so the program prints that I last inputted the word foo 15 minutes ago). Any ideas...
Permanent timer on Python
0
0
0
63
19,921,322
2013-11-12T05:10:00.000
0
0
1
0
python,macos,virtualenv
19,921,357
2
false
0
0
The best way to find out is to set up a test, duplicate account with all the same setup (.login, .bashrc, .bash_profile, .tcshrc, etc.) and see what happens when you try. You may be perfectly fine, or you might have your home directory name hard coded into one of those files, in which case testing this out first might ...
2
0
0
I was going to change the home directory name on my MacBook, but I was wondering if that will mess up any virtual environments or any other files I'm not thinking of right now in my already created Python/Django projects?
Will Changing Home Directory Name Mess Up Virtual Environments?
0
0
0
39
19,921,322
2013-11-12T05:10:00.000
0
0
1
0
python,macos,virtualenv
19,921,505
2
false
0
0
Rename the home directory, then create a link pointing the old directory name to the new directory name. This way, anything that points to the old name will still work.
2
0
0
I was going to change the home directory name on my MacBook, but I was wondering if that will mess up any virtual environments or any other files I'm not thinking of right now in my already created Python/Django projects?
Will Changing Home Directory Name Mess Up Virtual Environments?
0
0
0
39
19,921,705
2013-11-12T05:37:00.000
0
0
0
1
python,django,amazon-web-services,amazon-ec2
51,827,225
2
false
1
0
Make sure to include your IPv4 Public IP address in the ALLOWED_HOSTS section in Django project/app/settings.py script...
1
4
0
So, I have looked around stack overflow + other sites, but havent been able to solve this problem: hence posting this question! I have recently started learning django... and am now trying to run it on ec2. I have an ec2 instance of this format: ec2-xx-xxx-xx-xxx.us-west-2.compute.amazonaws.com on which I have a djang...
How do I access my django app running on Amazon ec2?
0
0
0
6,277
19,926,738
2013-11-12T10:32:00.000
2
1
0
1
python,jenkins,continuous-integration,continuous-deployment
19,932,927
1
true
0
0
Since we already use Jenkins, I think we do it in a script called by Jenkins. Any reason to do it with a different (better) tool? To answer your question: No, there aren't any big reasons to not go with Jenkins for deployment. Pros: You already know Jenkins (and you probably know some of the quirks) You don't need ...
1
2
0
We want to use continuous deployment. We have: all sources (python) in a local RhodeCode (git) server. Jenkins for automated testing SSH connections to the production systems (linux). a tool which can update servers in one command. Now something like this should be implemented: run tests with Jenkins if there is a ...
Continuous Deployment: Version Numbering and Jenkins for Deployment?
1.2
0
0
1,215
19,932,110
2013-11-12T14:40:00.000
2
0
0
0
java,python,hadoop
19,932,204
3
false
1
0
No, you don't necessarily need java knowledge, as you can write map-reduce jobs perfectly well in pig or hive (similar to SQL). However, as with all layers of abstraction, at some point you may well need to know what is going on "behind the scenes" and being able to look, understand and debug the underlying java is a b...
1
2
0
I wanted to start learning the big data technology from the scratch. I wanted to know is it necessary to learn java for operating with hadoop as i am already well versed in python?
is is necessary to learn java for hadoop?
0.132549
0
0
689
19,937,402
2013-11-12T18:45:00.000
1
0
0
0
python,django,oauth-2.0,multi-tenant,django-allauth
21,147,716
1
false
1
0
You should use Django sites framework together with django-allauth. Consumer keys, tokens make use of the Django sites framework. This is especially helpful for larger multi-domain projects, but also allows for for easy switching between a development (localhost) and production setup without messing with your se...
1
3
0
I am creating a web application that will support several domains. For example, if my app were named www.webapp.com, I'd also have numerous customers mapping their domains to my site via DNS CNAME mappings, i.e. webapp.yourdomain.com CNAME www.webapp.com and foo.anotherdomain.com CNAME www.webapp.com, etc... I want us...
django-allauth with multiple domains
0.197375
0
0
848
19,939,598
2013-11-12T20:50:00.000
0
0
0
0
python,qt,pyqt,pyqt4
19,943,638
1
false
0
1
The pyuic tool uses the objectName to generate the names of the top-level class and its members. So to make a member "private", just prepend some underscores to the objectName property in the designer component.
1
0
0
I've created a form in Qt Creator 4 and 'compile' it to python module with pyuic4. Everything is ok but when I call the class represented my for it contains over 20 form elements as a public members (including Spacers etc.). But I need only 5 of them. It's not fatal but annoying... Is there a way to declare an element ...
Qt Creator: how to hide members?
0
0
0
96
19,943,476
2013-11-13T01:22:00.000
0
1
0
0
php,python
19,951,713
1
false
0
0
There is absolutely no requirement than Python and PHP (or any other language) should generate the same random number for the same seed.
1
2
0
I currently need to use a script that requires python and PHP to output the same random numbers given a seed. Is there any RNG that can let them do this? When I use mt_rand and mt_srand and python's default rng (which is supposed to be mersenne twist) with the same seed I get different results.
Python and PHP not returning the same results for a similiarly seeded RNG
0
0
0
130
19,944,745
2013-11-13T03:31:00.000
0
0
0
0
python,selenium,webdriver,selenium-webdriver
58,951,194
3
false
0
0
"driver.session_id" will get you the session-id of current session.
2
11
0
Im using SauceLabs and I need the sessionId to get the Job Id there and use it to set pass/fail status during execution of the test. How can I get the session Id using python?
How to get session id on Selenium webdriver using Python?
0
0
1
14,421
19,944,745
2013-11-13T03:31:00.000
0
0
0
0
python,selenium,webdriver,selenium-webdriver
60,012,259
3
false
0
0
This worked for me: BuiltIn().get_library_instance('SeleniumLibrary').driver.session_id
2
11
0
Im using SauceLabs and I need the sessionId to get the Job Id there and use it to set pass/fail status during execution of the test. How can I get the session Id using python?
How to get session id on Selenium webdriver using Python?
0
0
1
14,421
19,945,334
2013-11-13T04:30:00.000
2
0
0
0
python,numpy,scipy,scikit-learn,scikits
24,098,425
1
false
0
0
No, this is not possible at present. It's also not "doable", and here's why. CountVectorizer and TfidfVectorizer are designed to turn text documents into vectors. These vectors need to all have an equal number of elements, which in turn is equal to the size of the vocabulary, because that conventions is ingrained in al...
1
5
1
Scikit-learn CountVectorizer for bag-of-words approach currently gives two sub-options: (a) use a custom vocabulary (b) if custom vocabulary is unavailable, then it makes a vocabulary based on all the words present in the corpus. My question: Can we specify a custom vocabulary to begin with, but ensure that it gets up...
Adding new words to text vectorizer in scikit-learn
0.379949
0
0
2,027
19,946,192
2013-11-13T05:41:00.000
0
1
0
0
php,python,ajax,twitter,streaming
22,292,555
2
true
1
0
I am using twython and using long polling technique for displaying the streams.
1
0
0
I am using twiiter streaming api and twython module with python 2.7 windows 7 os. I want to click a button and streaming of tweets should start. and on clicking the streaming should stop.I am using python for backend and HTML on front end.I am communicating to python via php using passthru function.when i am giving an ...
Streaming Tweets Via Python
1.2
0
1
225
19,949,809
2013-11-13T09:17:00.000
1
0
0
1
python,docker
19,951,847
3
false
1
0
In order to use a Docker container, you will always need the basics - Docker installed on a Linux OS (that supports LXC and any other required filesystem type). In a production environment, you'd be running a recent, native install of Linux, and the initial install of Docker would be easy, and a one-time event (in a cl...
3
5
0
I'll like to create a python flask application that can run on any platform. I've put it in a Docker container. But unless I've misunderstood something the host machine still need docker installed to launch the container. Which in turn required Vagrant and and Ubuntu VM (at least on Mac). Am I missing something? What i...
How do I make a standalone application out of a Docker container?
0.066568
0
0
3,690
19,949,809
2013-11-13T09:17:00.000
0
0
0
1
python,docker
20,142,281
3
false
1
0
The simple answer is: you can't. The long answer is: Docker is not intended to be used to make cross platform standalone applications (but JAVA is, for example). Docker instead focuses on having a light weight container that acts like a virtual machine but basically isn't. It's just a box inside a linux(!) system that ...
3
5
0
I'll like to create a python flask application that can run on any platform. I've put it in a Docker container. But unless I've misunderstood something the host machine still need docker installed to launch the container. Which in turn required Vagrant and and Ubuntu VM (at least on Mac). Am I missing something? What i...
How do I make a standalone application out of a Docker container?
0
0
0
3,690
19,949,809
2013-11-13T09:17:00.000
0
0
0
1
python,docker
20,142,478
3
false
1
0
A Linux VM is a dependency if you are on Windows or Mac. Vagrant is not though. It is mentioned only because it's probably the easiest way to get a VM up and running.
3
5
0
I'll like to create a python flask application that can run on any platform. I've put it in a Docker container. But unless I've misunderstood something the host machine still need docker installed to launch the container. Which in turn required Vagrant and and Ubuntu VM (at least on Mac). Am I missing something? What i...
How do I make a standalone application out of a Docker container?
0
0
0
3,690
19,951,684
2013-11-13T10:46:00.000
3
0
1
0
python
19,951,968
1
true
0
0
Module time is built-in in the Python interpreter. No other version than the interpreter's itself can be a valid answer (you can access that one using sys.version). Other built-in modules like os, sys etc. also do not have their own version information.
1
3
0
How do I determine which version of the python module 'time' is installed. For other modules .version.version or .__version__ work, however for time, both these methods return the error 'module' object has no attribute 'version' or 'version'
Which version of python time module am I using
1.2
0
0
1,804
19,952,513
2013-11-13T11:25:00.000
0
0
1
0
asp.net,visual-studio-2010,ironpython
20,004,327
1
true
0
0
I found the solution just in case someone needs the same, for websites which is what I needed (for web applications is easier because there's an installable tool) Add a registry entry key ".py" in HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0_Config\Projects{E24C65DC-7377-472b-9ABA-BC803B73C61A}\RelatedFiles....
1
0
0
Is it possible to have .aspx and .aspx.py (IronPython codefile) nested underneath aspx files in VS 2010 ? I've seen some people added Windows registry entries for Visual Studio so other files would show up as nested underneath aspx, but I've no idea how to do it for IronPython if possible
Visual Studio file nesting aspx - aspx.py
1.2
0
0
64
19,957,613
2013-11-13T15:23:00.000
1
1
0
0
python,sql,configuration,nginx,fuse
20,018,813
1
true
0
0
I haven't seen any working solution to solve your task, a quick google search doesn't give any useful information either (it doesn't look like HttpPerlModule could help with DB stored configuration). It sounds like it's a good task to develop and contribute to Nginx project !
1
0
0
I know there exists a plugin for nginx to load the config through perl. I was wondering, does anyone have any experience doing this without using a plugin? Possibly a fuse-backed Python script that queries a DB? I would really like to not use the perl plugin, as it doesn't seem that stable.
Running Nginx with a database-backed config file
1.2
1
0
722
19,960,086
2013-11-13T17:11:00.000
3
1
0
0
python,twitter,tweepy
19,960,645
1
false
0
0
As straming API creates a permanent connection, Falling behind technically means that tweets are put in this connection faster than consumed by your client. Solution is straightforward, you have to process tweets faster, that is optimize your landscape. There must be a bottleneck/bottlenecks, identify them and handle ...
1
1
0
I have a python script which reads all tweets about a specific sporting event and enters them into a database. While I was running it this weekend every time a big event occurred in the game the script would stop and I would get an error. It said it was with the code but I don't believe that is the case. I found this o...
Tweepy streaming API falling behind
0.53705
0
1
599
19,962,129
2013-11-13T18:58:00.000
0
1
0
0
python,django,jenkins
25,029,569
2
false
1
0
Check the latest version of original django-jenkins library. It has same unit test discovery method and coverage disabled by default. Coverage could be enabled with --enable-coverage command line option.
1
0
0
I am using django_discover_jenkins module for generating jenkins reports as a part of unit test runs. Has anyone used this before and found it to be slower? The coverage tasks slow this down considerably. How do I remove coverage task from the django_discover_jenkins task set without editing the settings file.
Django Jenkins Test runner - Slow
0
0
0
560
19,962,699
2013-11-13T19:31:00.000
5
0
0
0
python,angularjs,flask,cors,flask-restful
47,288,580
9
false
1
0
Just an update to this comment. Flask CORS is the way to go, but the flask.ext.cors is deprecated. use: from flask_cors import CORS
2
47
0
I've developed a small write-only REST api with Flask Restful that accepts PUT request from a handful of clients that can potentially have changing IP addresses. My clients are embedded Chromium clients running an AngularJS front-end; they authenticate with my API with a simple magic key -- it's sufficient for my very ...
Flask RESTful cross-domain issue with Angular: PUT, OPTIONS methods
0.110656
0
1
58,328
19,962,699
2013-11-13T19:31:00.000
36
0
0
0
python,angularjs,flask,cors,flask-restful
28,923,164
9
false
1
0
You can use the after_request hook: @app.after_request def after_request(response): response.headers.add('Access-Control-Allow-Origin', '*') response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization') response.headers.add('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE') ret...
2
47
0
I've developed a small write-only REST api with Flask Restful that accepts PUT request from a handful of clients that can potentially have changing IP addresses. My clients are embedded Chromium clients running an AngularJS front-end; they authenticate with my API with a simple magic key -- it's sufficient for my very ...
Flask RESTful cross-domain issue with Angular: PUT, OPTIONS methods
1
0
1
58,328
19,962,995
2013-11-13T19:48:00.000
0
0
1
0
python,selenium,beautifulsoup
19,963,148
1
true
0
0
There is no nice solution to do this. It would be the best to use existing mechanisms -- as dependencies defined in setup.py. If you really need to do this, you could execute the corresponding scripts using subprocess.call(): Check whether pip is available. If not, terminate the program. Check whether virtualenv is av...
1
1
0
I have a python.py file that I would like to by able to run on any computer that has python installed. However, the program uses several packages that I installed through pip (BeautifulSoup and Selenium). Is there a way to make a single python file that will automatically incorporate everything it needs from these pack...
Make python file that isn't reliant on installed packages
1.2
0
1
45
19,965,018
2013-11-13T21:45:00.000
9
0
1
0
python,format,decimal
19,965,123
8
false
0
0
Try math.floor(val) == val or val == int(val).
1
32
0
I am using the Decimal library in Python, and printing out the values using format(value, 'f'), where value is a Decimal. I get numbers in the form 10.00000, which reflects the precision on the decimal. I know that float supports is_integer, but there seems to be a lack of a similar API for decimals. I was wondering ...
python Decimal - checking if integer
1
0
0
26,761
19,965,232
2013-11-13T21:57:00.000
1
0
1
0
python,list,python-2.7
19,965,350
4
false
0
0
Your second solution is much less efficient than your first. count and remove both traverse the list, so to remove N copies of an item, you have to traverse the list N+1 times. Whereas the list comprehension only traverses the list once no matter how many copies there are.
1
0
0
Suppose you have a list that is n entries long. This list does not contain uniform data (some entries maybe strings, others integers, or even other lists). Assuming that list contains at least one instance of a given value, what is the fastest to remove all instances in that list? I can think of two, a list comprehens...
What is the fastest way to remove all instances of a particular entry from a list in Python?
0.049958
0
0
125
19,965,270
2013-11-13T22:00:00.000
1
0
1
0
python,django
19,967,173
1
false
0
0
They don't differ in performance at all.
1
1
0
I'm curious about this, from a performance point of view only, how do their differ considering the proper use?
Performance: Class Based Views VS Function Based Views
0.197375
0
0
346
19,965,595
2013-11-13T22:18:00.000
0
0
1
0
python,string,comparison
27,936,479
4
false
0
0
What is the need for using other than '==' as python strings are immutable and memoized by default? As pointed in other answers you can use 'is' for reference(id) comparison.
1
1
0
Can you compare strings in Python in any other way apart from ==? Is there anything like .equals in Java?
Can you compare strings in python like in Java with .equals?
0
0
0
7,329
19,966,996
2013-11-14T00:04:00.000
4
0
1
0
python,python-2.7,matplotlib,ipython
19,967,663
2
true
0
0
I discovered that I needed to use plt.show() rather than plt.draw().
1
3
0
When I run my code from the shell command line, it opens the figure window and displays the plot but as soon as the code is completed it closes it. I do not have any close() statements. How can I prevent figures from closing when running a python script from the command line with ipython? I could add a statement at the...
Prevent figures from closing when running a script from the command line
1.2
0
0
1,138
19,968,985
2013-11-14T03:29:00.000
0
0
0
0
jquery,python,django,autocomplete,django-forms
20,029,341
1
false
1
0
It would be helpful to see the model and form. If you are using a simple charfield in your model and set the choices in the automcomplete class, you should be able to input arbitrary values.
1
0
0
I have a django form element (Musical Instrument) where I'd like to autocomplete from a list of choices (e.g. ['Piano', 'Guitar', 'Drums', 'Bass']), but allow the user to enter something else if it isn't in the list. I'm currently using autocomplete-light, but can swap this for something else if need be. Any ideas?
Autocompleting list of choices with 'other' option in django
0
0
0
59
19,969,687
2013-11-14T04:41:00.000
3
0
0
1
python,linux,centos,mesos
20,348,972
1
false
0
0
you need to have python dev version (headers etc.) try yum install python-devel
1
1
0
I am trying to install mesos on CentOs. I downloaded it and run ./configure command. But couldn't be completed due to installed version of python as mesos requires development version 2.6. I tried to upgrade python but it upgrades to 2.4 only. Then I manually download python 2.6 and install, which is located under /usr...
Python error while configuring mesos on centos
0.53705
0
0
2,608
19,972,936
2013-11-14T08:35:00.000
0
0
0
0
emacs,ipython,tab-completion,linux-mint
19,977,775
3
false
0
0
Start IPython not from pure shell, but from a python-mode. I.e. M-x run-python RET with shipped python.el, having customized python-shell-interpreter accordingly. Resp. M-x IPython RET with python-mode.el
1
5
0
When I run IPython inside emacs in textmode (i.e. inside a terminal), I don't get any tab completion. Rather than given tab completion it jumps four spaces. When I run emacs in normal GUI mode there is fine tab completion. Is there a way to fix that for text mode? I'm using Linux Mint 15, Emacs 24.3 and IPython 1.1.0
No tab completion for IPython in Emacs textmode
0
0
0
2,227
19,975,234
2013-11-14T10:28:00.000
1
1
1
0
python,raspberry-pi,mqtt,mosquitto
19,975,285
2
false
0
0
If you are using pip, use pip freeze | grep 'python-mosquitto' to get the package version, and pip remove python-mosquitto to remove it.
1
0
0
How do I see what is the version of the python-mosquitto package used by my program? How do I find an old version of python-mosquitto (version 0.15) and remove it? I'm running on Raspberry Pi, raspian
how to find python-mosquitto version
0.099668
0
0
3,471