Datasets:
Q_CreationDate stringlengths 23 23 | Title stringlengths 11 149 | Question stringlengths 25 6.53k | Answer stringlengths 15 5.1k | Score float64 -1 1.2 | Is_accepted bool 2
classes | N_answers int64 1 17 | Q_Id int64 0 6.76k |
|---|---|---|---|---|---|---|---|
2008-08-05 22:26:00.797 | Create a directly-executable cross-platform GUI app using Python | Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux.
The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the ... | I'm not sure that this is the best way to do it, but when I'm deploying Ruby GUI apps (not Python, but has the same "problem" as far as .exe's are concerned) on Windows, I just write a short launcher in C# that calls on my main script. It compiles to an executable, and I then have an application executable. | 0.124933 | false | 2 | 0 |
2008-08-05 22:26:00.797 | Create a directly-executable cross-platform GUI app using Python | Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux.
The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the ... | Since python is installed on nearly every non-Windows OS by default now, the only thing you really need to make sure of is that all of the non-standard libraries you use are installed.
Having said that, it is possible to build executables that include the python interpreter, and any libraries you use. This is likely t... | 0.186186 | false | 2 | 0 |
2008-08-22 10:51:19.057 | How do content discovery engines, like Zemanta and Open Calais work? | I was wondering how as semantic service like Open Calais figures out the names of companies, or people, tech concepts, keywords, etc. from a piece of text. Is it because they have a large database that they match the text against?
How would a service like Zemanta know what images to suggest to a piece of text for inst... | Open Calais probably use language parsing technology and language statics to guess which words or phrases are Names, Places, Companies, etc. Then, it is just another step to do some kind of search for those entities and return meta data.
Zementa probably does something similar, but matches the phrases against meta-data... | 0 | false | 1 | 1 |
2008-08-22 15:34:13.760 | How to download a file over HTTP? | I have a small utility that I use to download an MP3 file from a website on a schedule and then builds/updates a podcast XML file which I've added to iTunes.
The text processing that creates/updates the XML file is written in Python. However, I use wget inside a Windows .bat file to download the actual MP3 file. I woul... | Following are the most commonly used calls for downloading files in python:
urllib.urlretrieve ('url_to_file', file_name)
urllib2.urlopen('url_to_file')
requests.get(url)
wget.download('url', file_name)
Note: urlopen and urlretrieve are found to perform relatively bad with downloading large files (size > 500 MB). req... | 0.293455 | false | 1 | 2 |
2008-08-29 04:59:31.200 | Find out how much memory is being used by an object in Python | How would you go about finding out how much memory is being used by an object? I know it is possible to find out how much is used by a block of code, but not by an instantiated object (anytime during its life), which is what I want. | For big objects you may use a somewhat crude but effective method:
check how much memory your Python process occupies in the system, then delete the object and compare.
This method has many drawbacks but it will give you a very fast estimate for very big objects. | 0.16183 | false | 1 | 3 |
2008-09-04 13:36:46.917 | Modulus operation with negatives values - weird thing? | Can you please tell me how much is (-2) % 5?
According to my Python interpreter is 3, but do you have a wise explanation for this?
I've read that in some languages the result can be machine-dependent, but I'm not sure though. | Your Python interpreter is correct.
One (stupid) way of calculating a modulus is to subtract or add the modulus until the resulting value is between 0 and (modulus − 1).
e.g.:
13 mod 5 = (13 − 5) mod 5 = (13 − 10) mod 5 = 3
or in your case: −2 mod 5 = (−2 + 5) mod 5 = 3 | 0.443188 | false | 6 | 4 |
2008-09-04 13:36:46.917 | Modulus operation with negatives values - weird thing? | Can you please tell me how much is (-2) % 5?
According to my Python interpreter is 3, but do you have a wise explanation for this?
I've read that in some languages the result can be machine-dependent, but I'm not sure though. | There seems to be a common confusion between the terms "modulo" and "remainder".
In math, a remainder should always be defined consistent with the quotient, so that if a / b == c rem d then (c * b) + d == a. Depending on how you round your quotient, you get different remainders.
However, modulo should always give a res... | 0 | false | 6 | 4 |
2008-09-04 13:36:46.917 | Modulus operation with negatives values - weird thing? | Can you please tell me how much is (-2) % 5?
According to my Python interpreter is 3, but do you have a wise explanation for this?
I've read that in some languages the result can be machine-dependent, but I'm not sure though. | The result depends on the language. Python returns the sign of the divisor, where for example c# returns the sign of the dividend (ie. -2 % 5 returns -2 in c#). | 0 | false | 6 | 4 |
2008-09-04 13:36:46.917 | Modulus operation with negatives values - weird thing? | Can you please tell me how much is (-2) % 5?
According to my Python interpreter is 3, but do you have a wise explanation for this?
I've read that in some languages the result can be machine-dependent, but I'm not sure though. | Well, 0 % 5 should be 0, right?
-1 % 5 should be 4 because that's the next allowed digit going in the reverse direction (i.e., it can't be 5, since that's out of range).
And following along by that logic, -2 must be 3.
The easiest way to think of how it will work is that you keep adding or subtracting 5 until the numbe... | 0.135221 | false | 6 | 4 |
2008-09-04 13:36:46.917 | Modulus operation with negatives values - weird thing? | Can you please tell me how much is (-2) % 5?
According to my Python interpreter is 3, but do you have a wise explanation for this?
I've read that in some languages the result can be machine-dependent, but I'm not sure though. | By the way: most programming languages would disagree with Python and give the result -2. Depending on the interpretation of modulus this is correct. However, the most agreed-upon mathematical definition states that the modulus of a and b is the (strictly positive) rest r of the division of a / b. More precisely, 0 <= ... | 1.2 | true | 6 | 4 |
2008-09-04 13:36:46.917 | Modulus operation with negatives values - weird thing? | Can you please tell me how much is (-2) % 5?
According to my Python interpreter is 3, but do you have a wise explanation for this?
I've read that in some languages the result can be machine-dependent, but I'm not sure though. | Well, -2 divided by 5 would be 0 with a remainder of 3. I don't believe that should be very platform dependent, but I've seen stranger things. | 0 | false | 6 | 4 |
2008-09-15 21:11:30.050 | Using boost-python with C++ in Linux | My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project.
Building the boost libraries ... | Found the solution! Boost builds a debug build by default. Typing "bjam release" builds the release configuration. (This isn't listed in any documentation anywhere, as far as I can tell.) Note that this is not the same as changing your build-type to release, as that doesn't build a release configuration. Doing a 'compl... | 0.265586 | false | 2 | 5 |
2008-09-15 21:11:30.050 | Using boost-python with C++ in Linux | My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project.
Building the boost libraries ... | If you want to build the debug variants of the boost libraries as well, you have to invoke bjam with the option --build-type=complete.
On Debian, you get the debug Python interpreter in the python2.x-dbg packages. Debug builds of the Boost libraries are in libboost1.xy-dbg, if you want to use the system Boost. | 0.265586 | false | 2 | 5 |
2008-09-16 07:07:42.550 | Can I implement a web user authentication system in python without POST? | My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible?
If it's not, how would you do it with POST? Just out of curiosity.
Cheers! | You can actually do it all with GET methods. However, you'll want to use a full challenge response protocol for the logins. (You can hash on the client side using javascript. You just need to send out a unique challenge each time.) You'll also want to use SSL to ensure that no one can see the strings as they go acr... | 1.2 | true | 3 | 6 |
2008-09-16 07:07:42.550 | Can I implement a web user authentication system in python without POST? | My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible?
If it's not, how would you do it with POST? Just out of curiosity.
Cheers! | You could use HTTP Authentication, if supported.
You'd have to add SSL, as all methods, POST, GET and HTTP Auth (well, except Digest HHTP authentication) send plaintext.
GET is basically just like POST, it just has a limit on the amount of data you can send which is usually a lot smaller than POST and a semantic differ... | 0.067922 | false | 3 | 6 |
2008-09-16 07:07:42.550 | Can I implement a web user authentication system in python without POST? | My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible?
If it's not, how would you do it with POST? Just out of curiosity.
Cheers! | With a bit of JavaScript, you could have the client hash the entered password and a server-generated nonce, and use that in an HTTP GET. | 0 | false | 3 | 6 |
2008-09-16 09:44:59.477 | How to prompt for user input and read command-line arguments | How do I have a Python script that a) can accept user input and how do I make it b) read in arguments if run from the command line? | Careful not to use the input function, unless you know what you're doing. Unlike raw_input, input will accept any python expression, so it's kinda like eval | 0.569146 | false | 1 | 7 |
2008-09-16 12:46:28.150 | Using the docstring from one method to automatically overwrite that of another method | The problem: I have a class which contains a template method execute which calls another method _execute. Subclasses are supposed to overwrite _execute to implement some specific functionality. This functionality should be documented in the docstring of _execute.
Advanced users can create their own subclasses to exten... | Look at the functools.wraps() decorator; it does all of this, but I don't know offhand if you can get it to run in the right context | 0.081452 | false | 2 | 8 |
2008-09-16 12:46:28.150 | Using the docstring from one method to automatically overwrite that of another method | The problem: I have a class which contains a template method execute which calls another method _execute. Subclasses are supposed to overwrite _execute to implement some specific functionality. This functionality should be documented in the docstring of _execute.
Advanced users can create their own subclasses to exten... | Well the doc-string is stored in __doc__ so it wouldn't be too hard to re-assign it based on the doc-string of _execute after the fact.
Basically:
class MyClass(object):
def execute(self):
'''original doc-string'''
self._execute()
class SubClass(MyClass):
def _execute(self):
'''sub-cl... | 0 | false | 2 | 8 |
2008-09-16 20:11:22.217 | Which of these scripting languages is more appropriate for pen-testing? | First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one.
If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I hav... | That depends on the implementation, if it will be distributed I would go with Java, seeing as you know that, because of its portability. If it is just for internal use, or will be used in semi-controlled environments, then go with whatever you are the most comfortable maintaining, and whichever has the best long-term ... | 0.101688 | false | 7 | 9 |
2008-09-16 20:11:22.217 | Which of these scripting languages is more appropriate for pen-testing? | First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one.
If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I hav... | I'm with tqbf. I've worked with Python and Ruby. Currently I'm working with JRuby. It has all the power of Ruby with access to the Java libraries so if there is something you absolutely need a low-level language to solve you can do so with a high-level language. So far I haven't needed to really use much Java as Ru... | 0 | false | 7 | 9 |
2008-09-16 20:11:22.217 | Which of these scripting languages is more appropriate for pen-testing? | First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one.
If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I hav... | If you plan on using Metasploit for pen-testing and exploit development I would recommend ruby as mentioned previously Metasploit is written in ruby and any exploit/module development you may wish to do will require ruby.
If you will be using Immunity CANVAS for pen testing then for the same reasons I would recommend P... | 0.101688 | false | 7 | 9 |
2008-09-16 20:11:22.217 | Which of these scripting languages is more appropriate for pen-testing? | First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one.
If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I hav... | [Disclaimer: I am primarily a Perl programmer, which may be colouring my judgement. However, I am not a particularly tribal one, and I think on this particular question my argument is reasonably objective.]
Perl was designed to blend seamlessly into the Unix landscape, and that is why it feels so alien to people with a... | 0.265586 | false | 7 | 9 |
2008-09-16 20:11:22.217 | Which of these scripting languages is more appropriate for pen-testing? | First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one.
If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I hav... | If you're looking for a scripting language that will play well with Java, you might want to look at Groovy. It has the flexibility and power of Perl (closures, built in regexes, associative arrays on every corner) but you can access Java code from it thus you have access to a huge number of libraries, and in particula... | 0.034 | false | 7 | 9 |
2008-09-16 20:11:22.217 | Which of these scripting languages is more appropriate for pen-testing? | First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one.
If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I hav... | All of them should be sufficient for that. Unless you need some library that is only available in one language, I'd let personal preference guide me. | 0.034 | false | 7 | 9 |
2008-09-16 20:11:22.217 | Which of these scripting languages is more appropriate for pen-testing? | First of all, I want to avoid a flame-war on languages. The languages to choose from are Perl, Python and Ruby . I want to mention that I'm comfortable with all of them, but the problem is that I can't focus just on one.
If, for example, I see a cool Perl module, I have to try it out. If I see a nice Python app, I hav... | Well, what kind of exploits are you thinking about? If you want to write something that needs low level stuff (ptrace, raw sockets, etc.) then you'll need to learn C. But both Perl and Python can be used. The real question is which one suits your style more?
As for toolmaking, Perl has good string-processing abilities,... | 0 | false | 7 | 9 |
2008-09-16 21:05:26.673 | Which is faster, python webpages or php webpages? | Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | It's about the same. The difference shouldn't be large enough to be the reason to pick one or the other. Don't try to compare them by writing your own tiny benchmarks ("hello world") because you will probably not have results that are representative of a real web site generating a more complex page. | 0.081452 | false | 9 | 10 |
2008-09-16 21:05:26.673 | Which is faster, python webpages or php webpages? | Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | If it ain't broke don't fix it.
Just write a quick test, but bear in mind that each language will be faster with certain functions then the other. | 0.040794 | false | 9 | 10 |
2008-09-16 21:05:26.673 | Which is faster, python webpages or php webpages? | Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | I would assume that PHP (>5.5) is faster and more reliable for complex web applications because it is optimized for website scripting.
Many of the benchmarks you will find at the net are only made to prove that the favoured language is better. But you can not compare 2 languages with a mathematical task running X-times... | 0.278185 | false | 9 | 10 |
2008-09-16 21:05:26.673 | Which is faster, python webpages or php webpages? | Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | You need to be able to make a business case for switching, not just that "it's faster". If a site built on technology B costs 20% more in developer time for maintenance over a set period (say, 3 years), it would likely be cheaper to add another webserver to the system running technology A to bridge the performance gap... | 0.040794 | false | 9 | 10 |
2008-09-16 21:05:26.673 | Which is faster, python webpages or php webpages? | Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | The only right answer is "It depends". There's a lot of variables that can affect the performance, and you can optimize many things in either situation. | 0 | false | 9 | 10 |
2008-09-16 21:05:26.673 | Which is faster, python webpages or php webpages? | Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | PHP and Python are similiar enough to not warrent any kind of switching.
Any performance improvement you might get from switching from one language to another would be vastly outgunned by simply not spending the money on converting the code (you don't code for free right?) and just buy more hardware. | 0.081452 | false | 9 | 10 |
2008-09-16 21:05:26.673 | Which is faster, python webpages or php webpages? | Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | There's no point in attempting to convince your employer to port from PHP to Python, especially not for an existing system, which is what I think you implied in your question.
The reason for this is that you already have a (presumably) working system, with an existing investment of time and effort (and experience). To ... | 0.995055 | false | 9 | 10 |
2008-09-16 21:05:26.673 | Which is faster, python webpages or php webpages? | Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | an IS organization would not ponder this unless availability was becoming an issue.
if so the case, look into replication, load balancing and lots of ram. | 0.040794 | false | 9 | 10 |
2008-09-16 21:05:26.673 | Which is faster, python webpages or php webpages? | Which is faster, python webpages or php webpages?
Does anyone know how the speed of pylons(or any of the other frameworks) compares to a similar website made with php?
I know that serving a python base webpage via cgi is slower than php because of its long start up every time.
I enjoy using pylons and I would still ... | I had to come back to web development at my new job, and, if not Pylons/Python, maybe I would have chosen to live in jungle instead :) In my subjective opinion, PHP is for kindergarten, I did it in my 3rd year of uni and, I believe, many self-respecting (or over-estimating) software engineers will not want to be bother... | -0.040794 | false | 9 | 10 |
2008-09-17 17:23:23.030 | Search for host with MAC-address using Python | I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas? | You would want to parse the output of 'arp', but the kernel ARP cache will only contain those IP address(es) if those hosts have communicated with the host where the Python script is running.
ifconfig can be used to display the MAC addresses of local interfaces, but not those on the LAN. | 0 | false | 4 | 11 |
2008-09-17 17:23:23.030 | Search for host with MAC-address using Python | I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas? | I don't think there is a built in way to get it from Python itself.
My question is, how are you getting the IP information from your network?
To get it from your local machine you could parse ifconfig (unix) or ipconfig (windows) with little difficulty. | 0.050976 | false | 4 | 11 |
2008-09-17 17:23:23.030 | Search for host with MAC-address using Python | I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas? | Depends on your platform. If you're using *nix, you can use the 'arp' command to look up the mac address for a given IP (assuming IPv4) address. If that doesn't work, you could ping the address and then look, or if you have access to the raw network (using BPF or some other mechanism), you could send your own ARP packe... | 0 | false | 4 | 11 |
2008-09-17 17:23:23.030 | Search for host with MAC-address using Python | I'd like to search for a given MAC address on my network, all from within a Python script. I already have a map of all the active IP addresses in the network but I cannot figure out how to glean the MAC address. Any ideas? | It seems that there is not a native way of doing this with Python. Your best bet would be to parse the output of "ipconfig /all" on Windows, or "ifconfig" on Linux. Consider using os.popen() with some regexps. | 0.050976 | false | 4 | 11 |
2008-09-17 20:48:45.610 | If it is decided that our system needs an overhaul, what is the best way to go about it? | We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the proper tools to move forward in a quick manner. We have pretty much embraced the current webMVC pattern that is... | It works out better than you'd believe.
Recently I did a large reverse-engineering job on a hideous old collection of C code. Function by function I reallocated the features that were still relevant into classes, wrote unit tests for the classes, and built up what looked like a replacement application. It had some o... | 0.135221 | false | 7 | 12 |
2008-09-17 20:48:45.610 | If it is decided that our system needs an overhaul, what is the best way to go about it? | We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the proper tools to move forward in a quick manner. We have pretty much embraced the current webMVC pattern that is... | Use this as an opportunity to remove unused features! Definitely go with the new language. Call it 2.0. It will be a lot less work to rebuild the 80% of it that you really need.
Start by wiping your brain clean of the whole application. Sit down with a list of its overall goals, then decide which features are neede... | 0.135221 | false | 7 | 12 |
2008-09-17 20:48:45.610 | If it is decided that our system needs an overhaul, what is the best way to go about it? | We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the proper tools to move forward in a quick manner. We have pretty much embraced the current webMVC pattern that is... | Whatever you do, see if you can manage to follow a plan where you do not have to port the application all in one big bang. It is tempting to throw it all away and start from scratch, but if you can manage to do it gradually the mistakes you do will not cost so much and cause so much panic. | 0.090455 | false | 7 | 12 |
2008-09-17 20:48:45.610 | If it is decided that our system needs an overhaul, what is the best way to go about it? | We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the proper tools to move forward in a quick manner. We have pretty much embraced the current webMVC pattern that is... | I would not recommend JScript as that is definitely the road less traveled.
ASP.NET MVC is rapidly maturing, and I think that you could begin a migration to it, simultaneously ramping up on the ASP.NET MVC framework as its finalization comes through.
Another option would be to use something like ASP.NET w/Subsonic or N... | 0 | false | 7 | 12 |
2008-09-17 20:48:45.610 | If it is decided that our system needs an overhaul, what is the best way to go about it? | We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the proper tools to move forward in a quick manner. We have pretty much embraced the current webMVC pattern that is... | Don't try and go 2.0 ( more features then currently exists or scheduled) instead build your new platform with the intent of resolving the current issues with the code base (maintainability/speed/wtf) and go from there. | 0 | false | 7 | 12 |
2008-09-17 20:48:45.610 | If it is decided that our system needs an overhaul, what is the best way to go about it? | We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the proper tools to move forward in a quick manner. We have pretty much embraced the current webMVC pattern that is... | Half a year ago I took over a large web application (fortunately already in Python) which had some major architectural deficiencies (templates and code mixed, code duplication, you name it...).
My plan is to eventually have the system respond to WSGI, but I am not there yet. I found the best way to do it, is in small s... | 0.04532 | false | 7 | 12 |
2008-09-17 20:48:45.610 | If it is decided that our system needs an overhaul, what is the best way to go about it? | We are mainting a web application that is built on Classic ASP using VBScript as the primary language. We are in agreement that our backend (framework if you will) is out dated and doesn't provide us with the proper tools to move forward in a quick manner. We have pretty much embraced the current webMVC pattern that is... | I agree with Michael Pryor and Joel that it's almost always a better idea to continue evolving your existing code base rather than re-writing from scratch. There are typically opportunities to just re-write or re-factor certain components for performance or flexibility. | 0 | false | 7 | 12 |
2008-09-18 04:04:58.170 | How do I verify that a string only contains letters, numbers, underscores and dashes? | I know how to do this if I iterate through all of the characters in the string but I am looking for a more elegant method. | You could always use a list comprehension and check the results with all, it would be a little less resource intensive than using a regex: all([c in string.letters + string.digits + ["_", "-"] for c in mystring]) | -0.037089 | false | 1 | 13 |
2008-09-18 12:51:07.733 | Python, beyond the basics | I've gotten to grips with the basics of Python and I've got a small holiday which I want to use some of to learn a little more Python. The problem is that I have no idea what to learn or where to start. I'm primarily web development but in this case I don't know how much difference it will make. | I'd suggest writing a non-trivial webapp using either Django or Pylons, something that does some number crunching.
No better way to learn a new language than commiting yourself to a problem and learning as you go! | 0.040794 | false | 3 | 14 |
2008-09-18 12:51:07.733 | Python, beyond the basics | I've gotten to grips with the basics of Python and I've got a small holiday which I want to use some of to learn a little more Python. The problem is that I have no idea what to learn or where to start. I'm primarily web development but in this case I don't know how much difference it will make. | Search "Alex Martelli", "Alex Martelli patterns" and "Thomas Wouters" on Google video. There's plenty of interesting talks on advanced Python, design patterns in Python, and so on. | 0.040794 | false | 3 | 14 |
2008-09-18 12:51:07.733 | Python, beyond the basics | I've gotten to grips with the basics of Python and I've got a small holiday which I want to use some of to learn a little more Python. The problem is that I have no idea what to learn or where to start. I'm primarily web development but in this case I don't know how much difference it will make. | The Python Cookbook is absolutely essential if you want to master idiomatic Python. Besides, that's the book that made me fall in love with the language. | 0.081452 | false | 3 | 14 |
2008-09-19 12:47:32.310 | Algorithm to detect similar documents in python script | I need to write a module to detect similar documents. I have read many papers of fingerprints of documents techniques and others, but I do not know how to write code or implement such a solution. The algorithm should work for Chinese, Japanese, English and German language or be language independent. How can I accomplis... | I think Jeremy has hit the nail on the head - if you just want to detect if files are different, a hash algorithm like MD5 or SHA1 is a good way to go.
Linus Torvalds' Git source control software uses SHA1 hashing in just this way - to check when files have been modified. | 0 | false | 2 | 15 |
2008-09-19 12:47:32.310 | Algorithm to detect similar documents in python script | I need to write a module to detect similar documents. I have read many papers of fingerprints of documents techniques and others, but I do not know how to write code or implement such a solution. The algorithm should work for Chinese, Japanese, English and German language or be language independent. How can I accomplis... | You need to make your question more concrete. If you've already read the fingerprinting papers, you already know the principles at work, so describing common approaches here would not be beneficial. If you haven't, you should also check out papers on "duplicate detection" and various web spam detection related papers... | 0.121841 | false | 2 | 15 |
2008-09-19 19:53:19.447 | What is "thread local storage" in Python, and why do I need it? | In Python specifically, how do variables get shared between threads?
Although I have used threading.Thread before I never really understood or saw examples of how variables got shared. Are they shared between the main thread and the children or only among the children? When would I need to use thread local storage to ... | I may be wrong here. If you know otherwise please expound as this would help explain why one would need to use thread local().
This statement seems off, not wrong: "If you want to atomically modify anything that another thread has access to, you have to protect it with a lock." I think this statement is ->effectively<-... | 0.067922 | false | 3 | 16 |
2008-09-19 19:53:19.447 | What is "thread local storage" in Python, and why do I need it? | In Python specifically, how do variables get shared between threads?
Although I have used threading.Thread before I never really understood or saw examples of how variables got shared. Are they shared between the main thread and the children or only among the children? When would I need to use thread local storage to ... | Worth mentioning threading.local() is not a singleton.
You can use more of them per thread.
It is not one storage. | 0.067922 | false | 3 | 16 |
2008-09-19 19:53:19.447 | What is "thread local storage" in Python, and why do I need it? | In Python specifically, how do variables get shared between threads?
Although I have used threading.Thread before I never really understood or saw examples of how variables got shared. Are they shared between the main thread and the children or only among the children? When would I need to use thread local storage to ... | Just like in every other language, every thread in Python has access to the same variables. There's no distinction between the 'main thread' and child threads.
One difference with Python is that the Global Interpreter Lock means that only one thread can be running Python code at a time. This isn't much help when it com... | 0.201295 | false | 3 | 16 |
2008-09-24 12:21:02.957 | Checking for code changes in all imported python modules | Almost every Python web framework has a simple server that runs a wsgi application and automatically reloads the imported modules every time the source gets changed. I know I can look at the code and see how it's done, but that may take some time and I'm asking just out of curiosity. Does anyone have any idea how this ... | As the author of one of the reloader mechanisms (the one in werkzeug) I can tell you that it doesn't work. What all the reloaders do is forking one time and restarting the child process if a monitor thread notices that one module changed on the file system.
Inline reload()ing doesn't work because references to the rel... | 1.2 | true | 1 | 17 |
2008-09-25 21:18:09.800 | How do you manage your custom modules? | I write tons of python scripts, and I find myself reusing lots code that I've written for other projects. My solution has been to make sure the code is separated into logical modules/packages (this one's a given). I then make them setuptools-aware and publish them on PyPI. This allows my other scripts to always have th... | I store it all offline in a logical directory structure, with commonly used modules grouped as utilities. This means it's easier to control which versions I publish, and manage. I also automate the build process to interpret the logical directory structure. | 0 | false | 2 | 18 |
2008-09-25 21:18:09.800 | How do you manage your custom modules? | I write tons of python scripts, and I find myself reusing lots code that I've written for other projects. My solution has been to make sure the code is separated into logical modules/packages (this one's a given). I then make them setuptools-aware and publish them on PyPI. This allows my other scripts to always have th... | What kind of modules are we talking about here? If you're planning on distributing your projects to other python developers, setuptools is great. But it's usually not a very good way to distribute apps to end users. Your best bet in the latter case is to tailor your packaging to the platforms you're distributing it ... | 0.135221 | false | 2 | 18 |
2008-09-26 12:05:29.377 | PyQt - QScrollBar | Dear Stacktoverflow, can you show me an example of how to use a QScrollBar? Thanks. | It will come down to you using the QScrollArea, it is a widget that implements showing something that is larger than the available space. You will not need to use QScrollBar directly. I don't have a PyQt example but there is a C++ example in the QT distribution it is called the "Image Viewer". The object hierarchy will... | 1.2 | true | 1 | 19 |
2008-09-26 23:59:47.337 | How to make a cross-module variable? | The __debug__ variable is handy in part because it affects every module. If I want to create another variable that works the same way, how would I do it?
The variable (let's be original and call it 'foo') doesn't have to be truly global, in the sense that if I change foo in one module, it is updated in others. I'd be f... | I believe that there are plenty of circumstances in which it does make sense and it simplifies programming to have some globals that are known across several (tightly coupled) modules. In this spirit, I would like to elaborate a bit on the idea of having a module of globals which is imported by those modules which nee... | 0.740859 | false | 2 | 20 |
2008-09-26 23:59:47.337 | How to make a cross-module variable? | The __debug__ variable is handy in part because it affects every module. If I want to create another variable that works the same way, how would I do it?
The variable (let's be original and call it 'foo') doesn't have to be truly global, in the sense that if I change foo in one module, it is updated in others. I'd be f... | You can already do this with module-level variables. Modules are the same no matter what module they're being imported from. So you can make the variable a module-level variable in whatever module it makes sense to put it in, and access it or assign to it from other modules. It would be better to call a function to ... | 0.168447 | false | 2 | 20 |
2008-09-30 16:50:38.440 | Python GUI Application redistribution | I need to develop a small-medium sized desktop GUI application, preferably with Python as a language of choice because of time constraints.
What GUI library choices do I have which allow me to redistribute my application standalone, assuming that the users don't have a working Python installation and obviously don't ha... | I've used py2Exe myself - it's really easy (at least for small apps). | 0 | false | 1 | 21 |
2008-10-06 21:03:55.827 | Writing a reliable, totally-ordered multicast system in Python | I have to write a reliable, totally-ordered multicast system from scratch in Python. I can't use any external libraries. I'm allowed to use a central sequencer.
There seems to be two immediate approaches:
write an efficient system, attaching a unique id to each multicasted message,
having the sequencer multicast sequ... | The approach you take is going to depend very much on the nature of the data that you're sending, the scale of your network and the quantity of data you're sending. In particular it is going to depend on the number of targets each of your nodes is connected to.
If you're expecting this to scale to a large number of tar... | 0.135221 | false | 2 | 22 |
2008-10-06 21:03:55.827 | Writing a reliable, totally-ordered multicast system in Python | I have to write a reliable, totally-ordered multicast system from scratch in Python. I can't use any external libraries. I'm allowed to use a central sequencer.
There seems to be two immediate approaches:
write an efficient system, attaching a unique id to each multicasted message,
having the sequencer multicast sequ... | The flooding approach can cause a bad situation to get worse. If messages are dropped due to high network load, having every node resend every message will only make the situation worse.
The best approach to take depends on the nature of the data you are sending. For example:
Multimedia data: no retries, a dropped pac... | 1.2 | true | 2 | 22 |
2008-10-07 18:18:48.450 | Average difference between dates in Python | I have a series of datetime objects and would like to calculate the average delta between them.
For example, if the input was (2008-10-01 12:15:00, 2008-10-01 12:25:00, 2008-10-01 12:35:00), then the average delta would be exactly 00:10:00, or 10 minutes.
Any suggestions on how to calculate this using Python? | Since you seem to be throwing out the 20 minute delta between times 1 and 3 in your example, I'd say you should just sort the list of datetimes, add up the deltas between adjacent times, then divide by n-1.
Do you have any code you can share with us, so we can help you debug it? | 0.16183 | false | 2 | 23 |
2008-10-07 18:18:48.450 | Average difference between dates in Python | I have a series of datetime objects and would like to calculate the average delta between them.
For example, if the input was (2008-10-01 12:15:00, 2008-10-01 12:25:00, 2008-10-01 12:35:00), then the average delta would be exactly 00:10:00, or 10 minutes.
Any suggestions on how to calculate this using Python? | You can subtract each successive date from the one prior (resulting in a timedelta object which represents the difference in days, seconds). You can then average the timedelta objects to find your answer. | 1.2 | true | 2 | 23 |
2008-10-08 06:27:12.350 | What is the problem with reduce()? | There seems to be a lot of heated discussion on the net about the changes to the reduce() function in python 3.0 and how it should be removed. I am having a little difficulty understanding why this is the case; I find it quite reasonable to use it in a variety of cases. If the contempt was simply subjective, I cannot i... | reduce() is not being removed -- it's simply being moved into the functools module. Guido's reasoning is that except for trivial cases like summation, code written using reduce() is usually clearer when written as an accumulation loop. | 0.999999 | false | 3 | 24 |
2008-10-08 06:27:12.350 | What is the problem with reduce()? | There seems to be a lot of heated discussion on the net about the changes to the reduce() function in python 3.0 and how it should be removed. I am having a little difficulty understanding why this is the case; I find it quite reasonable to use it in a variety of cases. If the contempt was simply subjective, I cannot i... | People worry it encourages an obfuscated style of programming, doing something that can be achieved with clearer methods.
I'm not against reduce myself, I also find it a useful tool sometimes. | 0.625929 | false | 3 | 24 |
2008-10-08 06:27:12.350 | What is the problem with reduce()? | There seems to be a lot of heated discussion on the net about the changes to the reduce() function in python 3.0 and how it should be removed. I am having a little difficulty understanding why this is the case; I find it quite reasonable to use it in a variety of cases. If the contempt was simply subjective, I cannot i... | The primary reason of reduce's existence is to avoid writing explicit for loops with accumulators. Even though python has some facilities to support the functional style, it is not encouraged. If you like the 'real' and not 'pythonic' functional style - use a modern Lisp (Clojure?) or Haskell instead. | 0.3154 | false | 3 | 24 |
2008-10-08 07:49:01.903 | When to use the Python debugger | Since Python is a dynamic, interpreted language you don't have to compile your code before running it. Hence, it's very easy to simply write your code, run it, see what problems occur, and fix them. Using hotkeys or macros can make this incredibly quick.
So, because it's so easy to immediately see the output of your pr... | In 30 years of programming I've used a debugger exactly 4 times. All four times were to read the core file produced from a C program crashing to locate the traceback information that's buried in there.
I don't think debuggers help much, even in compiled languages. Many people like debuggers, there are some reasons fo... | 0.496174 | false | 4 | 25 |
2008-10-08 07:49:01.903 | When to use the Python debugger | Since Python is a dynamic, interpreted language you don't have to compile your code before running it. Hence, it's very easy to simply write your code, run it, see what problems occur, and fix them. Using hotkeys or macros can make this incredibly quick.
So, because it's so easy to immediately see the output of your pr... | I find it very useful to drop into a debugger in a failing test case.
I add import pdb; pdb.set_trace() just before the failure point of the test. The test runs, building up a potentially quite large context (e.g. importing a database fixture or constructing an HTTP request). When the test reaches the pdb.set_trace() l... | 0.067922 | false | 4 | 25 |
2008-10-08 07:49:01.903 | When to use the Python debugger | Since Python is a dynamic, interpreted language you don't have to compile your code before running it. Hence, it's very easy to simply write your code, run it, see what problems occur, and fix them. Using hotkeys or macros can make this incredibly quick.
So, because it's so easy to immediately see the output of your pr... | Any time you want to inspect the contents of variables that may have caused the error. The only way you can do that is to stop execution and take a look at the stack.
pydev in Eclipse is a pretty good IDE if you are looking for one. | 0.135221 | false | 4 | 25 |
2008-10-08 07:49:01.903 | When to use the Python debugger | Since Python is a dynamic, interpreted language you don't have to compile your code before running it. Hence, it's very easy to simply write your code, run it, see what problems occur, and fix them. Using hotkeys or macros can make this incredibly quick.
So, because it's so easy to immediately see the output of your pr... | I use pdb for basic python debugging. Some of the situations I use it are:
When you have a loop iterating over 100,000 entries and want to break at a specific point, it becomes really helpful.(conditional breaks)
Trace the control flow of someone else's code.
Its always better to use a debugger than litter the code wi... | 1.2 | true | 4 | 25 |
2008-10-10 14:52:04.360 | Configuring python | I am new to python and struggling to find how to control the amount of memory a python process can take? I am running python on a Cento OS machine with more than 2 GB of main memory size. Python is taking up only 128mb of this and I want to allocate it more. I tried to search all over the internet on this for last half... | Forget all that, python just allocates more memory as needed, there is not a myriad of comandline arguments for the VM as in java, just let it run. For all comandline switches you can just run python -h or read man python. | 1.2 | true | 2 | 26 |
2008-10-10 14:52:04.360 | Configuring python | I am new to python and struggling to find how to control the amount of memory a python process can take? I am running python on a Cento OS machine with more than 2 GB of main memory size. Python is taking up only 128mb of this and I want to allocate it more. I tried to search all over the internet on this for last half... | Are you sure that the machine does not have a 128M process limit? If you are running the python script as a CGI inside a web server, it is quite likely that there is a process limit set - you will need to look at the web server configuration. | 0.386912 | false | 2 | 26 |
2008-10-13 14:26:10.293 | Dealing with a string containing multiple character encodings | I'm not exactly sure how to ask this question really, and I'm no where close to finding an answer, so I hope someone can help me.
I'm writing a Python app that connects to a remote host and receives back byte data, which I unpack using Python's built-in struct module. My problem is with the strings, as they include mu... | I would write a codec that incrementally scanned the string and decoded the bytes as they came along. Essentially, you would have to separate strings into chunks with a consistent encoding and decode those and append them to the strings that followed them. | 0.240117 | false | 2 | 27 |
2008-10-13 14:26:10.293 | Dealing with a string containing multiple character encodings | I'm not exactly sure how to ask this question really, and I'm no where close to finding an answer, so I hope someone can help me.
I'm writing a Python app that connects to a remote host and receives back byte data, which I unpack using Python's built-in struct module. My problem is with the strings, as they include mu... | I don't suppose you have any way of convincing the person who hosts the other machine to switch to unicode?
This is one of the reasons Unicode was invented, after all. | 0.081452 | false | 2 | 27 |
2008-10-15 06:59:50.787 | Does python support multiprocessor/multicore programming? | What is the difference between multiprocessor programming and multicore programming?
preferably show examples in python how to write a small program for multiprogramming & multicore programming | The main difference is how you organize and distribute data. Multicore typically has higher bandwidths between the different cores in a cpu, and multiprocessor needs to involve the bus between the cpus more.
Python 2.6 has gotten multiprocess (process, as in program running) and more synchronization and communication o... | 0.058243 | false | 1 | 28 |
2008-10-16 03:02:27.847 | Extracting a parenthesized Python expression from a string | I've been wondering about how hard it would be to write some Python code to search a string for the index of a substring of the form ${expr}, for example, where expr is meant to be a Python expression or something resembling one. Given such a thing, one could easily imagine going on to check the expression's syntax wi... | If you want to handle arbitrary expressions like {'{spam': 42}["spam}"], you can't get away without full-blown parser. | 0.101688 | false | 1 | 29 |
2008-10-17 09:02:12.737 | Using SQLite in a Python program | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | SQLite automatically creates the database file the first time you try to use it. The SQL statements for creating tables can use IF NOT EXISTS to make the commands only take effect if the table has not been created This way you don't need to check for the database's existence beforehand: SQLite can take care of that for... | 0.342695 | false | 5 | 30 |
2008-10-17 09:02:12.737 | Using SQLite in a Python program | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | AFAIK an SQLITE database is just a file.
To check if the database exists, check for file existence.
When you open a SQLITE database it will automatically create one if the file that backs it up is not in place.
If you try and open a file as a sqlite3 database that is NOT a database, you will get this:
"sqlite3.Database... | 1.2 | true | 5 | 30 |
2008-10-17 09:02:12.737 | Using SQLite in a Python program | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | Doing SQL in overall is horrible in any language I've picked up. SQLalchemy has shown to be easiest from them to use because actual query and committing with it is so clean and absent from troubles.
Here's some basic steps on actually using sqlalchemy in your app, better details can be found from the documentation.
pr... | 0.151877 | false | 5 | 30 |
2008-10-17 09:02:12.737 | Using SQLite in a Python program | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | Don't make this more complex than it needs to be. The big, independent databases have complex setup and configuration requirements. SQLite is just a file you access with SQL, it's much simpler.
Do the following.
Add a table to your database for "Components" or "Versions" or "Configuration" or "Release" or something ... | 0.998581 | false | 5 | 30 |
2008-10-17 09:02:12.737 | Using SQLite in a Python program | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | Yes, I was nuking out the problem. All I needed to do was check for the file and catch the IOError if it didn't exist.
Thanks for all the other answers. They may come in handy in the future. | 0 | false | 5 | 30 |
2008-10-20 17:19:57.223 | How do I use Tkinter with Python on Windows Vista? | I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to resolve this? | Maybe you should downgrade to 2.5 version? | 1.2 | true | 3 | 31 |
2008-10-20 17:19:57.223 | How do I use Tkinter with Python on Windows Vista? | I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to resolve this? | It seems this is a one of the many weird Vista problems and some random reinstalling, installing/upgrading of the visual studio runtime or some such seems sometimes to help, or disabling sxs in the system configuration or writing a manifest file etc.
Though I think you should downgrade to windows XP. | 0.135221 | false | 3 | 31 |
2008-10-20 17:19:57.223 | How do I use Tkinter with Python on Windows Vista? | I installed Python 2.6 for one user on Windows Vista. Python works okay, but when I try: import Tkinter, it says the side-by-side configuration has errors. I've tried tinkering with the Visual Studio runtime, with no good results. Any ideas on how to resolve this? | python 2.6.2 + tkinter 8.5, no problems | -0.135221 | false | 3 | 31 |
2008-10-22 02:54:17.533 | Alternatives to a wizard | I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.
However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at the same time... | The wxPython demo has an example of a "dynamic" wizard. Pages override GetNext() and GetPrev() to show pages dynamically. This shows the basic technique; you can extend it to add and remove pages, change pages on the fly, and rearrange pages dynamically.
The wizard class is just a convenience, though. You can modify it... | 0.081452 | false | 2 | 32 |
2008-10-22 02:54:17.533 | Alternatives to a wizard | I'm making a program that fits the wizard concept ideally; the user is walked through the steps to create a character for a game.
However, I'm realizing that the limitations of the wizard are making it difficult to design "elegant" logic flow. For example, because all pages of the wizard are initalized at the same time... | I'd get rid of wizard in whole. They are the most unpleasant things I've ever used.
The problem that requires a wizard-application where you click 'next' is perhaps a problem where you could apply a better user interface in a bit different manner. Instead of bringing up a dialog with annoying 'next' -button. Do this:
B... | 0 | false | 2 | 32 |
2008-10-23 23:50:15.687 | Will Django be a good choice for a permissions based web-app? | I've been exploring the details of Django for about a week now and like what I see. However I've come upon some.. negativity in relation to fine-grained control of permissions to the CRUD interface.
What I'm writing is an Intranet client management web-app. The organisation is about 6 tiers, and I need to restrict acce... | The Django permission system totally rules. Each model has a default set of permissions. You can add new permissions to your models, also.
Each User has a set of permissions as well as group memberships. Individual users can have individual permissions. And they inherit permissions from their group membership.
Your ... | 0.265586 | false | 1 | 33 |
2008-10-25 13:30:27.933 | How can I use Python for large scale development? | I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?
When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you... | The usual answer to that is testing testing testing. You're supposed to have an extensive unit test suite and run it often, particularly before a new version goes online.
Proponents of dynamically typed languages make the case that you have to test anyway because even in a statically typed language conformance to the c... | 0.101688 | false | 4 | 34 |
2008-10-25 13:30:27.933 | How can I use Python for large scale development? | I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?
When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you... | My general rule of thumb is to use dynamic languages for small non-mission-critical projects and statically-typed languages for big projects. I find that code written in a dynamic language such as python gets "tangled" more quickly. Partly that is because it is much quicker to write code in a dynamic language and that ... | 0.151877 | false | 4 | 34 |
2008-10-25 13:30:27.933 | How can I use Python for large scale development? | I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?
When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you... | I had some experience with modifying "Frets On Fire", an open source python "Guitar Hero" clone.
as I see it, python is not really suitable for a really large scale project.
I found myself spending a large part of the development time debugging issues related to assignment of incompatible types, things that static type... | 0.999909 | false | 4 | 34 |
2008-10-25 13:30:27.933 | How can I use Python for large scale development? | I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?
When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you... | Since nobody pointed out pychecker, pylint and similar tools, I will: pychecker and pylint are tools that can help you find incorrect assumptions (about function signatures, object attributes, etc.) They won't find everything that a compiler might find in a statically typed language -- but they can find problems that s... | 1.2 | true | 4 | 34 |
2008-10-27 03:32:24.250 | getting pywin32 to work inside open office 2.4 built in python 2.3 interpreter | I need to update data to a mssql 2005 database so I have decided to use adodbapi, which is supposed to come built into the standard installation of python 2.1.1 and greater.
It needs pywin32 to work correctly and the open office python 2.3 installation does not have pywin32 built into it. It also seems like this built ... | maybe the best way to install pywin32 is to place it in
(openofficedir)\program\python-core-2.3.4\lib\site-packages
it is easy if you have a python 2.3 installation (with pywin installed) under
C:\python2.3
move the C:\python2.3\Lib\site-packages\ to your
(openofficedir)\program\python-core-2.3.4\lib\site-packages | 0.135221 | false | 1 | 35 |
2008-10-27 18:43:41.087 | Possible to integrate Google AppEngine and Google Code for continuous integration? | Anyone have any thoughts on how/if it is possible to integrate Google Code commits to cause a Google AppEngine deployment of the most recent code?
I have a simple Google AppEngine project's source hosted on Google Code and would love if everytime I committed to Subversion, that AppEngine would reflect the latest commit... | Very interesting, but not yet possible, AFAIK. I have been looking for that option in Google Code with no success.
The only solution I can figure out is to install something in your machine that checks for changes in your SVN repository.
I'll be happy to hear about other approaches. | 0.081452 | false | 2 | 36 |
2008-10-27 18:43:41.087 | Possible to integrate Google AppEngine and Google Code for continuous integration? | Anyone have any thoughts on how/if it is possible to integrate Google Code commits to cause a Google AppEngine deployment of the most recent code?
I have a simple Google AppEngine project's source hosted on Google Code and would love if everytime I committed to Subversion, that AppEngine would reflect the latest commit... | For those of us who are using Github, this feature from the GAE team would make us all seriously consider switching to Google Code... | 0.081452 | false | 2 | 36 |
2008-10-28 02:34:19.140 | Python + Leopard + Fink + Mac Ports + Python.org + Idiot = broken Python - fresh start? | I have been enjoying learning the basics of python, but before I started reading things I tried to install various python versions and modules clumsily. Now that I have some ideas of what I want to do and how to do it I'm finding that various aspects are broken. For instance, 2.6 IDLE won't launch, and when I try to im... | Macports should be easy to get rid of; just delete /opt/local/. I think that Fink does something similar.
You can do which python to see what python is the default one. The system python should be in /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python
The MacPython you may have downloaded would either b... | 0.135221 | false | 1 | 37 |
2008-10-28 18:35:06.173 | wxPython wxDC object from win32gui.GetDC | I am getting a DC for a window handle of an object in another program using win32gui.GetDC which returns an int/long. I need to blit this DC into a memory DC in python. The only thing I can't figure out how to do is get a wxDC derived object from the int/long that win32gui returns. None of the wxDC objects allow me ... | From what I can tell, DCs in python are abstracted due to platform variation. So a device context in python doesn't directly map to a device context in Windows even though many of the methods are direct Windows method calls. To make this happen it appears you would need to make your own DelegateDC class or something ... | 0 | false | 1 | 38 |
2008-10-31 08:13:00.170 | Extending PythonCE to Access gsm/camera/gps Easily from PythonCE | As it seems there is no scripting language for Windows mobile devices that gives access to phone (sms, mms, make a call, take photo). I wonder how complex it would be to make a Python library that would enable that (write something in C, compile, and import in PythonCE).
Question: Where shall start to understand how to... | MSDN has plenty of samples for C++ development on Windows Mobile, and the SDK comes with several sample application. Unfortunately VS Express editions (the free ones) do not come with compilers for Smart Devices. The only free option is the older eMbedded Visual C++ (eVC), which is now something like 8 years old and n... | 0.135221 | false | 1 | 39 |
End of preview. Expand in Data Studio
- Downloads last month
- 14