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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,798,985 | 2011-10-17T20:10:00.000 | 4 | 0 | 1 | 0 | python,string | 7,798,996 | 4 | true | 0 | 0 | concatenate it:
string=char+string | 2 | 2 | 0 | is there a quick way to place a string in the front of another string in python? if so how?
as an example let's say that string = 'pple'. How would I put the string_2 = 'a' at the start of string? | Put a letter to the front of a string in python | 1.2 | 0 | 0 | 871 |
7,799,650 | 2011-10-17T21:15:00.000 | 2 | 0 | 1 | 0 | python,debugging,pydev,breakpoints | 7,805,480 | 1 | true | 0 | 0 | Unfortunately, PyDev does not have such a feature (and after thinking a bit on how would that be implemented, I couldn't come up with a way to implement that) -- your solution on changing it for a property is the one I use when I need that feature (and it won't work for a global variable as you said... in this case, in... | 1 | 3 | 0 | I have a global variable (I know) that is being changed from a good value to a bad value somewhere. I don't know where, and I'd like to find out where. I would like my debugger (Eclipse/PyDev) to break any time any code writes to this global variable, something akin to hardware breakpoints in OllyDBG.
One trick I've f... | Is there a way to set a breakpoint on variable access in Python with PyDev? | 1.2 | 0 | 0 | 1,940 |
7,800,693 | 2011-10-17T23:12:00.000 | 8 | 0 | 0 | 1 | python,google-chrome,google-chrome-extension,go,google-nativeclient | 7,844,298 | 4 | false | 0 | 0 | Go used to compile to NaCl, but NaCl's been such a moving target that the support was removed from Go. It'll probably be resurrected at some point if/when NaCl settles down. | 1 | 20 | 0 | Would it be possible to write a native client application in Python or Go that could then run in the browser? | Can Native Client (NaCl) programs be written in languages other than C or C++? | 1 | 0 | 0 | 4,357 |
7,801,387 | 2011-10-18T01:06:00.000 | 1 | 1 | 0 | 0 | python,google-app-engine,webob | 7,815,687 | 1 | true | 0 | 0 | From context, it sounds like you're trying to run your app on the dev_appserver. The dev_appserver does not yet support the Python 2.7 runtime; for now you'll have to do your development and testing on appspot. | 1 | 1 | 0 | I can't import WebOb 1.1 with the Python 2.7 runtime, as WebOb imports io, io imports _io, which is blocked by the SDK. Is there a way to whitelist _io? It is obviously not supposed to be blacklisted. | GAE Python 2.7, no _io module? | 1.2 | 0 | 1 | 201 |
7,802,504 | 2011-10-18T04:41:00.000 | 2 | 0 | 0 | 0 | python,database,pylons,message-queue,celery | 7,802,664 | 1 | true | 1 | 0 | It seems that your goal is not to decouple the database from the MQ, but rather from the workers. As such, you can create another queue that receives completion notifications, and have another single worker that picks up the notifications and updates the database appropriately. | 1 | 0 | 0 | I am building a web application that allows a user to upload an image. When the image is uploaded, it needs to be resized to one or more sizes, each of which needs to be sent to Amazon s3 for storage. Metadata and urls for each size of the image are stored in a single database record on the web server. I'm using a mess... | Best practice for decoupling a database from a message queue | 1.2 | 1 | 0 | 639 |
7,804,468 | 2011-10-18T08:35:00.000 | 0 | 0 | 0 | 0 | php,python,zend-framework,content-management-system | 7,804,591 | 2 | false | 1 | 0 | Sounds like Symfony would be just what you're looking for - with the recent Symfony 2 release, it's also very easy and convenient to integrate additional libraries like Zend, so you can have the best of both worlds for any custom components.
That said, the studio I work for run all our CMS work as Zend apps, so we can ... | 1 | 1 | 0 | I am planning a side project and I want to know your experiences with CMS builds. The project is a fairly straightforward CMS with no e-commerce functionality needed. I know I can build something like this using Zend Framework quite simply. As it is a side project I don't want to spending time doing the tedious stuff l... | Bespoke CMS or 3rd Party? | 0 | 0 | 0 | 591 |
7,806,031 | 2011-10-18T10:47:00.000 | 0 | 1 | 1 | 0 | python,objective-c,import | 7,852,425 | 1 | false | 0 | 0 | Thomas K set me on the right track, even though the problem was the completely opposite.
My Python setup was lacking the standard Python library - the part written in Python (usually distributed through /Library, /Lib or /pylib in the distribution. Once those files were added to my application, all of it imported fine.... | 1 | 0 | 0 | I'm running an embedded Python interpreter in Obj-C. I can run Python scripts just fine, but when I try to import certain standard modules, I get ImportError: No module named random, for instance.
However, I can import certain other modules. My investigations has given me this list so far:
Can:
import sys
import math
... | Can't import specific modules in embedded Python | 0 | 0 | 0 | 771 |
7,807,541 | 2011-10-18T12:57:00.000 | 57 | 1 | 1 | 0 | python,compilation | 7,807,661 | 6 | false | 0 | 0 | The first two bytes of the .pyc file are the magic number that tells the version of the bytecodes. The word is stored in little-endian format, and the known values are:
Python version
Decimal
Hexadecimal
Comment
Python 1.5
20121
0x994e
Python 1.5.1
20121
0x994e
Python 1.5.2
20121
0x994e
Python 1.6
5042... | 1 | 43 | 0 | Is there any way to know by which Python version the .pyc file was compiled? | Is there a way to know by which Python version the .pyc file was compiled? | 1 | 0 | 0 | 29,640 |
7,808,650 | 2011-10-18T14:13:00.000 | 0 | 0 | 0 | 0 | python,django | 7,816,060 | 1 | true | 1 | 0 | No. It is not possible. You could write a custom template tag like {% divwrapper model.attr %} or you could write a model method like "html_dump_all_attrs" that returned something. But no, your solution won't work. | 1 | 0 | 0 | Is it posible object to know if it getter called in template or not?
Check for same global variables or any ideas?
I wanna Moddel to give field attributes wrapped in div when it is called in template. | Overwrite getter to act differently depending on where it was called in template o not. Django | 1.2 | 0 | 0 | 71 |
7,810,646 | 2011-10-18T16:32:00.000 | 4 | 0 | 1 | 0 | python,eclipse,pydev | 7,814,687 | 2 | true | 0 | 0 | Yes, it's possible... the margin may be raised in window > preferences > general > editors > text editors > print margin column.
And the option to break in multilines or not may be changed in window > preferences > pydev > editor > code style > imports > 'allow multiline imports...' | 1 | 3 | 0 | PyDev's "Organize Import" will wrap the line at 80 char width like below:
from xyz import A, B, C, \
D, E, F
Is there a way to disable that wrap? or to extend the width?
I tried increasing the line width in eclipse settings, but it didn't seem to work. I think that's only specific in Java editors and not PyDev. | Is there a way to not wrap line when doing PyDev organize import? | 1.2 | 0 | 0 | 2,046 |
7,811,556 | 2011-10-18T17:52:00.000 | -2 | 0 | 0 | 0 | python,django | 54,346,385 | 11 | false | 1 | 0 | Simply put list(yourQuerySet). | 2 | 170 | 0 | How can I convert a Django QuerySet into a list of dicts? I haven't found an answer to this so I'm wondering if I'm missing some sort of common helper function that everyone uses. | How do I convert a Django QuerySet into list of dicts? | -0.036348 | 0 | 0 | 211,404 |
7,811,556 | 2011-10-18T17:52:00.000 | 0 | 0 | 0 | 0 | python,django | 69,901,744 | 11 | false | 1 | 0 | If you already have a query set you just use the list function to turn it into a list of dicts, eg:
list(MyModel.objects.values()) | 2 | 170 | 0 | How can I convert a Django QuerySet into a list of dicts? I haven't found an answer to this so I'm wondering if I'm missing some sort of common helper function that everyone uses. | How do I convert a Django QuerySet into list of dicts? | 0 | 0 | 0 | 211,404 |
7,814,351 | 2011-10-18T22:09:00.000 | 0 | 0 | 1 | 0 | java,c++,python,windows | 7,816,126 | 3 | false | 0 | 0 | This isn't exactly on point, but I'm in the middle of the process of converting from Linux gcc/make to MSVS myself. The paradigm shift can be tricky. I'll just share last week's aha! moment.
MSVS is all too willing to store absolute path names in project metadata, leading to frustration when you try to e.g. move to ano... | 2 | 0 | 0 | Moving from Linux, with its clean Filesystem Hierarchy to windows, i'd like to set up one or more dedicated folders to hold compilers and their related libraries, sysfs like, something like sysfs ... i'd like to find the elegant way to do this.
I mainly develop using C/C++ java and python. and even for C++ projects, m... | hybrid development environment | 0 | 0 | 0 | 109 |
7,814,351 | 2011-10-18T22:09:00.000 | 0 | 0 | 1 | 0 | java,c++,python,windows | 7,816,272 | 3 | false | 0 | 0 | I usually let VS, Qt/mingw, etc. install themselves where they wanted to go - i.e. I keep the default. Regarding my src-code-tree and build-tree, I always spend a lot of time and thought setting those up. I start by experimenting with the IDE (VS2008 in my most recent case), observe the default behavior and only then... | 2 | 0 | 0 | Moving from Linux, with its clean Filesystem Hierarchy to windows, i'd like to set up one or more dedicated folders to hold compilers and their related libraries, sysfs like, something like sysfs ... i'd like to find the elegant way to do this.
I mainly develop using C/C++ java and python. and even for C++ projects, m... | hybrid development environment | 0 | 0 | 0 | 109 |
7,817,567 | 2011-10-19T06:52:00.000 | 1 | 0 | 0 | 1 | python,nginx,berkeley-db | 8,835,081 | 1 | true | 0 | 0 | it supports
A Single Process With One Thread
A Single Process With Multiple Threads
Groups of Cooperating Processes
Groups of Unrelated Processes | 1 | 1 | 0 | I use Berkeley DB(BDB) in nginx. When a request arrives, nginx passes the URI as a key to BDB and checks if that key has a value in BDB file.
I actually did in an example. I add some data in BDB, and run nginx, it's OK. I can access it.
But when I add some data in running BDB with nginx (using Python), I can't get the... | Does Berkeley DB only support one processor operation | 1.2 | 1 | 0 | 237 |
7,818,002 | 2011-10-19T07:39:00.000 | 1 | 0 | 0 | 0 | python,django | 7,818,084 | 3 | true | 1 | 0 | manage.py is a file that excists in a project environment and is created after starting a project. It's purpose is to control project commands. Django-admin.py is a script to start a project ( you can put it anyhwhere, or shortcut it via .bash or .profile ) | 2 | 2 | 0 | I'm learning something about Django.In some tutorials that i've read is used django-admin.py for execute commands like " syncdb, startapp and startproject", in the others tutorials is used manage.py, So exist any important diference between use django-admin.py or manage.py ? | Exist a diference in use django-admin.py or manage.py | 1.2 | 0 | 0 | 1,552 |
7,818,002 | 2011-10-19T07:39:00.000 | 1 | 0 | 0 | 0 | python,django | 7,818,099 | 3 | false | 1 | 0 | manage.py is django-admin fitted in your project: it uses settings.py in your project dir | 2 | 2 | 0 | I'm learning something about Django.In some tutorials that i've read is used django-admin.py for execute commands like " syncdb, startapp and startproject", in the others tutorials is used manage.py, So exist any important diference between use django-admin.py or manage.py ? | Exist a diference in use django-admin.py or manage.py | 0.066568 | 0 | 0 | 1,552 |
7,819,730 | 2011-10-19T10:14:00.000 | 0 | 0 | 0 | 0 | python,css,django,django-admin | 7,820,620 | 3 | false | 1 | 0 | Probably you can hack your urls.py file and point only a single media URL to be served from a local folder while the others are served from the Django directory(in development mode). | 1 | 3 | 0 | Overriding admin templates is as easy as creating a folder admin in your templates directory and copying whatever template files you'd like to override into it. I simply want to play with the admin style sheets however, so I made a folder admin in my static files folder and put css/base.css into it. Unlike the template... | Override specific admin css files in Django | 0 | 0 | 0 | 3,643 |
7,820,021 | 2011-10-19T10:41:00.000 | 3 | 0 | 1 | 1 | python,file,io | 7,820,272 | 5 | false | 0 | 0 | A better solution is to implement a resource manager (writer) to avoid opening the same file twice. This manager could use threading synchronization mechanisms (threading.Lock) to avoid simultaneous access on some platforms. | 4 | 15 | 0 | I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file.
Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied? | What happens if two python scripts want to write in the same file? | 0.119427 | 0 | 0 | 6,557 |
7,820,021 | 2011-10-19T10:41:00.000 | 2 | 0 | 1 | 1 | python,file,io | 7,821,856 | 5 | false | 0 | 0 | How about having all of the different processes write their output into a queue, and have a single process that reads that queue, and writes to the file? | 4 | 15 | 0 | I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file.
Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied? | What happens if two python scripts want to write in the same file? | 0.07983 | 0 | 0 | 6,557 |
7,820,021 | 2011-10-19T10:41:00.000 | 0 | 0 | 1 | 1 | python,file,io | 50,034,098 | 5 | false | 0 | 0 | Use multiprocessing.Lock() instead of threading.Lock(). Just a word of caution! might slow down your concurrent processing ability because one process just waits for the lock to be released | 4 | 15 | 0 | I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file.
Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied? | What happens if two python scripts want to write in the same file? | 0 | 0 | 0 | 6,557 |
7,820,021 | 2011-10-19T10:41:00.000 | 8 | 0 | 1 | 1 | python,file,io | 7,820,062 | 5 | true | 0 | 0 | In general, this is not a good idea and will take a lot of care to get right. Since the writes will have to be serialized, it might also adversely affect scalability.
I'd recommend writing to separate files and merging (or just leaving them as separate files). | 4 | 15 | 0 | I have a pipeline which at some point splits work into various sub-processes that do the same thing in parallel. Thus their output should go into the same file.
Is it too risky to say all of those processes should write into the same file? Or does python try and retry if it sees that this resource is occupied? | What happens if two python scripts want to write in the same file? | 1.2 | 0 | 0 | 6,557 |
7,821,977 | 2011-10-19T13:24:00.000 | 0 | 0 | 1 | 0 | python,kml | 7,822,039 | 3 | false | 0 | 0 | You can download the KML file in python using urllib. For reading KML, you can use a parser (search for "kml python parser"). | 1 | 1 | 0 | I'd like to download a KML file and print a particular element of it as a string in Python.
Could anyone give me an example of how to do this?
Thanks. | KML to string in Python? | 0 | 0 | 0 | 2,981 |
7,822,207 | 2011-10-19T13:40:00.000 | 1 | 0 | 1 | 0 | python,message-queue,multiprocessing | 7,823,332 | 3 | false | 0 | 0 | Two different ideas for performance constraints:
The bottleneck is the workers fighting each other and the parent for access to the job queue.
The bottleneck is connection rate-limits (syn-flood protection) on the servers.
Gathering more information:
Profile the amount of work done: tasks completed per second, use t... | 2 | 1 | 0 | I have a python (2.6.5 64-bit, Windows 2008 Server R2) app that launches worker processes. The parent process puts jobs in a job queue, from which workers pick them up. Similarly it has a results queue. Each worker performs its job by querying a server. CPU usage by the workers is low.
When the number of workers grows,... | Python multiprocessing queue scaling to large numbers of workers | 0.066568 | 0 | 0 | 1,336 |
7,822,207 | 2011-10-19T13:40:00.000 | 0 | 0 | 1 | 0 | python,message-queue,multiprocessing | 7,822,483 | 3 | false | 0 | 0 | Not exactly sure what is going on unless you provide all the details.
However, remember that the real concurrency is bounded by the actual number of hardware threads. If the number of processes launched is much larger than the actual number of hardware threads, at some point the context-switching overhead will be more... | 2 | 1 | 0 | I have a python (2.6.5 64-bit, Windows 2008 Server R2) app that launches worker processes. The parent process puts jobs in a job queue, from which workers pick them up. Similarly it has a results queue. Each worker performs its job by querying a server. CPU usage by the workers is low.
When the number of workers grows,... | Python multiprocessing queue scaling to large numbers of workers | 0 | 0 | 0 | 1,336 |
7,825,066 | 2011-10-19T16:58:00.000 | 2 | 0 | 0 | 0 | python,firebird,ddl,kinterbasdb | 7,832,347 | 1 | false | 0 | 0 | It has been a while since I used kinterbasdb, but as far as I know you should be able to do this with any query command which can also be used for INSERT, UPDATE and DELETE (ie nothing that produces a resultset). So Connection.execute_immediate and Cursor.execute should work.
Did you actually try this.
BTW: With Firebi... | 1 | 1 | 0 | Is there way to execute DDL script from Python with kinterbasdb library for Firebird database?
Basically I'd like to replicate 'isql -i myscript.sql' command. | How to run DDL script with kinterbasdb | 0.379949 | 1 | 0 | 412 |
7,826,349 | 2011-10-19T18:39:00.000 | 7 | 0 | 0 | 0 | python,http,urllib2,head,pycurl | 7,826,403 | 3 | true | 0 | 0 | The server is taking the bulk of the time, not your requester or the network. If it's a dynamic resource, it's likely that the server doesn't know all the header information - in particular, Content-Length - until it's built it. So it has to build the whole thing whether you're doing HEAD or GET. | 3 | 4 | 0 | I always had the idea that doing a HEAD request instead of a GET request was faster (no matter the size of the resource) and therefore had it advantages in certain solutions.
However, while making a HEAD request in Python (to a 5+ MB dynamic generated resource) I realized that it took the same time as making a GET requ... | HEAD request vs. GET request | 1.2 | 0 | 1 | 2,998 |
7,826,349 | 2011-10-19T18:39:00.000 | 1 | 0 | 0 | 0 | python,http,urllib2,head,pycurl | 7,826,409 | 3 | false | 0 | 0 | The response time is dominated by the server, not by your request. The HEAD request returns less data (just the headers) so conceptually it should be faster, but in practice, many static resources are cached so there is almost no measureable difference (just the time for the additional packets to come down the wire). | 3 | 4 | 0 | I always had the idea that doing a HEAD request instead of a GET request was faster (no matter the size of the resource) and therefore had it advantages in certain solutions.
However, while making a HEAD request in Python (to a 5+ MB dynamic generated resource) I realized that it took the same time as making a GET requ... | HEAD request vs. GET request | 0.066568 | 0 | 1 | 2,998 |
7,826,349 | 2011-10-19T18:39:00.000 | 1 | 0 | 0 | 0 | python,http,urllib2,head,pycurl | 7,826,411 | 3 | false | 0 | 0 | Chances are, the bulk of that request time is actually whatever process generates the 5+MB response on the server rather than the time to transfer it to you.
In many cases, a web application will still execute the full script when responding to a HEAD request--it just won't send the full body back to the requester.
If ... | 3 | 4 | 0 | I always had the idea that doing a HEAD request instead of a GET request was faster (no matter the size of the resource) and therefore had it advantages in certain solutions.
However, while making a HEAD request in Python (to a 5+ MB dynamic generated resource) I realized that it took the same time as making a GET requ... | HEAD request vs. GET request | 0.066568 | 0 | 1 | 2,998 |
7,827,628 | 2011-10-19T20:21:00.000 | 3 | 1 | 0 | 0 | c++,python,macros,licensing,gpl | 7,854,444 | 2 | true | 0 | 0 | No the macros don't become GPL derived works anymore than a 'C' program written on a GPL linux system or with a GPL gcc compiler become GPL.
Including library functions is a little more complicated. If you wrote those library functions then you can let the user do what they want with them. If they are part of the GIMP/... | 2 | 1 | 0 | I'm considering writing a program in C++ which will embed a Python interpreter for executing macros created by users. Suppose that I'm intending to release my program under the GPLv3. What is not clear to me is what impact this has on the macros and data created by the users of my program.
Do any of the requirements of... | How does the GPL affect macros stored in user data? | 1.2 | 0 | 0 | 186 |
7,827,628 | 2011-10-19T20:21:00.000 | 0 | 1 | 0 | 0 | c++,python,macros,licensing,gpl | 7,854,671 | 2 | false | 0 | 0 | You may want to consider using the LGPL for this reason. I am curious what the FSF has to say about such things though. | 2 | 1 | 0 | I'm considering writing a program in C++ which will embed a Python interpreter for executing macros created by users. Suppose that I'm intending to release my program under the GPLv3. What is not clear to me is what impact this has on the macros and data created by the users of my program.
Do any of the requirements of... | How does the GPL affect macros stored in user data? | 0 | 0 | 0 | 186 |
7,827,859 | 2011-10-19T20:42:00.000 | 2 | 0 | 0 | 0 | python,database,database-design | 7,827,955 | 4 | false | 0 | 0 | Just a general data modeling concept: you never want to name anything "...NumberOne", "...NumberTwo". Data models designed in this way are very difficult to query. You'll ultimately need to visit each of N tables for 1 to N ingredients. Also, each table in the model would ultimately have the same fields making main... | 1 | 0 | 0 | I'm very new to Python and I'm trying to write a sort of recipe organizer to get acquainted with the language. Basically, I am unsure how how I should be storing the recipes.
For now, the information I want to store is:
Recipe name
Ingredient names
Ingredient quantities
Preparation
I've been thinking about how to d... | How to store recipe information with Python | 0.099668 | 1 | 0 | 2,639 |
7,829,384 | 2011-10-19T23:19:00.000 | 2 | 0 | 0 | 0 | python,django,internationalization | 7,830,439 | 3 | false | 1 | 0 | Django's LocaleMiddleware tries to determine the locale from the given request and replaces the LANGUAGE_CODE accordingly. It goes through the following steps:
Checks the session for a session variable called django_language. Set the language to the given locale in this session. If not existing it goes to 2.
Checks th... | 2 | 5 | 0 | I cannot get translations to show up for my templates. Here is what I have done:
In my template file (index.html), I have loaded i18n and used the trans tag where I want translations.
In my project directory, I rand ./manage.py makemessages -l es
My django.po file is in ./conf/locale/es/LC_MESSAGES/django.po
I edited... | Django i18n not working | 0.132549 | 0 | 0 | 3,330 |
7,829,384 | 2011-10-19T23:19:00.000 | 0 | 0 | 0 | 0 | python,django,internationalization | 7,838,833 | 3 | true | 1 | 0 | Ok, I found the problem... My po files were in ./conf/locale instead of just ./locale.
The reason I created ./conf/locale was because when I rand django-admin.py makemessages, it instructed me to do so. However, if it's in your local project directory, then it is just simply ./locale. | 2 | 5 | 0 | I cannot get translations to show up for my templates. Here is what I have done:
In my template file (index.html), I have loaded i18n and used the trans tag where I want translations.
In my project directory, I rand ./manage.py makemessages -l es
My django.po file is in ./conf/locale/es/LC_MESSAGES/django.po
I edited... | Django i18n not working | 1.2 | 0 | 0 | 3,330 |
7,829,768 | 2011-10-20T00:21:00.000 | 1 | 0 | 0 | 0 | python,screen-scraping | 7,853,614 | 2 | false | 1 | 0 | I have something similiar to what you have, but you left out what my main question revolves around. I looked at htmlparser and bs, but I am unsure how to do something like if($posttext == gold) echo "gold in so and so".. seems like bs deals a lot with tags..i suppose since facebook posts can use a variety of tags, how ... | 1 | 0 | 0 | Currently, there's a game that has different groups, and you can play for a prize 'gold' every hour. Sometimes there is gold, sometimes there isn't. It is posted on facebook every hour ''gold in group2" or "gold in group6'', and other times there isn't a post due to no gold being a prize for that hour. I want to write ... | fetch text from a web site and displaying it back | 0.099668 | 0 | 1 | 105 |
7,829,829 | 2011-10-20T00:31:00.000 | 2 | 0 | 0 | 0 | python,pyqt,mouseevent,pyqt4,mouseover | 7,829,879 | 4 | false | 0 | 1 | call setMouseTracking(True) method first. Then mouseMoveEvent will be fired without any button pressed. | 1 | 9 | 0 | I need to catch when a User moves the mouse over the GUI, but not when they're holding down the mouse button (which would do something different).
I can't find any conveniant method to do this,
except to periodically find the mouse position and check it to it's previous position...
Which would suck.
The mouseMoveEvent ... | PyQt4 MouseMove event without MousePress | 0.099668 | 0 | 0 | 20,559 |
7,830,091 | 2011-10-20T01:17:00.000 | 14 | 0 | 0 | 0 | python,django,django-models,database-indexes | 7,834,946 | 5 | false | 1 | 0 | If unique_together does add an index, it will be a multiple column index.
If you want one of the columns to be indexed individually, I believe you need to specify db_index=True in the field definition. | 1 | 29 | 0 | A field on a model, foo = models.ForeignKey(Foo) will automatically add a database index for the column, in order to make look-ups faster. That's good and well, but Django's docs don't state whether the fields in a model-meta's unique_together receive the same treatment. I happen to have a model in which one char field... | Django: Does unique_together imply db_index=True in the same way that ForeignKey does? | 1 | 0 | 0 | 9,904 |
7,833,831 | 2011-10-20T09:29:00.000 | 3 | 0 | 1 | 0 | python,vb6,native,windows-95 | 7,835,341 | 4 | false | 0 | 1 | If you must use a null modem, how about the built in serial line networking support?
Then you can just use normal network methods (psexec, file share, etc) methods to do the update. | 2 | 3 | 0 | I have a VB6 application running on a number of old 486 Windows 95 machines and sometimes the application is upgraded. The only way to accomplish this today is to use Hyperterminal and send the file over a null modem cable. Replacing the machines is not an option at this point.
I want to write an application that can t... | Make new software for Windows 95 on 486 machines, what to use? | 0.148885 | 0 | 0 | 547 |
7,833,831 | 2011-10-20T09:29:00.000 | 0 | 0 | 1 | 0 | python,vb6,native,windows-95 | 7,835,783 | 4 | false | 0 | 1 | I guess the answer is pretty simple if you are happy using VB6 and the other app is already VB6, then use it.
That will do whatever serial comms you require quite adequately. Remember though you may want to update the application you write to do the updating in which case you are back to using hyperterminal! | 2 | 3 | 0 | I have a VB6 application running on a number of old 486 Windows 95 machines and sometimes the application is upgraded. The only way to accomplish this today is to use Hyperterminal and send the file over a null modem cable. Replacing the machines is not an option at this point.
I want to write an application that can t... | Make new software for Windows 95 on 486 machines, what to use? | 0 | 0 | 0 | 547 |
7,835,250 | 2011-10-20T11:28:00.000 | 0 | 0 | 1 | 0 | python,numbers | 7,835,276 | 3 | false | 0 | 0 | That means the number is a Long, meaning it is stored using more bytes and can contain larger values | 1 | 0 | 0 | What's the meaning of "L" behind any number(e.g 153L=?,648L=?)
I am getting the value 2432902008176640000L while i am typing math.factorial(20) in python2.7 interpreter.
May be some ppl find it a silly question but i dont know anything about this "L" thing.So please help me to increase my knowledge. | Numbers related query | 0 | 0 | 0 | 69 |
7,835,974 | 2011-10-20T12:33:00.000 | 19 | 0 | 1 | 0 | python,django,pycrypto | 8,373,548 | 3 | true | 0 | 0 | It depends.
Some parts of PyCrypto are really good. For example, the API for Crypto.Random (introduced in PyCrypto 2.1) was designed to be pretty foolproof, and the underlying algorithm it uses (Fortuna) was also designed to be pretty foolproof.
Other parts are just implementations of low-level crypto primitives, so i... | 2 | 13 | 0 | I am planning on using PyCrypto for a project and I want to know whether PyCrypto is safe and reliable enough to use. How can I ensure that PyCrypto is encrypting data correctly according to the various encryption algorithms such as RSA and AES? | Is PyCrypto safe and reliable to use? | 1.2 | 0 | 0 | 4,581 |
7,835,974 | 2011-10-20T12:33:00.000 | 4 | 0 | 1 | 0 | python,django,pycrypto | 7,850,214 | 3 | false | 0 | 0 | Note that I am not an expert in crypto either. That said, I took a quick look at the PyCrypto code on github and at their mailing list. One of the things that gives me confidence is that there is good, expert contributions to the code base. The developers acknowledge insecurities and work to correct them.
If you have a... | 2 | 13 | 0 | I am planning on using PyCrypto for a project and I want to know whether PyCrypto is safe and reliable enough to use. How can I ensure that PyCrypto is encrypting data correctly according to the various encryption algorithms such as RSA and AES? | Is PyCrypto safe and reliable to use? | 0.26052 | 0 | 0 | 4,581 |
7,838,401 | 2011-10-20T15:31:00.000 | 0 | 0 | 0 | 0 | javascript,python,ajax | 7,841,692 | 1 | true | 1 | 0 | Thanks Prusse,It works now - I have increased time limit from 1 to 200 on function queue(s) | 1 | 0 | 0 | I'm using a python tool called "Ajaxterm"(http://wiki.kartbuilding.net/index.php/Ajaxterm). After setting it up. The problem , I face is,when type few chars - they appear as jumbled character.For example,When i type "abcde" it may come as "cdbea" - but no character missing. From my understanding - I tried to debug t... | how to synchronize data between two connects | 1.2 | 0 | 0 | 58 |
7,838,667 | 2011-10-20T15:52:00.000 | 5 | 0 | 0 | 1 | python,django,google-app-engine,web-applications,sqlite | 7,838,935 | 1 | false | 1 | 0 | Unfortunately, no you can't. Google App Engine does not allow you to write files, and that is needed by SQLite.
Until recently, it had no support of SQL at all, preferring a home-grown solution (see the "CAP theorem" as for why). This motivated the creation of projects like "Django-nonrel" which is a version of Django ... | 1 | 3 | 0 | I created a simple bookmarking app using django which uses sqlite3 as the database backend.
Can I upload it to appengine and use it? What is "Django-nonrel"? | Can I deploy a django app which uses sqlite3 as backend on google app engine? | 0.761594 | 1 | 0 | 582 |
7,842,538 | 2011-10-20T21:33:00.000 | 0 | 0 | 0 | 0 | python,binding,tkinter | 7,843,137 | 2 | false | 0 | 1 | Returning 'break' at the end of your event handler will interrupt event propagation. | 1 | 0 | 0 | I'm using a Tkinter Text box in my Python (using 2.7.2) script as an entry-type box -- when enter is pressed, it copies the contents into a different text box and then deletes it out of the entry one.
I've bound the necessary event to the Text box when the Enter key is pressed.
The only problem I have is that whenever... | Python Tkinter - Overwriting/Deleting "Default" Widget Bindings | 0 | 0 | 0 | 889 |
7,843,238 | 2011-10-20T22:55:00.000 | 2 | 1 | 0 | 1 | python,c,sandbox | 7,843,516 | 3 | false | 0 | 0 | Unless you're using a sandboxed version of Python (using PyPy for example), there is no reliable way to switch-off network access from within the script itself. Of course, you could run under a VM with the network access shut off. | 3 | 4 | 0 | Suppose I have a script written in Python or Ruby, or a program written in C. How do I ensure that the script has no access to network capabilities? | How do I block all network access for a script? | 0.132549 | 0 | 0 | 291 |
7,843,238 | 2011-10-20T22:55:00.000 | 5 | 1 | 0 | 1 | python,c,sandbox | 7,843,275 | 3 | true | 0 | 0 | You more or less gave a generic answer yourself by tagging it with "sandbox" because that's what you need, some kind of sandbox. Things that come to mind are: using JPython or JRuby that run on the JVM. Within the JVM you can create a sandbox using a policy file so no code in the JVM can do thing you don't allow.
For C... | 3 | 4 | 0 | Suppose I have a script written in Python or Ruby, or a program written in C. How do I ensure that the script has no access to network capabilities? | How do I block all network access for a script? | 1.2 | 0 | 0 | 291 |
7,843,238 | 2011-10-20T22:55:00.000 | 0 | 1 | 0 | 1 | python,c,sandbox | 7,843,519 | 3 | false | 0 | 0 | Firewalls can block specific applications or processes from accessing the network. ZoneAlarms is a good one that I have used to do exactly what you want in the past. So it can be done programatically, but I don't know near enough about OS programming to offer any advice on how to go about doing it. | 3 | 4 | 0 | Suppose I have a script written in Python or Ruby, or a program written in C. How do I ensure that the script has no access to network capabilities? | How do I block all network access for a script? | 0 | 0 | 0 | 291 |
7,843,786 | 2011-10-21T00:24:00.000 | 3 | 0 | 1 | 0 | python | 7,843,795 | 4 | false | 0 | 0 | It sounds like you're using Numpy. If so, the shape (38845,) means you have a 1-dimensional array, of size 38845. | 3 | 0 | 0 | I am using a package and it is returning me an array. When I print the shape it is (38845,). Just wondering why this ','.
I am wondering how to interpret this.
Thanks. | How to intepret the shape of the array in Python? | 0.148885 | 0 | 0 | 376 |
7,843,786 | 2011-10-21T00:24:00.000 | 0 | 0 | 1 | 0 | python | 7,843,917 | 4 | false | 0 | 0 | Just wondering why this ','.
Because (38845) is the same thing as 38845, but a tuple is expected here, not an int (since in general, your array could have multiple dimensions). (38845,) is a 1-tuple. | 3 | 0 | 0 | I am using a package and it is returning me an array. When I print the shape it is (38845,). Just wondering why this ','.
I am wondering how to interpret this.
Thanks. | How to intepret the shape of the array in Python? | 0 | 0 | 0 | 376 |
7,843,786 | 2011-10-21T00:24:00.000 | 8 | 0 | 1 | 0 | python | 7,843,805 | 4 | true | 0 | 0 | Python has tuples, which are like lists but of fixed size. A two-element tuple is (a, b); a three-element one is (a, b, c). However, (a) is just a in parentheses. To represent a one-element tuple, Python uses a slightly odd syntax of (a,). So there is only one dimension, and you have a bunch of elements in that one dim... | 3 | 0 | 0 | I am using a package and it is returning me an array. When I print the shape it is (38845,). Just wondering why this ','.
I am wondering how to interpret this.
Thanks. | How to intepret the shape of the array in Python? | 1.2 | 0 | 0 | 376 |
7,846,355 | 2011-10-21T07:36:00.000 | 2 | 0 | 0 | 0 | python,postgresql,postgis,geodjango | 7,904,142 | 6 | false | 0 | 0 | I have no experience with GeoDjango, but on PostgreSQL/PostGIS you have the st_distance(..) function. So, you can order your results by st_distance(geom_column, your_coordinates) asc and see what are the nearest rows.
If you have plain coordinates (no postgis geometry), you can convert your coordinates to a point with ... | 1 | 13 | 0 | I am using GeoDjango with PostGIS. Then I am into trouble on how to get the nearest record from the given coordinates from my postgres db table. | How can I query the nearest record in a given coordinates(latitude and longitude of string type)? | 0.066568 | 1 | 0 | 5,401 |
7,846,413 | 2011-10-21T07:41:00.000 | 0 | 0 | 1 | 0 | python,database | 7,847,894 | 3 | false | 0 | 1 | You could pickle a dict that associates filenames to byte strings of RGBA data.
Assuming you have loaded the image with PIL, make sure they have all the same size and color format. Build a dict with images[filename] = im.tostring() and dump() it with pickle. Use Image.fromstring with the right size and mode parameters ... | 1 | 2 | 1 | I have to store/retrieve a large number of images to use in my program.
Each image is small: an icon 50x50, and each one has associated a string which is the path the icon is related to.
Since they are so small I was thinking if there is some library which allows to store all of them in a single file.
I would need to ... | python: container to memorize a large number of images | 0 | 0 | 0 | 165 |
7,847,818 | 2011-10-21T10:00:00.000 | 0 | 0 | 0 | 0 | python,sql-server,ruby,windows,csv | 7,847,885 | 4 | false | 0 | 0 | And what about DTS services? It's integral part of MS SQL server starting with early versions and it allows you to import text-based data to server tables | 1 | 0 | 0 | What's the best combination of tools to import daily data feed (in .CSV format) to a MSSQL server table?
Environment and acceptable tools:
- Windows 2000/XP
- ruby or python
MS SQL Server is on a remote server, the importing process has to be done on a Windows client machine. | Import CSV to MS SQL Server programmatically | 0 | 1 | 0 | 3,142 |
7,851,817 | 2011-10-21T15:37:00.000 | 1 | 0 | 0 | 1 | python,linux,networking | 7,851,867 | 1 | true | 0 | 0 | Are you receiving and processing the packet and only need to suppress the ICMP port-unreachable? If so, maybe just add an entry to the iptables OUTPUT chain to drop it? | 1 | 2 | 0 | We occasionally have to debug glitchy Cisco routers that don't handle the TCP Selective Acknowledgment (SACK) options correctly. This causes our TCP sessions to die when routed through an IPTABLES port redirection rule.
To help with the diagnosis, I've been constructing a python-based utility to construct a sequence of... | Subsuming the Linux packet processing stack | 1.2 | 0 | 1 | 197 |
7,855,099 | 2011-10-21T20:46:00.000 | 2 | 0 | 0 | 0 | python,google-app-engine,google-cloud-datastore | 7,855,122 | 1 | true | 1 | 0 | get_by__id()
no change; it's still a key whether it has an ID or a name
key().id() | 1 | 0 | 0 | How to define that?
What should be used instead of
get_by_key_name
SELECT __key__
key().name() | How to use datastore id instead of key_name? | 1.2 | 0 | 0 | 147 |
7,855,293 | 2011-10-21T21:09:00.000 | 2 | 0 | 1 | 0 | python,error-handling,deprecated | 7,855,701 | 2 | false | 0 | 0 | No worries. The warning is about something in the standard library that was already fixed in Python 2.7. You can safely ignore it :-)
The sets.py is part of the standard library. Line 85 is just a warning that the sets module is deprecated in favor of the set() builtin method but that won't disappear until Python3.0... | 1 | 1 | 0 | I ran some python code and got this error message:
C:\Python26\lib\sets.py:85: DeprecationWarning: functions overriding warnings.showwarning() must support the 'line' argument
stacklevel=2)
I am not sure if this is some warning that I can just ignore or if this is serious? Any input will be appreciated. Thanks | error message concerning deprecation | 0.197375 | 0 | 0 | 359 |
7,855,845 | 2011-10-21T22:09:00.000 | 5 | 0 | 0 | 0 | python,numpy,random-sample | 7,855,863 | 4 | false | 0 | 0 | This shouldn't happen. Check your code for bad imports like from numpy import *. | 1 | 5 | 1 | When I call random.sample(arr,length)
an error returns random_sample() takes at most 1 positional argument (2 given). After some Googling I found out I'm calling Numpy's random sample function when I want to call the sample function of the random module. I've tried importing numpy under a different name, which doesn'... | Python's random module made inaccessible by Numpy's random module | 0.244919 | 0 | 0 | 4,375 |
7,856,725 | 2011-10-22T00:57:00.000 | 0 | 0 | 0 | 0 | python,spss | 11,026,071 | 2 | false | 0 | 0 | I was recently given a data set from confirmit. There are almost 4000 columns in the excel file. I want to enter it into a mysql db. There is not way they are just doing that output from one table. Do you know how the table schema works for confirmit? | 2 | 2 | 1 | I recently asked about accessing data from SPSS and got some absolutely wonderful help here. I now have an almost identical need to read data from a Confirmit data file. Not finding a ton of confirmit data file format on the web. It appears that Confirmit can export to SPSS *.sav files. This might be one avenue for me.... | Anyone familiar with data format of Comfirmit? | 0 | 0 | 0 | 768 |
7,856,725 | 2011-10-22T00:57:00.000 | 0 | 0 | 0 | 0 | python,spss | 10,631,838 | 2 | true | 0 | 0 | You can get the data schema from Excel definition export from Confirmit
You can export from Confirmit txt file with the same template | 2 | 2 | 1 | I recently asked about accessing data from SPSS and got some absolutely wonderful help here. I now have an almost identical need to read data from a Confirmit data file. Not finding a ton of confirmit data file format on the web. It appears that Confirmit can export to SPSS *.sav files. This might be one avenue for me.... | Anyone familiar with data format of Comfirmit? | 1.2 | 0 | 0 | 768 |
7,857,755 | 2011-10-22T06:05:00.000 | 6 | 0 | 0 | 0 | python,database,sqlite | 7,857,866 | 3 | false | 0 | 0 | Chromium is holding a database lock for long periods of time? Yuck! That's really not a very good idea at all. Still, not your fault…
You could try just copying the database file (e.g., with the system utility cp) and using that snapshot for reading purposes; SQLite keeps all its committed state in a single file per da... | 1 | 15 | 0 | I'd like to open the chromium site data (in ~/.config/chromium/Default) with python-sqlite3 but it gets locked whenever chromium is running, which is understandable since transactions may be made. Is there a way to open it in read-only mode, ensuring that I can't corrupt the integrity of the db while chromium is using ... | Is it possible to open a locked sqlite database in read only mode? | 1 | 1 | 0 | 7,130 |
7,857,940 | 2011-10-22T07:00:00.000 | 1 | 0 | 0 | 0 | java,android,python,rfid | 7,858,130 | 1 | true | 1 | 0 | Buy a Nexus-S, buy some tags.
Then take a look at the code of the 'Tags' application that comes with android. Play with it, modify it. Write some tags with your own application.
Learn what Ndef is and how you craft your own messages/records. Learn how to use the transceive function to do direct communication to the ta... | 1 | 1 | 0 | I've heard that the Google Nexus S has RFID capabilities. I'd like to start learning about RFID and programmatically doing things. Where should I start? Good tutorials or code examples are what I'm after. (or hardware if it's not Android I suppose).
Doesn't have to be Android, could be python or java libraries as well.... | RFID + Android --> where do I start? | 1.2 | 0 | 1 | 1,251 |
7,858,436 | 2011-10-22T08:59:00.000 | 1 | 1 | 0 | 0 | python,ruby,scripting | 7,858,486 | 2 | false | 0 | 0 | I started with python and ruby both few months ago. Ruby has loads and loads of issues and I find python really cool. Dint try with scripting. I am working on web apps.
Used python script to to interact with database and inserting raw fields. Works really fine. | 1 | 0 | 0 | I need to write a bunch of scripts to grab diagnostic data from customer environments where our product is installed. Troubleshooting data I need comes various sources including Oracle database, PowerShell commands, WMI, Registry, Windows commands such as netstat, our own property files, log files etc. The results wi... | Ruby vs Python: Which is better suited for scripting utilities on Windows? And why? | 0.099668 | 0 | 0 | 1,651 |
7,858,552 | 2011-10-22T09:25:00.000 | 1 | 1 | 0 | 0 | python,screen-scraping,mechanize,web-scraping,deobfuscation | 7,860,906 | 1 | false | 1 | 0 | Rather than trying to process the page, how about just use Firebug to figure out the names of the form fields, and then use httplib or whatever to send a request with the necessary fields and settings?
If it's sent using ajax, you should be able to determine the values being sent to the server in Firebug as well. | 1 | 1 | 0 | I'm trying to interact with a HTML 4.0 website which uses heavily obfuscated javascript to hide the regular HTML elements. What I want to do is to fill out a form and read the returned results, and this is proving harder to do than expected.
When I read the page using Firebug, it gave me the source code deobfuscated, a... | Parse and interact with obfuscated javascript | 0.197375 | 0 | 0 | 754 |
7,859,775 | 2011-10-22T13:09:00.000 | 3 | 0 | 0 | 0 | python,django,mongodb,couchdb | 10,204,764 | 3 | false | 1 | 0 | I've used mongo-engine with Django but you need to create a file specifically for Mongo documents eg. Mongo_models.py. In that file you define your Mongo documents. You then create forms to match each Mongo document. Each form has a save method which inserts or updates whats stored in Mongo. Django forms are designed t... | 1 | 3 | 0 | This is what I have :-
Ubuntu 11.10.
Django 1.3
Python 2.7
What I want to do is build an app that is similar to top-coder and I have the skeletal version of the app sketched out. The basic requirements would be:-
1. Saving the code.
2. Saving the user name and ranks.(User-profile)
3. Should allow a teacher to creat... | Mongo DB or Couch DB with django for building an app that is similar to top coder? | 0.197375 | 1 | 0 | 2,560 |
7,860,643 | 2011-10-22T15:43:00.000 | 2 | 0 | 0 | 0 | unicode,python-3.x,flask-sqlalchemy | 7,860,959 | 1 | true | 1 | 0 | No, but make sure you separate binary data from text data. That makes it easier to port.
It's easier to use Unicode from the start, but of course you can postpone it. But it's really not very difficult.
You replace everything that should be text data with Unicode, yes.
Only of you make loads of conversions of really ma... | 1 | 2 | 0 | I am working on a web development project using flask and sqlalchemy orm. My post is related to use of unicode in developing this app.
What I have understood till now about unicode :
If I want my webapp to handle data in languages other than English I need to use unicode data type for my variables. Because string var... | To use unicode or not in web development project using flask and sqlalchemy | 1.2 | 0 | 0 | 293 |
7,860,958 | 2011-10-22T16:35:00.000 | 3 | 1 | 1 | 0 | python,python-c-api | 7,861,240 | 2 | true | 0 | 0 | The object returned by PyEval_Evalcode() can be transformed to a Python string using PyObject_Repr() or PyObject_Str(). The resultant python string can be turned into a regular C string with PyString_AsString(). | 2 | 3 | 0 | I'm trying to emulate code.InteractiveInterpreter from the embedded Python C API. I'm using PyEval_Evalcode to evaluate the user input. I am trying to evaluate user input in the interpreter and return the output as a string (just like the interpreter would). However, PyEval_Evalcode returns a multitude of datatypes wra... | Evaluating Python Code From the CAPI and getting Output | 1.2 | 0 | 0 | 270 |
7,860,958 | 2011-10-22T16:35:00.000 | 0 | 1 | 1 | 0 | python,python-c-api | 11,220,657 | 2 | false | 0 | 0 | I have binary string and cannot return it as string because of null terminated string.
if(PyString_Check(pValue))
{
const char* s=/*PyBytes_AsString*/PyString_AsString(PyObject_Repr(pValue)); //return hex representation in ascii
int sz=PyString_Size(pValue);//size... | 2 | 3 | 0 | I'm trying to emulate code.InteractiveInterpreter from the embedded Python C API. I'm using PyEval_Evalcode to evaluate the user input. I am trying to evaluate user input in the interpreter and return the output as a string (just like the interpreter would). However, PyEval_Evalcode returns a multitude of datatypes wra... | Evaluating Python Code From the CAPI and getting Output | 0 | 0 | 0 | 270 |
7,863,077 | 2011-10-22T22:35:00.000 | 2 | 0 | 1 | 0 | python,regex | 7,863,092 | 5 | false | 0 | 0 | findall + len seems like one solution. | 1 | 1 | 0 | Im trying to make a regular expression in python that allows me to find a word within a string "n" times
For example, if i wanted to find a expression that could match if the word "cat" is exactly two times. How i would do that?
It should accept "The blue cat talks to the red cat in the tree". Because it has "cat" exac... | A regular expression for finding a word within a string exactly "n" times | 0.07983 | 0 | 0 | 1,524 |
7,863,224 | 2011-10-22T23:10:00.000 | 1 | 0 | 1 | 0 | python,matplotlib,graph | 7,863,244 | 3 | false | 0 | 0 | Yes. You can wrap an import statement in a try-except block. It is commonly used for backwards-compatability cruft. For instance, by importing a fall-back module as the desired module. That way the rest of the code can be oblivious to which module is actually in use. | 1 | 4 | 0 | I am developing a Python model that will support graphing if the correct modules are installed. I would like the source code to be the same if possible, IE, if the graphing model can't load, graphing would be ignored from the menu logic.
How can I accomplish this? | Change Program Flow based on Available Libraries | 0.066568 | 0 | 0 | 169 |
7,863,986 | 2011-10-23T02:35:00.000 | 4 | 0 | 0 | 1 | python,unix,utf-8,utf-16,binutils | 7,864,249 | 1 | true | 0 | 0 | I'm not experienced with strings, but the version I have (2.21.51.20110605) has an 8-bit encoding option (-eS) that would work with utf-8 text. It must have to cast a wide net looking for 'text' delimited by non-printable characters (value < 32). I'd expect a lot of noise. A test on a random executable showed the -eS (... | 1 | 3 | 0 | I've noticed gnu-binutils-strings can printout utf-16 content in a file - is it possible for the program to print out utf-8 strings? if so, which arguments are appropriate? i'm working in a python environment using subprocess and would like to work with the output from gnu-binutils-strings that a subprocess.Popen call ... | gnu-binutils-strings utf-8 instead of utf-16 or ascii | 1.2 | 0 | 0 | 573 |
7,864,103 | 2011-10-23T03:12:00.000 | 6 | 0 | 1 | 0 | python | 7,864,121 | 1 | true | 0 | 0 | If the 3rd party project is using setuptools or distribute, you can do python setup.py develop instead of install. This will create the appropriate sym-links in the site-packages dir for you. | 1 | 3 | 0 | I often find myself wanting to use a 3rd party python module in my own project, but I know that I will also need to make changes to the 3rd party module that I want to push upstream. What is the best practice of file layout/installation to achieve this?
Most python modules are laid out with root dir containing a "setup... | Best practice for hacking on a 3rd-party python module | 1.2 | 0 | 0 | 559 |
7,869,552 | 2011-10-23T22:00:00.000 | 0 | 1 | 0 | 1 | python,ssh,scp | 7,869,588 | 4 | false | 0 | 0 | scp lets you:
Copy entire directories using the -r flag: scp -r g0:labgroup/ .
Specify a glob pattern: scp 'g0:labgroup/assignment*.hs' .
Specify multiple source files: scp 'g0:labgroup/assignment1*' 'g0:labgroup/assignment2*' .
Not sure what sort of globbing is supported, odds are it just uses the shell for this. I'... | 1 | 0 | 0 | Python 2.4.x (cannot install any non-stock modules).
Question for you all. (assuming use of subprocess.popen)
Say you had 20 - 30 machines - each with 6 - 10 files on them that you needed to read into a variable.
Would you prefer to scp into each machine, once for each file (120 - 300 SCP commands total), reading each... | Python - SCP vs SSH for multiple computers and multiple files | 0 | 0 | 0 | 1,890 |
7,869,589 | 2011-10-23T22:08:00.000 | 1 | 0 | 1 | 0 | python,user-interface | 7,870,721 | 6 | false | 0 | 1 | tkinter is one choice. It has a canvas widget that is very easy to use -- you can draw objects (lines, circles, etc) as well as embed images (for tiles, for example). And of course it comes with a standard collection of widgets (buttons, comboboxes, listboxes, menus, etc) that can either be embedded in a canvas or used... | 1 | 18 | 0 | I want to create a 2D game on Python with heavy user interface: windows, buttons, text input, etc. So far I've been using PyGame for a few simple games.
The game is a 2D MUD, with the standard rendering loop to draw stuff on the screen. I need the user interface to interact with the game entities like sales, blacksmith... | Which Python user interface library can I use for 2D games? | 0.033321 | 0 | 0 | 5,109 |
7,869,624 | 2011-10-23T22:15:00.000 | 2 | 0 | 0 | 0 | python,django,memory,garbage-collection | 7,869,753 | 1 | false | 1 | 0 | mod_wsgi keeps loaded python process in memory to speed up any further requests. That is absolutely normal/ | 1 | 0 | 0 | It seems logical to me that processes should die and memory be cleared after the python scripts have run and the HTTP response has been sent.
however It seems I have four processes running, one of which is using over 100MB of memory.
It seems like way too much for what I am doing. Is there some garbage collector settin... | Why don't processes die after page load? - Django | 0.379949 | 0 | 0 | 100 |
7,870,966 | 2011-10-24T03:10:00.000 | 0 | 1 | 0 | 0 | python | 7,871,122 | 1 | false | 1 | 0 | You probably want to store each user's timezone in your database and then you can change a particular datetime object's timezone by using datetime.astimezone(tz) .
Now deciding what a good time to to sms them is entirely up to you. | 1 | 0 | 0 | I need to send sms globally to different timezones to each customer registered online
The messages are scheduled to be send each month.
I have the country details of each cutomer . I would be writing a python script and add it to cronjobs for sending sms.
The issue I am facing is knowing a safe time ( sometime during ... | Dealing with timezones for sending sms -python /django | 0 | 0 | 0 | 125 |
7,873,170 | 2011-10-24T08:50:00.000 | 1 | 0 | 0 | 1 | python | 7,873,222 | 2 | false | 0 | 0 | You're asking a very general question. Perhaps overly general.
Generally, unless your application is relatively simple, it's impossible to guarantee that it is going to work on Linux and Mac OS X by only having Windows available. You will have to at least test it on Linux. Mac OS X is rather similar to Linux in many as... | 2 | 1 | 0 | I have windows xp, I have found some python libraries that only work for windows xp and thus if you have a mac os or linux or windows 7, you can't download my program because it won't work, how to make these libraries compatible with these OS, I can't ask the creator of the libraries so I have to download the source co... | How to make python modules compatible with different OS? | 0.099668 | 0 | 0 | 133 |
7,873,170 | 2011-10-24T08:50:00.000 | 0 | 0 | 0 | 1 | python | 7,873,269 | 2 | true | 0 | 0 | Your question is quite broad:
1) Development and testing:
Use VMs, absolutely, they are great for testing on OS you don't natively use, and to have a clean environment for testing (eg. test even windows stuff on a clean windows VM if you can, you might find out you're missing some dependencies that you took for granted... | 2 | 1 | 0 | I have windows xp, I have found some python libraries that only work for windows xp and thus if you have a mac os or linux or windows 7, you can't download my program because it won't work, how to make these libraries compatible with these OS, I can't ask the creator of the libraries so I have to download the source co... | How to make python modules compatible with different OS? | 1.2 | 0 | 0 | 133 |
7,874,752 | 2011-10-24T11:14:00.000 | 0 | 0 | 0 | 0 | python,openerp | 23,337,385 | 3 | false | 1 | 0 | same problem here.I'm using Multi-company, I provid all permistion to the user | 2 | 1 | 0 | After creating an opportunity, when I click on save, it gives me this warning for some users:
"Operation prohibited by access rules, or performed on an already deleted document (Operation: read, Document type: User Modification)."
What's causing this problem?
Update: I have created a new user of admin type and I add... | Warning while saving opportunity in OpenERP | 0 | 0 | 0 | 1,027 |
7,874,752 | 2011-10-24T11:14:00.000 | 0 | 0 | 0 | 0 | python,openerp | 19,397,247 | 3 | false | 1 | 0 | Hi these is due to the access right problem .So you give the proper access right to your user(for creating the oppurtunity) | 2 | 1 | 0 | After creating an opportunity, when I click on save, it gives me this warning for some users:
"Operation prohibited by access rules, or performed on an already deleted document (Operation: read, Document type: User Modification)."
What's causing this problem?
Update: I have created a new user of admin type and I add... | Warning while saving opportunity in OpenERP | 0 | 0 | 0 | 1,027 |
7,875,688 | 2011-10-24T12:34:00.000 | 9 | 0 | 0 | 0 | python,matplotlib,colorbar | 7,878,155 | 4 | false | 0 | 0 | Easiest solution is to call clim(lower_limit, upper_limit) with the same arguments for each plot. | 1 | 38 | 1 | I using matplotlib to plot some data in python and the plots require a standard colour bar. The data consists of a series of NxM matrices containing frequency information so that a simple imshow() plot gives a 2D histogram with colour describing frequency. Each matrix contains data in different, but overlapping ranges.... | How can I create a standard colorbar for a series of plots in python | 1 | 0 | 0 | 46,914 |
7,876,250 | 2011-10-24T13:20:00.000 | 0 | 1 | 1 | 0 | python | 7,876,369 | 1 | false | 0 | 0 | Constructor arguments are usually documented in the type docstring, i.e. via the tp_doc slot, so you can do help(type) (or type? in IPython) instead of help(type.__new__) or help(type.__init__). | 1 | 1 | 0 | When developing a Python plug-in (in C++), how does one go about setting
the documentation for __new__? In particular, given a new type
defined by a PyTypeObject structure in the C++, how does one document
the arguments which can be passed to the constructor. | Generating constructor documentation for class defined in C++ | 0 | 0 | 0 | 119 |
7,877,638 | 2011-10-24T14:59:00.000 | 2 | 1 | 0 | 0 | python,testing,bdd | 7,994,429 | 3 | true | 0 | 0 | I have to disagree with Andy.
I do agree that the appropriate testing should be done at the appropriate time, and that unit tests (i.e. ones that do not interact with anything outside their unit) do not replace all other forms of testing.
But that doesn't necessarily mean that with the proper separation you cannot use... | 3 | 7 | 0 | I like Lettuce, and the feel of testing with it. Could I replace all the tests ( doctests/unit tests ) in a project with Lettuce features? | Can BDD testing with Lettuce replace all other forms of testing in a project? | 1.2 | 0 | 0 | 1,121 |
7,877,638 | 2011-10-24T14:59:00.000 | 8 | 1 | 0 | 0 | python,testing,bdd | 7,878,932 | 3 | false | 0 | 0 | In short, no.
I haven't used Lettuce, but your question applies equally to other BDD frameworks such as Cucumber.
This approach is considered bad practice since integration tests are slower to run and more work to maintain than unit tests.
Also, a big advantage of Gherkin syntax is that it's readable by non-technical s... | 3 | 7 | 0 | I like Lettuce, and the feel of testing with it. Could I replace all the tests ( doctests/unit tests ) in a project with Lettuce features? | Can BDD testing with Lettuce replace all other forms of testing in a project? | 1 | 0 | 0 | 1,121 |
7,877,638 | 2011-10-24T14:59:00.000 | 1 | 1 | 0 | 0 | python,testing,bdd | 17,815,773 | 3 | false | 0 | 0 | It is a poor idea to use Gherkin/Lettuce for everything.
1) You should never do away with manual testing entirely. You might replace repetitive scripted testing, but you need to run the software past someone who can misunderstand or misuse it. Creative, destructive, human testing is important -- but the heavy lifting (... | 3 | 7 | 0 | I like Lettuce, and the feel of testing with it. Could I replace all the tests ( doctests/unit tests ) in a project with Lettuce features? | Can BDD testing with Lettuce replace all other forms of testing in a project? | 0.066568 | 0 | 0 | 1,121 |
7,878,730 | 2011-10-24T16:24:00.000 | 3 | 0 | 0 | 0 | python,tkinter,treeview,ttk | 32,121,255 | 6 | false | 0 | 1 | I realise this is an old question but just for the record configuring the tags just after creating the tree (i.e. when no items have yet been added to it) also works. As items get inserted later on they will be given the background colour appropriate to their 'oddrow' or 'evenrow' tag. | 1 | 15 | 0 | How can I set a style for treeview widgets so that alternate rows have different background colors, for example, rows 1,3,5 have white backgrounds and rows 2,4,6 have light blue-grey backgrounds?
I'd also like to set gridlines. | ttk treeview: alternate row colors | 0.099668 | 0 | 0 | 27,341 |
7,880,180 | 2011-10-24T18:36:00.000 | 0 | 0 | 0 | 0 | python,django,django-south,pylint | 68,687,946 | 4 | false | 1 | 0 | The anser here didn't work for me, the ignore list doesn't work on directories.
I had to add
ignore-paths=.*/migrations | 1 | 14 | 0 | I'm using South for migration in my Django project. When I run Pylint on my project I get a bunch of errors from the migration files. How can I exclude migration files from Pylint?
I'm on a Windows system so I can't use filename exclusions in the Pylint options. I've tried to resort to adding # pylint: disable-msg-cat=... | How do I exclude South migrations from Pylint? | 0 | 0 | 0 | 3,484 |
7,881,230 | 2011-10-24T19:59:00.000 | 2 | 0 | 0 | 1 | python,windows,linux,macos,clipboard | 7,889,078 | 5 | false | 0 | 0 | Polling is NOT robust/reliable.
You cannot determine if data has changed (on windows anyway) without pasting it into a buffer for inspection. This requires opening the clipboard. If you do this in a loop, you're going to collide with other apps. i.e. the app where the user is copying another item onto the clipboard. Th... | 1 | 4 | 0 | I am trying to create a script in Python that will collect data put in the clipboard by the user and preferably save it as a list or in a text file or string/array/variable to work with later on.
This should work on Linux all versions (I would assume Ubuntu), Mac OS all versions and Windows all versions. I am not sure... | Copy data from the clipboard on Linux, Mac and Windows with a single Python script | 0.07983 | 0 | 0 | 5,923 |
7,881,474 | 2011-10-24T20:19:00.000 | 1 | 1 | 0 | 0 | python,mod-wsgi,mod-python,mod-fastcgi | 7,881,775 | 4 | false | 1 | 0 | The best solution might be to use mod_proxy and run the Python web app in a different webserver. | 1 | 5 | 0 | I wrote a WSGI application which I need to deploy to a server, however I've been given a server that already has mod_python installed.
I am not allowed to remove mod_python since there are some mod_python applications running on it already.
One option I considered was installing mod_wsgi alongside mod_python, however I... | deploying a WSGI application on mod_python | 0.049958 | 0 | 0 | 1,117 |
7,881,926 | 2011-10-24T20:58:00.000 | 5 | 0 | 1 | 1 | python,debugging,core | 7,881,936 | 1 | true | 0 | 0 | The "file" program can tell you; type "file core". | 1 | 1 | 0 | I have a python program that spawns a number of processes, one of which segfaults and dumps core. Is there a way to find out which executable produced the resulting core file? | Which executable does a core file belong to? | 1.2 | 0 | 0 | 522 |
7,882,442 | 2011-10-24T21:52:00.000 | 1 | 0 | 0 | 0 | python,django,user-interface,django-admin | 7,883,376 | 1 | true | 1 | 0 | My guess is that it would be easiest to do this as a javascript widget--it'll be easier to wedge into the admin and there's tons of examples to work off of.
Daring to venture slightly off of the question though, I'll say I'd be pretty nervous trying to write regexes to parse human-generated responses of any complexity,... | 1 | 1 | 0 | I'm building a Django app that will let researchers send text messages to study participants and parse the responses. While parsing, say, 'Y/N' and numbers is going to be pretty easy, we'll need to send messages that need more complex responses. Which, I think, means regular expressions.
All this is easy enough; the th... | Django Admin: let people test a regexp? | 1.2 | 0 | 0 | 66 |
7,883,646 | 2011-10-25T01:06:00.000 | 23 | 0 | 0 | 0 | python,sqlite,numpy,scipy,hdf5 | 7,891,137 | 1 | true | 0 | 0 | Most of it depends on your use case.
I have a lot more experience dealing with the various HDF5-based methods than traditional relational databases, so I can't comment too much on SQLite libraries for python...
At least as far as h5py vs pyTables, they both offer very seamless access via numpy arrays, but they're orie... | 1 | 12 | 1 | There seems to be many choices for Python to interface with SQLite (sqlite3, atpy) and HDF5 (h5py, pyTables) -- I wonder if anyone has experience using these together with numpy arrays or data tables (structured/record arrays), and which of these most seamlessly integrate with "scientific" modules (numpy, scipy) for ea... | exporting from/importing to numpy, scipy in SQLite and HDF5 formats | 1.2 | 1 | 0 | 3,647 |
7,883,962 | 2011-10-25T02:11:00.000 | 3 | 0 | 1 | 0 | python,yield | 7,884,098 | 4 | false | 0 | 0 | Another use is in a network client. Use 'yield' in a generator function to round-robin through multiple sockets without the complexity of threads.
For example, I had a hardware test client that needed to send a R,G,B planes of an image to firmware. The data needed to be sent in lockstep: red, green, blue, red, green, b... | 1 | 43 | 0 | I know how yield works. I know permutation, think it just as a math simplicity.
But what's yield's true force? When should I use it? A simple and good example is better. | Where to use yield in Python best? | 0.148885 | 0 | 0 | 34,825 |
7,884,010 | 2011-10-25T02:20:00.000 | 4 | 0 | 0 | 0 | python,ruby,clojure,lua,livecoding | 7,898,079 | 8 | false | 1 | 1 | The only thing that’s necessary to make this work is a form of dynamic binding, e.g., message passing in Erlang or eval in many other languages.
If you have dynamic binding, then you can change the target of a message without affecting the message, or a message without affecting the target—provided that a target is def... | 3 | 13 | 0 | I would like to build a "live coding framework".
I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding.
Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. I... | What programming language features are well suited for developing a live coding framework? | 0.099668 | 0 | 0 | 1,317 |
7,884,010 | 2011-10-25T02:20:00.000 | 2 | 0 | 0 | 0 | python,ruby,clojure,lua,livecoding | 36,677,720 | 8 | false | 1 | 1 | Smalltalk is probably the best bet for this. As unlike the others, it has a whole IDE for live coding, not just a REPL | 3 | 13 | 0 | I would like to build a "live coding framework".
I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding.
Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. I... | What programming language features are well suited for developing a live coding framework? | 0.049958 | 0 | 0 | 1,317 |
7,884,010 | 2011-10-25T02:20:00.000 | 1 | 0 | 0 | 0 | python,ruby,clojure,lua,livecoding | 7,897,130 | 8 | false | 1 | 1 | Tcl has such a thing already. For example, you can write a gui program that creates a separate window that has an interactive prompt. From there you can reload your code, type in new code, etc.
You can do this with any gui toolkit, though some will be much harder than others. It should be easy with python, though the i... | 3 | 13 | 0 | I would like to build a "live coding framework".
I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding.
Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. I... | What programming language features are well suited for developing a live coding framework? | 0.024995 | 0 | 0 | 1,317 |
7,886,024 | 2011-10-25T07:32:00.000 | 0 | 0 | 0 | 0 | python | 7,886,073 | 2 | false | 0 | 0 | Try getting this to work using the MySQL gui. Once that works properly, then you can try to get it to work with Python using the SQL statements that worked in MySQL. | 1 | 0 | 0 | I have two List. first list element Name Age Sex and second list element test 10 female. I want to insert this data into database. In first list having MySQL Column and in second MySQL Column Values.I'm trying to make this query. INSERT INTO (LIST1) VALUES (List2) =>INSERT INTO table (name,age,sex) values (test,10,fem... | related to List (want to insert into database) | 0 | 1 | 0 | 77 |
7,887,707 | 2011-10-25T10:10:00.000 | 1 | 0 | 0 | 0 | python,caching,plone | 7,888,725 | 1 | true | 1 | 0 | Firebug shows all resource responses, including those taken from the browser cache. The way to differentiate between the two is the colour of the entry; black means it required network access (e.g. the browser asked the server), gray is a cached response.
In other words, just because you see resources listed in Firebug... | 1 | 2 | 0 | Problem: I'd like to reduce the number of http request just by caching in browser some resources.
I've succesfully configured plone.app.caching in plone4.1 (without caching proxy), and no debug/develop mode (css, js, kss) is active.
I'm getting correct "X-Cache-Operation" headers in responses, but the number of http re... | plone 4.1 - plone.app.caching issue - unable to reduce http requests | 1.2 | 0 | 0 | 181 |
7,888,953 | 2011-10-25T12:00:00.000 | 1 | 0 | 1 | 0 | python | 7,889,022 | 3 | false | 0 | 0 | You can either have a try...finally pair, or make your class a context manager suitable for use in the with statement. | 2 | 5 | 0 | I have a class where I create a file object in the constructor. This class also implements a finish() method as part of its interface and in this method I close the file object. The problem is that if I get an exception before this point, the file will not be closed. The class in question has a number of other methods ... | Guaranteeing a file close | 0.066568 | 0 | 0 | 258 |
7,888,953 | 2011-10-25T12:00:00.000 | 3 | 0 | 1 | 0 | python | 7,889,203 | 3 | false | 0 | 0 | For short lived file objects, a try/finally pair or the more succinct with-statement is recommended as a clean way to make sure the files are flushed and the related resources are released.
For long lived file objects, you can register with atexit() for an explicit close or just rely on the interpreter cleaning up befo... | 2 | 5 | 0 | I have a class where I create a file object in the constructor. This class also implements a finish() method as part of its interface and in this method I close the file object. The problem is that if I get an exception before this point, the file will not be closed. The class in question has a number of other methods ... | Guaranteeing a file close | 0.197375 | 0 | 0 | 258 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.