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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
712,510 | 2009-04-03T04:02:00.000 | 0 | 0 | 0 | 0 | python,csv | 1,396,578 | 12 | false | 0 | 0 | Disagreeing with the noble colleagues, I often use DBD::CSV from Perl. There are good reasons to do it. Foremost is data update made simple using a spreadsheet. As a bonus, since I am using SQL queries, the application can be easily upgraded to a real database engine. Bear in mind these were extremely small databas... | 9 | 4 | 0 | Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database.
While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use S... | Using CSV as a mutable database? | 0 | 1 | 0 | 2,433 |
712,510 | 2009-04-03T04:02:00.000 | 0 | 0 | 0 | 0 | python,csv | 713,531 | 12 | false | 0 | 0 | What about postgresql? I've found that quite nice to work with, and python supports it well.
But I really would look for another provider unless it's really not an option. | 9 | 4 | 0 | Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database.
While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use S... | Using CSV as a mutable database? | 0 | 1 | 0 | 2,433 |
712,510 | 2009-04-03T04:02:00.000 | 1 | 0 | 0 | 0 | python,csv | 713,396 | 12 | false | 0 | 0 | "Anyways, now, the question: is it possible to update values SQL-style in a CSV database?"
Technically, it's possible. However, it can be hard.
If both PHP and Python are writing the file, you'll need to use OS-level locking to assure that they don't overwrite each other. Each part of your system will have to lock th... | 9 | 4 | 0 | Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database.
While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use S... | Using CSV as a mutable database? | 0.016665 | 1 | 0 | 2,433 |
712,510 | 2009-04-03T04:02:00.000 | 0 | 0 | 0 | 0 | python,csv | 712,567 | 12 | false | 0 | 0 | I agree. Tell them that 5 random strangers agree that you being forced into a corner to use CSV is absurd and unacceptable. | 9 | 4 | 0 | Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database.
While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use S... | Using CSV as a mutable database? | 0 | 1 | 0 | 2,433 |
712,510 | 2009-04-03T04:02:00.000 | 1 | 0 | 0 | 0 | python,csv | 712,568 | 12 | false | 0 | 0 | You can probably used sqlite3 for more real database. It's hard to imagine hosting that won't allow you to install it as a python module.
Don't even think of using CSV, your data will be corrupted and lost faster than you say "s#&t" | 9 | 4 | 0 | Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database.
While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use S... | Using CSV as a mutable database? | 0.016665 | 1 | 0 | 2,433 |
712,510 | 2009-04-03T04:02:00.000 | 1 | 0 | 0 | 0 | python,csv | 712,522 | 12 | false | 0 | 0 | I couldn't imagine this ever being a good idea. The current mess I've inherited writes vital billing information to CSV and updates it after projects are complete. It runs horribly and thousands of dollars are missed a month. For the current restrictions that you have, I'd consider finding better hosting. | 9 | 4 | 0 | Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database.
While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use S... | Using CSV as a mutable database? | 0.016665 | 1 | 0 | 2,433 |
712,510 | 2009-04-03T04:02:00.000 | 1 | 0 | 0 | 0 | python,csv | 712,515 | 12 | false | 0 | 0 | Keep calling on the help desk.
While you can use a CSV as a database, it's generally a bad idea. You would have to implement you own locking, searching, updating, and be very careful with how you write it out to make sure that it isn't erased in case of a power outage or other abnormal shutdown. There will be no transa... | 9 | 4 | 0 | Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database.
While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use S... | Using CSV as a mutable database? | 0.016665 | 1 | 0 | 2,433 |
712,510 | 2009-04-03T04:02:00.000 | 0 | 0 | 0 | 0 | python,csv | 712,512 | 12 | false | 0 | 0 | I'd keep calling help desk. You don't want to use CSV for data if it's relational at all. It's going to be nightmare. | 9 | 4 | 0 | Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database.
While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use S... | Using CSV as a mutable database? | 0 | 1 | 0 | 2,433 |
712,510 | 2009-04-03T04:02:00.000 | 0 | 0 | 0 | 0 | python,csv | 712,974 | 12 | false | 0 | 0 | If I understand you correctly: you need to access the same database from both python and php, and you're screwed because you can only use mysql from php, and only sqlite from python?
Could you further explain this? Maybe you could use xml-rpc or plain http requests with xml/json/... to get the php program to communicat... | 9 | 4 | 0 | Yes, this is as stupid a situation as it sounds like. Due to some extremely annoying hosting restrictions and unresponsive tech support, I have to use a CSV file as a database.
While I can use MySQL with PHP, I can't use it with the Python backend of my program because of install issues with the host. I can't use S... | Using CSV as a mutable database? | 0 | 1 | 0 | 2,433 |
712,791 | 2009-04-03T06:56:00.000 | 6 | 0 | 1 | 0 | python,json,simplejson | 714,748 | 13 | false | 0 | 0 | Another reason projects use simplejson is that the builtin json did not originally include its C speedups, so the performance difference was noticeable. | 4 | 405 | 0 | I have seen many projects using simplejson module instead of json module from the Standard Library. Also, there are many different simplejson modules. Why would use these alternatives, instead of the one in the Standard Library? | What are the differences between json and simplejson Python modules? | 1 | 0 | 1 | 141,384 |
712,791 | 2009-04-03T06:56:00.000 | 2 | 0 | 1 | 0 | python,json,simplejson | 38,016,773 | 13 | false | 0 | 0 | In python3, if you a string of b'bytes', with json you have to .decode() the content before you can load it. simplejson takes care of this so you can just do simplejson.loads(byte_string). | 4 | 405 | 0 | I have seen many projects using simplejson module instead of json module from the Standard Library. Also, there are many different simplejson modules. Why would use these alternatives, instead of the one in the Standard Library? | What are the differences between json and simplejson Python modules? | 0.03076 | 0 | 1 | 141,384 |
712,791 | 2009-04-03T06:56:00.000 | 5 | 0 | 1 | 0 | python,json,simplejson | 712,795 | 13 | false | 0 | 0 | The builtin json module got included in Python 2.6. Any projects that support versions of Python < 2.6 need to have a fallback. In many cases, that fallback is simplejson. | 4 | 405 | 0 | I have seen many projects using simplejson module instead of json module from the Standard Library. Also, there are many different simplejson modules. Why would use these alternatives, instead of the one in the Standard Library? | What are the differences between json and simplejson Python modules? | 0.076772 | 0 | 1 | 141,384 |
712,791 | 2009-04-03T06:56:00.000 | 0 | 0 | 1 | 0 | python,json,simplejson | 31,269,030 | 13 | false | 0 | 0 | I came across this question as I was looking to install simplejson for Python 2.6. I needed to use the 'object_pairs_hook' of json.load() in order to load a json file as an OrderedDict. Being familiar with more recent versions of Python I didn't realize that the json module for Python 2.6 doesn't include the 'object_pa... | 4 | 405 | 0 | I have seen many projects using simplejson module instead of json module from the Standard Library. Also, there are many different simplejson modules. Why would use these alternatives, instead of the one in the Standard Library? | What are the differences between json and simplejson Python modules? | 0 | 0 | 1 | 141,384 |
713,847 | 2009-04-03T13:13:00.000 | 0 | 0 | 0 | 0 | python,web-services,rest,frameworks | 1,722,910 | 16 | false | 0 | 0 | I strongly recommend TurboGears or Bottle:
TurboGears:
less verbose than django
more flexible, less HTML-oriented
but: less famous
Bottle:
very fast
very easy to learn
but: minimalistic and not mature | 2 | 321 | 0 | Is there a list somewhere of recommendations of different Python-based REST frameworks for use on the serverside to write your own RESTful APIs? Preferably with pros and cons.
Please feel free to add recommendations here. :) | Recommendations of Python REST (web services) framework? | 0 | 0 | 1 | 241,535 |
713,847 | 2009-04-03T13:13:00.000 | 8 | 0 | 0 | 0 | python,web-services,rest,frameworks | 6,897,383 | 16 | false | 0 | 0 | I don't see any reason to use Django just to expose a REST api, there are lighter and more flexible solutions. Django carries a lot of other things to the table, that are not always needed. For sure not needed if you only want to expose some code as a REST service.
My personal experience, fwiw, is that once you have a... | 2 | 321 | 0 | Is there a list somewhere of recommendations of different Python-based REST frameworks for use on the serverside to write your own RESTful APIs? Preferably with pros and cons.
Please feel free to add recommendations here. :) | Recommendations of Python REST (web services) framework? | 1 | 0 | 1 | 241,535 |
715,550 | 2009-04-03T20:14:00.000 | 1 | 0 | 1 | 0 | python,json | 715,569 | 5 | false | 0 | 0 | Could it simply be a two dimensional array? Then you may use integers as keys | 2 | 47 | 0 | In python I have a dictionary that maps tuples to a list of tuples. e.g.
{(1,2): [(2,3),(1,7)]}
I want to be able to encode this data use it with javascript, so I looked into json but it appears keys must be strings so my tuple does not work as a key.
Is the best way to handle this is encode it as "1,2" and then parse... | Best way to encode tuples with json | 0.039979 | 0 | 0 | 76,643 |
715,550 | 2009-04-03T20:14:00.000 | 2 | 0 | 1 | 0 | python,json | 715,584 | 5 | false | 0 | 0 | You can't use an array as a key in JSON. The best you can do is encode it. Sorry, but there's really no other sane way to do it. | 2 | 47 | 0 | In python I have a dictionary that maps tuples to a list of tuples. e.g.
{(1,2): [(2,3),(1,7)]}
I want to be able to encode this data use it with javascript, so I looked into json but it appears keys must be strings so my tuple does not work as a key.
Is the best way to handle this is encode it as "1,2" and then parse... | Best way to encode tuples with json | 0.07983 | 0 | 0 | 76,643 |
715,758 | 2009-04-03T21:19:00.000 | 10 | 0 | 1 | 0 | python,generator,coroutine,continuations | 7,252,061 | 3 | false | 0 | 0 | In newer version of Python, you can send values to Generators with generator.send(), which makes python Generators effectively coroutines.
The main difference between python Generator, and other generator, say greenlet, is that in python, your yield value can only return back to the caller. While in greenlet, target.sw... | 2 | 157 | 0 | What is the difference between a coroutine and a continuation and a generator ? | Coroutine vs Continuation vs Generator | 1 | 0 | 0 | 34,625 |
715,758 | 2009-04-03T21:19:00.000 | 34 | 0 | 1 | 0 | python,generator,coroutine,continuations | 715,801 | 3 | false | 0 | 0 | Coroutine is one of several procedures that take turns doing their job and then pause to give control to the other coroutines in the group.
Continuation is a "pointer to a function" you pass to some procedure, to be executed ("continued with") when that procedure is done.
Generator (in .NET) is a language construct th... | 2 | 157 | 0 | What is the difference between a coroutine and a continuation and a generator ? | Coroutine vs Continuation vs Generator | 1 | 0 | 0 | 34,625 |
716,524 | 2009-04-04T04:52:00.000 | 1 | 0 | 0 | 1 | python,ruby,deployment | 718,216 | 5 | false | 1 | 0 | You can't strictly do this (creating a single installer/executable) in a general cross-platform way, because different platforms use different executable formats. The JVM thing is relying on having a platform-specific JVM already installed on the destination computer; if there is not one installed, then your JAR won't... | 2 | 4 | 0 | Are there any good options other than the JVM for packaging Python or Ruby applications for distribution to end-users? Specifically, I'm looking for ways to be able to write and test a web-based application written in either Ruby or Python, complete with a back-end database, that I can then wrap up in a convenient set... | Packaging Ruby or Python applications for distribution? | 0.039979 | 0 | 0 | 2,181 |
716,524 | 2009-04-04T04:52:00.000 | 1 | 0 | 0 | 1 | python,ruby,deployment | 7,002,189 | 5 | false | 1 | 0 | You can either distribute the app as a virtual machine or create an installer that includes all dependencies, like the GitHub guys did for their on-premise version. | 2 | 4 | 0 | Are there any good options other than the JVM for packaging Python or Ruby applications for distribution to end-users? Specifically, I'm looking for ways to be able to write and test a web-based application written in either Ruby or Python, complete with a back-end database, that I can then wrap up in a convenient set... | Packaging Ruby or Python applications for distribution? | 0.039979 | 0 | 0 | 2,181 |
716,795 | 2009-04-04T08:58:00.000 | 1 | 0 | 1 | 0 | python,exception,event-handling,stack-trace | 718,230 | 4 | false | 0 | 0 | I'd think that the simplest method would be to add an ID field to the event(s) in question, and to have each event source (by whatever definition of 'event source' is appropriate here) provide a unique identifier when it posts the event. You do get slightly more overhead, but probably not enough to be problematic, and... | 2 | 1 | 0 | I'm implementing a event system: Various pieces of code will post events to a central place where they will be distributed to all listeners. The main problem with this approach: When an exception happens during event processing, I can't tell anymore who posted the event.
So my question is: Is there an efficient way to ... | Locating (file/line) the invocation of a constructor in python | 0.049958 | 0 | 0 | 185 |
716,795 | 2009-04-04T08:58:00.000 | 0 | 0 | 1 | 0 | python,exception,event-handling,stack-trace | 716,803 | 4 | false | 0 | 0 | It may be worthwhile to attach a hash of the stack trace to the constructor of your event and to store the actual contents in memcache with the hash as the key. | 2 | 1 | 0 | I'm implementing a event system: Various pieces of code will post events to a central place where they will be distributed to all listeners. The main problem with this approach: When an exception happens during event processing, I can't tell anymore who posted the event.
So my question is: Is there an efficient way to ... | Locating (file/line) the invocation of a constructor in python | 0 | 0 | 0 | 185 |
716,946 | 2009-04-04T11:47:00.000 | 0 | 1 | 0 | 0 | python,sms,notifications | 716,953 | 7 | false | 1 | 0 | I don't have any knowledge in this area. But I think you'll have to talk to the mobile operators, and see if they have any API for sending SMS messages.
You'll probably have to pay them, or have some scheme for customers to pay them. Alternatively there might be some 3rd party that implements this functionality. | 2 | 1 | 0 | I have a web application and I would like to enable real time SMS notifications to the users of the applications.
Note: I currently cannot use the Twitter API because I live in West Africa, and Twitter doesn't send SMS to my country.
Also email2sms is not an option because the mobile operators don't allow that in my c... | How do I enable SMS notifications in my web apps? | 0 | 0 | 1 | 2,976 |
716,946 | 2009-04-04T11:47:00.000 | 2 | 1 | 0 | 0 | python,sms,notifications | 5,414,483 | 7 | false | 1 | 0 | The easiest way to accomplish this is by using a third party API. Some I know that work well are:
restSms.me
Twilio.com
Clicatell.com
I have used all of them and they easiest/cheapest one to implement was restSms.me
Hope that helps. | 2 | 1 | 0 | I have a web application and I would like to enable real time SMS notifications to the users of the applications.
Note: I currently cannot use the Twitter API because I live in West Africa, and Twitter doesn't send SMS to my country.
Also email2sms is not an option because the mobile operators don't allow that in my c... | How do I enable SMS notifications in my web apps? | 0.057081 | 0 | 1 | 2,976 |
717,148 | 2009-04-04T14:03:00.000 | 2 | 0 | 1 | 0 | python,queue,thread-safety,python-multithreading,deque | 717,199 | 7 | false | 0 | 0 | deque is thread-safe. "operations that do not require locking" means that you don't have to do the locking yourself, the deque takes care of it.
Taking a look at the Queue source, the internal deque is called self.queue and uses a mutex for accessors and mutations, so Queue().queue is not thread-safe to use.
If you're ... | 3 | 230 | 0 | I need a queue which multiple threads can put stuff into, and multiple threads may read from.
Python has at least two queue classes, Queue.Queue and collections.deque, with the former seemingly using the latter internally. Both claim to be thread-safe in the documentation.
However, the Queue docs also state:
collectio... | Queue.Queue vs. collections.deque | 0.057081 | 0 | 0 | 85,204 |
717,148 | 2009-04-04T14:03:00.000 | 363 | 0 | 1 | 0 | python,queue,thread-safety,python-multithreading,deque | 717,261 | 7 | true | 0 | 0 | Queue.Queue and collections.deque serve different purposes. Queue.Queue is intended for allowing different threads to communicate using queued messages/data, whereas collections.deque is simply intended as a datastructure. That's why Queue.Queue has methods like put_nowait(), get_nowait(), and join(), whereas collectio... | 3 | 230 | 0 | I need a queue which multiple threads can put stuff into, and multiple threads may read from.
Python has at least two queue classes, Queue.Queue and collections.deque, with the former seemingly using the latter internally. Both claim to be thread-safe in the documentation.
However, the Queue docs also state:
collectio... | Queue.Queue vs. collections.deque | 1.2 | 0 | 0 | 85,204 |
717,148 | 2009-04-04T14:03:00.000 | 11 | 0 | 1 | 0 | python,queue,thread-safety,python-multithreading,deque | 43,500,869 | 7 | false | 0 | 0 | All single-element methods on deque are atomic and thread-safe. All other methods are thread-safe too. Things like len(dq), dq[4] yield momentary correct values. But think e.g. about dq.extend(mylist): you don't get a guarantee that all elements in mylist are filed in a row when other threads also append elements on th... | 3 | 230 | 0 | I need a queue which multiple threads can put stuff into, and multiple threads may read from.
Python has at least two queue classes, Queue.Queue and collections.deque, with the former seemingly using the latter internally. Both claim to be thread-safe in the documentation.
However, the Queue docs also state:
collectio... | Queue.Queue vs. collections.deque | 1 | 0 | 0 | 85,204 |
717,506 | 2009-04-04T17:54:00.000 | 21 | 0 | 1 | 0 | python,ruby,language-features,monkeypatching | 717,563 | 8 | false | 0 | 0 | It's a technique less practised in Python, in part because "core" classes in Python (those implemented in C) are not really modifiable. In Ruby, on the other hand, because of the way it's implemented internally (not better, just different) just about anything can be modified dynamically.
Philosophically, it's something... | 3 | 15 | 0 | In many discussions I have heard about Ruby in which people have expressed their reservations about the language, the issue of monkey patching comes up as one of their primary concerns.
However, I rarely hear the same arguments made in the context of Python although it is also permitted in the Python language.
Why th... | If monkey patching is permitted in both Ruby and Python, why is it more controversial in Ruby? | 1 | 0 | 0 | 2,615 |
717,506 | 2009-04-04T17:54:00.000 | 13 | 0 | 1 | 0 | python,ruby,language-features,monkeypatching | 717,553 | 8 | false | 0 | 0 | "Does Python include different types of safeguards to minimize the risks of this feature?"
Yes. The community refuses to do it. The safeguard is entirely social. | 3 | 15 | 0 | In many discussions I have heard about Ruby in which people have expressed their reservations about the language, the issue of monkey patching comes up as one of their primary concerns.
However, I rarely hear the same arguments made in the context of Python although it is also permitted in the Python language.
Why th... | If monkey patching is permitted in both Ruby and Python, why is it more controversial in Ruby? | 1 | 0 | 0 | 2,615 |
717,506 | 2009-04-04T17:54:00.000 | 2 | 0 | 1 | 0 | python,ruby,language-features,monkeypatching | 721,025 | 8 | false | 0 | 0 | I think that monkey patching should only be used as the last solution.
Normally Python programmers know how a class or a method behave. They know that class xxx is doing things in a certain way.
When you monkey patch a class or a method, you are changing it's behavior. Other Python programmers using this class can be v... | 3 | 15 | 0 | In many discussions I have heard about Ruby in which people have expressed their reservations about the language, the issue of monkey patching comes up as one of their primary concerns.
However, I rarely hear the same arguments made in the context of Python although it is also permitted in the Python language.
Why th... | If monkey patching is permitted in both Ruby and Python, why is it more controversial in Ruby? | 0.049958 | 0 | 0 | 2,615 |
719,194 | 2009-04-05T16:07:00.000 | 3 | 0 | 0 | 0 | javascript,python,html,ajax | 719,293 | 4 | false | 1 | 0 | You create the buttons, which can be links or images or whatever. Now hook a JavaScript function up to each button's click event. On clicking, the function fires and
Sends a request to the server code that says, more or less, +1 or -1.
Server code takes over. This will vary wildly depending on what framework you use (... | 1 | 32 | 0 | Problems
how to make an Ajax buttons (upward and downward arrows) such that the number can increase or decrease
how to save the action af an user to an variable NumberOfVotesOfQuestionID
I am not sure whether I should use database or not for the variable. However, I know that there is an easier way too to save the nu... | How can you make a vote-up-down button like in Stackoverflow? | 0.148885 | 0 | 1 | 7,516 |
719,705 | 2009-04-05T21:13:00.000 | 8 | 0 | 1 | 0 | python,class,oop,language-features | 10,376,716 | 9 | false | 0 | 0 | I understand the arguments against nested classes, but there is a case for using them in some occasions. Imagine I'm creating a doubly-linked list class, and I need to create a node class for maintaing the nodes. I have two choices, create Node class inside the DoublyLinkedList class, or create the Node class outside t... | 1 | 110 | 0 | Python's inner/nested classes confuse me. Is there something that can't be accomplished without them? If so, what is that thing? | What is the purpose of python's inner classes? | 1 | 0 | 0 | 66,321 |
719,886 | 2009-04-05T23:34:00.000 | 2 | 0 | 0 | 0 | python,postgresql | 719,913 | 3 | false | 0 | 0 | Have you considered keeping your same "schedule", and just shuffling the teams? Generating a schedule where everyone plays each other the proper number of times is possible, but if you already have such a schedule then it's much easier to just shuffle the teams.
You could keep your current table, but replace each team... | 2 | 0 | 0 | I am trying to do the schedule for the upcoming season for my simulation baseball team. I have an existing Postgresql database that contains the old schedule.
There are 648 rows in the database: 27 weeks of series for 24 teams. The problem is that the schedule has gotten predictable and allows teams to know in advanc... | Help Me Figure Out A Random Scheduling Algorithm using Python and PostgreSQL | 0.132549 | 1 | 0 | 2,359 |
719,886 | 2009-04-05T23:34:00.000 | 1 | 0 | 0 | 0 | python,postgresql | 719,909 | 3 | false | 0 | 0 | I'm not sure I fully understand the problem, but here is how I would do it:
1. create a complete list of matches that need to happen
2. iterate over the weeks, selecting which match needs to happen in this week.
You can use Python lists to represent the matches that still need to happen, and, for each week, the matches... | 2 | 0 | 0 | I am trying to do the schedule for the upcoming season for my simulation baseball team. I have an existing Postgresql database that contains the old schedule.
There are 648 rows in the database: 27 weeks of series for 24 teams. The problem is that the schedule has gotten predictable and allows teams to know in advanc... | Help Me Figure Out A Random Scheduling Algorithm using Python and PostgreSQL | 0.066568 | 1 | 0 | 2,359 |
721,035 | 2009-04-06T11:22:00.000 | 0 | 0 | 0 | 0 | python,django,django-templates | 18,688,638 | 8 | false | 1 | 0 | '\s' might be ok in the use case described above, but be careful, this replaces other whitespaces like '\t' or '\n' as well! If this is not what you want, just use " " instead. | 2 | 16 | 0 | I'm having trouble with Django templates and CharField models.
So I have a model with a CharField that creates a slug that replaces spaces with underscores. If I create an object, Somename Somesurname, this creates slug Somename_Somesurname and gets displayed as expected on the template.
However, if I create an object... | Django templates stripping spaces? | 0 | 0 | 0 | 27,195 |
721,035 | 2009-04-06T11:22:00.000 | 1 | 0 | 0 | 0 | python,django,django-templates | 57,768,087 | 8 | false | 1 | 0 | For someone having issue with django template try this :
I had a similar issue with my <optgorup> tag, i am getting my values from django model to display under select. I simple used '' around label option to get the complete text with space.<optgroup label='{{key}}'> | 2 | 16 | 0 | I'm having trouble with Django templates and CharField models.
So I have a model with a CharField that creates a slug that replaces spaces with underscores. If I create an object, Somename Somesurname, this creates slug Somename_Somesurname and gets displayed as expected on the template.
However, if I create an object... | Django templates stripping spaces? | 0.024995 | 0 | 0 | 27,195 |
721,436 | 2009-04-06T13:27:00.000 | 8 | 1 | 1 | 0 | python,encryption | 721,444 | 3 | true | 0 | 0 | If it's two-way, it's not really a "hash". It's encryption (and from the sounds of things this is really more of a 'salt' or 'cypher', not real encryption.) A hash is one-way by definition. So rather than something like MD5 or SHA1 you need to look for something more like PGP.
Secondly, can you explain the reasoning... | 1 | 5 | 0 | The authentication system for an application we're using right now uses a two-way hash that's basically little more than a glorified caesar cypher. Without going into too much detail about what's going on with it, I'd like to replace it with a more secure encryption algorithm (and it needs to be done server-side). Un... | What's a good two-way encryption library implemented in Python? | 1.2 | 0 | 0 | 3,449 |
723,635 | 2009-04-06T23:30:00.000 | 9 | 1 | 0 | 0 | python,networking,automated-tests,ethernet | 724,009 | 4 | false | 0 | 0 | It can be handled in hardware, but isn't always -- and even if it is, you can turn that off; see the ethtool offload parameters.
With regard to getting full control over the frames you create -- look into PF_PACKET (for one approach) or the tap driver (for another).
Here's an article on using PF_PACKET to send hand-cra... | 1 | 9 | 0 | I'm not sure if this is even possible since this might be handled in hardware, but I need to send some Ethernet frames with errors in them. I'd like to be able to create runts, jabber, misalignment, and bad FCS errors. I'm working in Python. | How do you send an Ethernet frame with a corrupt FCS? | 1 | 0 | 0 | 12,680 |
723,652 | 2009-04-06T23:38:00.000 | 0 | 0 | 0 | 0 | python,django,dreamweaver | 5,149,029 | 4 | false | 1 | 0 | Beshir Kayali's plugin fails installation for DW CS5 and Extension Manager CS4.
Irony that it asks for DW CS4 or better, else "upgrade" Extension manager to CS3.
I could put some effort in to make this work, yet this is the sole review of the extension:
I allows you to insert 6 kinds of template tags; if, for, templat... | 1 | 6 | 0 | Does a plugin exists for Python/Django into Dreamweaver? Just wondering since Dreamweaver is a great web dev tool. | Python/Django plugin for Dreamweaver | 0 | 0 | 0 | 24,140 |
723,757 | 2009-04-07T00:39:00.000 | 0 | 0 | 0 | 0 | python,sql,xml | 723,931 | 5 | false | 0 | 0 | It may be a common task, but maybe 20GB isn't as common with MySQL as it is with SQL Server.
I've done this using SQL Server Integration Services and a bit of custom code. Whether you need either of those depends on what you need to do with 20GB of XML in a database. Is it going to be a single column of a single row of... | 1 | 5 | 0 | I'm working with a 20 gig XML file that I would like to import into a SQL database (preferably MySQL, since that is what I am familiar with). This seems like it would be a common task, but after Googling around a bit I haven't been able to figure out how to do it. What is the best way to do this?
I know this ability i... | Import XML into SQL database | 0 | 1 | 0 | 12,197 |
724,212 | 2009-04-07T05:18:00.000 | 1 | 0 | 0 | 0 | python,django,unicode | 724,957 | 2 | false | 1 | 0 | Create a File with the data. Use a Django models.FileField to hold a reference to the file.
No it does not involve a ton of I/O. If your file is small it adds 2 or 3 I/O's (the directory read, the iNode read and the data read.) | 2 | 1 | 0 | I want to save some text to the database using the Django ORM wrappers. The problem is, this text is generated by scraping external websites and many times it seems they are listed with the wrong encoding. I would like to store the raw bytes so I can improve my encoding detection as time goes on without redoing the scr... | How to handle unicode of an unknown encoding in Django? | 0.099668 | 0 | 0 | 487 |
724,212 | 2009-04-07T05:18:00.000 | 1 | 0 | 0 | 0 | python,django,unicode | 724,955 | 2 | false | 1 | 0 | You can store data, encoded into base64, for example. Or try to analize HTTP headers from browser, may be it is simplier to get proper encoding from there. | 2 | 1 | 0 | I want to save some text to the database using the Django ORM wrappers. The problem is, this text is generated by scraping external websites and many times it seems they are listed with the wrong encoding. I would like to store the raw bytes so I can improve my encoding detection as time goes on without redoing the scr... | How to handle unicode of an unknown encoding in Django? | 0.099668 | 0 | 0 | 487 |
724,664 | 2009-04-07T08:36:00.000 | -1 | 0 | 1 | 0 | python,compiler-construction,installation,distutils | 724,745 | 6 | false | 0 | 0 | import distutils.ccompiler
compiler_name = distutils.ccompiler.get_default_compiler() | 2 | 35 | 0 | For example, I may use python setup.py build --compiler=msvc or python setup.py build --compiler=mingw32 or just python setup.py build, in which case the default compiler (say, bcpp) will be used. How can I get the compiler name inside my setup.py (e. g. msvc, mingw32 and bcpp, respectively)?
UPD.: I don't need the def... | Python distutils, how to get a compiler that is going to be used? | -0.033321 | 0 | 0 | 15,132 |
724,664 | 2009-04-07T08:36:00.000 | 8 | 0 | 1 | 0 | python,compiler-construction,installation,distutils | 1,671,060 | 6 | false | 0 | 0 | You can subclass the distutils.command.build_ext.build_ext command.
Once build_ext.finalize_options() method has been called, the compiler type is stored in self.compiler.compiler_type as a string (the same as the one passed to the build_ext's --compiler option, e.g. 'mingw32', 'gcc', etc...). | 2 | 35 | 0 | For example, I may use python setup.py build --compiler=msvc or python setup.py build --compiler=mingw32 or just python setup.py build, in which case the default compiler (say, bcpp) will be used. How can I get the compiler name inside my setup.py (e. g. msvc, mingw32 and bcpp, respectively)?
UPD.: I don't need the def... | Python distutils, how to get a compiler that is going to be used? | 1 | 0 | 0 | 15,132 |
727,410 | 2009-04-07T20:14:00.000 | 0 | 0 | 0 | 1 | python,google-app-engine,logging | 18,987,161 | 11 | false | 1 | 0 | Use log.setLevel(Level.ALL) to see messages
The default message filtering level seems to be 'error'. I didn't see any useful log messages until I used the setLevel() method to make the .info and .warning messages visible.
Text printed to System.out wasn't showing up either. It seems to be interpreted as log.info() l... | 2 | 50 | 0 | Often when I am coding I just like to print little things (mostly the current value of variables) out to console. I don't see anything like this for Google App Engine, although I note that the Google App Engine Launcher does have a Log terminal. Is there any way to write to said Terminal, or to some other terminal, usi... | How do I write to the console in Google App Engine? | 0 | 0 | 0 | 25,274 |
727,410 | 2009-04-07T20:14:00.000 | 1 | 0 | 0 | 1 | python,google-app-engine,logging | 20,152,111 | 11 | false | 1 | 0 | Hello I'm using the version 1.8.6 of GoogleAppEngineLauncher, you can use a flag to set the messages log level you want to see, for example for debug messages:
--dev_appserver_log_level debug
Use it instead of --debug (see @Christopher answer). | 2 | 50 | 0 | Often when I am coding I just like to print little things (mostly the current value of variables) out to console. I don't see anything like this for Google App Engine, although I note that the Google App Engine Launcher does have a Log terminal. Is there any way to write to said Terminal, or to some other terminal, usi... | How do I write to the console in Google App Engine? | 0.01818 | 0 | 0 | 25,274 |
730,394 | 2009-04-08T14:53:00.000 | 6 | 0 | 0 | 0 | python,layout,wxpython,widget | 730,452 | 1 | true | 0 | 1 | Got it.
When creating the widget, use a size of (-1,100), where "100" is the height you want. Apparently the "-1" is a sort of "None" in this context.
When adding the widget to the sizer, use a proportion of 0, like this:
self.sizer.Add(self.timeline,0,wx.EXPAND) | 1 | 2 | 0 | I have a wx.Frame, in which I have a vertical BoxSizer with two items, a TextCtrl and a custom widget. I want the custom widget to have a fixed pixel height, while the TextCtrl will expand normally to fill the window. What should I do? | wxPython: Making a fixed-height panel | 1.2 | 0 | 0 | 2,175 |
731,016 | 2009-04-08T17:34:00.000 | 2 | 0 | 0 | 0 | python,actionscript,flash | 731,089 | 3 | false | 1 | 0 | It might help to look at the arguments passed to the Flash movie. If there's reference to an FLV file then there's a good chance the SWF is being used to play a movie.
The path to the SWF might help too. If it's under, say an /ads directory then it's probably just a banner ad. Or if it's under /games then it's proba... | 2 | 1 | 0 | I'm doing some crawling with Python, and would like to be able to identify (however imperfectly) the flash I come across - is it a video, an ad, a game, or whatever.
I assume I would have to decompile the swf, which seems doable. But what sort of processing would I do with the decompiled Actionscript to figure out what... | How can I get useful information from flash swf files? | 0.132549 | 0 | 0 | 1,325 |
731,016 | 2009-04-08T17:34:00.000 | 4 | 0 | 0 | 0 | python,actionscript,flash | 731,053 | 3 | false | 1 | 0 | I think your best bet would be to check the context where you see the swf file
usually they're embedded within web pages so if that page has 100 occurences of the word "game", then it might be a game, as an example
To detect an ad it might be trickier but i think that checking the domainname where the swf is hosted mig... | 2 | 1 | 0 | I'm doing some crawling with Python, and would like to be able to identify (however imperfectly) the flash I come across - is it a video, an ad, a game, or whatever.
I assume I would have to decompile the swf, which seems doable. But what sort of processing would I do with the decompiled Actionscript to figure out what... | How can I get useful information from flash swf files? | 0.26052 | 0 | 0 | 1,325 |
731,470 | 2009-04-08T19:31:00.000 | 0 | 0 | 0 | 0 | javascript,python | 731,629 | 9 | false | 1 | 0 | Is this for a real webapp? Or is this a convenience thing for you to view output in the browser? If it's more so for convenience, you could consider using mod_python.
mod_python is an extension for the apache webserver that embeds a python interpreter in the web server (so the script runs server side). It would easily ... | 3 | 7 | 0 | I have a python script that runs continuously. It outputs 2 lines of info every 30 seconds. I'd like to be able to view this output on the web. In particular, I'd like the site to auto-update (add the new output at the top of the page/site every 30 seconds without having to refresh the page).
I understand I can do t... | What's easiest way to get Python script output on the web? | 0 | 0 | 1 | 16,918 |
731,470 | 2009-04-08T19:31:00.000 | 0 | 0 | 0 | 0 | javascript,python | 731,476 | 9 | false | 1 | 0 | JavaScript is the primary way to add this sort of interactivity to a website. You can make the back-end Python, but the client will have to use JavaScript AJAX calls to update the page. Python doesn't run in the browser, so you're out of luck if you want to use just Python.
(It's also possible to use Flash or Java ap... | 3 | 7 | 0 | I have a python script that runs continuously. It outputs 2 lines of info every 30 seconds. I'd like to be able to view this output on the web. In particular, I'd like the site to auto-update (add the new output at the top of the page/site every 30 seconds without having to refresh the page).
I understand I can do t... | What's easiest way to get Python script output on the web? | 0 | 0 | 1 | 16,918 |
731,470 | 2009-04-08T19:31:00.000 | 1 | 0 | 0 | 0 | javascript,python | 731,477 | 9 | false | 1 | 0 | You need Javascript in one way or another for your 30 second refresh. Alternatively, you could set a meta tag refresh for every 30 seconds to redirect to the current page, but the Javascript route will prevent page flicker. | 3 | 7 | 0 | I have a python script that runs continuously. It outputs 2 lines of info every 30 seconds. I'd like to be able to view this output on the web. In particular, I'd like the site to auto-update (add the new output at the top of the page/site every 30 seconds without having to refresh the page).
I understand I can do t... | What's easiest way to get Python script output on the web? | 0.022219 | 0 | 1 | 16,918 |
731,759 | 2009-04-08T20:46:00.000 | 0 | 0 | 0 | 0 | python,user-interface,named-pipes | 731,919 | 3 | false | 0 | 1 | When I did something like this I used a separate thread listening on the pipe. The thread had a pointer/handle back to the GUI so it could send the data to be displayed.
I suppose you could do it in the GUI's update/event loop, but you'd have to make sure it's doing non-blocking reads on the pipe. I did it in a separat... | 2 | 0 | 0 | I'm kind of lost on how to approach this problem, I'd like to write a GUI ideally using Tkinter with python, but I initially started with Qt and found that the problem extends either with all GUI frameworks or my limited understanding.
The data in this case is coming from a named pipe, and I'd like to display whatever ... | Showing data in a GUI where the data comes from an outside source | 0 | 0 | 0 | 641 |
731,759 | 2009-04-08T20:46:00.000 | 0 | 0 | 0 | 0 | python,user-interface,named-pipes | 731,927 | 3 | false | 0 | 1 | In the past when I've had GUI's reading data off of external things (eg: ethernet sockets), I've had a separate thread that handles servicing the external thing, and a timed callback (generally set to something like half a second) to update the GUI widget that displays the external data. | 2 | 0 | 0 | I'm kind of lost on how to approach this problem, I'd like to write a GUI ideally using Tkinter with python, but I initially started with Qt and found that the problem extends either with all GUI frameworks or my limited understanding.
The data in this case is coming from a named pipe, and I'd like to display whatever ... | Showing data in a GUI where the data comes from an outside source | 0 | 0 | 0 | 641 |
731,887 | 2009-04-08T21:14:00.000 | 1 | 0 | 0 | 0 | python,tkinter | 732,131 | 3 | true | 0 | 1 | You could take all your GUI building logic and initial state code out of the mainloop and put it into functions. Call these functions from the mainloop (something like: buildgui() & initstate()) and then, when the user clicks your menu icon, just call initstate() to set it back like it was when the application first st... | 3 | 3 | 0 | I just want the equivalent of closing and reopening my main program. I want to invoke it when a "new"-like option from a drop-down menu is clicked on. Something like calling root.destroy() and then re-initiating the mainloop.
How can I get this done? | Resetting the main GUI window | 1.2 | 0 | 0 | 6,011 |
731,887 | 2009-04-08T21:14:00.000 | 4 | 0 | 0 | 0 | python,tkinter | 732,529 | 3 | false | 0 | 1 | There are at least three ways you can solve this.
Method one: the head fake. When you create your app, don't put all the widgets in the root window. Instead, hide the root window and create a new toplevel that represents your application. When you restart it's just a matter of destroying that new toplevel and re-runni... | 3 | 3 | 0 | I just want the equivalent of closing and reopening my main program. I want to invoke it when a "new"-like option from a drop-down menu is clicked on. Something like calling root.destroy() and then re-initiating the mainloop.
How can I get this done? | Resetting the main GUI window | 0.26052 | 0 | 0 | 6,011 |
731,887 | 2009-04-08T21:14:00.000 | 2 | 0 | 0 | 0 | python,tkinter | 732,085 | 3 | false | 0 | 1 | If you are on Unix, restart the entire application with os.execv. Make sure you pass all command line arguments etc. | 3 | 3 | 0 | I just want the equivalent of closing and reopening my main program. I want to invoke it when a "new"-like option from a drop-down menu is clicked on. Something like calling root.destroy() and then re-initiating the mainloop.
How can I get this done? | Resetting the main GUI window | 0.132549 | 0 | 0 | 6,011 |
731,993 | 2009-04-08T21:44:00.000 | 1 | 0 | 1 | 0 | python,multithreading,multiprocessing,multicore,python-stackless | 732,026 | 9 | false | 0 | 0 | I always prefer multiple threads for simplicity, but there is a real issue with affinity. There is no way (that I know of) to tell Python's threading implementation to bind to a specific processor. This may not be an issue for you, it doesnt sound like it should be. Unless you have a good reason not to, it sounds like ... | 6 | 24 | 0 | I'm making a program for running simulations in Python, with a wxPython interface. In the program, you can create a simulation, and the program renders (=calculates) it for you. Rendering can be very time-consuming sometimes.
When the user starts a simulation, and defines an initial state, I want the program to render ... | Multiprocessing or Multithreading? | 0.022219 | 0 | 0 | 9,001 |
731,993 | 2009-04-08T21:44:00.000 | 0 | 0 | 1 | 0 | python,multithreading,multiprocessing,multicore,python-stackless | 734,919 | 9 | false | 0 | 0 | It sounds like you'd want threading.
The way you described it, it sounded like there was one single thing that actually took a lot of CPU...the actual running of the simulation.
What you're trying to get is more responsive displays, by allowing user interaction and graphics updates while the simulation is running. ... | 6 | 24 | 0 | I'm making a program for running simulations in Python, with a wxPython interface. In the program, you can create a simulation, and the program renders (=calculates) it for you. Rendering can be very time-consuming sometimes.
When the user starts a simulation, and defines an initial state, I want the program to render ... | Multiprocessing or Multithreading? | 0 | 0 | 0 | 9,001 |
731,993 | 2009-04-08T21:44:00.000 | 18 | 0 | 1 | 0 | python,multithreading,multiprocessing,multicore,python-stackless | 732,116 | 9 | false | 0 | 0 | "I checked it out and it looks good, but I also heard that processes, unlike threads, can't share a lot of information..."
This is only partially true.
Threads are part of a process -- threads share memory trivially. Which is as much of a problem as a help -- two threads with casual disregard for each other can overwr... | 6 | 24 | 0 | I'm making a program for running simulations in Python, with a wxPython interface. In the program, you can create a simulation, and the program renders (=calculates) it for you. Rendering can be very time-consuming sometimes.
When the user starts a simulation, and defines an initial state, I want the program to render ... | Multiprocessing or Multithreading? | 1 | 0 | 0 | 9,001 |
731,993 | 2009-04-08T21:44:00.000 | 14 | 0 | 1 | 0 | python,multithreading,multiprocessing,multicore,python-stackless | 732,119 | 9 | false | 0 | 0 | Stackless: uses 1 cpu. "Tasklets" must yield voluntarily. The preemption option doesn't work all the time.
Threaded: uses 1 cpu. Native threads share time somewhat randomly after running 20-100 python opcodes.
Multiprocessing: uses multiple cpu
Update
Indepth Analysis
Use threaded for an easy time. However, if you cal... | 6 | 24 | 0 | I'm making a program for running simulations in Python, with a wxPython interface. In the program, you can create a simulation, and the program renders (=calculates) it for you. Rendering can be very time-consuming sometimes.
When the user starts a simulation, and defines an initial state, I want the program to render ... | Multiprocessing or Multithreading? | 1 | 0 | 0 | 9,001 |
731,993 | 2009-04-08T21:44:00.000 | 1 | 0 | 1 | 0 | python,multithreading,multiprocessing,multicore,python-stackless | 35,972,455 | 9 | false | 0 | 0 | Very puzzled. Bastien Léonard rightly pointed out that the GIL will stop any ability to use threading in any useful way. His reference states:
"Use of a global interpreter lock in a language effectively limits the
amount of parallelism reachable through concurrency of a single
interpreter process with multiple thr... | 6 | 24 | 0 | I'm making a program for running simulations in Python, with a wxPython interface. In the program, you can create a simulation, and the program renders (=calculates) it for you. Rendering can be very time-consuming sometimes.
When the user starts a simulation, and defines an initial state, I want the program to render ... | Multiprocessing or Multithreading? | 0.022219 | 0 | 0 | 9,001 |
731,993 | 2009-04-08T21:44:00.000 | 10 | 0 | 1 | 0 | python,multithreading,multiprocessing,multicore,python-stackless | 732,199 | 9 | false | 0 | 0 | A process has its own memory space. It makes it more difficult to share information, but also makes the program safer (less need for explicit synchronization). That being said, processes can share the same memory in read-only mode.
A thread is cheaper to create or kill, but the main difference is that it shares memory... | 6 | 24 | 0 | I'm making a program for running simulations in Python, with a wxPython interface. In the program, you can create a simulation, and the program renders (=calculates) it for you. Rendering can be very time-consuming sometimes.
When the user starts a simulation, and defines an initial state, I want the program to render ... | Multiprocessing or Multithreading? | 1 | 0 | 0 | 9,001 |
732,192 | 2009-04-08T22:47:00.000 | 0 | 0 | 0 | 0 | python,colors,tkinter | 732,452 | 4 | false | 0 | 1 | Instantiate Tk(), run the code once, and then stick the information into your source as a dict literal? | 1 | 2 | 0 | I know I can call Tkinter.Tk().winfo_rgb(color) to get a tuple of values that represent the named color.
for instance Tkinter.Tk().winfo_rgb("red") returns (65535, 0, 0)
The problem is it also opens a window. I was hoping to abstract some color calculations into a generic color class, and handle whether or not the cla... | Get Tk winfo_rgb() without having a window instantiated | 0 | 0 | 0 | 1,348 |
732,222 | 2009-04-08T22:58:00.000 | 2 | 0 | 1 | 0 | python,http,chunked-encoding | 9,326,192 | 6 | false | 0 | 0 | Twisted supports chunked transfer and it does so transparently. i.e., if your request handler does not specify a response length, twisted will automatically switch to chunked transfer and it will generate one chunk per call to Request.write. | 1 | 7 | 0 | I'm looking for a well-supported multithreaded Python HTTP server that supports chunked encoding replies. (I.e. "Transfer-Encoding: chunked" on responses). What's the best HTTP server base to start with for this purpose? | Python HTTP server that supports chunked encoding? | 0.066568 | 0 | 1 | 6,143 |
732,429 | 2009-04-09T00:52:00.000 | 1 | 0 | 0 | 0 | javascript,python,http,pylons,widget | 732,453 | 3 | false | 1 | 1 | webkit-gtk is getting very stable, and i believe has python bindings now so technically you could use that (then your text editor merely needs to be <body contenteditable></body> and you'd be done. Unfortunately i'm not sure how complete its bindings are at present | 1 | 4 | 0 | I'm writing a web-app using Python and Pylons. I need a textbox that is rich (ie, provides the ability to bold/underline/add bullets..etc...). Does anyone know a library or widget I can use?
It doesn't have to be Python/Pylons specific, as it can be a Javascript implementation as well.
Thanks! | HTML Rich Textbox | 0.066568 | 0 | 0 | 8,362 |
732,476 | 2009-04-09T01:33:00.000 | 2 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 8,218,516 | 16 | false | 1 | 0 | Rails is like Bible. Unless you are a Saint, you do not need to understand it and you probably will never understand; all you need to do is to believe in it. | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 0.024995 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 1 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 738,453 | 16 | false | 1 | 0 | Like others suggest, trying both is one good way, but really, to me, I would base it more on which language you prefer to use. Sure, if it's a web app, you'll do a lot with the framework, but "every" line of code you write will be in that language. Since both frameworks are strong, it's really more a matter of what l... | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 0.012499 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 0 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 735,375 | 16 | false | 1 | 0 | Your question must be : Python or Ruby ;) | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 0 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 2 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 733,441 | 16 | false | 1 | 0 | You are at a point where you cant make a bad choice!
My personal preference is django, but I know for a fact rails is good too.
I think the best answer is what the BFDLs of django themselves say:
Try both, use whichever you like. | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 0.024995 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 1 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 733,185 | 16 | false | 1 | 0 | Since you're a seasoned .NET programmer, you really should look at ASP.NET and MVC before turning to Rails and Django, at least if your goal is to get up-and-running quickly. It's always easier to leverage something that you already know in-depth.
I was in a similar situation recently -- I had a project that I wanted ... | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 0.012499 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 0 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 732,624 | 16 | false | 1 | 0 | I'm curious. If you are a C# programmer, why have you ruled out Microsoft's MVC?
You have two different needs expressed in your question:
1) Want to try something new
2) Want to build community finance site quickly.
I understand the desire to look at RoR or Django for need 1, but for need 2 I'd expect you would be more... | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 0 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 2 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 732,604 | 16 | false | 1 | 0 | i'm another C#/.net guy with the same itch to tinker. Django is appealing. Though the development is easy and fun, i've heard some stories about deployment and configuration headaches with both Rails and Django (mostly rails). It's not like just throwing an asp.net app at IIS or PHP at Apache. For those things you can ... | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 0.024995 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 6 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 732,712 | 16 | false | 1 | 0 | I just finished building a small social networking site with Django for a client. I was new to Python and new to Django, but it was one of the most enjoyable development experiences I've had in a while (even with the headaches of being new to a language and framework). And it only took two weeks.
If you're building t... | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 1 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 6 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 732,574 | 16 | false | 1 | 0 | funny... I'm in the same boat, though perhaps I've been looking around for a bit longer.
I came in from MS-land (C# too) and I went with Django, but only after I tinkered around with Google's AppEngine, which re-introduced me to Python. Django is well organized, internally consistent (as far as I could tell), and well... | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 1 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 7 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 733,369 | 16 | false | 1 | 0 | I like Django better because it's less magic, with Rails i feel they pushed the convention over configuration principle too far, so i prefer the more explicit nature of Django. | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 1 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 10 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 732,489 | 16 | false | 1 | 0 | If you want a quick stack check out Sinatra.
Django will make more sense faster. It has awesome routing, simple file structure, nice clean syntax, not a lot of WTF moments, and understandable ORM functionality.
Rails you will have to dive into. You will battle activerecord. You will try to wrap your head around the man... | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 1 | 0 | 0 | 6,353 |
732,476 | 2009-04-09T01:33:00.000 | 20 | 0 | 0 | 0 | c#,python,ruby-on-rails,ruby,django | 732,557 | 16 | true | 1 | 0 | I kind of like the Python language
better and it seems to be more
full-featured than Ruby for
statistical, scientific and networking
(let me know if you think this is
wrong).
If you think you'll need libraries like NumPy or SciPy, probably best to stick with python/django. I've struggled to find ruby equival... | 12 | 11 | 0 | I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me ... | Django or Ruby on Rails | 1.2 | 0 | 0 | 6,353 |
735,743 | 2009-04-09T20:03:00.000 | 3 | 1 | 1 | 0 | python,ping | 735,801 | 3 | false | 0 | 0 | Just because a site fails a ping doesn't mean the domain is available. The domain could be reserved but not pointing anywhere, or the machine may not respond to pings, or it may just be down. | 1 | 0 | 0 | Is there any way to generate words based on characters and checking if a domain exists with this word (ping)?
What I want to do is to generate words based on some characters, example "abcdefgh", and then ping generatedword.com to check if it exists. | Looping through chars, generating words and checking if domain exists | 0.197375 | 0 | 0 | 382 |
736,335 | 2009-04-10T00:22:00.000 | 1 | 0 | 1 | 0 | python,python-3.x | 4,898,617 | 5 | false | 0 | 0 | The reason it wasn't obvious to you is that Python intentionally doesn't try to support such a thing. Namespaces are a feature, and using them is to your advantage. If you want something you defined in another file, import it. This means from reading your source code you can figure out where everything came from, and a... | 2 | 4 | 0 | Is there is a super global (like PHP) in Python? I have certain variables I want to use throughout my whole project in separate files, classes, and functions, and I don't want to have to keep declaring it throughout each file. | Python Superglobal? | 0.039979 | 0 | 0 | 4,007 |
736,335 | 2009-04-10T00:22:00.000 | 4 | 0 | 1 | 0 | python,python-3.x | 4,900,210 | 5 | false | 0 | 0 | in years of practice, i've grown quite disappointed with python's import system: it is complicated and difficult to handle correctly. also, i have to maintain scores of imports in each and every module i write, which is a pita.
namespaces are a very good idea, and they're indispensable---php doesn't have proper namesp... | 2 | 4 | 0 | Is there is a super global (like PHP) in Python? I have certain variables I want to use throughout my whole project in separate files, classes, and functions, and I don't want to have to keep declaring it throughout each file. | Python Superglobal? | 0.158649 | 0 | 0 | 4,007 |
737,511 | 2009-04-10T12:40:00.000 | 2 | 0 | 0 | 0 | python,sql,linux,sqlite,hosting | 737,617 | 4 | false | 0 | 0 | There is no out-of-the-box solution; you either have to backport the SQLlite module from Python 2.5 to Python 2.2 or ask your web hoster to upgrade to the latest Python version.
Python 2.2 is really ancient! At least for security reasons, they should upgrade (no more security fixes for 2.2 since May 30, 2003!).
Note t... | 2 | 1 | 0 | I've written a web-app in python using SQLite and it runs fine on my server at home (with apache and python 2.5.2). I'm now trying to upload it to my web host and there servers use python 2.2.3 without SQLite.
Anyone know of a way to use SQLite in python 2.2.3 e.g. a module that I can upload and import? I've tried butc... | SQLite in Python 2.2.3 | 0.099668 | 1 | 0 | 1,012 |
737,511 | 2009-04-10T12:40:00.000 | 0 | 0 | 0 | 0 | python,sql,linux,sqlite,hosting | 4,066,757 | 4 | false | 0 | 0 | In case anyone comes across this question, the reason why neither pysqlite nor APSW are available for Python 2.2 is because Python 2.3 added the simplified GIL API. Prior to Python 2.3 it required a lot of code to keep track of the GIL. (The GIL is the lock used by Python to ensure correct behaviour while multi-threa... | 2 | 1 | 0 | I've written a web-app in python using SQLite and it runs fine on my server at home (with apache and python 2.5.2). I'm now trying to upload it to my web host and there servers use python 2.2.3 without SQLite.
Anyone know of a way to use SQLite in python 2.2.3 e.g. a module that I can upload and import? I've tried butc... | SQLite in Python 2.2.3 | 0 | 1 | 0 | 1,012 |
737,947 | 2009-04-10T15:11:00.000 | 0 | 0 | 0 | 0 | python,windows,memory-management | 4,207,006 | 7 | false | 0 | 1 | You are probably looking for something like ZODB. However, though ZODB tries hard to be transparent, no solution is going to be 100% free of artifacts. You have to write your code with an awareness that your objects primarily live in a database, but that there are multiple representations of your objects, there are c... | 2 | 2 | 0 | I understood that in certain Windows XP programs, like Photoshop, there is something called "scratch disks". What I understood that this means, and please correct me if I'm wrong, is that Photoshop manages its own virtual memory on the hard-drive, instead of letting Windows manage it. I understood that the reason for t... | Scratch disks in Python? | 0 | 0 | 0 | 561 |
737,947 | 2009-04-10T15:11:00.000 | 1 | 0 | 0 | 0 | python,windows,memory-management | 737,963 | 7 | false | 0 | 1 | Scratch disks will benefit your application in the case that it works with very big files,
Is that the case?
If not, then i don't think you may find something that will benefit your application in scratch disks. | 2 | 2 | 0 | I understood that in certain Windows XP programs, like Photoshop, there is something called "scratch disks". What I understood that this means, and please correct me if I'm wrong, is that Photoshop manages its own virtual memory on the hard-drive, instead of letting Windows manage it. I understood that the reason for t... | Scratch disks in Python? | 0.028564 | 0 | 0 | 561 |
738,433 | 2009-04-10T18:22:00.000 | 2 | 0 | 0 | 0 | python,django | 3,727,548 | 1 | false | 1 | 0 | InstantDjango uses sqlite by default. What database did you set your normal django to use? and you did you create that database before you ran the syncdb?
InstantDjango uses different packaging for all the django required libraries (portable versions) which might be less stable but they should work for your development... | 1 | 0 | 0 | I've been trying to get Django running and when going through the intro to projects it seems that I keep having trouble when I get to the 'sync database' section. When using InstantDjango this doesn't seem to be as much of a problem. My question is, can one just do Django development with the InstantDjango program or ... | Getting started with Django-Instant Django | 0.379949 | 0 | 0 | 1,541 |
739,090 | 2009-04-10T22:43:00.000 | 0 | 0 | 0 | 1 | python,debugging,gdb,subprocess,selinux | 750,128 | 3 | false | 0 | 0 | Your comment notes that you're sshing in with putty... do you have a controlling tty? With openssh you would want to add the -T option, I don't know how/if putty will do this the way you're using it.
Also: you might try using cygwin's ssh instead of putty. | 2 | 4 | 0 | Scenario:
There is a complex piece of software that is annoying to launch by hand. What I've done is to create a python script to launch the executable and attach gdb for debugging.
The process launching script:
ensures an environment variable is set.
ensures a local build directory gets added to the environment's LD_... | How do you automate the launching/debugging of large scale projects? | 0 | 0 | 0 | 1,141 |
739,090 | 2009-04-10T22:43:00.000 | 0 | 0 | 0 | 1 | python,debugging,gdb,subprocess,selinux | 753,721 | 3 | false | 0 | 0 | if you already have a current script set up to do this, but are having problems automating part of it, maybe you can just grab expect and use it to provide the setup, then drop back into interactive mode in expect to launch the process. Then you can still have your ctrl-c available to interrupt. | 2 | 4 | 0 | Scenario:
There is a complex piece of software that is annoying to launch by hand. What I've done is to create a python script to launch the executable and attach gdb for debugging.
The process launching script:
ensures an environment variable is set.
ensures a local build directory gets added to the environment's LD_... | How do you automate the launching/debugging of large scale projects? | 0 | 0 | 0 | 1,141 |
739,687 | 2009-04-11T07:37:00.000 | 1 | 0 | 1 | 0 | python,multithreading,locking,multiprocessing | 739,698 | 3 | false | 0 | 0 | I don't think so. Threading locks are within the same process, while the multiprocessing lock would likely be in shared memory.
Last time I checked, multiprocessing doesn't allow you to share the lock in a Queue, which is a threading lock. | 3 | 7 | 0 | Are the locks from the threading module interchangeable with those from the multiprocessing module? | Python: Locks from `threading` and `multiprocessing` interchangable? | 0.066568 | 0 | 0 | 2,042 |
739,687 | 2009-04-11T07:37:00.000 | 8 | 0 | 1 | 0 | python,multithreading,locking,multiprocessing | 740,197 | 3 | true | 0 | 0 | You can typically use the two interchangeably, but you need to cognizant of the differences. For example, multiprocessing.Event is backed by a named semaphore, which is sensitive to the platform under the application.
Multiprocessing.Lock is backed by Multiprocessing.SemLock - so it needs named semaphores. In essence,... | 3 | 7 | 0 | Are the locks from the threading module interchangeable with those from the multiprocessing module? | Python: Locks from `threading` and `multiprocessing` interchangable? | 1.2 | 0 | 0 | 2,042 |
739,687 | 2009-04-11T07:37:00.000 | 1 | 0 | 1 | 0 | python,multithreading,locking,multiprocessing | 739,705 | 3 | false | 0 | 0 | Yes, you can use locks from the multiprocessing module as normal in your one-process application, but if you're using multiprocessing, you should use its locks. | 3 | 7 | 0 | Are the locks from the threading module interchangeable with those from the multiprocessing module? | Python: Locks from `threading` and `multiprocessing` interchangable? | 0.066568 | 0 | 0 | 2,042 |
739,993 | 2009-04-11T12:34:00.000 | 0 | 0 | 1 | 0 | python,module,pip | 63,098,126 | 31 | false | 0 | 0 | If none of the above seem to help, in my environment was broken from a system upgrade and I could not upgrade pip. While it won't give you an accurate list you can get an idea of which libraries were installed simply by looking inside your env>lib>python(version here)>site-packages> . Here you will get a good indicatio... | 1 | 1,152 | 0 | How do I get a list of Python modules installed on my computer? | How do I get a list of locally installed Python modules? | 0 | 0 | 0 | 1,573,801 |
740,630 | 2009-04-11T19:07:00.000 | 0 | 0 | 0 | 0 | python,sqlalchemy | 776,246 | 4 | false | 0 | 0 | Could you post a sample of your table and mapper set up? It might be easier to spot what is going on.
Without seeing the code it is hard to tell, but perhaps there is something wrong with the direction of the relationship? | 3 | 9 | 0 | I'm trying to use SQLAlchemy to implement a basic users-groups model where users can have multiple groups and groups can have multiple users.
When a group becomes empty, I want the group to be deleted, (along with other things associated with the group. Fortunately, SQLAlchemy's cascade works fine with these more simp... | SQLAlchemy many-to-many orphan deletion | 0 | 1 | 0 | 3,255 |
740,630 | 2009-04-11T19:07:00.000 | 3 | 0 | 0 | 0 | python,sqlalchemy | 763,256 | 4 | true | 0 | 0 | The way I've generally handled this is to have a function on your user or group called leave_group. When you want a user to leave a group, you call that function, and you can add any side effects you want into there. In the long term, this makes it easier to add more and more side effects. (For example when you want... | 3 | 9 | 0 | I'm trying to use SQLAlchemy to implement a basic users-groups model where users can have multiple groups and groups can have multiple users.
When a group becomes empty, I want the group to be deleted, (along with other things associated with the group. Fortunately, SQLAlchemy's cascade works fine with these more simp... | SQLAlchemy many-to-many orphan deletion | 1.2 | 1 | 0 | 3,255 |
740,630 | 2009-04-11T19:07:00.000 | 3 | 0 | 0 | 0 | python,sqlalchemy | 770,287 | 4 | false | 0 | 0 | I think you want cascade='save, update, merge, expunge, refresh, delete-orphan'. This will prevent the "delete" cascade (which you get from "all") but maintain the "delete-orphan", which is what you're looking for, I think (delete when there are no more parents). | 3 | 9 | 0 | I'm trying to use SQLAlchemy to implement a basic users-groups model where users can have multiple groups and groups can have multiple users.
When a group becomes empty, I want the group to be deleted, (along with other things associated with the group. Fortunately, SQLAlchemy's cascade works fine with these more simp... | SQLAlchemy many-to-many orphan deletion | 0.148885 | 1 | 0 | 3,255 |
740,844 | 2009-04-11T21:53:00.000 | 3 | 0 | 1 | 0 | python,multiprocessing,pool | 741,852 | 3 | true | 0 | 0 | From Jesse Noller:
It is not currently supported in the
API, but would not be a bad addition.
I'll look at adding it to
python2.7/2.6.3 3.1 this week | 1 | 7 | 0 | I am subclassing the Process class, into a class I call EdgeRenderer. I want to use multiprocessing.Pool, except instead of regular Processes, I want them to be instances of my EdgeRenderer. Possible? How? | Python multiprocessing: Pool of custom Processes | 1.2 | 0 | 0 | 5,413 |
741,950 | 2009-04-12T15:43:00.000 | 4 | 0 | 1 | 0 | python,parameters,function | 40,388,500 | 6 | false | 0 | 0 | In Python 3, use someMethod.__code__.co_argcount
(since someMethod.func_code.co_argcount doesn't work anymore) | 3 | 34 | 0 | I was creating a simple command line utility and using a dictionary as a sort of case statement with key words linking to their appropriate function. The functions all have different amount of arguments required so currently to check if the user entered the correct amount of arguments needed for each function I placed... | Programmatically determining amount of parameters a function requires - Python | 0.132549 | 0 | 0 | 27,364 |
741,950 | 2009-04-12T15:43:00.000 | 2 | 0 | 1 | 0 | python,parameters,function | 38,776,881 | 6 | false | 0 | 0 | This has already been answered but without the inspect module you can also use someMethod.func_code.co_argcount | 3 | 34 | 0 | I was creating a simple command line utility and using a dictionary as a sort of case statement with key words linking to their appropriate function. The functions all have different amount of arguments required so currently to check if the user entered the correct amount of arguments needed for each function I placed... | Programmatically determining amount of parameters a function requires - Python | 0.066568 | 0 | 0 | 27,364 |
741,950 | 2009-04-12T15:43:00.000 | 1 | 0 | 1 | 0 | python,parameters,function | 742,452 | 6 | false | 0 | 0 | Make each command a class, derived from an abstract base defining the general structure of a command. As much as possible, the definition of command properties should be put into class variables with methods defined in the base class handling that data.
Register each of these subclasses with a factory class.
This facto... | 3 | 34 | 0 | I was creating a simple command line utility and using a dictionary as a sort of case statement with key words linking to their appropriate function. The functions all have different amount of arguments required so currently to check if the user entered the correct amount of arguments needed for each function I placed... | Programmatically determining amount of parameters a function requires - Python | 0.033321 | 0 | 0 | 27,364 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.