Q_Id
int64
2.93k
49.7M
CreationDate
stringlengths
23
23
Users Score
int64
-10
437
Other
int64
0
1
Python Basics and Environment
int64
0
1
System Administration and DevOps
int64
0
1
DISCREPANCY
int64
0
1
Tags
stringlengths
6
90
ERRORS
int64
0
1
A_Id
int64
2.98k
72.5M
API_CHANGE
int64
0
1
AnswerCount
int64
1
42
REVIEW
int64
0
1
is_accepted
bool
2 classes
Web Development
int64
0
1
GUI and Desktop Applications
int64
0
1
Answer
stringlengths
15
5.1k
Available Count
int64
1
17
Q_Score
int64
0
3.67k
Data Science and Machine Learning
int64
0
1
DOCUMENTATION
int64
0
1
Question
stringlengths
25
6.53k
Title
stringlengths
11
148
CONCEPTUAL
int64
0
1
Score
float64
-1
1.2
API_USAGE
int64
1
1
Database and SQL
int64
0
1
Networking and APIs
int64
0
1
ViewCount
int64
15
3.72M
22,996,507
2014-04-10T18:48:00.000
4
0
0
0
0
python,arrays,numpy,arcgis,arcpy
0
22,996,581
0
2
0
true
0
0
If I understand your description right, you should just be able to do B[A].
1
2
1
0
I have two raster files which I have converted into NumPy arrays (arcpy.RasterToNumpyArray) to work with the values in the raster cells with Python. One of the raster has two values True and False. The other raster has different values in the range between 0 to 1000. Both rasters have exactly the same extent, so both N...
How to search in one NumPy array for positions for getting at these position the value from a second NumPy array?
0
1.2
1
0
0
143
23,001,932
2014-04-11T01:26:00.000
4
0
0
0
0
python,algorithm,count
0
23,001,960
0
1
0
true
0
0
Since all 1's come before the 0's, you can find the index of the first 0 using Binary search algorithm (which is log N) and you just have to do this for all the N rows. So the total complexity is NlogN.
1
1
1
0
Assuming that in each row of the array, all 1's come before the 0's, how would I be able to come up with an (O)nlogn algorithm to count the 1's in the array. I think first I would have to make a counter, search each row for 1's (n), and add that to the counter. Where does the "log n part" come into play? I read that a ...
Counting 1's in a n x n array of 0's and 1's
0
1.2
1
0
0
100
23,014,432
2014-04-11T13:46:00.000
0
0
1
0
0
python,multithreading,performance,multiprocessing
0
23,014,920
0
3
0
false
0
0
In python you want multiprocessing over multithreading. Threads don't do well in Python beacause of the GIL.
1
0
0
0
I've written a script that pulls data from my school's website and I'm having some trouble with execution time. There are over 20 campuses, each with data for three semesters. The script looks up those school names, then the semesters available for each school, then the subjects/departments that are offering classes e...
Performance Improvements with Processes or Threads
1
0
1
0
1
67
23,028,941
2014-04-12T10:07:00.000
3
0
0
1
0
python,sockets,web,tornado
0
23,031,157
0
1
0
true
0
0
You can start multiple servers that share an IOLoop within the same process. Your HTTPServer could listen on one port, and the TCPServer could listen on another.
1
2
0
0
I know the httpserver module in tornado is implemented based on the tcpserver module, so I can write a socket server based on tornado. But how can I write a server that is both a socket server and a web server? For example, if I want to implement a chat app. A user can either login through a browser or a client progra...
How to use tornado as both a socket server and web server?
0
1.2
1
0
1
1,209
23,031,149
2014-04-12T13:42:00.000
0
1
1
0
1
python,python-3.x,raspbian,pycrypto
0
23,031,224
0
1
0
false
0
0
Having looked into it there does not seem to be a pycrypto version for python3 at the moment. I think you're options are to look for an alternative package or to convert your code to python 2. There are tools available which can do this automatically, for example 3to2 is available in pip.
1
0
0
0
I'm trying to install pycrypto for python 3.x.x on raspberry pi but when i run python setup.py install from the command line, it is by default installed to python 2.7.x i have installed python-dev and still with no luck, i have read that using a PIP might help, but unfortunately i don't know how to use it. all my codes...
how to install python package in Raspbian?
0
0
1
0
0
419
23,038,209
2014-04-13T01:48:00.000
0
0
1
1
0
python,python-2.7,enthought,leap-motion
1
24,131,195
0
2
0
false
0
0
Try this: Put the four files into one folder. Right click on the Sample.py until it says "Open with" and gives some choices. Select Python Launcher.app (2.7.6) # This version of Python Launcher must match the Mac built in Python Version. If your version of LeapPython.so is constructed correctly, it should run.
1
0
0
0
I am trying to install the leap motion sdk into Enthought Canapy. The page called Hello World on leap motion mentions i need to put these four files: Sample.py, Leap.py, LeapPython.so and libLeap.dylib into my "current directory". I don't know how to find my current directory. I have tried several things including typi...
Installing Leap Motion sdk into Enthought SDK
0
0
1
0
0
671
23,070,922
2014-04-14T21:37:00.000
0
1
1
1
1
python,chipmunk,pymunk
0
23,200,199
0
1
0
true
0
0
Try and go to the folder where setup.py is first and then do python setup.py install. As you have noticed, it assumes that you run it from the same folder as where its located.
1
1
0
0
I have downloaded pymunk module on my computer. When I typed in "python setup.py install" in terminal, it says "no such file or directory", then I typed in the complete path of setup.py instead of setup.py, and it still could not run since the links to other files in the code of setup.py are not complete paths. (Like R...
Compile pymunk on mac OS X
0
1.2
1
0
0
118
23,088,338
2014-04-15T15:36:00.000
3
0
1
1
0
python
0
51,430,363
0
4
0
false
0
0
You know, you can start python with py -specific version To run a script on interpreter with a specific version you'll just start your script with following parameters, py yourscript.py -version
1
4
0
0
I'm learning python now using a mac which pre-installed python 2.7.5. But I have also installed the latest 3.4. I know how to choose which interpreter to use in command line mode, ie python vs python 3 will bring up the respective interpreter. But if I just write a python script with this header in it "#!/usr/bin/pyth...
how to specify version of python to run a script?
1
0.148885
1
0
0
28,056
23,096,631
2014-04-15T23:59:00.000
0
0
0
0
0
python,bittorrent
0
25,778,457
0
1
0
false
1
0
It's trivial to "break down" files as you put it. You'll need an algorithm to disassemble them, and then to reassemble them later, presumably by a browser since you mentioned HTML and CSS. Bittorrents implements this, and additionally the ability upload and download from a distributed "swarm" of peers also interested i...
1
0
0
0
I am trying to make a program that breaks down files like HTML or CSS into chunks like that of a torrent. I am completely unsure how to do this. They need to be broken down, than later reassembled in order. anybody know how to do this? It doesn't have to be in Python, that was just my starting point.
How do I break down files in a similar way to torrents?
0
0
1
0
0
350
23,097,604
2014-04-16T01:51:00.000
0
1
0
0
0
python,multithreading,buffer,raspberry-pi
0
23,097,644
0
1
1
false
0
1
I don't think that RasPi would work that well running multithreaded programs. Try the first method, though it would be interesting to see the results of a multithreaded program.
1
0
0
0
I apologize in advance for this being a bit vague, but I'm trying to figure out what the best way is to write my program from a high-level perspective. Here's an overview of what I'm trying to accomplish: RasPi takes input from altitude sensor on serial port at 115000 baud. Does some hex -> dec math and updates state ...
How to structure my Python code?
0
0
1
0
0
73
23,098,583
2014-04-16T03:42:00.000
0
0
1
0
1
firefox,ipython,ipython-notebook
1
23,773,427
0
1
0
false
0
0
I found that the problem occurs when changing the cookie preference "Keep until:" " they expire" to "ask me every time" (in Preferences->Privacy->History). As soon as I switch to "they expire" or "I close Firefox" and reload the page with my notebook, it renders as expected and the notebook is shown as running. Creatin...
1
0
0
0
I upgraded from Ipython 1.2.1 to Ipython 2.0. When I try to open an existing notebook or create a new notebook in Firefox, I only get a blank screen. There is no error message in the terminal window that I used to start the notebook server. This happens on CentOs 6.5 with Python 2.7.5 and Firefox 24.4 as well as on Mac...
Opening notebook with Ipython 2.0 in Firefox yields only a blank screen
0
0
1
0
0
247
23,104,754
2014-04-16T09:05:00.000
1
0
1
0
1
c#,visual-studio-2013,ironpython,vsix
0
23,131,781
0
1
0
true
0
0
I would presume that there is a way to include them in the VSIX file and also know where they are on disk - at least, you could use AppDomain.CurrentDomain.GetAssemblies() for find the IronPython assembly and Assembly.Location to find where it is, and hope the VSIX puts the Lib directory near that. (My only experience ...
1
0
0
0
I'm currently writing a Visual Studio extension, which provides scripting capabilities. I'm using IronPython (the newest one), but I have some problems with Python's standard libraries. As I understand, all necessary files reside in the <IronPython folder>\Lib folder. I cannot rely on my users installing IronPython, so...
Embedding IronPython's stdlib in VS extension
1
1.2
1
0
0
110
23,110,542
2014-04-16T13:13:00.000
3
0
1
0
0
python,math
0
23,110,634
0
3
0
true
0
0
With just a single point (and nothing else) you cannot solve such a problem, there are infinitely many lines going through a single point. If you know the angle to x axis then simply m=tan(angle) (you do not need any points to do that, point is only required to figure out c value, which should now be simple). To conver...
3
0
0
0
I understand that the equation for a straight line is: y = (m * x) + c where m is the slope of the line which would be (ydelta/xdelta) but I dont know how to get this value when I only know a single point and an angle rather than two points. Any help is appreciated. Thanks in advance.
How do I find the slope (m) for a line given a point (x,y) on the line and the line's angle from the y axis in python?
0
1.2
1
0
0
928
23,110,542
2014-04-16T13:13:00.000
-1
0
1
0
0
python,math
0
23,110,747
0
3
0
false
0
0
Okay, let's say your point is (x,y)=(1,2) Then you want to solve 2 = m + c. Obviously there is no way you can do this.
3
0
0
0
I understand that the equation for a straight line is: y = (m * x) + c where m is the slope of the line which would be (ydelta/xdelta) but I dont know how to get this value when I only know a single point and an angle rather than two points. Any help is appreciated. Thanks in advance.
How do I find the slope (m) for a line given a point (x,y) on the line and the line's angle from the y axis in python?
0
-0.066568
1
0
0
928
23,110,542
2014-04-16T13:13:00.000
0
0
1
0
0
python,math
0
23,111,191
0
3
0
false
0
0
The equation of a line is y = mx + c. You are given a point on this line, and the angle of this line from the y-axis. The gradient m will be math.cot(angle_in_radians). The x and y values will be the same as your given point. To find c, simply evaluate y - mx.
3
0
0
0
I understand that the equation for a straight line is: y = (m * x) + c where m is the slope of the line which would be (ydelta/xdelta) but I dont know how to get this value when I only know a single point and an angle rather than two points. Any help is appreciated. Thanks in advance.
How do I find the slope (m) for a line given a point (x,y) on the line and the line's angle from the y axis in python?
0
0
1
0
0
928
23,117,242
2014-04-16T18:21:00.000
0
0
1
0
1
python-2.7,opencv,opensuse,undefined-symbol
0
25,503,548
0
1
0
false
0
0
Not exactly a prompt answer (nor a direct one). I had the same issue and (re)installing various dependencies didn't help either. Ultimately, I cloned (from git) and compiled opencv (which includes the cv2.so library) from scratch, replaced the old cv2.so library and got it to work. Here is the git repo: https://github....
1
0
1
0
I'm using OpenSUSE 13.1 64-bit on an Lenovo ThinkPad Edge E145. I tryed to play a bit around with Python(2.7) and Python-OpenCV(2.4). Both is installed by using YAST. When i start the Python-Interactive-Mode (by typing "python") and try to "import cv" there are 2 things that happen: case 1: "import cv" --> End's up wit...
Python OpenCV "ImportError: undefined Symbol" or Memory Access Error
0
0
1
0
0
892
23,128,964
2014-04-17T09:07:00.000
0
0
0
0
0
python,django,python-2.7,google-analytics-api,http-status-code-403
0
29,837,598
0
3
0
false
1
0
You should use View ID Not account ID, the 'View ID', you can go: Admin -> Select Site -> Under "View" -> View Settings , if it doesn't works you can go: Admin->Profiles->Profile Settings
2
3
0
0
I am trying to access data from google-analytics. I am following the guide and is able to gauthorize my user and get the code from oauth. When I try to access data from GA I only get 403 Insufficient Permission back. Do I somehow have to connect my project in Google API console to my analytics project? How would I do ...
Google Analytics reports API - Insufficient Permission 403
1
0
1
0
1
5,740
23,128,964
2014-04-17T09:07:00.000
9
0
0
0
0
python,django,python-2.7,google-analytics-api,http-status-code-403
0
24,274,077
0
3
0
true
1
0
Had the same problem, but now is solved. Use View ID Not account ID, the 'View ID', can be found in the Admin->Profiles->Profile Settings tab UPDATE now, if you have more a account , you must go: Admin -> Select account -> under View-> click on View Settings
2
3
0
0
I am trying to access data from google-analytics. I am following the guide and is able to gauthorize my user and get the code from oauth. When I try to access data from GA I only get 403 Insufficient Permission back. Do I somehow have to connect my project in Google API console to my analytics project? How would I do ...
Google Analytics reports API - Insufficient Permission 403
1
1.2
1
0
1
5,740
23,147,008
2014-04-18T03:41:00.000
0
0
1
0
1
python,tree,family-tree
0
34,161,376
0
2
0
true
0
0
After searching a lot, I found that the Graph ADT suits the above problem better. Since a family has relations over a wide span in all directions, using a graph ADT would be conventional. Each node can store details about a person. Node can consist of parent node links, and some functionalities to find rel...
1
1
0
0
I ve recently started with python and am working on building a Family tree using python. My idea is that the tree should grow in both sides, i.e) both the older generations as well as younger generations can be added to the same tree. I tried implementing with Binary tree ADT and N-ary tree ADT, but that doesn't work ...
Creating Family Trees Using Python
0
1.2
1
0
0
5,025
23,154,120
2014-04-18T12:26:00.000
0
0
0
0
0
python,facebook,google-app-engine,authentication,google-cloud-endpoints
0
23,223,929
0
1
0
true
1
0
For request details, add 'HttpServletRequest' (java) to your API function parameter. For Google authentication, add 'User' (java) to your API function parameter and integrate with Google login on client. For twitter integration, use Google app-engine OpenID. For facebook/loginForm, its all on you to develop a custom au...
1
1
0
1
I'm trying to implement a secure google cloud endpoint in python for multi-clients (js / ios / android) I want my users to be able to log by three ways loginForm / Google / Facebook. I read a lot of docummentation about that but I didn't realy understood how I have to handle connection flow and session (or something el...
google endpoint custom auth python
0
1.2
1
0
1
95
23,166,158
2014-04-19T05:16:00.000
17
1
0
1
0
python,amazon-web-services,ssh,amazon-ec2
0
23,166,196
0
2
0
false
1
0
You can run the program using the nohup command, so that even when the SSH session closes your program continues running. Eg: nohup python yourscriptname.py & For more info you can check the man page for it using man nohup.
1
13
0
0
I have a python script that basically runs forever and checks a webpage every second and notifies me if any value changes. I placed it on an AWS EC2 instance and ran it through ssh. The script was running fine when I checked after half an hour or so after I started it. The problem is that after a few hours when I chec...
Make python script to run forever on Amazon EC2
0
1
1
0
0
8,060
23,166,386
2014-04-19T05:45:00.000
0
0
1
1
0
python
0
23,376,739
0
1
0
false
0
0
I simply replaced the executable link in my IDE from "/usr/bin/python" to "/Library/Frameworks/Python.framework/Versions/3.4/bin".
1
1
0
0
I have Python 2.7.5 running on OS X 10.9.2. I downloaded the Python installer "python-3.4.0-macosx10.6.dmg" from python.org. After the installation, I still get 2.7.5 when querying python -V. I am not sure what I need to do to replace 2.7.5 with 3.4 besides installing python-3.4.0-macosx10.6.dmg.
Replacing Python 2.7.5 with Python 3.4 on OS X 10.9.2
0
0
1
0
0
312
23,173,427
2014-04-19T17:49:00.000
1
0
0
0
0
python,networkx
1
23,183,710
0
1
0
false
0
0
To generate trees with more nodes it is only needed to increase the "number of tries" (parameter of random_powerlaw_tree). 100 tries is not enough even to have a tree with 11 nodes (it gives an error). For example, with 1000 tries I manage to generate trees with 100 nodes, using networkX 1.8.1 and python 3.4.0
1
1
1
0
I am trying to use one of the random graph-generators of NetworkX (version 1.8.1): random_powerlaw_tree(n, gamma=3, seed=None, tries=100) However, I always get this error File "/Library/Python/2.7/site-packages/networkx/generators/random_graphs.py", line 840, in random_powerlaw_tree "Exceeded max (%d) attempts for a va...
Parameters to let random_powerlaw_tree() generate trees with more than 10 nodes
0
0.197375
1
0
0
451
23,184,702
2014-04-20T16:17:00.000
0
0
0
1
0
python,google-app-engine,app.yaml,xhtml2pdf
1
23,335,617
0
1
0
false
1
0
I got it now! Don't use XHTML2PDF - use ReportLab on its own instead.
1
0
0
0
I am new to GAE, web dev and python, but am working my way up. I have been trying to get xhtml2pdf working on GAE for some time now but have had no luck. I have downloaded various packages but keep getting errors of missing modules. These errors vary depending on what versions of these packages and dependencies I use...
How do I get xhtml2pdf working on GAE?
0
0
1
0
0
113
23,190,913
2014-04-21T04:42:00.000
0
1
1
0
0
python,variables,cgi,text-files
0
23,190,978
0
1
0
true
0
0
Traditionally this is done using cookies or hidden form fields.
1
0
0
0
I want to pass a variable in one python cgi script to other cgi script? how can i do this as in php. using url or something...? i saved variable in text file, thus read and get saved variable when other page load Is this method good?
How to pass variable in one .py cgi to other python cgi script
0
1.2
1
0
0
241
23,191,241
2014-04-21T05:16:00.000
1
0
0
1
0
python,cygwin,bottle
0
23,191,551
0
1
0
true
0
0
Since you get a connection refused error, the best I can think of is that this is a browser issue. Try editing the LAN settings on your Chrome browser to bypass proxy server for local address.
1
1
0
0
I am running python 2.7 + bottle on cygwin and I wanted to access a sample webpage from chrome. I am unable to access the website running on http://localhost:8080/hello but when I do a curl within cygwin I am able to access it. Error Message when accessing through Chrome Connection refused Description: Connection refus...
Accessing localhost from windows browser
0
1.2
1
0
1
1,043
23,237,444
2014-04-23T07:17:00.000
4
0
1
0
0
python,mysql,database,class,oop
0
23,237,519
0
1
0
false
0
0
Would a Class be better for this? Probably not. Classes are useful when you have multiple, stateful instances that have shared methods. Nothing in your problem description matches those criteria. There's nothing wrong with having a script with a handful of functions to perform simple data transfers (extract, transfor...
1
3
0
0
I searched around and couldn't really find any information on this. Basically i have a database "A" and a database "B". What i want to do is create a python script (that will likely run as a cron job) that will collect data from database "A" via sql, perform an action on it, and then input that data into database "B". ...
Collecting Data from Database, functions vs classes
0
0.664037
1
1
0
156
23,246,013
2014-04-23T13:34:00.000
1
0
0
0
1
python,numpy,fits,pyfits
0
23,254,015
0
1
0
false
0
0
The expression data.field[('zquality' > 2) & ('pgal'==3)] is asking for fields where the string 'zquality' is greater than 2 (always true) and where the string 'pgal' is equal to 3 (also always false). Actually chances are you're getting an exception because data.field is a method on the Numpy recarray objects that PyF...
1
0
1
0
I have opened a FITS file in pyfits. The HEADER file reads XTENSION='BINTABLE' with DIMENSION= 52989R x 36C with 36 column tags like, 'ZBEST', 'ZQUALITY', 'M_B', 'UB', 'PGAL' etc. Now, I have to choose objects from the data with 'ZQUALITY' greater than 2 & 'PGAL' equals to 3. Then I have to make a histogram for the 'ZB...
Condtionally selecting values from a Numpy array returned from PyFITS
0
0.197375
1
0
0
229
23,258,176
2014-04-24T01:28:00.000
0
1
1
0
0
java,python,c++,compilation,translation
0
23,258,361
0
1
0
false
0
0
All of the translation process is done when you compile a Java program. This is no different than compiling a C++ program or any other compiled language. The biggest difference is that this translation is targeted to the Java Byte Code language rather than assembly or machine language. The Byte Code undergoes its own t...
1
4
0
0
So my question today is about the translation process of Java. I understand the general translation process itself but I am not too sure how it applies to Java. Where does the lexical analysis take place? When is symbol table created? When is the syntax analysis and how is the syntax tree created? From what I have alr...
What is the Translastion Process of Java?
0
0
1
0
0
954
23,262,767
2014-04-24T07:41:00.000
0
1
0
0
0
python,ldap
0
23,263,099
0
1
0
false
0
0
You are right, there is an ongoing communication between your workstation and the Active Directory server, which can use LDAP protocol. Since I don't know what you tried so far, I suggest that you look into the python module python-ldap. I have used it in the past to connect, query and modify information on Active-Dire...
1
0
0
1
When I logon to my company's computer with the AD username/password, I find that my Outlook will launch successfully. That means the AD authentication has passed. In my opinion, outlook retrieves the AD user information, then sends it to an LDAP server to verify. But I don't know how it retrieves the information, or by...
How does auto-login Outlook successfully when in AD environment?
0
0
1
0
1
104
23,268,179
2014-04-24T11:55:00.000
1
0
0
0
0
python,sql,qt,pyqt
0
23,281,662
0
2
0
false
0
1
This question is a bit broad, but I'll try answering it anyway. Qt does come with some models that can be connected to a database. Specifically classes like QSqlTableModel. If you connect such a model to your database and set it as the model for a QTableView it should give you most of the behavior you want. Unfortunate...
1
1
0
0
I have made a database file using SQL commands in python. i have used quite a lot of foreign keys as well but i am not sure how to display this data onto qt with python? any ideas? i would also like the user to be able to add/edit/delete data
How to display data from a database file onto pyqt so that the user can add/delete/edit the data?
0
0.099668
1
1
0
4,532
23,288,911
2014-04-25T09:14:00.000
1
0
0
0
0
python,html,django
0
23,297,917
0
1
0
true
1
0
Part of your page that contains the paragraph tags is a piece of JavaScript that contains a timer. Every once in a while it does an Ajax request to get the data with regard to "what's going on now in the system". If you use the Ajax facilites of JQuery, which is probably the easiest, you can pass a JavaScript callback ...
1
0
0
0
I am developing a project on Python using Django. The project is doing lot of work in the background so i want to notify users what's going on now in the system. For this i have declared a p tag in HTML and i want to send data to it. I know i can do this by templates but i am little confused as 5 functions need to pas...
Pass Data From Python To Html Tag
1
1.2
1
0
0
117
23,306,361
2014-04-26T03:40:00.000
1
0
0
0
0
python,proxy
0
23,442,148
0
1
0
false
0
0
In mitmproxy 0.10, a flow object is passed to the response handler function. You can access both flow.request and flow.response.
1
0
0
0
I am trying to write my own proxy extensions. Both, burp suite as well as mitmproxy allows us to write extensions. Till now, I am successful with intercepting the request and response headers, and write it to my own output file. The problem is, I get frequent requests and responses at anonymous time and at the same ti...
how to identify http response belongs to which particular request through python?
1
0.197375
1
0
1
175
23,311,233
2014-04-26T13:00:00.000
1
0
1
1
0
python,service
0
23,311,785
0
1
0
true
0
0
The communication with daemons is usually done by signals. You can use userdefined signals or SIGSTOP(17) and SIGCONT(19) to pause and continue your daemon.
1
0
0
0
I am writing a python 'sensor'. The sensor spawns two children, one that reads in data and the other processes and outputs the data in db format. I need to run it in the background with the ability to start, stop pretty much as a service/daemon. I've looked at various options: daemonizing, init scripts etc. The problem...
Python pseudo service
0
1.2
1
0
0
48
23,319,138
2014-04-27T03:43:00.000
0
1
0
1
0
python,hash,routing
0
69,093,482
0
2
0
false
0
0
Typical algorithms split the traffic into semi-even groups of N pkts, where N is the number of ECMP links. So if the pkt sizes differ, or if some "streams" have more pkts than others, the overall traffic rates will not be even. Some algorithms factor for this. Breaking up or moving strean is bad (for many reasons). ...
1
0
0
0
I would like to know , how an ECMP and hash mapping are used in load balancing or routing of a tcp packet .Any help with links,examples or papers would be really useful. Sorry for the inconvinience , as I am completely new to this type of scenario. Thanks for your time and consideration.
Hash Mapping and ECMP
0
0
1
0
0
460
23,326,430
2014-04-27T17:13:00.000
1
0
0
0
0
python,r,algorithm
1
23,326,609
0
1
0
false
0
0
Sort the points, group them by value, and try all <=2n+1 thresholds that classify differently (<=n+1 gaps between distinct data values including the sentinels +-infinity and <=n distinct data values). The latter step is linear-time if you try thresholds lesser to greater and keep track of how many points are misclassif...
1
0
1
0
I have a set of {(v_i, c_i), i=1,..., n}, where v_i in R and c_i in {-1, 0, 1} are the discrimination value and label of the i-th training example. I would like to learn a threshold t so that the training error is the minimum when I declare the i-th example has label -1 if v_i < t, 0 if v_i=t, and 1 if v_i>t. How ca...
learn a threshold from labels and discrimination values?
1
0.197375
1
0
0
72
23,327,609
2014-04-27T18:58:00.000
1
0
0
0
0
javascript,jquery,python,ajax
0
23,328,225
0
1
0
true
1
0
You can use jQuery, which gives you a very simple way to do that: $.post( "yourpage.html", $('form').serialize() + "&ajax=true", function(response) { $('#results').html(response); }); Server side, detect if ajax is true and then return only the query results instead of the whole page. They will be saved in the elem...
1
0
0
0
I have a web page with a form each time a form is submitted same page loads but with different data relevant to the query. On the back-end i am using python for finding data relevant to query. I want to process all this with ajax as back-end process needs more time so i need to show status to the user i -e whats going ...
Refresh same page with ajax with different data
1
1.2
1
0
0
540
23,329,034
2014-04-27T21:10:00.000
0
0
1
1
0
python,macos,python-2.7,twisted
0
40,758,241
0
4
0
false
0
0
I too was getting a ImportError: No module named xxxeven though I did a pip install xxx and pip2 install xxx. pip2.7 install xxx worked for me. This installed it in the python 2.7 directory.
1
10
0
0
Hello I'm trying to run twisted along with python but python cannot find twisted. I did run $pip install twisted successfully but it is still not available. ImportError: No module named twisted.internet.protocol It seems that most people have $which python at /usr/local/bin/python but I get /Library/Frameworks/Pytho...
Python OSX $ which Python gives /Library/Frameworks/Python.framework/Versions/2.7/bin/python
0
0
1
0
0
35,517
23,366,047
2014-04-29T13:27:00.000
0
0
1
0
0
python,read-write
0
23,366,357
0
2
0
false
0
0
You can use SQLite or Pickle module instead, to allow easier data retrieval/manipulation from multiple programs/scripts.
1
2
0
0
I have a program that imports a .py file that contains lists and dictionaries and uses them in the program. I am making another program that's purpose is to change the lists and dictionaries in this database .py file (either adding or removing parts of the lists/dictionaries). How would I go about doing this? Do i need...
Modifying a .py file within Python
0
0
1
0
0
3,423
23,374,854
2014-04-29T20:42:00.000
0
1
1
0
1
c#,python,ipc
0
62,980,335
0
2
1
false
0
0
Based on the what you have said, you can connect to the python process and catch standard output text. Easy, fast and reliable!
1
5
0
0
I have some C# code that needs to call a Python script several thousand times, each time passing a string, and then expecting a float back. The python script can be run using ANY version of Python, so I cannot use Iron python. It's been recommended that I use IPC named pipes. I have no experience with this, and am havi...
Simplest way to communicate between Python and C# using IPC?
0
0
1
0
0
9,440
23,388,647
2014-04-30T12:53:00.000
1
0
0
0
1
python,sqlite,pygtk
0
23,389,055
0
1
0
true
0
1
AFAIK, WinXP supports setlocale just fine. If you want to do locale-aware conversions, try using locale.atof('2,34') instead of float('2,34').
1
0
0
0
I'm trying to use the data collected by a form I to a sqlite query. In this form I've made a spin button which gets any numeric input (ie. either2,34 or 2.34) and sends it in the form of 2,34 which python sees as str. I've already tried to float() the value but it doesn't work. It seems to be a locale problem but someh...
pygtk spinbutton "greek" floating point
0
1.2
1
1
0
48
23,393,456
2014-04-30T16:31:00.000
0
0
0
0
0
python,machine-learning,statistics,categorization
0
23,421,883
0
1
0
true
0
0
The principled way to do this is to assign probabilities to different model types and to different parameters within a model type. Look for "Bayesian model estimation".
1
0
1
0
My problem is as follows: I am given a number of chi-squared values for the same collection of data sets, fitted with different models. (so, for example, for 5 collections of points, fitted with either a single binomial distribution, or both binomial and normal distributions, I would have 10 chi-squared values). I woul...
Categorizing points using known distributions
0
1.2
1
0
0
52
23,396,807
2014-04-30T19:47:00.000
1
0
0
0
0
python,nlp,nltk
0
23,396,854
0
1
0
false
0
0
In short "you cannot". This task is far beyond simple text processing which is provided with NLTK. Such objects relations sentiment analysis could be the topic of the research paper, not something solvable with a simple approach. One possible method would be to perform a grammar analysis, extraction of the conceptual r...
1
0
1
0
I'm using NLTK to extract named entities and I'm wondering how it would be possible to determine the sentiment between entities in the same sentence. So for example for "Jon loves Paris." i would get two entities Jon and Paris. How would I be able to determine the sentiment between these two entities? In this case shou...
How to determine the "sentiment" between two named entities with Python/NLTK?
0
0.197375
1
0
0
301
23,399,888
2014-04-30T23:38:00.000
1
0
1
0
1
python,path,console,ipython
1
23,588,025
1
2
0
true
0
0
I am pulling the answer out of the comments. Point your PATH system variable to the correct version of Python. This is accomplished (on Windows) by going to System Properties -> Advanced -> Environment Variables. If you already have a Python directory in there, modify it to the correct, new path. Otherwise, append it t...
1
0
0
0
I've been using ipython notebook with console2 for a while now and recently installed a different version of python and now my console is giving me an error saying "No module named IPython". I think the path has been changed or something, but I don't know how to fix it. Any help is greatly appreciated!
ipython console2 no module named Ipython
0
1.2
1
0
0
1,050
23,426,916
2014-05-02T11:20:00.000
1
0
0
0
0
python,django,mezzanine,cartridge
0
23,427,146
0
1
0
true
1
0
The products most likely aren't published, but can be previewed by an authenticated administrator. Check the "status" and "published from" fields for each product.
1
0
0
0
I am trying to develop a small project to learn how mezzanine and cartridge work. I have the problem that items in the shop are listed only if I am logged in, while I'd like to be able to show them to unauthorized users. Is there a setting that has to be toggled?
Products are not shown if the user is not logged in
0
1.2
1
0
0
56
23,440,391
2014-05-03T04:49:00.000
0
0
0
1
0
python,sublimetext2
0
23,440,406
0
2
0
false
0
0
Just add raw_input("Press ENTER to exit") and it will "pause" until you press a key. You should be able to add this line anywhere and as often as needed.
1
0
0
0
I was learning python use sublime text2 dev. when I code "hello world" and build it, the "cmd"window appears and disappears in a moment. I want to make the output hold on,but I don't know how. help me, thank you.
how to prevent the window from self-close when building program in sublime
0
0
1
0
0
302
23,454,521
2014-05-04T09:16:00.000
0
1
0
0
0
python,linux,web,flask,raspberry-pi
0
23,454,864
0
2
0
false
1
0
Best practice is to never do this kind of thing. If you are giving sudo access to your pi from internet and then executing user input you are giving everyone in the internet the possibility of executing arbitrary commands in your system. I understand that this is probably your pet project, but still imagine someone get...
1
0
0
0
I have created a web-app using Python Flask framework on Raspberry Pi running Raspbian. I want to control the hardware and trigger some sudo tasks on the Pi through web. The Flask based server runs in non-sudo mode listening to port 8080. When a web client sends request through HTTP, I want to start a subprocess with s...
How to start a privileged process through web on the server?
0
0
1
0
0
166
23,468,132
2014-05-05T08:33:00.000
0
0
0
0
0
python,django,mercurial
0
23,479,318
0
1
0
false
1
0
This is something you should fix at the web application level, not at the Mercurial level. If you're fine with having people wait you set up a distributed locking scheme where the web worker thread tries to acquire a repository-specific lock from shared memory/storage before taking any actions. If it can't acquire th...
1
0
0
0
Our Django project provides interfaces to users to create repository create new repo add new changes to existing repo Any user can access any repo to make changes directly via an HTTP POST containing changes. Its totally fine if the traffic is less. But if the traffic increases up to the point that multiple users wan...
Django: Atomic operations on a directory in media storage
0
0
1
0
0
37
23,513,981
2014-05-07T09:31:00.000
0
0
0
1
0
python,github
0
23,514,046
0
3
0
false
0
0
.sh is a shell script, you can just execute it. ./setup.sh
2
0
0
0
I have downloaded and unzip the cabot(python tool) in my linux system.But then I don't know how to install it.In the cabot folder there is setup.sh file. But when I put build or install it is not working.So What to do?
How to install cabot in linux
0
0
1
0
0
1,740
23,513,981
2014-05-07T09:31:00.000
0
0
0
1
0
python,github
0
23,514,107
0
3
0
false
0
0
It's an ".sh" file right? Then to run the same what you have to do is :- 1)Open Terminal 2)Change directory to file location 3) run the following command. sh setup.sh
2
0
0
0
I have downloaded and unzip the cabot(python tool) in my linux system.But then I don't know how to install it.In the cabot folder there is setup.sh file. But when I put build or install it is not working.So What to do?
How to install cabot in linux
0
0
1
0
0
1,740
23,515,224
2014-05-07T10:26:00.000
1
1
0
1
0
python,linux
0
23,515,529
0
1
0
true
0
0
If you are using logrotate for log rotation then it has options to remove old files, if not you could run something as simple as this once a day in your cron: find /path/to/log/folder -mtime +5 -type f -exec rm {} \; Or more specific match a pattern in the filename find . -mtime +5 -type f -name *.log -exec ls -l ...
1
0
0
0
I have two questions about using crontab file: 1.I am using a service. When it runs, a new log file created everyday in a log directory. i want to delete all files that already exist greater 5 day in that log directory 2.I want to delete all the infomation that exist greater than 5 days in a log file( /var/log/syslog) ...
How to delete some file with crontab in linux
0
1.2
1
0
0
374
23,526,579
2014-05-07T19:25:00.000
1
0
0
0
0
python,scrapy,scrapyd
0
24,659,705
0
1
0
false
1
0
Maybe you should do a cron job that executes every three hours and performs a curl call to Scrapyd to schedule the job.
1
0
0
0
I want to make my spider start every three hours. I have a scrapy confinguration file located in c:/scrapyd folder. I changed the poll_interval to 100 the spider works, but it didn't repeat each 100 seconds. how to do that please?
scrapyd pool_intervel to scheduler a spider
0
0.197375
1
0
1
215
23,531,555
2014-05-08T02:09:00.000
0
1
0
0
1
python,emacs,virtualenv,org-mode
1
23,557,258
0
1
0
false
1
0
Reads like a bug, please consider reporting it at emacs-orgmode@gnu.org As a workaround try setting the virtualenv at the Python-side, i.e. give PYTHONPATH as argument. Alternatively, mark the source-block as region and execute it the common way, surpassing org
1
1
0
0
I'm running into a few issues on my Emacs + Org mode + Python setup. I thought I'd put this out there to see if the community had any suggestions. Virtualenv: I'm trying to execute a python script within a SRC block using a virtual environment instead of my system's python implementation. I have a number of libraries i...
Run python from virtualenv in org file & HTML5 export in org v.7.9.3
0
0
1
0
0
510
23,551,808
2014-05-08T20:24:00.000
3
0
0
1
0
python,django,architecture,celery
0
23,846,005
0
2
0
false
1
0
Celery actually makes this pretty simple, since you're already putting the tasks on a queue. All that changes with more workers is that each worker takes whatever's next on the queue - so multiple workers can process at once, each on their own machine. There's three parts to this, and you've already got one of them. S...
2
1
0
0
Currently we have everything setup on single cloud server, that includes: Database server Apache Celery redis to serve as a broker for celery and for some other tasks etc Now we are thinking to break apart the main components to separate servers e.g. separate database server, separate storage for media files, web ser...
django-celery infrastructure over multiple servers, broker is redis
0
0.291313
1
0
0
2,804
23,551,808
2014-05-08T20:24:00.000
4
0
0
1
0
python,django,architecture,celery
0
23,552,055
0
2
0
false
1
0
What will strongly simplify your processing is some shared storage, accessible from all cooperating servers. With such design, you may distribute the work among more servers without worrying on which server will be next processing step done. Using AWS S3 (or similar) cloud storage If you can use some cloud storage, lik...
2
1
0
0
Currently we have everything setup on single cloud server, that includes: Database server Apache Celery redis to serve as a broker for celery and for some other tasks etc Now we are thinking to break apart the main components to separate servers e.g. separate database server, separate storage for media files, web ser...
django-celery infrastructure over multiple servers, broker is redis
0
0.379949
1
0
0
2,804
23,567,726
2014-05-09T14:53:00.000
2
0
0
0
1
python,qt,pyqt,pyqtgraph
0
23,572,444
0
1
0
false
0
1
It's likely you have items in the scene that accept their own mouse input, but it's difficult to say without seeing code. In particular, be wary of complex plot lines that are made clickable--it is very expensive to compute the intersection of the mouse cursor with such complex shapes. The best (some would say only) w...
1
0
0
0
I have a multi-threaded (via pyqt) application which plots realtime data (data is processed in the second thread and passed to the gui thread to plot via a pyqt-signal). If I place the mouse over the application it continues to run at full speed (as measured by the time difference between calls to app.processEvents())....
PYQTGraph application slows down when mouse moves over application
0
0.379949
1
0
0
742
23,572,471
2014-05-09T19:27:00.000
1
0
1
1
0
python,nltk,python-idle
1
23,572,642
0
2
0
false
0
0
Supplementing the answer above, when you install python packages they will install under the default version of python you are using. Since the module imports in python 2.7.6 make sure that you aren't using the Python 3 version of IDLE.
1
1
0
0
Programming noob here. I'm on Mac OS 10.5.8. I have Python 2.7.6 and have installed NLTK. If I run Python from Terminal, I can "import nltk" with no problem. But if I open IDLE (either from Terminal or by double-clicking on the application) and try the same thing there, I get an error message, "ImportError: No module n...
How do I get IDLE to find NLTK?
0
0.099668
1
0
0
2,634
23,577,208
2014-05-10T04:49:00.000
0
0
1
0
0
javascript,ipython,ipython-notebook
0
61,441,244
0
3
0
false
0
0
as now in 5.7.4 version shortcut to create cell above is esc + a
1
1
0
0
I upgraded to IPython 2.0 today. Alot of changes seem good, but the button to insert a new cell, above/below seems to be gone. The option is still in the menu, and I believe the keyboard short cut works. But the button is gone. I'm sure there is a way to turn it back on, but the documentation for the new version doesn'...
IPython 2.0 Notebook: where has the "Add Cell Above" button gone, and how do I get it back?
1
0
1
0
0
826
23,583,017
2014-05-10T15:40:00.000
0
0
1
0
0
python,debugging,exception,web2py,pycharm
1
23,634,516
0
1
0
true
1
0
I figured this out by looking through the web2py source code. Apparently, web2py is set up to do what I want to do for a particular debugger, seemingly called Wing Db. There's a constant env var ref in the code named WINGDB_ACTIVE that, if set, redirects exceptions to an external debugger. All I had do to was define ...
1
0
0
0
I'm just starting to build a web app with web2py for the first time. It's great how well PyCharm integrates with web2py. One thing I'd like to do, however, is avoid the web2py ticketing system and just allow exceptions to be caught in the normal way in PyCharm. Currently, any attempt to catch exceptions, even via an ...
Can web2py be made to allow exceptions to be caught in my PyCharm debugger?
1
1.2
1
0
0
95
23,587,568
2014-05-10T23:57:00.000
5
0
1
0
0
python,algorithm,list,frequency
0
23,587,628
0
5
0
false
0
0
Why not have two lists, one for questions not yet picked and one for questions that have been picked. Initially, the not-yet-picked list will be full, and you will pick elements from it which will be removed and added to the picked list. Once the not-yet-picked list is empty, repeat the same process as above, this time...
2
4
0
0
I am building a quiz application which pulls questions randomly from a pool of questions. However, there is a requirement that the pool of questions be limited to questions that the user has not already seen. If, however, the user has seen all the questions, then the algorithm should "reset" and only show questions t...
Efficient algorithm for determining values not as frequent in a list
1
0.197375
1
0
0
314
23,587,568
2014-05-10T23:57:00.000
0
0
1
0
0
python,algorithm,list,frequency
0
23,587,653
0
5
0
false
0
0
Let's define a "pivot" that separates a list into two sections. The pivot partitions the array such that all numbers before the pivot has been picked one more than the numbers after the pivot (or more generally, all numbers before pivot are ineligible for picking, while all numbers after the pivot are eligible for pick...
2
4
0
0
I am building a quiz application which pulls questions randomly from a pool of questions. However, there is a requirement that the pool of questions be limited to questions that the user has not already seen. If, however, the user has seen all the questions, then the algorithm should "reset" and only show questions t...
Efficient algorithm for determining values not as frequent in a list
1
0
1
0
0
314
23,595,346
2014-05-11T16:53:00.000
1
0
1
0
0
python
0
23,595,617
0
2
0
false
0
0
Both python 2.7 and python 3 coexist on one machine happily. If you name the scripts .py for those you would like to run with python 2.3 and .py3 for those that you would like to run with python3 then you can just invoke the scripts by typing their names or by double clicking. These associations are set up by default ...
1
0
0
0
I have two versions of Python installed in my computer, Python 3.4 and Python 2.7, and I use both of these installations. When I run a script, how do I choose which versions I want to use? May I rename the names of the executables for that (Python.exe -> Python27.exe)? Thanks.
Multiple Python versions in one computer (windows 7)
0
0.099668
1
0
0
327
23,610,748
2014-05-12T13:44:00.000
4
0
0
1
0
python,google-app-engine
0
23,612,408
0
1
0
true
1
0
There's no 100% sure way to assess the number of frontend instance hours. An instance can serve more than one request at a time. In addition, the algorithm of the scheduler (the system that starts the instances) is not documented by Google. Depending on how demanding your code is, I think you can expect a standard F1 i...
1
0
0
1
We are developing a Python server on Google App Engine that should be capable of handling incoming HTTP POST requests (around 1,000 to 3,000 per minute in total). Each of the requests will trigger some datastore writing operations. In addition we will write a web-client as a human-usable interface for displaying and an...
GAE: how to quantify Frontend Instance Hours usage?
0
1.2
1
0
0
1,362
23,613,260
2014-05-12T15:37:00.000
1
0
0
0
1
javascript,python,css,selenium
1
23,649,576
0
1
0
true
0
0
Overflow takes only one of five values (overflow: auto | hidden | scroll | visible | inherit). Use visible
1
1
0
0
I am trying to use Python Selenium to click a button on a webpage, but Selenium is giving exception "Element is not currently visible and so may not be interacted with". The DOM structure is quite simple: <body style="overflow: hidden;"> ... <div aria-hidden="false" style="display: block; ..."> ... ...
How to check what is causing a web element to be invisible to Python Selenium?
0
1.2
1
0
1
1,022
23,623,717
2014-05-13T05:54:00.000
0
0
0
0
0
python,python-2.7,ubuntu,graphviz
1
34,070,637
0
2
0
false
0
0
This is a bug in latest ubuntu xdot package, please use xdot in pip repository: sudo apt-get remove xdot sudo pip install xdot
1
0
1
0
Lately I have observed that xdot utility which is implemented in python to view dot graphs is giving me following error when I am trying to open any dot file. File "/usr/bin/xdot", line 4, in xdot.main() File "/usr/lib/python2.7/dist-packages/xdot.py", line 1947, in main win.open_file(args[0]) File "/usr/lib/pytho...
Graphviz xdot utility fails to parse graphs
0
0
1
0
0
1,384
23,645,572
2014-05-14T04:19:00.000
5
0
0
1
0
python,django,google-app-engine
0
23,646,875
0
1
0
true
1
0
In simple words these are two versions of datastore . db being the older version and ndb the newer one. The difference is in the models, in the datastore these are the same thing. NDB provides advantages like handling caching (memcache) itself. and ndb is faster than db. so you should definitely go with ndb. to use ndb...
1
2
0
0
I have been going through the Google App Engine documentation (Python) now and found two different types of storage. NDB Datastore DB Datastore Both quota limits (free) seem to be same, and their database design too. However NDB automatically cache data in Memcache! I am actually wondering when to use which storage?...
App Engine: Difference between NDB and Datastore
0
1.2
1
1
0
568
23,646,485
2014-05-14T05:42:00.000
1
1
0
0
1
python,pyramid,mako,waitress
0
23,654,584
1
2
0
false
1
1
Oh my, I found the thing... I had <%block cached="True" cache_key="${self.filename}+body"> and the file inclusion was inside of that block. Cheerious:)
1
0
0
0
I've a strange issue. pserve --reload has stopped reloading the templates. It is reloading if some .py-file is changing, but won't notice .mak-file changes anymore. I tried to fix it by: Checking the filepermissions Creating the new virtualenv, which didn't help. Installing different version of mako without any effec...
Pyramid Mako pserver --reload not reloading in Mac
0
0.099668
1
0
0
216
23,680,786
2014-05-15T14:12:00.000
2
0
1
0
0
python,ipython
0
30,603,070
0
1
0
false
0
0
If you are connected to the kernel via the IPython console client and are on a Unix-like OS, you can detach using Ctrl-\
1
4
0
0
Can someone please tell me how I can detach from an IPython kernel without terminating it? I see in the documentation of quit() that there is a parameter keep_kernel, but unfortunately quit(keep_kernel=True) won't work.
Detach from IPython kernel without terminating it
0
0.379949
1
0
0
682
23,691,819
2014-05-16T02:43:00.000
0
0
0
0
0
python,python-3.x,tkinter
0
23,704,276
0
1
1
false
0
1
I cannot answer this specifically for 'unlock' event (if there even is one in the GUI; I can't find one by cursory search.). But I think the real answer is to change the question. Having a program simply take focus when user unlocks the display is very un-Windows-ish behavior. The Windows user expects to see the de...
1
0
0
0
I have a tkinter program written in python 3.3.3. I see myself in the need of making the the program get focus when the user unlocks the computer. I don't really know how to go ahead and start with this, users have a .exe version of the program that I created with cxfreeze. I f i need to modify the .py and create anoth...
Get focus on tkinter program after pc is unlocked
0
0
1
0
0
100
23,695,305
2014-05-16T12:45:00.000
0
0
0
0
0
python,scipy,openshift
0
33,723,529
0
1
0
false
0
0
Either add scipy to your setup.py file or login to openshift rhc ssh yourapp and install manually: pip install scipy
1
0
0
0
I would like to install scipy on openshift but I don't know how to do it. I'm an absolute beginner with python and openshift. Therefore it would be great if somebody could provide a step by step explanation on how to proceed.
install scipy on openshift
0
0
1
0
0
232
23,716,904
2014-05-17T22:58:00.000
1
0
0
0
1
python,numpy,scipy,signal-processing,fft
0
23,717,381
0
1
0
true
0
0
If your IFFT's length is different from that of the FFT, and the length of the IFFT isn't composed of only very small prime factors (2,3,etc.), then the efficiency can drop off significantly. Thus, this method of resampling is only efficient if the two sample rates are different by ratios with small prime factors, such...
1
0
1
0
I'm trying to resample a 1-D signal using an FFT method (basically, the one from scipy.signal). However, the code is taking forever to run, even though my input signal is a power of two in length. After looking at profiling, I found the root of the problem. Basically, this method takes an FFT, then removes part of the ...
IFFT taking orders of magnitude more than FFT
1
1.2
1
0
0
285
23,729,919
2014-05-19T04:53:00.000
2
0
0
0
0
python,theano,summarization,deep-learning
0
23,765,727
0
2
0
false
0
0
I think you need to be a little more specific. When you say "I am unable to figure to how exactly the summary is generated for each document", do you mean that you don't know how to interpret the learned features, or don't you understand the algorithm? Also, "deep learning techniques" covers a very broad range of model...
1
3
1
1
I am trying to summarize text documents that belong to legal domain. I am referring to the site deeplearning.net on how to implement the deep learning architectures. I have read quite a few research papers on document summarization (both single document and multidocument) but I am unable to figure to how exactly the s...
Text summarization using deep learning techniques
0
0.197375
1
0
0
2,167
23,744,128
2014-05-19T17:52:00.000
-1
0
0
0
0
python,sqlite,unit-testing
0
23,744,831
0
1
0
false
0
0
I don't understand your problem. Why do you care that it's serverless? My standard technique for this is: use SQLAlchemy in tests, configure it with sqlite:/// or sqlite:///:memory:
1
0
0
0
Hi I am trying to write python functional tests for our application. It involves several external components and we are mocking them all out.. We have got a better framework for mocking a service, but not for mocking a database yet. sqlite is very lite and thought of using them but its a serverless, is there a way I c...
how to do database mocking or make sqlite run on localhost?
1
-0.197375
1
1
0
535
23,754,108
2014-05-20T07:59:00.000
0
0
0
0
0
python,database,sockets,pyside,qtsql
0
23,754,331
0
1
0
false
0
1
I'm not familiar with PySide .. but the idea is you need to build a function that when internet connection is available it should synchronize your local database with online database and in the server-side you need to build a script that can handle requests ( POST / GET ) to receive the scores and send it to database ...
1
0
0
0
I am working on my Python project using PySide as my Ui language. My projet is a game which require an internet connection to update the users'score and store in the database. My problem is how can I store my database in the internet. I mean that all users can access this information when they are connected to an inter...
Using Database with Pyside and Socket
0
0
1
1
0
193
23,763,365
2014-05-20T14:59:00.000
2
0
0
0
0
python,django
0
23,763,477
0
2
0
false
1
0
This has nothing to do with the Django template, but how you define the variable in the first place. Basckslashes are only "interpreted" when you specify them as literals in your Python code. So given your Python code above, you can either use the double backslash, or use a raw string. If you were loading the string "f...
1
2
0
0
I'm using Python 2.7 and Django 1.4 If I have a string variable result = "fred\xbf", how do I tell the Django template to display "fred\xbf" rather than process the backslash and display some strange character? I know I can escape the backslash: "fred\\xbf" , but can I get the Django template to understand I want the ...
How do I tell Python not to interpret backslashes in strings?
0
0.197375
1
0
0
2,703
23,764,710
2014-05-20T15:56:00.000
2
1
1
0
0
python,open-source
0
23,764,809
0
1
0
true
0
0
Not sure if this is an appropriate question for SO - you might get voted down. But ... Whenever I have seen this question, the answer is almost always: find a project you like / you're interested in find something in that project that you feel you can fix / enhance (have a look through their bug tracker) fork the proj...
1
0
0
0
I know python and want to contribute on OpenSource projects that features python. Anyone can help me where to contribute and how. I already googled it and find github and code.google as a good place to contribute but how to start it I don't know. Suggest how to get started.
how to contribute on open source project featuring python
0
1.2
1
0
0
435
23,781,823
2014-05-21T11:24:00.000
1
0
1
0
0
python,file,binary
0
23,781,948
0
2
0
true
0
0
Under Python 2, the only difference binary mode makes is how newlines are translated when writing; \n would be translated to the platform-dependant line separator. In other words, just write your ASCII byte strings directly to your binary file, there is no difference between your ASCII data and the binary data as far a...
1
0
0
0
I have this wired protocol I am implementing and I have to write binary and ASCII data into the same file, how can I do this at the same time or at least the result in the end will be the file with mixed asci and binary data ? I know that open("myfile", "rb") does open myfile in the binary mode, except that I can't fin...
How to write binary and asci data into a file in python?
0
1.2
1
0
0
782
23,793,628
2014-05-21T20:56:00.000
1
0
1
0
0
python,nlp,nltk
0
23,816,393
0
3
0
false
0
0
I do not think your "algo" is even doing entity recognition... however, stretching the problem you presented quite a bit, what you want to do looks like coreference resolution in coordinated structures containing ellipsis. Not easy at all: start by googling for some relevant literature in linguistics and computational ...
1
0
1
0
First: Any recs on how to modify the title? I am using my own named entity recognition algorithm to parse data from plain text. Specifically, I am trying to extract lawyer practice areas. A common sentence structure that I see is: 1) Neil focuses his practice on employment, tax, and copyright litigation. or 2) Neil f...
How to extract meaning from sentences after running named entity recognition?
0
0.066568
1
0
0
1,842
23,801,986
2014-05-22T08:49:00.000
0
0
1
0
0
python,win32com
0
23,802,237
0
2
0
false
0
0
You can have multi dimensional arrays or objects, your choice :) arr = []; arr.append([1,2]); print arr; would output [[1,2]]
1
1
0
0
I need to read values from excel worksheet into 2d array.can anyone tell me how to do this using pythonwin32com.
Two dimensional array in python
0
0
1
0
0
213
23,807,459
2014-05-22T12:55:00.000
1
0
1
1
0
python,vm-implementation
0
30,846,061
0
2
0
false
0
0
It may depend on Python implementation such as Pypy, Jython. In CPython, you have to use a separate process if you want an independent interpreter otherwise at the very least GIL is shared. multiprocessing, concurrent.futures modules allow you to run arbitrary Python code in separate processes and to communicate with ...
1
3
0
1
Does anyone know how to launch a new python virtual machine from inside a python script, and then interact with it to execute code in a completely separate object space? In addition to code execution, I'd like to be able to access the objects and namespace on this virtual machine, look at exception information, etc. I'...
Programmatically launch and interact with python virtual machine
0
0.099668
1
0
0
923
23,823,519
2014-05-23T07:35:00.000
2
0
1
0
0
python,setuptools,distribute
0
24,061,938
0
1
0
true
0
0
The situation is legitimately confusing as there are too many installers available for Python and the landscape has changed recently. Distribute was a fork of setuptools which itself is an extension to distutils. They merged back with setuptools in 2013. Your book is most likely out of date. The documentation of setupt...
1
0
0
0
I am following a python bbok which says to install Distribute. However I am confused should I install Distribute or Setuptools as both of them have merged now. Is there still a difference between the two? Since I have installed pip and that automaticallly installs setuptools I want to know how can I check if Distribute...
What should I install Distribute or Setuptools
0
1.2
1
0
0
55
23,831,422
2014-05-23T14:08:00.000
1
0
0
0
0
python,binary,endianness
0
23,831,750
0
3
0
false
0
0
Note: I assume Python 3. Endianness is not a concern when writing ASCII or byte strings. The order of the bytes is already set by the order in which those bytes occur in the ASCII/byte string. Endianness is a property of encodings that maps some value (e.g. a 16 bit integer or a Unicode code point) to several bytes. By...
1
4
0
0
When using file.write() with 'wb' flag does Python use big or litte endian, or sys.byteorder value ? how can i be sure that the endianness is not random, I am asking because I am mixing ASCII and binary data in the same file and for the binary data i use struct.pack() and force it to little endian, but I am not sure wh...
What endianness does Python use to write into files?
1
0.066568
1
0
0
8,145
23,846,899
2014-05-24T15:45:00.000
3
0
1
0
0
python,windows-7,installation,lighttable
0
29,813,451
0
1
0
false
0
1
It's pretty easy to do. Unzip to where ever Move the LightTable directory (from inside LightTableWin) to your Program Files (x86) directory. 2.1 If you are using Windows Explorer, you'll need to start windows explorer as an administrator (found by right clicking the program icon) open your Program Files (x86)\Ligh...
1
2
0
0
I am trying to download/install Light Table. I want it to show up in the start menu. When downloading light table, it shows up as a Zip folder in the TEMP file. I've extracted the files and am unable to get it to show up in the start menu. Normally the programs I download have an installer that does this automatically....
Install Light Table editor on Windows 7
0
0.53705
1
0
0
2,589
23,859,613
2014-05-25T20:22:00.000
4
0
0
0
0
python,pyqt,pyqt4
0
41,981,238
0
6
0
false
0
1
You may simply try this: os.startfile(whatever_valid_filename) This starts the default OS application for whatever_valid_filename, meaning Explorer for a folder name, default notepad for a .txt file, etc.
1
4
0
0
I have searched a lot and I know how to open a directory dialog window. But what I am looking for is the method to open a directory folder under windows OS, just like you right click one of your local folder and select open. Any suggestions?
PyQt - How to open a directory folder?
0
0.132549
1
0
0
21,145
23,869,132
2014-05-26T11:31:00.000
1
0
1
0
1
python,excel,vba
1
23,869,285
0
1
0
false
0
0
It is xlCalculationAutomatic or you could use the number -4105 in Python.
1
1
0
0
how to make excel workbook calculation to automatic in both vba and python script? I tried this Application.Calculation = xlCalculateAutomatic but it is not working. It throws me below error. global name 'xlCalculateAutomatic' is not defined.
workbook calculation to automatic in both vba and python
0
0.197375
1
0
0
93
23,870,365
2014-05-26T12:38:00.000
7
0
1
0
1
python,django,pycharm
0
32,492,931
0
6
0
false
1
0
I have met the problems today. At last, I finished it by: Create project in command line Create app in command line Just open the existing files and code in pycharm The way I use have the benefits: don't need by professional pycharm code django project in pycharm
1
51
0
1
I'm new in this area so I have a question. Recently, I started working with Python and Django. I installed PyCharm Community edition as my IDE, but I'm unable to create a Django project. I looked for some tutorials, and there is an option to select "project type", but in the latest version this option is missing. Can s...
How to set up a Django project in PyCharm
0
1
1
0
0
89,573
23,884,156
2014-05-27T08:08:00.000
1
0
0
0
0
python,gstreamer
0
23,921,536
0
1
0
false
0
1
I'd suggest to file a bug and ideally make your test files available. If you want to track this down yourself take a look at the GST_DEBUG="*:3" ./your-app output to see which element is emitting the warning.
1
0
0
0
I'm writing a mediaplayer-gui fitting some needs of a medialibrary containing classical music only. Language is python3/tkinter. One backend is gstreamer1.0, playbin (seems to be the only one, playing gapless). When playbin gets the uri of a file with 5.0 channels (FRONT_LEFT,FRONT_RIGHT,FRONT_CENTER,REAR_LEFT,REAR_RIG...
how to make playbin of gstreamer1.0 playing multichannel-audio 5.0 playing without downmixing to stereo
0
0.197375
1
0
0
193
23,891,195
2014-05-27T13:46:00.000
-1
0
1
0
0
python
0
23,891,448
0
3
0
true
0
0
I'll answer to my own question since I got an idea while writing the question, and maybe someone will need that. I added a link from that folder to my site-packages folder like that: ln -s /home/me/python/pyutils /path/to/site-packages/pyutils Then, since the PYTHONPATH contains the /path/to/site-packages folder, and I...
1
1
0
0
I have a case for needing to add a path to a python package to sys.path (instead of its parent directory), but then refer to the package normally by name. Maybe that's weird, but let me exemplify what I need and maybe you guys know how to achieve that. I have all kind of experimental folders, modules, etc inside a pat...
Add path to python package to sys.path
0
1.2
1
0
0
2,392
23,897,254
2014-05-27T19:16:00.000
3
0
1
0
0
python,multiprocessing,lsf
0
23,901,931
0
1
0
true
0
0
One (very simplified) way to think of LSF is as a system that launches a process and lets the process know how many cores (potentially on different hosts) have been allocated to it. LSF can't prevent your program from doing something stupid (like for example, if multiple instances of it run at the same time, and one i...
1
3
0
0
I have a single task to complete X number of times in Python and I will be using LSF to speed that up. Is it better to submit a job containing several Python scripts which can be run separately in parallel or one Python script that utilizes the multiprocessor module? My issue is I don't trust LSF to know how to split u...
LSF: Submit one Python script that uses multiprocessor module *or* submit several scripts at once that are "pre-split"?
0
1.2
1
0
0
1,380
23,921,986
2014-05-28T21:13:00.000
2
0
0
0
0
python,web-scraping,beautifulsoup,web-crawler
0
23,922,228
0
2
0
false
1
0
You're basically asking "how do I write a search engine." This is... not trivial. The right way to do this is to just use Google's (or Bing's, or Yahoo!'s, or...) search API and show the top n results. But if you're just working on a personal project to teach yourself some concepts (not sure which ones those would be...
1
8
0
0
I'm trying to teach myself a concept by writing a script. Basically, I'm trying to write a Python script that, given a few keywords, will crawl web pages until it finds the data I need. For example, say I want to find a list of venemous snakes that live in the US. I might run my script with the keywords list,venemou...
Web scraping without knowledge of page structure
0
0.197375
1
0
1
3,298
23,944,242
2014-05-29T22:46:00.000
7
1
1
0
1
python,c,numpy,gmp,gmpy
0
23,946,348
0
1
0
true
0
0
numpy and GMPY2 have different purposes. numpy has fast numerical libraries but to achieve high performance, numpy is effectively restricted to working with vectors or arrays of low-level types - 16, 32, or 64 bit integers, or 32 or 64 bit floating point values. For example, numpy access highly optimized routines writt...
1
2
1
0
I understand that GMPY2 supports the GMP library and numpy has fast numerical libraries. I want to know how the speed compares to actually writing C (or C++) code with GMP. Since Python is a scripting language, I don't think it will ever be as fast as a compiled language, however I have been wrong about these generaliz...
How do numpy and GMPY2 compare with GMP in terms of speed?
0
1.2
1
0
0
2,014
23,985,795
2014-06-02T00:19:00.000
1
0
0
0
0
python,amazon-web-services,amazon-s3,flask
0
23,986,820
0
1
0
false
1
0
Make the request to your Flask application, which will authenticate the user and then issue a redirect to the S3 object. The trick is that the redirect should be to a signed temporary URL that expires in a minute or so, so it can't be saved and used later or by others. You can use boto.s3.key.generate_url function in y...
1
0
0
0
I am trying to serve files securely (images in this case) to my users. I would like to do this using flask and preferably amazon s3 however I would be open to another cloud storage solution if required. I have managed to get my flask static files like css and such on s3 however this is all non-secure. So everyone who ...
Secure access of webassets with Flask and AWS S3
1
0.197375
1
0
0
890
23,987,050
2014-06-02T03:41:00.000
1
0
0
0
1
python,django,orm
0
23,987,194
0
2
0
false
1
0
I chose option 1 when I set up my environment, which does much of the same stuff. I have a JSON interface that's used to pass data back to the server. Since I'm on a well-protected VLAN, this works great. The biggest benefit, like you say, is the Django ORM. A simple address call with proper data is all that's neede...
1
2
0
0
So in my spare time, I've been developing a piece of network monitoring software that essentially can be installed on a bunch of clients, and the clients report data back to the server(RAM/CPU/Storage/Network usage, and the like). For the administrative console as well as reporting, I've decided to use Django, which ha...
How to access Django DB and ORM outside of Django
0
0.099668
1
1
0
849
24,036,291
2014-06-04T11:33:00.000
11
0
0
1
0
c#,python,protocol-buffers,protobuf-net
0
24,038,019
0
1
0
true
0
0
DateTime is spoofed via a multi-field message that is not trivial, but not impossible to understand. In hindsight, I wish I had done it a different way, but it is what it is. The definition is available in bcl.proto in the protobuf-net project. However! If you are targering multiple platforms, I strongly recommend you ...
1
8
0
0
I'm working on a project consisting on Client/Server. Client is written in Python (will run on linux) and server in C#. I'm communicating through standard sockets and I'm using protobuf-net for protocol definition. However, I'm wondering how would protobuf-net handle DateTime serialization. Unix datetime differs from ....
How protobuf-net serialize DateTime?
0
1.2
1
0
0
3,765
24,062,830
2014-06-05T14:26:00.000
1
0
1
0
0
python,c,distutils
0
24,066,500
0
3
0
false
0
0
I'd consider building the python module as a subproject of a normal shared library build. So, use automake, autoconf or something like that to build the shared library, have a python_bindings directory with a setup.py and your python module.
1
16
0
0
I have written a library whose main functionality is implemented in C (speed is critical), with a thin Python layer around it to deal with the ctypes nastiness. I'm coming to package it and I'm wondering how I might best go about this. The code it must interface with is a shared library. I have a Makefile which builds ...
Best way to package a Python library that includes a C shared library?
1
0.066568
1
0
0
4,767
24,069,711
2014-06-05T20:31:00.000
1
0
0
0
1
python,rdf,freebase
0
25,625,683
0
1
0
false
1
0
The Freebase dump is in RDF format. The easiest way to query it is to dump it (or a subset of it) into an RDF store. It'll be quicker to query, but you'll need to pay the database load time up front first.
1
3
0
1
I downloaded the freebase data dump and I want to use it to get information about a query just like how I do it using the web API. How exactly do I do it? I tried using a simple zgrep but the result was a mess and takes too much time. Any graceful way to do it (preferably something that plays nicely with python)?
How to search freebase data dump
0
0.197375
1
0
1
964
24,077,041
2014-06-06T08:05:00.000
1
0
0
1
0
python,google-app-engine
0
24,088,125
0
1
0
true
1
0
Unfortunately there is not currently a well-supported way to do this. However, with the disclaimer that this is likely to break at some point in the future, as it depends on internal implementation details, You can fetch the relevant _AE_Backup_Information and _AE_DatastoreAdmin_Operation entities from your datastore a...
1
0
0
0
I am taking the backup of datastore , using Taskqueues. I want to check whether the backup has completed successfully or not. I can check the end of the backup job by checking the taskqueue, but how can i check whether the backup was successful or it failed due to some errors.
Google App Engine Check Success of backup programmatically
0
1.2
1
0
0
69
24,112,422
2014-06-09T01:02:00.000
0
0
0
0
0
python,mysql,ruby-on-rails
0
24,112,483
0
1
0
true
0
0
Use ssh to login to your home computer, setup authorized keys for it and disable password login. setup iptables on your linux machine if you don't have a firewall on your router, and disable traffic on all ports except 80 and 22 (ssh and internet). That should get you started.
1
0
0
0
I have read a few posts on how to enable remote login to mysql. My question is: is this a safe way to access data remotely? I have a my sql db located at home (on Ubuntu 14.04) that I use for research purposes. I would like to run python scripts from my Macbook at work. I was able to remote login from my old windows O...
Best way to access data from mysql db on other non-local machines
1
1.2
1
1
0
49
24,123,128
2014-06-09T15:05:00.000
0
1
0
1
0
python,git
0
24,123,328
0
2
0
false
0
0
in the top of your python file add #!/usr/bin/python then you can rename mv myScript.py myScript and run chmod 755 myScript. This will make it so you can run the file with ./myScript look into adding the file directory to your path or linking it to the path if you want to be able to run it from anywhere.
1
3
0
0
I'm writing git commands through a Python script (on Windows) When I double click on myScript.py, commands are launched in the Windows Command Prompt. I would like to execute them in Git Bash. Any idea how to do that without opening Git Bash and write python myScript.py?
Launch Python script in Git Bash
0
0
1
0
0
28,190
24,128,433
2014-06-09T20:26:00.000
6
0
0
0
0
python,django,email,nginx,django-allauth
0
24,129,038
0
2
0
true
1
0
Django get hostname and port from HTTP headers. Add proxy_set_header Host $http_host; into your nginx configuration before options proxy_pass.
1
8
0
0
I'm running django on port 8001, while nginx is handling webserver duties on port 80. nginx proxies views and some REST api calls to Django. I'm using django-allauth for user registration/authentication. When a new user registers, django-allauth sends the user an email with a link to click. Because django is running...
django-allauth: how to modify email confirmation url?
0
1.2
1
0
0
2,367