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
6,024,212
2011-05-16T22:35:00.000
2
0
1
0
python,python-2.7,python-3.x
6,024,559
5
false
0
0
I Can't talk for the community but these from __future__ import ... don't work for all python versions or aren't reliable on some cases. print_function and unicode_literals were added on Python2.6, with_statement on Python2.5 and the others on Python2.2 So, if you want to support 2.6 or later, you're fine. If you still...
1
2
0
I am starting a project in Python 3.x, (I'm quite new to Python) and there exists the possibility that I will need to use say Thrift or any other library that is not yet ported to Python 3.x. I don't mind about devoting some (substantial) amount of time to convert an external library to Python 3.x if with that others c...
What's the preferred method in the community for having python 2.x and 3.x in the same codebase?
0.07983
0
0
293
6,025,305
2011-05-17T01:27:00.000
0
0
1
1
emacs,buffer,python-mode
6,401,182
2
false
0
0
I use python-mode 5.2.0. I went into python-mode.el and changed the switch-to-buffer-other-window to switch-to-buffer. I evaluated it and now the interpreter opens up in the same window (regardless of the number of other windows I have). Did you evaluate the function when you changed the above line? Btw, opening the in...
1
1
0
Maybe I'm being irrational but I really really hate it when a command opens a new window in emacs. I'm using emacs on Ubuntu which came with python-mode and when I start an interpreter with C-c ! it pops up in a new window. What I want is for emacs to switch to a new buffer in the same window. So far I've tried addin...
making python interpreter open in same window
0
0
0
1,148
6,026,485
2011-05-17T05:10:00.000
0
0
0
0
python,linux,unix,sqlite
6,026,507
4
false
0
0
In general, the first thing to do is to ask your host. I seems a bit odd that SQLite is not installed (or installed properly). So they'll likely fix it quite fast if you ask them.
1
2
0
I'm trying to run a python script using python 2.6.4. The hosting company has 2.4 installed so I compiled my own 2.6.4 on a similar server and then moved the files over into ~/opt/python. that part seems to be working fine. anyhow, when I run the script below, I am getting ImportError: No module named _sqlite3 and I'm ...
How can I get sqlite working on a shared hosting server?
0
1
0
1,962
6,028,968
2011-05-17T09:38:00.000
0
0
0
0
python
6,029,158
4
false
0
0
You could always implement an object for every file, giving it a number of methods, like open and display and etc etc. You could then define __hash__ and __eq__ for the object, this would allow you to store items in a set, causing the duplicates to just update a single instance inside the set. This is just another way...
1
2
0
i am building a small search engine to search a collection of pdfs. From each pdf i extract a set of tokens and store it in database. I do not want to store duplicate tokens in database, instead i want to store count of each token in the database. Does python has any special datastructure that do not store duplicates b...
Python Datastructure Suggestion
0
0
0
130
6,030,115
2011-05-17T11:29:00.000
0
1
0
0
python,amazon-ec2
71,252,207
5
false
1
0
simply add your code to Github and take clone on EC2 instance and run that code.
2
71
0
I understand nearly nothing to the functioning of EC2. I created an Amazon Web Service (AWS) account. Then I launched an EC2 instance. And now I would like to execute a Python code in this instance, and I don't know how to proceed. Is it necessary to load the code somewhere in the instance? Or in Amazon's S3 and to lin...
How to run a code in an Amazone's EC2 instance?
0
0
0
66,912
6,030,115
2011-05-17T11:29:00.000
4
1
0
0
python,amazon-ec2
12,026,840
5
false
1
0
Launch your instance through Amazon's Management Console -> Instance Actions -> Connect (More details in the getting started guide) Launch the Java based SSH CLient Plugins-> SCFTP File Transfer Upload your files run your files in the background (with '&' at the end or use nohup) Be sure to select an AMI with python ...
2
71
0
I understand nearly nothing to the functioning of EC2. I created an Amazon Web Service (AWS) account. Then I launched an EC2 instance. And now I would like to execute a Python code in this instance, and I don't know how to proceed. Is it necessary to load the code somewhere in the instance? Or in Amazon's S3 and to lin...
How to run a code in an Amazone's EC2 instance?
0.158649
0
0
66,912
6,030,291
2011-05-17T11:46:00.000
2
1
1
0
java,python,nlp,information-retrieval,text-mining
6,030,342
4
false
1
0
it's not language you have to evaluate, but frameworks and app servers for clustering, data storage/retrieval etc available for the language. you can use jython and use all the java enterprise technologies for high load system and do text parsing with python.
3
10
0
I'm soon to start on a new project where I am going to do lots of text processing tasks like searching, categorization/classifying, clustering, and so on. There's going to be a huge amount of documents that need to be processed; probably millions of documents. After the initial processing, it also has to be able to be...
Python or Java for text processing (text mining, information retrieval, natural language processing)
0.099668
0
0
10,439
6,030,291
2011-05-17T11:46:00.000
3
1
1
0
java,python,nlp,information-retrieval,text-mining
6,030,330
4
false
1
0
Just write it, the biggest flaw in programming people have is premature optimization. Work on a project, write it out and get it working. Then go back and fix the bugs and ensure that its optimized. There are going to be a number of people harping on about speed of x vs y and y is better than x but at the end of a day ...
3
10
0
I'm soon to start on a new project where I am going to do lots of text processing tasks like searching, categorization/classifying, clustering, and so on. There's going to be a huge amount of documents that need to be processed; probably millions of documents. After the initial processing, it also has to be able to be...
Python or Java for text processing (text mining, information retrieval, natural language processing)
0.148885
0
0
10,439
6,030,291
2011-05-17T11:46:00.000
9
1
1
0
java,python,nlp,information-retrieval,text-mining
6,030,370
4
false
1
0
It's very difficult to answer questions like this without trying. So why don't you Figure out what would be a difficult operation Implement that (and I mean the simplest, quickest hack that you can make work) Run it with a lot of data, and see how long it takes Figure out if it's too slow I've done this in the past a...
3
10
0
I'm soon to start on a new project where I am going to do lots of text processing tasks like searching, categorization/classifying, clustering, and so on. There's going to be a huge amount of documents that need to be processed; probably millions of documents. After the initial processing, it also has to be able to be...
Python or Java for text processing (text mining, information retrieval, natural language processing)
1
0
0
10,439
6,030,876
2011-05-17T12:39:00.000
2
0
0
1
python,ubuntu,plone,zlib
6,056,817
5
false
0
0
Instructing the Unified Installer to build its own zlib works: ./install.sh --libz=yes zeo
2
5
0
I am a Plone newbie and am trying to install Plone 4.0.5 on Ubuntu 11.04 Natty using the Unified Installer. I unpack the installer and run the ./install.sh zeo as root and I get the following error: ZEO Cluster Install selected Detailed installation log being written to /tmp/Plone-4.0.5-UnifiedInstaller/install.log ...
Plone 4.0.5 unified installer failing on Ubuntu 11.04 (natty) with zip/zlib error
0.07983
0
0
5,914
6,030,876
2011-05-17T12:39:00.000
1
0
0
1
python,ubuntu,plone,zlib
6,044,639
5
false
0
0
Note that if you have an acceptable Python on your system already (or can install one), you may use "--with-python=/path/to/Python-2.6" on the install.sh command line.
2
5
0
I am a Plone newbie and am trying to install Plone 4.0.5 on Ubuntu 11.04 Natty using the Unified Installer. I unpack the installer and run the ./install.sh zeo as root and I get the following error: ZEO Cluster Install selected Detailed installation log being written to /tmp/Plone-4.0.5-UnifiedInstaller/install.log ...
Plone 4.0.5 unified installer failing on Ubuntu 11.04 (natty) with zip/zlib error
0.039979
0
0
5,914
6,032,106
2011-05-17T14:12:00.000
4
0
1
0
python
6,032,189
4
false
0
0
Either store the count in the registry or write it to a file along with the program. Either way is easy for the end user to modify though, unless you manage to encrypt the count file. Since it's an .exe from py2exe, there would be at least a low barrier if you used something like AES encryption with a string key store...
3
2
0
Hello I made a program in python2.6 and converted to exe with py2exe. I wish that could limit the number of times the user can use, then this is blocked with a counter or maybe a library. Any ideas?
Limit number of executions of a python program
0.197375
0
0
362
6,032,106
2011-05-17T14:12:00.000
2
0
1
0
python
6,032,176
4
false
0
0
Write the number of starts into a file and check it. If you want a 100% secure and safe way to prevent users from starting your app more than 15 times, then you should not publish it. That's the only working way to make sure the user doesn't start it more than 15 times. Rationale: Any good hacker will be able to disman...
3
2
0
Hello I made a program in python2.6 and converted to exe with py2exe. I wish that could limit the number of times the user can use, then this is blocked with a counter or maybe a library. Any ideas?
Limit number of executions of a python program
0.099668
0
0
362
6,032,106
2011-05-17T14:12:00.000
0
0
1
0
python
6,032,175
4
false
0
0
A compiled binary can't (easily) modify itself to keep track of something like this. You're going to have to write a counter to the registry or to some web API and check that counter on application (executable) startup. Keeping in mind, this won't stop someone that determed from bypassing the counter- just a casual us...
3
2
0
Hello I made a program in python2.6 and converted to exe with py2exe. I wish that could limit the number of times the user can use, then this is blocked with a counter or maybe a library. Any ideas?
Limit number of executions of a python program
0
0
0
362
6,032,287
2011-05-17T14:24:00.000
0
0
0
0
javascript,python,screen-scraping,pyqt,pyside
6,036,473
2
false
1
1
I think you are confused about where things happen, so it is not clear to me what it is you are attempting to do, but lets make a guess. I think you want to automate the use of a web site, where you have to call up a selection page, tick a box, click a button and handle the resulting download. If you only want to do i...
1
3
0
I am trying to use PyQt to load the html of a web page which can then be manipulated and fed back to the page for web scraping. I am basically trying to log into a page with Javascript on it, search for documents to download (by selecting a check box next to the correct one's names), and then clicking a download button...
Outputting and Responding to Javascript with PyQt
0
0
0
1,332
6,033,067
2011-05-17T15:17:00.000
1
0
0
0
python,django
6,033,103
1
true
1
0
You could use permissions. When they sign up if they're a Teacher give them content creation permissions. If they're a student they don't get the permissions. In the user profile I would just have a field that says which type they are. Unless a lot of the data is different I wouldn't have two user profiles.
1
2
0
I'm building a web application where I have 2 sets of users (students and teachers). Teachers should be able to create their account, create a page of their content. Students should be able to create an account to sign up for this content. I am currently using django-registration to handle registration but I am wonderi...
Two sets of users (teacher and student) in Django authentication
1.2
0
0
1,239
6,037,210
2011-05-17T21:13:00.000
0
0
0
0
java,python,django,command-line-interface
40,871,485
2
false
1
0
Yeah subprocess is a great module to call commandline scripts. If you are worried that the process will take to long for the user to wait around for html, consider using celery to asynchronously call your external scripts as a background process.
1
1
0
I am just trying to gather some information, and whether it is possible to tie in cli java application and set up the class path using python. Also to be able to pass data around and share information between the two applications (web frontend and java application) I currently I have a java application and looking to s...
django and calling cli java application
0
0
0
793
6,037,379
2011-05-17T21:29:00.000
0
1
0
0
python
6,037,452
2
false
1
0
Some sites will set the 'generator' meta-tag in the html head.
1
0
0
Is there a way beside checking for known signatures in the site content to find out what kind of software is the website running e.g vbbuliten,WP etc, preferably python.
Detecting blog or forum software using python?
0
0
0
649
6,040,603
2011-05-18T06:14:00.000
2
0
1
0
python,dot,pydot
6,040,922
1
true
0
0
dot.write_png('filename.png')? Or is there something I'm missing? Also, the neato command-line program has a -n option for graph files that already have layout. The program description says it is for undirected graphs, but I tried it with a digraph and it produced the correct result.
1
1
0
I have taken an initial DOT file and modified the pos attributes of some nodes using pydot. Now I want to render an image file that shows the nodes in their new positions. The catch is, I don't want a layout program to mess with the positions! I just want to see the nodes exactly where the pos attribute indicates. I do...
How to render DOT file using only pos attributes
1.2
0
0
672
6,041,395
2011-05-18T07:42:00.000
3
0
1
0
python,class,serialization,memory-management,pickle
6,046,352
2
false
0
0
Do you construct your tree once and then use it without modifying it further? In that case you might want to consider using separate structures for the dynamic construction and the static usage. Dicts and objects are very good for dynamic modification, but they are not very space efficient in a read-only scenario. I do...
1
10
1
I was wondering whether someone might know the answer to the following. I'm using Python to build a character-based suffix tree. There are over 11 million nodes in the tree which fits in to approximately 3GB of memory. This was down from 7GB by using the slot class method rather than the Dict method. When I serialise...
Python memory serialisation
0.291313
0
0
415
6,042,308
2011-05-18T09:09:00.000
7
0
0
0
python,matrix,numpy,scipy,matrix-inverse
6,042,505
1
true
0
0
There really isn't an inversion routine, per se. scipy.linalg.solve is the canonical way of solving a matrix-vector or matrix-matrix equation, and it can be given explicit information about the structure of the matrix which it will use to choose the correct routine (probably the equivalent of BLAS3 dtrsm in this case)....
1
13
1
In numpy/scipy, what's the canonical way to compute the inverse of an upper triangular matrix? The matrix is stored as 2D numpy array with zero sub-diagonal elements, and the result should also be stored as a 2D array. edit The best I've found so far is scipy.linalg.solve_triangular(A, np.identity(n)). Is that it?
numpy: inverting an upper triangular matrix
1.2
0
0
6,594
6,042,335
2011-05-18T09:12:00.000
3
0
0
0
python,google-chrome,browser,ubuntu-11.04
22,594,464
2
false
0
0
for mac, do this webbrowser.get("open -a /Applications/Google\ Chrome.app %s").open("http://google.com")
1
9
0
How I should call webbrowser.get() function so I open the chrome web browser? I'm running Ubuntu 11.04 and Python version 2.7. Using webbrowser.get('chrome') yields an error.
Calling Chrome web browser from the webbrowser.get() in Python
0.291313
0
1
20,001
6,043,463
2011-05-18T10:48:00.000
0
0
1
0
python,string,utf-8
6,043,585
5
false
0
0
If you can ensure that the utf-8 representation of your chars are only 2 byte long than you should be safe to split the unicode string into chunks of 150 chars (this should be true for most european encodings). But utf-8 is variable-width encoding. So might might split the unicode string into single characters, convert...
1
11
0
I want to split u"an arbitrary unicode string" into chunks of say 300 bytes without destroying any characters. The strings will be written to a socket that expects utf8 using unicode_string.encode("utf8"). I don't want to destroy any characters. How would I do this?
Split unicode string into 300 byte chunks without destroying characters
0
0
0
3,255
6,044,443
2011-05-18T12:10:00.000
2
1
0
0
python,eclipse,logging
6,045,239
2
false
1
0
It will depends on how you configure your logging system. If you use only print statement, it should be shown in the console view of eclipse. If you use logging and you configured a Console handler it should also be displayed in the console eclipse view. If you configured only file handler in the logging configuration,...
1
0
0
Where should I see the logging output on Eclipse while debugging ? and when running ?
Python logging module on Eclipse
0.197375
0
0
1,139
6,045,515
2011-05-18T13:29:00.000
1
0
1
1
python,linux,32bit-64bit,freeze
6,045,613
1
false
0
0
Could you use something likemake CFLAGS="-m32".?
1
0
0
I've a number of python scripts that I am likely to need to distribute to users who may have minimal x86 linux setups and no guarantees of having python or a particular version of it. My desktop is an x86-84 architecture setup, but I am able to cross compile 32 bit elf's with GCC. The python freeze script is currently ...
Can python freeze be made to compile 32 bit binaries on a 64 bit linux
0.197375
0
0
362
6,048,046
2011-05-18T16:36:00.000
1
0
1
1
python,file,nfs,resource-leak
6,052,579
2
false
0
0
The kernel keeps track of file descriptors, so even if you got python to unload the .so and release the memory, it would not know to close the leaked file descriptors. The only thing that comes to mind is importing the .so after forking, and only cleaning up after the forked child process has exited (and the file handl...
1
2
0
here is a quite cool problem. I have a python script (main) that calls a python module (foo.py) which in turns calls another python module (barwrapper.py) uses LoadLibrary to dynamically open and access a libbar.so library. libbar and the whole rest of the chain open and create files to perform their task. The problem...
File handle leaking (maybe) in a C library makes trouble with NFS (+python, but that's incidental)
0.099668
0
0
368
6,049,208
2011-05-18T18:15:00.000
1
0
0
0
python,wxpython,cairo
6,450,169
2
false
0
1
If you're double-buffering anyway, why not do a quick bitmap scale as a "preview" while waiting for the newly redrawn vector image? I confess I don't know how to do this. But if you can make it work, it should work! :)
1
6
0
I have a wx.ScrolledWindow where is drawn on using cairo. I have implemented a zoom-functionality which right now redraws the whole content. But as there will be up to 200 curves to draw I should consider a more performant solution. I have thought of these: Buffering images for the zoom factors -1/+1 (Memory consuming...
What is the most performant way to implement zoom to a cairo-drawn canvas?
0.099668
0
0
1,049
6,049,481
2011-05-18T18:39:00.000
3
0
0
0
python,wxpython
6,050,833
3
false
0
1
You can use the frame instance's FindWindowByName() method, assuming you passed a unique name parameter to the widget or you might be able to use the frame instance's FindWindowByLabel() method. You can also find by id, but I don't really recommend that since it's better not to manage the ids yourself.
1
4
0
I was wondering if it is possible (I'm sure it is) to get a reference to a control based on the name of the control. Something like control = findcontrol("btnProduct"+buttonNumber) You probably catch my drift... (and yes, I am a newby in wxPython) Regards, Dennis
wxpython, find control based on its name
0.197375
0
0
1,526
6,049,741
2011-05-18T19:02:00.000
0
0
1
1
python,fork,process,ipython
6,218,845
2
false
0
0
In Linux terminology, instead of forking the iPython process, why don't you exec a regular python interpreter from the iPython shell and have that one fork?
1
7
0
I am planning a Python script that'll use os.fork() to create a bunch of child processes to perform some computations. The parent process will block until the children terminate. The twist is that I need to be able to run the script both from the Unix shell using python and from ipython using %run. In what manner shoul...
ipython and fork()
0
0
0
1,506
6,051,175
2011-05-18T21:19:00.000
1
0
0
0
python,screen-scraping,web-scraping
6,097,514
4
false
1
0
One approach is to compare the structure of multiple webpages that share the same template. In this case you would compare multiple SO questions. Then you can determine which content is static (useless) or dynamic (useful). This field is known as wrapper induction. Unfortunately it is harder than it sounds!
1
2
0
Is there a API or systematic way of stripping irrelevant parts of a web page while scraping it via Python? For instance, take this very page -- the only important part is the question and the answers, not the side bar column, header, etc. One can guess things like that, but is there any smart way of doing it?
Stripping irrelevant parts of a web page
0.049958
0
1
171
6,051,301
2011-05-18T21:35:00.000
7
0
0
0
python,django
6,052,784
4
false
1
0
You can use the slice notation: {{ a_string_variable|slice:":5" }} This would give you the first 5 characters in the string.
1
5
0
On the Django docs for built in tags and filters they give a filter to truncate words but not characters (letters/numbers/spaces, etc). Is there such a thing available?
What is the Django filter for truncating characters?
1
0
0
6,402
6,051,378
2011-05-18T21:43:00.000
1
0
1
0
java,php,python,regex,pdf
6,051,457
3
false
0
0
Splitting a PDF at the byte stream level will not result in a valid PDF. Now that we've got that out of the way, you'll need a library (Apache PDFBox in java, pyPDF in python) that can parse PDFs and let you iterate over the text, applying your regexp. Once you've found the text you use the library to extract the relev...
2
0
0
I am trying to split gargantuan PDFs based on a RegEx of the sort [A-Z][a-z]+(\s–\s)[A-Z][a-z]+ Because after every instance of this begins a new 'section' that I need to be split into its own document. I have no idea where to begin, or what language to look at first. Any help would be appreciated.
Split PDF after RegEx: Where should I start?
0.066568
0
0
498
6,051,378
2011-05-18T21:43:00.000
0
0
1
0
java,php,python,regex,pdf
6,054,867
3
false
0
0
A PDF contains alsorts of file structures, it is not just a collection of pages. So you can't just break it up.
2
0
0
I am trying to split gargantuan PDFs based on a RegEx of the sort [A-Z][a-z]+(\s–\s)[A-Z][a-z]+ Because after every instance of this begins a new 'section' that I need to be split into its own document. I have no idea where to begin, or what language to look at first. Any help would be appreciated.
Split PDF after RegEx: Where should I start?
0
0
0
498
6,051,570
2011-05-18T22:03:00.000
1
0
1
0
python,iterator,scope
6,051,628
2
true
0
0
Generator expressions do not leak the iterator. List comprehensions in 2.x do, but not in 3.x.
1
1
0
I have the following snippet of code. I'm basically trying to get the index/iterator of a particular string in a list (aside from just knowing whether it is present). Is this possible at all, or should I be using a loop-with-an-if? bucket = ["alpha", "beta", "gamma"] content = "" if any(content == "beta" for content in...
Iterator value not retained after 'any()' call
1.2
0
0
69
6,052,379
2011-05-18T23:58:00.000
6
0
0
0
python,python-3.x,pygame
6,052,506
2
false
0
1
To be honest, that's probably more trouble than it's worth. Your best bet is to get together and make a list of the addons you guys want to use and whether or not they're compatible with 3.1. Then decide if you can live without the incompatible ones. If you can't, do the project in 2.5, otherwise go with 3.1 and have...
2
7
0
I'm currently working the final project for my programming class. We're writing it in Python 3.1, and I'm doing the GUI. My team's leader wants to do the whole project in 3.1, but most pyGame addons (like pyConsole) are giving me compatibility issues. So, my question is, can I write my frontend in 2.5 and then hook it...
Using Python 3.1 and 2.5 together
1
0
0
195
6,052,379
2011-05-18T23:58:00.000
3
0
0
0
python,python-3.x,pygame
6,052,534
2
false
0
1
Short Answer NO. Longer Answer. You can write your frontend with Python 2.5 and the backend with 3.0, but they can't interact at all. You need some sort of abstraction layer between them. Doing something like this you can have any language in the other side. The abstraction Layer would need to pull jobs work on them a...
2
7
0
I'm currently working the final project for my programming class. We're writing it in Python 3.1, and I'm doing the GUI. My team's leader wants to do the whole project in 3.1, but most pyGame addons (like pyConsole) are giving me compatibility issues. So, my question is, can I write my frontend in 2.5 and then hook it...
Using Python 3.1 and 2.5 together
0.291313
0
0
195
6,053,426
2011-05-19T03:30:00.000
2
0
0
0
python,sql,django,postgresql
6,053,509
3
false
1
0
Yes. I don't see why not, but that would be most unconventional and breaking convention usually leads to complications down the track. Describe the problem you think it will solve and perhaps someone can offer a more conventional solution.
1
2
0
I need to have some references in my table and a bunch of "deferrable initially deferred" modifiers, but I can't find a way to make this work in the default generated Django code. Is it safe to create the table manually and still use Django models?
Is it safe to write your own table creation SQL for use with Django, when the generated tables are not enough?
0.132549
1
0
112
6,053,867
2011-05-19T04:45:00.000
2
0
1
0
python,windows,loops,registry
6,054,398
1
true
0
0
_winreg.OpenKey to open a given registry key. _winreg.EnumKey to enumerate the sub-keys of a given registry key. And you have the _winreg.HKEY_CLASSES_ROOT and friends key constants. What else do you need?
1
0
0
I am trying to write a small application that checks each value in the Windows Registry for valid file paths, provided it is a REG_SZ. I need to be able to loop through all of the keys and subkeys reading each value as I go. I looked in to _winreg, but couldn't find any clear examples for this task. Any help would be g...
Loop through Registry Python
1.2
0
0
1,420
6,054,672
2011-05-19T06:29:00.000
1
0
1
0
python,function,keyword,coffeescript
6,061,329
4
true
0
0
Keywords are lower-level building blocks than functions, and can do things that functions can't. You cite return in your question, which is a good example: In all the languages you mention, there's no way to use a function to provide the same behavior as return x.
2
5
0
I was thinking about this recently since Python 3 is changing print from a statement to a function. However, Ruby and CoffeeScript take the opposite approach, since you often leave out parentheses from functions, thereby blurring the distinction between keywords/statements and functions. (A function call without paren...
What's the difference between a keyword or a statement, and a function call?
1.2
0
0
2,811
6,054,672
2011-05-19T06:29:00.000
4
0
1
0
python,function,keyword,coffeescript
6,061,369
4
false
0
0
A function is executed within a stack frame, whereas a keyword statement isn't necessarily. A good example is the return statement: If it were a function and would execute in its own stack, there would be no way it could control the execution flow in the way it does.
2
5
0
I was thinking about this recently since Python 3 is changing print from a statement to a function. However, Ruby and CoffeeScript take the opposite approach, since you often leave out parentheses from functions, thereby blurring the distinction between keywords/statements and functions. (A function call without paren...
What's the difference between a keyword or a statement, and a function call?
0.197375
0
0
2,811
6,056,936
2011-05-19T10:01:00.000
0
0
0
0
python,facebook,oauth
6,064,508
2
false
1
0
I would think newsfeed, but if there is a difference, it's very small.
2
3
0
I'm planning to start a web app that uses the Facebook Python SDK. I found two examples in the sdk, newsfeed and oauth. Since im going to deploy the app at google appengine I'm confused to choose which one to base my project. The oauth example uses OAuth 2.0 directly and the newsfeed example rely on the cookie saved b...
To use Facebook Javascript or not
0
0
0
130
6,056,936
2011-05-19T10:01:00.000
0
0
0
0
python,facebook,oauth
6,064,561
2
false
1
0
If is a Javascript SDK then it runs on the client browser, not in GAE server, so, that should be the one with less ( server ) CPU usage.
2
3
0
I'm planning to start a web app that uses the Facebook Python SDK. I found two examples in the sdk, newsfeed and oauth. Since im going to deploy the app at google appengine I'm confused to choose which one to base my project. The oauth example uses OAuth 2.0 directly and the newsfeed example rely on the cookie saved b...
To use Facebook Javascript or not
0
0
0
130
6,058,019
2011-05-19T11:37:00.000
2
0
0
0
python,security,passwords
6,058,858
2
false
0
0
If you use a different salt for each user, you must store it somewhere (ideally in a different place). If you use the same salt for every user, you can hardcode it in your app, but it can be considered less secure. If you don't keep the salt, you will not be able to match a given password against the one in your datab...
1
10
0
I am creating a software with user + password. After autentification, the user can access some semi public services, but also encrypt some files that only the user can access. The user must be stored as is, without modification, if possible. After auth, the user and the password are kept in memory as long as the softwa...
Storing user and password in a database
0.197375
1
0
3,307
6,058,818
2011-05-19T12:47:00.000
0
0
0
1
python,vpn
6,058,965
2
false
0
0
Python itself can't be used to route traffic; though you can use it to execute system commands to change your routing table. If you're on Linux, you need to use the ip command from the iproute2 and iptables from netfilter to change the routing behavior of specific traffic.
2
4
0
Is there any method to connect to vpn through python and have that traffic of that application only route through the said VPN?
routing a only specific traffic through a vpn connection via python
0
0
1
2,644
6,058,818
2011-05-19T12:47:00.000
0
0
0
1
python,vpn
41,357,041
2
false
0
0
Please, be more specific in your question. Generally, yes, it is possible. If you use python 2.7 or newer, you can use source_address option for http connections (see reference for libraries you use) as tuple ('interface address', port). If you use sockets in your app, use socket.bind(('interface address', port)) on cr...
2
4
0
Is there any method to connect to vpn through python and have that traffic of that application only route through the said VPN?
routing a only specific traffic through a vpn connection via python
0
0
1
2,644
6,059,744
2011-05-19T13:51:00.000
0
0
0
0
python,django
6,060,065
3
false
1
0
The best resource in my opinion is right here a Stackoverflow. I haven't found any good python or django books that were better than just doing it yourself. If you know how to program, jump right in. Start making a django app. You'll find it pretty straightforward. I prefer vim but a lot of people use Eclipse or Kom...
1
2
0
I am a Java developer and am going to try out Python/Django for the first time and I had some basic questions from my end. Which are the go-to python forums? Which are the go-to django forums? What are the go-to IDEs? (I use Eclipse for Java) Are there any books you encourage or discourage me from reading? Any final wo...
Python and Django basics
0
0
0
1,236
6,062,396
2011-05-19T17:19:00.000
1
0
0
1
python,nosql,distributed-computing
6,062,779
5
false
0
0
Can you write your code using a Python binding to MPI? MPI has facility for over the wire data transmission from M nodes to N nodes, M,N>=1. Also, as mentioned above you could write the data to 100 files on a shared filesystem, then read the files on the 'master' node.
4
10
0
I have 100 servers in my cluster. At time 17:35:00, all 100 servers are provided with data (of size 1[MB]). Each server processes the data, and produces an output of about 40[MB]. The processing time for each server is 5[sec]. At time 17:35:05 (5[sec] later), there's a need for a central machine to read all the output ...
Quick Sending of 4[GB] To Be Processed From 100 Machines?
0.039979
0
0
423
6,062,396
2011-05-19T17:19:00.000
2
0
0
1
python,nosql,distributed-computing
6,063,128
5
false
0
0
What's your networking setup ? If your central machine is connected to the cluster by a single gigabit link, it's going to take you at least ~30s to copy the 4GByte to it (and that's assuming 100% efficiency and about 8s per gigabyte, which I've never seen).
4
10
0
I have 100 servers in my cluster. At time 17:35:00, all 100 servers are provided with data (of size 1[MB]). Each server processes the data, and produces an output of about 40[MB]. The processing time for each server is 5[sec]. At time 17:35:05 (5[sec] later), there's a need for a central machine to read all the output ...
Quick Sending of 4[GB] To Be Processed From 100 Machines?
0.07983
0
0
423
6,062,396
2011-05-19T17:19:00.000
5
0
0
1
python,nosql,distributed-computing
6,064,685
5
true
0
0
Look at the flow of data in your application, and then look at the data rates that your (I assume shared) disk system provides and the rate your GigE interconnect provides, and the topology of your cluster. Which of these is a bottleneck? GigE provides theoretical maximum 125 MB/s transmission rate between nodes - thus...
4
10
0
I have 100 servers in my cluster. At time 17:35:00, all 100 servers are provided with data (of size 1[MB]). Each server processes the data, and produces an output of about 40[MB]. The processing time for each server is 5[sec]. At time 17:35:05 (5[sec] later), there's a need for a central machine to read all the output ...
Quick Sending of 4[GB] To Be Processed From 100 Machines?
1.2
0
0
423
6,062,396
2011-05-19T17:19:00.000
2
0
0
1
python,nosql,distributed-computing
6,087,129
5
false
0
0
Experiment! Other answers have included tips on what to experiment with, but you might solve the problem the most straight-forward way and use that as your baseline. You have 1meg producing 40meg of output on each server - experiment with each server compressing the data to be sent. (That compression might be free-ish ...
4
10
0
I have 100 servers in my cluster. At time 17:35:00, all 100 servers are provided with data (of size 1[MB]). Each server processes the data, and produces an output of about 40[MB]. The processing time for each server is 5[sec]. At time 17:35:05 (5[sec] later), there's a need for a central machine to read all the output ...
Quick Sending of 4[GB] To Be Processed From 100 Machines?
0.07983
0
0
423
6,062,999
2011-05-19T18:10:00.000
2
0
0
0
python,sqlite
6,175,144
1
true
0
0
As Firefox is massively using SQLite I wouldn't be surprised if this request came from their camp to prevent any kind of 3rd party interference (e.g. "trashing" with large/small/invalid/obscure values) by this kind of pragma propagating through all database connections Hence, my strong belief is that there is no altern...
1
5
0
The sqlite docs says that using the pragma default_cache_size is deprecated. I looked, but I couldn't see any explanation for why. Is there a reason for this? I'm working on an embedded python program, and we open and close connections a lot. Is the only alternative to use the pragma cache_size on every database connec...
Alternative to deprecated sqlite pragma "default_cache_size"
1.2
1
0
890
6,063,286
2011-05-19T18:35:00.000
7
0
0
1
python,google-app-engine,google-cloud-datastore
6,063,370
2
false
1
0
Datastore has no concept of versions. When you update a model definition, any entities you create in the future will be of the new type, and the old ones will be of the old type. This frequently leads to runtime errors if your code is not aware of these changes.
1
15
0
Google App Engine has the concept of app versions. i.e., you can have multiple versions of your app running concurrently and accessible at different subdomains. For instance: http://1.my-app-name.appspot.com, http://2.my-app-name.appspot.com. What aspects of the app are actually "versioned" by this? Is it only the Pyth...
Google App Engine Versioning in the Datastore
1
0
0
1,749
6,063,494
2011-05-19T18:52:00.000
4
0
1
0
python,python-2.7,optimization,python-2.6
6,158,391
7
false
0
0
What is the (average, min, max) number of base objects in a collection? Tuples are "deduplicated" and lists are not? What do you think that "deduplicated" means in this context? Lists do take up more memory than tuples, because extra memory is allocated on the presumption that a list is going to grow and you definitely...
3
8
0
I have a medium-amount of base objects. These base objects will be put in collections, and these collections will be munged around: sorted, truncated, etc. Unfortunately, the n is large enough that memory consumption is slightly worrisome, and speed is getting concerning. My understanding is that tuples are slightly m...
Python efficiency: lists vs. tuples
0.113791
0
0
8,021
6,063,494
2011-05-19T18:52:00.000
2
0
1
0
python,python-2.7,optimization,python-2.6
6,063,534
7
false
0
0
You can't use them the same way. Tuples are immutable and don't support appending, sorting, etc (calling sorted on a tuple yields a list, and so on). Tuples are totally different from lists, so any performance comparison is meaningless.
3
8
0
I have a medium-amount of base objects. These base objects will be put in collections, and these collections will be munged around: sorted, truncated, etc. Unfortunately, the n is large enough that memory consumption is slightly worrisome, and speed is getting concerning. My understanding is that tuples are slightly m...
Python efficiency: lists vs. tuples
0.057081
0
0
8,021
6,063,494
2011-05-19T18:52:00.000
1
0
1
0
python,python-2.7,optimization,python-2.6
6,063,520
7
false
0
0
You cannot sort an immutable object - i.e. when sorting a tuple you'll always create a new one.
3
8
0
I have a medium-amount of base objects. These base objects will be put in collections, and these collections will be munged around: sorted, truncated, etc. Unfortunately, the n is large enough that memory consumption is slightly worrisome, and speed is getting concerning. My understanding is that tuples are slightly m...
Python efficiency: lists vs. tuples
0.028564
0
0
8,021
6,063,755
2011-05-19T19:16:00.000
4
0
1
0
python
6,063,831
15
false
0
0
Instead of incrementing the value, just use a tuple for the colliding key. If you need to keep them in order, every key should be a tuple, not just the duplicates.
4
76
0
How can I increment a floating point value in python by the smallest possible amount? Background: I'm using floating point values as dictionary keys. Occasionally, very occasionally (and perhaps never, but not certainly never), there will be collisions. I would like to resolve these by incrementing the floating point ...
Increment a Python floating point value by the smallest possible amount
0.053283
0
0
22,984
6,063,755
2011-05-19T19:16:00.000
2
0
1
0
python
6,134,027
15
false
0
0
For colliding key k, add: k / 250 Interesting problem. The amount you need to add obviously depends on the magnitude of the colliding value, so that a normalized add will affect only the least significant bits. It's not necessary to determine the smallest value that can be added. All you need to do is approximate it....
4
76
0
How can I increment a floating point value in python by the smallest possible amount? Background: I'm using floating point values as dictionary keys. Occasionally, very occasionally (and perhaps never, but not certainly never), there will be collisions. I would like to resolve these by incrementing the floating point ...
Increment a Python floating point value by the smallest possible amount
0.02666
0
0
22,984
6,063,755
2011-05-19T19:16:00.000
5
0
1
0
python
6,133,814
15
false
0
0
Forgetting about why we would want to increment a floating point value for a moment, I would have to say I think Autopulated's own answer is probably correct. But for the problem domain, I share the misgivings of most of the responders to the idea of using floats as dictionary keys. If the objection to using Decimal (...
4
76
0
How can I increment a floating point value in python by the smallest possible amount? Background: I'm using floating point values as dictionary keys. Occasionally, very occasionally (and perhaps never, but not certainly never), there will be collisions. I would like to resolve these by incrementing the floating point ...
Increment a Python floating point value by the smallest possible amount
0.066568
0
0
22,984
6,063,755
2011-05-19T19:16:00.000
4
0
1
0
python
6,063,845
15
false
0
0
I recommend against assuming that floats (or timestamps) will be unique if at all possible. Use a counting iterator, database sequence or other service to issue unique identifiers.
4
76
0
How can I increment a floating point value in python by the smallest possible amount? Background: I'm using floating point values as dictionary keys. Occasionally, very occasionally (and perhaps never, but not certainly never), there will be collisions. I would like to resolve these by incrementing the floating point ...
Increment a Python floating point value by the smallest possible amount
0.053283
0
0
22,984
6,064,044
2011-05-19T19:46:00.000
0
0
0
0
button,menu,bitmap,wxpython,toggle
6,073,070
2
false
0
1
Per Mark's suggestion, if you have wx 2.8.12 you can use a plate button to get the toggle/bitmap/menu functionality. Since it is not easy for me to update to the newer wx at this point, I'll use a bitmap button and fake the toggle.
2
0
0
I need a button that has a bitmap, toggles, and to which I can add a menu (I realize this is asking a lot). I can't figure out a way to do this in wx python. Here are the things I've tried and why they don't work: plate buttons: don't toggle genbitmaptogglebuttons: for some reason, these buttons kill my tooltips (I p...
wx python bitmap/toggle/menu button
0
0
0
618
6,064,044
2011-05-19T19:46:00.000
0
0
0
0
button,menu,bitmap,wxpython,toggle
6,064,311
2
false
0
1
I don't see a pre-built button with all those features. I would think that you can use the generic toggle button or maybe the ShapedButton for your bitmap toggle functionality and attach a right-click popup menu. I'm not really sure what you mean by a menu, so that may not work. If you're talking about a menu implement...
2
0
0
I need a button that has a bitmap, toggles, and to which I can add a menu (I realize this is asking a lot). I can't figure out a way to do this in wx python. Here are the things I've tried and why they don't work: plate buttons: don't toggle genbitmaptogglebuttons: for some reason, these buttons kill my tooltips (I p...
wx python bitmap/toggle/menu button
0
0
0
618
6,064,385
2011-05-19T20:18:00.000
0
0
0
0
python,couchdb,pymongo,couchdb-python
11,588,230
2
false
1
0
Use view() function to run permanent views in database. It is more efficient. In many cases, temporary may be very costly.
1
2
0
I'm using ad-hoc JavaScript map functions in couchdb-python through its query() function. Is there a way of getting the time the query takes to process? I've tried timing the script, but it's pretty obvious to me that the time I'm getting is not correct. If I iterate over the ViewResult that the query() function retur...
Is there a way to get the time in milliseconds for an ad-hoc query against CouchDB using couchdb-python?
0
0
0
209
6,066,396
2011-05-20T00:47:00.000
0
0
0
0
python,video-processing,watermark,video-watermarking
6,077,343
3
false
0
0
If you're looking for a robust (for-pay) service, I've had a very nice experience with Zencoder. The python api module is easy to use and fairly well documented.
2
3
0
Is there any standard method of watermarking videos of some format in Python? And how about still images?
Is there a standard way of Watermarking videos in Python?
0
0
0
1,876
6,066,396
2011-05-20T00:47:00.000
0
0
0
0
python,video-processing,watermark,video-watermarking
6,076,489
3
false
0
0
Transloadit provides image & video conversion via web services, works well, and very cheap. If you need to do this on a large scale and don't want to buy a bunch of HW, they are great. Someone mentioned Zencoder. I don't have experience to understand all the tradeoffs between Transloadit and Zencoder. However in the...
2
3
0
Is there any standard method of watermarking videos of some format in Python? And how about still images?
Is there a standard way of Watermarking videos in Python?
0
0
0
1,876
6,066,797
2011-05-20T02:10:00.000
0
0
1
0
python,file-io
6,066,839
3
false
0
0
You'll probably need to keep track of it separately, along with your file. You might wrap your file object to include a counter. Python itself only keeps track of how far along you are in terms of bytes, and has no way to move around based on line numbers. Edit: I stand corrected. S.Lott's suggestion of fileinput is sp...
1
5
0
I am reading a file in Python. After I read a bunch of lines, is there a convenient function that I can use to get the current line number in the file that the cursor is on? I am trying to refrain from using a counter since I have multiple functions that read the same file and may move the cursor all over the place. Th...
How to find line number of cursor in Python?
0
0
0
1,221
6,067,613
2011-05-20T04:54:00.000
0
0
0
0
python,selenium
6,068,761
4
false
0
0
If you are looking for something like isThisLink(String textToBeValidated), then no. Selenium doesn't have such a method. You will have to write custom code to validate that.
3
1
0
Is there any method in selenium to get that text is a Link or simple text
Is there any method in selenium to get that text is a "Link" or simple text
0
0
1
872
6,067,613
2011-05-20T04:54:00.000
0
0
0
0
python,selenium
6,082,293
4
false
0
0
You can use is_element_present('link=' + text). This will return true if text is a link otherwise false. Caution: You need to escape special characters in text. While testing this I was looking for a link that had a question mark in it and it was not found.
3
1
0
Is there any method in selenium to get that text is a Link or simple text
Is there any method in selenium to get that text is a "Link" or simple text
0
0
1
872
6,067,613
2011-05-20T04:54:00.000
0
0
0
0
python,selenium
6,087,908
4
false
0
0
You can user getText() method in the below way: selenium.getText("ID or xpath"); Happy Learning , Happy Sharing...
3
1
0
Is there any method in selenium to get that text is a Link or simple text
Is there any method in selenium to get that text is a "Link" or simple text
0
0
1
872
6,067,785
2011-05-20T05:22:00.000
2
0
1
0
python,frameworks,distribution,bundle
6,067,880
1
false
0
0
I'd recommend against it. You'll run into problems between 32b and 64b versions, between different libc versions, noexec locations, wrong selinux/apparmor profiles for custom paths and many other potential problems... Unless you're planning to release (and test!) a package for each separate distribution, architecture a...
1
0
0
Here's the deal. I am developing a framework whose sole users have extremely messed up python installations on their servers (Linux). They all have multiple versions of Python on their servers and their PYTHONHOME and PYTHONPATH variables are pointing to different versions. Since my framework will require Python 2.6, I...
Is it wrong to package Python with my framework?
0.379949
0
0
92
6,067,836
2011-05-20T05:33:00.000
3
1
0
0
python,algorithm,compression,data-dump
6,067,866
1
true
0
0
GZIP with standard compression level should be fine for most cases. Higher compression levels=more CPU time. BZ2 is packing better but is also slower. Well, there is always a trade-off between CPU consumption/running time and compression efficiency...all compressions with default compression levels should be fine.
1
1
0
I'm creating data dumps from my site for others to download and analyze. Each dump will be a giant XML file. I'm trying to figure out the best compression algorithm that: Compresses efficiently (CPU-wise) Makes the smallest possible file Is fairly common I know the basics of compression, but haven't a clue as to whic...
What's the best compression algorithm for data dumps
1.2
0
0
1,128
6,067,919
2011-05-20T05:46:00.000
1
1
0
0
python,architecture
6,067,968
3
false
1
0
You will actually only need the user_likes table. The like_count is calculated from that table. You will only need to store that if you need to gain performance, but since you're using memcached, It may be a good idea to not store the aggregated value in the database, but store it only in memcached.
2
0
0
I have a website where people post comments, pictures, and other content. I want to add a feature that users can like/unlike these items. I use a database to store all the content. There are a few approaches I am looking at: Method 1: Add a 'like_count' column to the table, and increment it whenever someone likes an i...
What would be a good strategy to implement functionality similar to facebook 'likes'?
0.066568
1
0
104
6,067,919
2011-05-20T05:46:00.000
1
1
0
0
python,architecture
6,067,953
3
false
1
0
One relation table that does a many-to-many mapping between user and item should do the trick.
2
0
0
I have a website where people post comments, pictures, and other content. I want to add a feature that users can like/unlike these items. I use a database to store all the content. There are a few approaches I am looking at: Method 1: Add a 'like_count' column to the table, and increment it whenever someone likes an i...
What would be a good strategy to implement functionality similar to facebook 'likes'?
0.066568
1
0
104
6,071,395
2011-05-20T11:41:00.000
1
0
1
0
python,parsing,ivr,vxml,freeswitch
6,071,833
1
false
0
0
Isn't any standard XML parser enough? You could just write a quick wrapper to get the elemenents you're interested in (although xpath will also do that for you). To verify correctness, the VXML schema / definition should be enough (as long as your chosen XML parser supports them) If XML parser is too low level, let us ...
1
0
0
I am looking for a vxml (voicexml) parser in python language. Need to use the parsed vxml tags and interact with freeswitch to run IVR. Can anyone help me with any kind of opensource vxml parsers?
I am looking for a vxml (voicexml) parser in python language
0.197375
0
1
1,073
6,074,030
2011-05-20T15:20:00.000
0
0
1
0
python,editor
6,075,662
2
false
0
0
I don't understand the question fully either. Why NOT install python? But if the question is how to be able to edit and run python on machines without installing it, there's Movable Python (http://www.voidspace.org.uk/python/movpy/) with a small fee to purchase and Portable Python (http://www.portablepython.com/wiki/Ab...
1
0
0
I need an editor with python built into it. Currently I use blender so I do not have install python. Blender comes with the python32.dll to use python. is there another editor out there that I can execute python commands without it being installed?
Is there a Python editor with python built in?
0
0
0
1,321
6,074,034
2011-05-20T15:20:00.000
0
0
1
1
python,redirect,pipe,system-calls
6,074,155
2
false
0
0
Python as build-in functionality like os.listdir() or os.walk() for listing stuff on the filesystem. Running 'ls' yourself is very bad-style. In general look at the documentation of the subprocess module giving you all flexibility for interacting with external commands.
1
0
0
I wish to execute os.system('ls') in python. the return value of this statement is an error code integer..but I want to get the contents of the present directory as a string. How to accomplish this?
redirecting system call output in python
0
0
0
624
6,074,884
2011-05-20T16:22:00.000
0
0
0
0
java,python,regex
6,075,053
3
false
1
0
You should be fine with java regular expressions and it should be a trivial exercise to support named captures. After all it is just mapping capture group numbers to names. I even have code for this around somewhere, but can't share due to copyright reasons. You could put regular expressions to parse the individual pa...
2
0
0
I am working on some code to parse text into XML. I am currently using java and jaxb to handle the XML and the in-program representation of my data. I need to setup an easily expandable and adaptable method to parse the info from my text files into my java classes. The data will for the most part stay the same, but I n...
Flexible parsing of text with regular expressions in Java or Python
0
0
0
446
6,074,884
2011-05-20T16:22:00.000
2
0
0
0
java,python,regex
6,075,184
3
false
1
0
Those look like fixed-width fields, which are probably a good choice for simple string splitting. The only thing it looks like you could use regular expressions for is to determine what type of record you are looking at, although it looks like the indentation level is also useful for determining that.
2
0
0
I am working on some code to parse text into XML. I am currently using java and jaxb to handle the XML and the in-program representation of my data. I need to setup an easily expandable and adaptable method to parse the info from my text files into my java classes. The data will for the most part stay the same, but I n...
Flexible parsing of text with regular expressions in Java or Python
0.132549
0
0
446
6,075,361
2011-05-20T17:08:00.000
2
1
1
0
python,linux,shutil
6,075,406
3
false
0
0
Python 2.7 is the earliest release to include make_archive in shutils. shutils in general existed since at least 2.0.
1
2
0
I am trying to use shutil.make_archive, but I get a "module not found" error. Then I tried using Python 2.7 and it worked. What is the lowest Python version that contains that module and function?
What is the lowest version of Python that has the shutil module?
0.132549
0
0
816
6,075,774
2011-05-20T17:50:00.000
1
0
1
0
python
6,075,820
3
false
0
0
It means negation. errno.EACCES (permission denied) is the number 13 (positive). The author of that code had a convention where he wanted the error number to be negative to be interpreted by their code later. Presumably, he has a reason for adopting this convention. E.g., the function returns non-negative integers ...
1
0
0
In python code. When you see a negative in front of a Error Flag, what does it mean? return -errno.EACCES
Need help understanding this python error return (Google search doesn't help)
0.066568
0
0
140
6,076,014
2011-05-20T18:11:00.000
4
0
0
0
python,drawing,wxpython
6,076,453
2
true
0
1
I would just call self.Refresh() or maybe RefreshRect() and pass the area that needs to be repainted.
1
4
0
I've got a Canvas which manipulates objects in the mouse event handler. After modifying the objects, I want to trigger the OnPaint() event for the same Canvas to show (rerender) the changes. What is the right way to do this? It doesn't let me call OnPaint() directly. Also, is triggering an event from another event "wro...
Force repaint in wxPython Canvas
1.2
0
0
3,642
6,078,181
2011-05-20T22:27:00.000
0
1
1
0
python-3.x,python-idle
23,234,123
4
false
0
0
Just copy and paste the code into a new file (In file), and save it. To run, you can go to the run section and select "Run Module", or you can simply press F5.
3
0
0
How to clear Python shell ? I am writing a module in python, I want to save it in a file. what is the best way to do it?
Clearing Python shell
0
0
0
7,935
6,078,181
2011-05-20T22:27:00.000
2
1
1
0
python-3.x,python-idle
6,080,090
4
false
0
0
Python shell does not get cleared or saved. Perhaps you are using IDLE. It's a confusing piece of software. I'd recommend you to get a real IDE, or at least a proper text editor.
3
0
0
How to clear Python shell ? I am writing a module in python, I want to save it in a file. what is the best way to do it?
Clearing Python shell
0.099668
0
0
7,935
6,078,181
2011-05-20T22:27:00.000
2
1
1
0
python-3.x,python-idle
6,078,245
4
true
0
0
File -> New Window. Put your module in this new window, than save it. To run, just press F5.
3
0
0
How to clear Python shell ? I am writing a module in python, I want to save it in a file. what is the best way to do it?
Clearing Python shell
1.2
0
0
7,935
6,078,990
2011-05-21T01:19:00.000
0
0
0
0
python,django
6,079,021
2
false
1
0
Monkeypatch django.utils.timesince.timesince with your desired function.
1
0
0
I want to override timesince Django's template filter for creating a more efficient filter for getting relative times. How can I do it?
How can I override Django filter
0
0
0
174
6,079,020
2011-05-21T01:26:00.000
0
1
0
0
java,c++,python,performance,web-crawler
6,081,622
4
false
0
0
If you're using tomcat search for "Crawler Session Manager Valve"
4
0
0
It seems like typical crawlers that just download a small number of pages or do very little processing to decide what pages to download are IO limited. I am curious as to what order of magnitude estimates of sizes relevant data structures, number of stored pages, indexing requirements etc that might actually make CPU t...
In what scenarios might a web crawler be CPU limited as opposed to IO limited?
0
0
1
210
6,079,020
2011-05-21T01:26:00.000
2
1
0
0
java,c++,python,performance,web-crawler
6,079,060
4
true
0
0
Only when you are doing extensive processing on each page. eg if you are running some sort of AI to try to guess the semantics of the page. Even if your crawler is running on a really fast connection, there is still overhead creating connections, and you may also be limited by the bandwidth of the target machines
4
0
0
It seems like typical crawlers that just download a small number of pages or do very little processing to decide what pages to download are IO limited. I am curious as to what order of magnitude estimates of sizes relevant data structures, number of stored pages, indexing requirements etc that might actually make CPU t...
In what scenarios might a web crawler be CPU limited as opposed to IO limited?
1.2
0
1
210
6,079,020
2011-05-21T01:26:00.000
1
1
0
0
java,c++,python,performance,web-crawler
6,080,282
4
false
0
0
If the page contains pictures and you are trying to do face recognition on the pictures (ie to form a map of pages that have pictures of each person). That may be CPU bound because of the processing involved.
4
0
0
It seems like typical crawlers that just download a small number of pages or do very little processing to decide what pages to download are IO limited. I am curious as to what order of magnitude estimates of sizes relevant data structures, number of stored pages, indexing requirements etc that might actually make CPU t...
In what scenarios might a web crawler be CPU limited as opposed to IO limited?
0.049958
0
1
210
6,079,020
2011-05-21T01:26:00.000
0
1
0
0
java,c++,python,performance,web-crawler
6,079,035
4
false
0
0
Not really. It takes I/O to download these additional links, and you're right back to I/O-limited again.
4
0
0
It seems like typical crawlers that just download a small number of pages or do very little processing to decide what pages to download are IO limited. I am curious as to what order of magnitude estimates of sizes relevant data structures, number of stored pages, indexing requirements etc that might actually make CPU t...
In what scenarios might a web crawler be CPU limited as opposed to IO limited?
0
0
1
210
6,079,128
2011-05-21T01:57:00.000
-1
0
1
1
python,ipython,ld,rpath,tcmalloc
6,079,512
3
false
0
0
If you compiled 2.6.6 and installed 2.6.5 from the repos, then ubuntu is having a conflict in finding what python you're using. I'm flagging this to move to Superuser.
1
2
0
I compiled Python 2.6.6 with google-perf tools (tcmalloc) library to eliminate some of the memory issues I was having with the default 2.6.5. After getting 2.6.6 going it seems to not work becuase I think having issues with the default 2.6.5 install in Ubuntu. Will none of the binaries installed from the software chann...
Compiling Python 2.6.6 and need for external packages wxPython, setuptools, etc... in Ubuntu
-0.066568
0
0
2,035
6,080,024
2011-05-21T06:22:00.000
0
0
0
0
python,django,url
6,080,084
4
false
1
0
I guess the main problem is in your view file,where you are working with http response request object .Check that all the settings are accurate in settings.py,also use try except block for finding the error more precisely.
1
3
0
I am receiving notifications every time, when enter an address that does not exist. Traceback (most recent call last): File "/home/user/opt/local/django/core/handlers/base.py", line 100, in get_response File "/web/blog/views.py", line 33, in post File "/home/user/local/django/db/models/manager.py", line 13...
django Error (EXTERNAL IP)
0
0
0
1,988
6,080,242
2011-05-21T07:13:00.000
7
0
1
0
javascript,node.js,ipython,coffeescript
6,081,947
6
false
1
0
To my knowledge, node and coffee are the only full-featured command-line REPLs for Node.js and CoffeeScript (respectively) right now. In their latest iterations, both offer some degree of colorful output, pretty printing, and completion.
1
33
0
More specifically, is there a REPL that has (more) colorful output, pretty printing, tab completion and the other goodies that ipython has for node.js javascript/coffeescript?
ipython equivalent for javascript/coffeescript for node.js?
1
0
0
6,571
6,080,477
2011-05-21T08:10:00.000
2
1
1
1
python,linux,file-io
6,080,484
5
false
0
0
Use the os.stat() function to get a stat structure. The st_size attribute of that is the size of the file in bytes.
1
13
0
I am doing backups in python script but i need to get the size of tar.gz file created in MB How can i get the size in MB of that file
How to get the size of tar.gz in (MB) file in python
0.07983
0
0
28,504
6,081,008
2011-05-21T10:01:00.000
2
0
0
0
python,arrays,csv,numpy
40,091,714
12
false
0
0
If you want to save your numpy array (e.g. your_array = np.array([[1,2],[3,4]])) to one cell, you could convert it first with your_array.tolist(). Then save it the normal way to one cell, with delimiter=';' and the cell in the csv-file will look like this [[1, 2], [2, 4]] Then you could restore your array like this: yo...
1
711
1
Is there a way to dump a NumPy array into a CSV file? I have a 2D NumPy array and need to dump it in human-readable format.
Dump a NumPy array into a csv file
0.033321
0
0
1,040,617
6,081,815
2011-05-21T12:43:00.000
1
1
0
0
c++,python,bittorrent,tracker
6,093,419
2
true
0
0
libtorrent automatically does this when stopping a torrent, or stopping the session. If it seems to fail, you might want to increase the tracker timeout when shutting down. This will add to the shutdown delay, but will give some more overloaded trackers some more time. See session_settings::stop_tracker_timeout. By def...
1
0
0
From what I know, when seeding or leeching torrent, your IP is on tracker and it remains there for some few hours or days How do I manually tell my the tracker using Libtorrent I am no longer going to be connected to the tracker and it should forget my IP as I am neither seeding nore leeching. Any code bits or advices ...
reporting end of seed or leeching to tracker Libtorrent
1.2
0
0
659
6,082,723
2011-05-21T15:33:00.000
2
0
0
0
python,listbox,tkinter
6,083,339
1
false
0
1
No, there is no setting, subclass or theme that will let you do that with a listbox. What you might want to use instead is a set of check buttons with the indicator turned off so they each appear as a button with a single letter. You can then pack them all horizontally in a frame. With the indicator off, the button wil...
1
0
0
I want to provide a listbox where the user can select (multiple) characters (usually close to 15). Quite often some of these will be sequenced, so a listbox is easier than a validated text entry field. Since the character combination has a meaning to the user, it is user friendly to orient the listbox horizontally. Is ...
Horizontally oriented listbox using Python and Tkinter
0.379949
0
0
1,145
6,084,123
2011-05-21T20:01:00.000
1
0
0
1
python,google-app-engine,http-post
6,084,633
2
false
1
0
The general problem with capturing a POST and turning it into a GET is first that the query string on a GET has a browser-dependent limited size, and second that a POST may be form/multi-part (what to do with the uploaded file becomes an issue). An approach that might work for you is to accept the POST and save the dat...
1
3
0
in a form, I submit data to a python webapp handler (all Google App Engine based) using a HTTP POST request. In this script, I first check if the user is logged in and if not, I use users.create_login_url(...) to redirect the user first to the login page. How can I ensure that after login the user is not just forwarded...
Preserve POST variables during login redirect in GAE?
0.099668
0
0
375
6,084,985
2011-05-21T23:06:00.000
9
0
1
1
python,unix,stat,ctime
6,085,044
1
true
0
0
It is relatively trivial to set a files ctime to the current time. Just modify its mtime, flip a permission bit or even make a hardlink to it. It is, AFAIK, impossible to set a file's ctime to an arbitrary value using the system call API in any direct sort of way. If you had root access you could set the system time, d...
1
7
0
How can I set a Unix file's ctime? (I'd much prefer an answer in terms of Python. If there's no way to do it with standard Python, then I suppose C is OK too.) (Note: I know that one can use os.utime to set a file's atime and mtime. I am interested in setting ctime.) (Note2: I hope that there's an answer that works f...
How to set a file's ctime with Python?
1.2
0
0
4,201
6,085,280
2011-05-22T00:27:00.000
1
1
0
0
php,python,file-upload
6,085,309
2
false
0
0
I think you're referring to a application made in php running on some website in which case thats just normal HTTP stuff. So just look at what name the file field has on the html form generated by that php script and then do a normal post. (urllib2 or whatever you use)
1
2
0
I was wondering is there any tutorial out there that can teach you how to push multiple files from desktop to a PHP based web server with use of Python application? Edited I am going to be writing this so I am wondering in general what would be the best method to push files from my desktop to web server. As read from s...
how to upload files to PHP server with use of Python?
0.099668
0
1
2,176
6,086,341
2011-05-22T06:03:00.000
2
0
0
0
python,database,sql-server-2005,adodbapi
21,480,454
3
false
0
0
I had the same problem, and I tracked it down to a failure to load win32com.pyd, because of some system DLLs that was not in the "dll load path", such as msvcp100.dll I solved the problem by copying a lot of these dll's (probably too many) into C:\WinPython-64bit-3.3.3.2\python-3.3.3.amd64\Lib\site-packages\win32
1
6
0
I'm very new to Python and I have Python 3.2 installed on a Win 7-32 workstation. Trying to connect to MSSQLServer 2005 Server using adodbapi-2.4.2.2, the latest update to that package. The code/connection string looks like this: conn = adodbapi.connect('Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info...
Connecting to SQLServer 2005 with adodbapi
0.132549
1
0
8,199
6,086,560
2011-05-22T07:07:00.000
1
0
0
0
java,php,python,neural-network
6,086,737
1
false
0
0
Support Vector Machines tend to work much better for character recognition with error rates around 2% generally reported. I suggest that as an alternative if you're just using the character recognition as a module in a larger project.
1
0
1
i looking for a example of character recognizing (just one - for example X or A) using MLP, Backward propagation. I want a simple example, and not the entire library. Language does not matter, preferably one of those Java, Python, PHP
Backward propagation - Character Recognizing - Seeking an example
0.197375
0
0
162