Q_CreationDate
stringlengths
23
23
Title
stringlengths
11
149
Question
stringlengths
25
6.53k
Answer
stringlengths
15
5.1k
Score
float64
-1
1.2
Is_accepted
bool
2 classes
N_answers
int64
1
17
Q_Id
int64
0
6.76k
2010-04-04 00:28:33.830
Python progression path - From apprentice to guru
I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been at the very core of all the major contributions I have made in the lab. I more or less fell in love with the way Python permits me to express beautiful solutio...
I'll give you the simplest and most effective piece of advice I think anybody could give you: code. You can only be better at using a language (which implies understanding it) by coding. You have to actively enjoy coding, be inspired, ask questions, and find answers by yourself. Got a an hour to spare? Write code that ...
0.706807
false
5
503
2010-04-04 10:55:44.530
how to create multiple selections in text edit box in qt4?
Qt3.3 used to allow for multiple selections in the QTextEdit widget by calling the setSelection() function and specifying a different selection id (selNum) as the last argument in that function. In Qt4, to create a selection, I do it by creating a QTextCursor object and call the setPosition() or movePosition() methods...
How about creating multiple cursors (QTextCursor), each selection a different portion of the text. Would that work for you?
0
false
2
504
2010-04-04 10:55:44.530
how to create multiple selections in text edit box in qt4?
Qt3.3 used to allow for multiple selections in the QTextEdit widget by calling the setSelection() function and specifying a different selection id (selNum) as the last argument in that function. In Qt4, to create a selection, I do it by creating a QTextCursor object and call the setPosition() or movePosition() methods...
The solution, i realise now is actually quite simple. To graphically visualise all the various selections (separate QTextCursor objects), instead of calling the setTextCursor() method for the QTextEdit widget for each of the selections, i change the background color of each of those sections of text by calling the set...
1.2
true
2
504
2010-04-05 13:18:44.587
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
Codeigniter it's fast and very documented also has a large community to and finaly friendly with the programmer.
0.201295
false
5
505
2010-04-05 13:18:44.587
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
I am using CodeIgniter 1.7.2 and for complex websites it's very good and powerfull, but it definitely is missing some kind of code generator which will allow for example to build an IT application in one click. I had the impression (from watching a tutorial) that Django has it.
0
false
5
505
2010-04-05 13:18:44.587
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
If for the PHP part I would choose CodeIgniter - it doesn't get too much into your way. But it doesn't have any code/view/model generators out of the box, you need to type a bit. But languages other than PHP appear to be more sexy.
0
false
5
505
2010-04-05 13:18:44.587
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
Most of the frameworks out there nowadays are fast enough to serve whatever needs you will have. It really depends on in which environment you feel most comfortable. Though there are nuances here and there, MVC frameworks share a lot of the same principles, so whichever you choose to use is really a matter of which you...
1.2
true
5
505
2010-04-05 13:18:44.587
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
This is a very subjective question but personally I'd recommend Django. Python is a very nice language to use and the Django framework is small, easy to use, well documented and also has a pretty active community. This choice was made partly because of my dislike for PHP though, so take the recommendation with a pinch ...
0.999139
false
5
505
2010-04-05 20:23:48.887
Disable autocomplete on textfield in Django?
Does anyone know how you can turn off autocompletion on a textfield in Django? For example, a form that I generate from my model has an input field for a credit card number. It is bad practice to leave autocompletion on. When making the form by hand, I'd add a autocomplete="off" statement, but how do you do it in Djan...
Add the autocomplete="off" to the form tag, so you don't have to change the django.form instance. <form action="." method="post" autocomplete="off"> {{ form }} </form>
0.999996
false
1
506
2010-04-06 13:24:47.997
Emacs bulk indent for Python
Working with Python in Emacs if I want to add a try/except to a block of code, I often find that I am having to indent the whole block, line by line. In Emacs, how do you indent the whole block at once. I am not an experienced Emacs user, but just find it is the best tool for working through ssh. I am using Emacs on ...
indent-region mapped to C-M-\ should do the trick.
0.201295
false
2
507
2010-04-06 13:24:47.997
Emacs bulk indent for Python
Working with Python in Emacs if I want to add a try/except to a block of code, I often find that I am having to indent the whole block, line by line. In Emacs, how do you indent the whole block at once. I am not an experienced Emacs user, but just find it is the best tool for working through ssh. I am using Emacs on ...
In addition to indent-region, which is mapped to C-M-\ by default, the rectangle edit commands are very useful for Python. Mark a region as normal, then: C-x r t (string-rectangle): will prompt you for characters you'd like to insert into each line; great for inserting a certain number of spaces C-x r k (kill-rectang...
0.470104
false
2
507
2010-04-08 04:03:48.057
deletion of folders
how can i delete a folder using python script?and what are the return values??
you can use os.rmdir() to remove a directory. To remove a directory tree recursively, you can use shutil.rmtree. If you know that you already have empty directory nodes, you can also check out os.removedirs()
0
false
1
508
2010-04-09 18:45:51.457
ISBNs are used as primary key, now I want to add non-book things to the DB - should I migrate to EAN?
I built an inventory database where ISBN numbers are the primary keys for the items. This worked great for a while as the items were books. Now I want to add non-books. some of the non-books have EANs or ISSNs, some do not. It's in PostgreSQL with django apps for the frontend and JSON api, plus a few supporting python ...
A simple solution (although arguably whether good) would be to use (isbn,title) or (isbn,author) which should pretty much guarantee uniqueness. Ideology is great but practicality also serves a purpose.
0.101688
false
2
509
2010-04-09 18:45:51.457
ISBNs are used as primary key, now I want to add non-book things to the DB - should I migrate to EAN?
I built an inventory database where ISBN numbers are the primary keys for the items. This worked great for a while as the items were books. Now I want to add non-books. some of the non-books have EANs or ISSNs, some do not. It's in PostgreSQL with django apps for the frontend and JSON api, plus a few supporting python ...
I don't know postgres but normally ISBM would be a unique index key but not the primary. It's better to have an integer as primary/foreign key. That way you only need to add a new field EAN/ISSN as nullable.
0.296905
false
2
509
2010-04-09 19:44:57.647
How to create make .so files from code written in C or C++ that are usable from Python
Looking at Python modules and at code in the "lib-dnyload" directory in the Python framework, I noticed whenever code is creating some kind of GUI or graphic it imports a non-Python file with a .so extension. And there are tons .so files in "lib-dnyload". From googling things I found that these files are called shared...
You can write python extensions in many ways, including Cython, SWIG, boost.python ... You can also write a shared library and use the "ctypes" library to access it.
0
false
1
510
2010-04-09 21:58:06.780
How do I write raw binary data in Python?
I've got a Python program that stores and writes data to a file. The data is raw binary data, stored internally as str. I'm writing it out through a utf-8 codec. However, I get UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 25: character maps to <undefined> in the cp1252.py file. This looks t...
You shouldn't normally use codecs with str, except to turn them into unicodes. Perhaps you should be looking at using the latin-1 codec if you think you want "raw" data in your unicodes.
0
false
2
511
2010-04-09 21:58:06.780
How do I write raw binary data in Python?
I've got a Python program that stores and writes data to a file. The data is raw binary data, stored internally as str. I'm writing it out through a utf-8 codec. However, I get UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 25: character maps to <undefined> in the cp1252.py file. This looks t...
NOTE: this was written for Python 2.x. Not sure if applicable to 3.x. Your use of str for raw binary data in memory is correct. [If you're using Python 2.6+, it's even better to use bytes which in 2.6+ is just an alias to str but expresses your intention better, and will help if one day you port the code to Python 3.]...
1.2
true
2
511
2010-04-11 03:15:41.097
How can I learn to set up a build process?
What I was taught at school is all about programming languages, software design, but hardly anything about how to automatically build a software, probably with something like unit testing integrated. Please tell me how do one start learning to set up a build process for his project. If this is too abstract to make any ...
For Python projects you should use setuptools. Setuptools has all the stuff to pack things up into .eggs, compile C modules, run unit tests, etc... If you've ever done "python setup.py [build|install|test]" then you've used setuptools.
0.081452
false
2
512
2010-04-11 03:15:41.097
How can I learn to set up a build process?
What I was taught at school is all about programming languages, software design, but hardly anything about how to automatically build a software, probably with something like unit testing integrated. Please tell me how do one start learning to set up a build process for his project. If this is too abstract to make any ...
While this is certainly not a complete answer to your question, I would like to recommend very highly the learning of the tool 'make'. I find myself using it on a VERY regular basis, for a wide variety of tasks, including (but by no means limited to) building, testing, and deploying software.
0
false
2
512
2010-04-11 03:42:56.387
Installing virtualenvwrapper on Windows
I've installed virtualenv and virtualenvwrapper on Windows using easy_install. But mkvirtualenv is missing. I tried to search on my machine but I couldn't find it. I don't know how to solve it. Do you have any idea?
mkvirtualenv is a bash script so you need to run bash shell to make use of it. mkvirtualenv is a bash function in the mkvirtualenv_bashrc script You will need to run this from cygwin under Windows. (You can call a native python from this and not need a cygwin python)
1.2
true
2
513
2010-04-11 03:42:56.387
Installing virtualenvwrapper on Windows
I've installed virtualenv and virtualenvwrapper on Windows using easy_install. But mkvirtualenv is missing. I tried to search on my machine but I couldn't find it. I don't know how to solve it. Do you have any idea?
In windows we need to use virtualenv not mkvirtualenv while creating virtual environments
0.327599
false
2
513
2010-04-11 06:01:58.793
Python: what package contains the installation metadata?
e.g., how can I find out that the executable has been installed in "/usr/bin/python" and the library files in "/usr/lib/python2.6"?
You want the sys module: >>> print sys.executable /usr/bin/python >>> print sys.path ['', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-...
0.201295
false
1
514
2010-04-11 09:45:28.490
Does python-memcached support consistent hashing & binary protocol?
Python-memcached is the official supported memcached driver for Django. Does it support Consistent hashing Binary protocol If it does, how do I use those features within Django? I couldn't find any documentation.
Looking at the _get_server method on python-memcached v1.45, it seems it doesn't use consistent hashing, but a simple hash % len(buckets). Same goes for binary protocol, python-memcache uses, as far as I can see in the source, only text commands.
1.2
true
1
515
2010-04-13 07:41:56.143
How do I start learn Python for web
I have been learning Python for a while, and now I'd like to learn Python for the web; using Python as a back-end of a website. Where and how do I start learning this? Example usages are: connecting to databases, and retrieving and storing information from forms.
there are numerous options for learning python for web. I learned python to access web data from courser.org, and the tutorial was very interesting. If you want to learn python for web then I suggest you to learn python to access web data in courser.org you can also learn python for everybody which is a specialization ...
0
false
2
516
2010-04-13 07:41:56.143
How do I start learn Python for web
I have been learning Python for a while, and now I'd like to learn Python for the web; using Python as a back-end of a website. Where and how do I start learning this? Example usages are: connecting to databases, and retrieving and storing information from forms.
There are numerous frameworks for making websites in Python. Once you are familiar with Python and the general nature of websites which would include the knowledge of HTTP, HTML you can proceed by using any of the following to make websites using Python: Webapp2 - A simple framework to get you started with making webs...
0
false
2
516
2010-04-13 20:38:43.150
How to get a Device Specific UID using Python in ASE on Android?
I am working on am Android Scripting Environment (ASE) script in Python to replicate an iPhone app. I need a device UID of some sort. My thoughts where a salted MD5 hash of the MAC address or device phone number, but I can't figure out how to access either of those using the Python APIs within ASE. What can I do to cre...
The newer versions of ASE now include a function call to create these identifiers.
1.2
true
1
517
2010-04-14 14:46:12.967
Python and Eclipse: How to use interactive console after running a module, with the module variables and functions
Let's consider 3 situations: 1) I write a pyhon module in Eclipse (pydev) and run it Ctrl-F11. The module runs and I don't have any control or access (AFAIK) to the module variables and functions. 2) I have defined a python interpreter as an external tool in Eclipse, so I can run it within Eclipse. It works fine, but i...
If you run it as a debug operation in Eclipse, you should be able to set a breakpoint, and you can then examine variables, etc. But you can evaluate random python scripts via the watch functionality.
1.2
true
1
518
2010-04-16 03:57:57.730
MySQL to AppEngine
I'm from Brazil and study at FATEC (college located in Brazil). I'm trying to learn about AppEngine. Now, I'm trying to load a large database from MySQL to AppEngine to perform some queries, but I don't know how i can do it. I did some testing with CSV files,but is there any way to perform the direct import from MySQL?...
If you're using Pentaho BI Server as your data source, why don't you consider using Pentaho Data Integration (ETL tool) to move the data over? At the very least PDI automate any movement of data between your data source and any AppEngine bulk loader tool (it can easily trigger any app with a shell step).
0
false
1
519
2010-04-16 04:21:52.330
Py GTK Drawing area and Rich Text Editor
I would like to include a rich text editor in a pygtk drawing area for an application i am developing. The editor ( a small resizable widget ) should be able to move around the drawing area like a rectangle. I am not sure how to start as I am pretty new to PyGTK. thank you !
gtk.TextView is "rich", in that it can display all types of formatting and even embedded widgets. If you want the functionality of editing rich text, you will have to write something yourself, though others have tried in applications like BloGTK. From which you could steal codes.
0
false
1
520
2010-04-16 07:58:56.710
how to call a c++ file from python without using any of the spam bindings?
i have this encryption algorithm written in C++ , but the values that has to be encrypted are being taken input and stored in a file by a python program . Thus how can i call this c++ program from python?
Look for the subprocess module. It is the recommended way to invoke processes from within Python. The os.system function is a viable alternative sometimes, if your needs are very simple (no pipes, simple arguments, etc.)
0.386912
false
2
521
2010-04-16 07:58:56.710
how to call a c++ file from python without using any of the spam bindings?
i have this encryption algorithm written in C++ , but the values that has to be encrypted are being taken input and stored in a file by a python program . Thus how can i call this c++ program from python?
The os.system function will invoke an arbitrary command-line from python.
0
false
2
521
2010-04-16 12:59:42.270
Inexpensive ways to add seek to a filetype object
PdfFileReader reads the content from a pdf file to create an object. I am querying the pdf from a cdn via urllib.urlopen(), this provides me a file like object, which has no seek. PdfFileReader, however uses seek. What is the simple way to create a PdfFileReader object from a pdf downloaded via url. Now, what can I do ...
I suspect you may be optimising prematurely here. Most modern systems will cache files in memory for a significant period of time before they flush them to disk, so if you write the data to a temporary file, read it back in, then close and delete the file you may find that there's no significant disc traffic (unless it...
0.135221
false
1
522
2010-04-16 16:11:58.573
access variables of other functions
in python, how can i access the variables of one function into another function, is it possible, i tried the global variable method but that doesn't work for me. can someone help me, how to access the variables from one function to another function.
Don't try to do this. Explicit is better than implicit - if your function needs access to certain variables, pass them in. If it needs to change a value in the calling function, return the new value.
0
false
2
523
2010-04-16 16:11:58.573
access variables of other functions
in python, how can i access the variables of one function into another function, is it possible, i tried the global variable method but that doesn't work for me. can someone help me, how to access the variables from one function to another function.
If you want to share data between functions then create a class and turn the functions into methods on the class.
1.2
true
2
523
2010-04-16 16:43:19.367
Django - how to write users and profiles handling in best way?
I am writing simple site that requires users and profiles to be handled. The first initial thought is to use django's build in user handling, but then the user model is too narrow and does not contain fields that I need. The documentation mentions user profiles, but user profiles section has been removed from djangoboo...
Thank you all for your answers! I know that django dev documentation mentions user profiles, but does it very briefly (roughly few lines) and links to djangobook containing information about user profiles, but... to its first version, covering django 0.96. The second version of djangobook, covering django 1.0 (that is ...
0
false
1
524
2010-04-16 17:04:49.293
Capturing stdout within the same process in Python
I've got a python script that calls a bunch of functions, each of which writes output to stdout. Sometimes when I run it, I'd like to send the output in an e-mail (along with a generated file). I'd like to know how I can capture the output in memory so I can use the email module to build the e-mail. My ideas so far w...
You said that your script "calls a bunch of functions" so I'm assuming that they're python functions accessible from your program. I'm also assuming you're using print to generate the output in all these functions. If that's the case, you can just replace sys.stdout with a StringIO.StringIO which will intercept all the...
1.2
true
1
525
2010-04-17 22:24:51.723
In python, how do I drag and drop 1 or more files onto my script as arguments with absolute path? (for windows, linux, and mac)
I am writing a simple Python script with no GUI. I want to be able to drag and drop multiple files onto my python script and have access to their absolute paths inside of the script. How do I do this in Mac, Linux, and windows? For times sake, just Mac will be fine for now. I've googled this question and only found one...
This really is independent of python. It depends entirely on which file browser you're using and how it supports drag and drop.
0.135221
false
2
526
2010-04-17 22:24:51.723
In python, how do I drag and drop 1 or more files onto my script as arguments with absolute path? (for windows, linux, and mac)
I am writing a simple Python script with no GUI. I want to be able to drag and drop multiple files onto my python script and have access to their absolute paths inside of the script. How do I do this in Mac, Linux, and windows? For times sake, just Mac will be fine for now. I've googled this question and only found one...
Usually when you drag a file onto a script/executable, the OS passes the path to that file as a command-line argument. Check sys.argv
0.135221
false
2
526
2010-04-18 03:56:23.810
pexpect install problem
i have installed pexpect with the following command "python setup.py install" but when i try to run a program it says "AttributeError: 'module' object has no attribute 'spawn'". how to settle the matter?
Pexpect has not been ported to python3, and apparently the author has no plans on doing so. I tried converting it with the python 2to3 program, but could not get it to work.
0.135221
false
2
527
2010-04-18 03:56:23.810
pexpect install problem
i have installed pexpect with the following command "python setup.py install" but when i try to run a program it says "AttributeError: 'module' object has no attribute 'spawn'". how to settle the matter?
It looks like pexpect wasn't ported yet to python 3 (quite a late answer, but still usable for people googling here)
0.265586
false
2
527
2010-04-19 05:01:31.697
In SqlAlchemy, how to ignore m2m relationship attributes when merge?
There is a m2m relation in my models, User and Role. I want to merge a role, but i DO NOT want this merge has any effect on user and role relation-ship. Unfortunately, for some complicate reason, role.users if not empty. I tried to set role.users = None, but SA complains None is not a list. At this moment, I use...
You'd better fix your code to avoid setting role.users for the item you are going to merge. But there is another way - setting cascade='none' for this relation. Then you lose an ability to save relationship from Role side, you'll have to save User with roles attribute set.
1.2
true
1
528
2010-04-20 18:41:03.133
Regex for finding valid sphinx fields
I'm trying to validate that the fields given to sphinx are valid, but I'm having difficulty. Imagine that valid fields are cat, mouse, dog, puppy. Valid searches would then be: @cat search terms @(cat) search terms @(cat, dog) search term @cat searchterm1 @dog searchterm2 @(cat, dog) searchterm1 @mouse searchterm2 ...
To match all allowed fields, the following rather fearful looking regex works: @((?:cat|mouse|dog|puppy)\b|\((?:(?:cat|mouse|dog|puppy)(?:, *|(?=\))))+\)) It returns these matches, in order: @cat, @(cat), @(cat, dog), @cat, @dog, @(cat, dog), @mouse. The regex breaks down as follows: @ ...
0.201295
false
1
529
2010-04-21 17:09:56.487
python: find and replace numbers < 1 in text file
I'm pretty new to Python programming and would appreciate some help to a problem I have... Basically I have multiple text files which contain velocity values as such: 0.259515E+03 0.235095E+03 0.208262E+03 0.230223E+03 0.267333E+03 0.217889E+03 0.156233E+03 0.144876E+03 0.136187E+03 0.137865E+00 etc for many l...
typical technique would be: read file line by line split each line into a list of strings convert each string to the float compare converted value with 1 replace when needed write back to the new file As I don't see you having any code yet, I hope that this would be a good start
0.265586
false
1
530
2010-04-23 10:08:06.833
Automating Excel macro using python
I am using python in Linux to automate an excel. I have finished writing data into excel by using pyexcelerator package. Now comes the real challenge. I have to add another tab to the existing sheet and that tab should contain the macro run in the first tab. All these things should be automated. I Googled a lot and fo...
Maybe manipulating your .xls with Openoffice and pyUno is a better way. Way more powerful.
0
false
2
531
2010-04-23 10:08:06.833
Automating Excel macro using python
I am using python in Linux to automate an excel. I have finished writing data into excel by using pyexcelerator package. Now comes the real challenge. I have to add another tab to the existing sheet and that tab should contain the macro run in the first tab. All these things should be automated. I Googled a lot and fo...
Excel Macros are per sheets, so, I am afraid, you need to copy the macros explicitly if you created new sheet, instead of copying existing sheet to new one.
0
false
2
531
2010-04-23 12:43:50.543
Gtk: How can I get a part of a file in a textview with scrollbars relating to the full file
I'm trying to make a very large file editor (where the editor only stores a part of the buffer in memory at a time), but I'm stuck while building my textview object. Basically- I know that I have to be able to update the text view buffer dynamically, and I don't know hot to get the scrollbars to relate to the full fil...
You probably should create your own Gtk.TextBuffer implementation, as the default one relies on storing whole buffer in memory.
0.201295
false
1
532
2010-04-23 15:52:34.600
Importing Classes Within a Module
Currently, I have a parser with multiple classes that work together. For Instance: TreeParser creates multiple Product and Reactant modules which in turn create multiple Element classes. The TreeParser is called by a render method within the same module, which is called from the importer. Finally, if the package has de...
I'm not really sure what your problem is, is it that you just want to type less? get a decent source editor with autocomplete! you can do import longmodulename as ln and use ln.something instead of longmodulename.something you can do from longmodulename import ( something, otherthing ) and use something directly impo...
0.386912
false
2
533
2010-04-23 15:52:34.600
Importing Classes Within a Module
Currently, I have a parser with multiple classes that work together. For Instance: TreeParser creates multiple Product and Reactant modules which in turn create multiple Element classes. The TreeParser is called by a render method within the same module, which is called from the importer. Finally, if the package has de...
I think this is the key statement in your question. I don't really want to add the module name in front of every call to the class My response: I hear what you're saying, but this is standard practice in Python. Any Python programmer reading code like "result = match(blah)" will presume you're calling a local functio...
1.2
true
2
533
2010-04-25 20:55:44.383
How to make an executable file in Python?
I want to make an executable file (.exe) of my Python application. I want to know how to do it but have this in mind: I use a C++ DLL! Do I have to put the DLL along side with the .exe or is there some other way?
I've built exe files from Python 2.7 code using each of these tools: Cython (with --embed option) Nuitka Py2exe These all will produce a standalone exe. Your installer will have to include the requisite CRT dlls. Your end result will be indistinguishable from any other exe to the typical user. The first two compile...
0.058243
false
1
534
2010-04-27 14:27:05.607
Could Python's logging SMTP Handler be freezing my thread for 2 minutes?
A rather confusing sequence of events happened, according to my log-file, and I am about to put a lot of the blame on the Python logger, which is a bold claim. I thought I should get some second opinions about whether what I am saying could be true. I am trying to explain why there is are several large gaps in my log f...
Stress-testing was revealing: My logging configuration sent critical messages to SMTPHandler, and debug messages to a local log file. For testing I created a moderately large number of threads (e.g. 50) that waited for a trigger, and then simultaneosly tried to log either a critical message or a debug message, dependin...
1.2
true
1
535
2010-04-28 00:55:44.230
Can I get the amount of time for which a key is pressed on a keyboard
I am working on a project in which I have to develop bio-passwords based on user's keystroke style. Suppose a user types a password for 20 times, his keystrokes are recorded, like holdtime : time for which a particular key is pressed. digraph time : time it takes to press a different key. suppose a user types a pass...
The answer is conditionally "yes". If your languages/environment has interactive keyboard support that offers Key-Down and Key-Up events, then you catch both events and time the difference between them. This would be trivially easy in JavaScript on a web page, which would also be the easiest way to show off your work t...
0
false
2
536
2010-04-28 00:55:44.230
Can I get the amount of time for which a key is pressed on a keyboard
I am working on a project in which I have to develop bio-passwords based on user's keystroke style. Suppose a user types a password for 20 times, his keystrokes are recorded, like holdtime : time for which a particular key is pressed. digraph time : time it takes to press a different key. suppose a user types a pass...
If you read from the terminal in conical mode, you can read each keystroke as it's pressed. You won't see keydown keyup events, like you could if you trapped X events, but it's probably easier, especially if you're just running in a console or terminal.
0
false
2
536
2010-04-28 15:37:49.327
Finding all points common to two circles
In Python, how would one find all integer points common to two circles? For example, imagine a Venn diagram-like intersection of two (equally sized) circles, with center-points (x1,y1) and (x2,y2) and radii r1=r2. Additionally, we already know the two points of intersection of the circles are (xi1,yi1) and (xi2,yi2). H...
So you want to find the lattice points that are inside both circles? The method you suggested of drawing a box and iterating through all the points in the box seems the simplest to me. It will probably be efficient, as long as the number of points in the box is comparable to the number of points in the intersection. A...
0
false
4
537
2010-04-28 15:37:49.327
Finding all points common to two circles
In Python, how would one find all integer points common to two circles? For example, imagine a Venn diagram-like intersection of two (equally sized) circles, with center-points (x1,y1) and (x2,y2) and radii r1=r2. Additionally, we already know the two points of intersection of the circles are (xi1,yi1) and (xi2,yi2). H...
You may also want to look into the various clipping algorithms used in graphics development. I have used clipping algorithms to solve alot of problems similar to what you are asking here.
0.067922
false
4
537
2010-04-28 15:37:49.327
Finding all points common to two circles
In Python, how would one find all integer points common to two circles? For example, imagine a Venn diagram-like intersection of two (equally sized) circles, with center-points (x1,y1) and (x2,y2) and radii r1=r2. Additionally, we already know the two points of intersection of the circles are (xi1,yi1) and (xi2,yi2). H...
If the locations and radii of your circles can vary with a granularity less than your grid, then you'll be checking a bunch of points anyway. You can minimize the number of points you check by defining the search area appropriately. It has a width equal to the distance between the points of intersection, and a height ...
0.067922
false
4
537
2010-04-28 15:37:49.327
Finding all points common to two circles
In Python, how would one find all integer points common to two circles? For example, imagine a Venn diagram-like intersection of two (equally sized) circles, with center-points (x1,y1) and (x2,y2) and radii r1=r2. Additionally, we already know the two points of intersection of the circles are (xi1,yi1) and (xi2,yi2). H...
You're almost there. Iterating over the points in the box should be fairly good, but you can do better if for the second coordinate you iterate directly between the limits. Say you iterate along the x axis first, then for the y axis, instead of iterating between bounding box coords figure out where each circle intersec...
0.067922
false
4
537
2010-04-28 19:06:45.113
Timed email reminder in python
I have written up a python script that allows a user to input a message, his email and the time and they would like the email sent. This is all stored in a mysql database. However, how do I get the script to execute on the said time and date? will it require a cron job? I mean say at 2:15 on april 20th, the script wil...
If you cannot have a continuously running script, something must trigger it, so that would have to rely on your OS internals. In a unix environment a cron job, as you self state, would do the trick. Set cron to run the script, and make the script wait for a given time and then continue running and sending until the nex...
1.2
true
2
538
2010-04-28 19:06:45.113
Timed email reminder in python
I have written up a python script that allows a user to input a message, his email and the time and they would like the email sent. This is all stored in a mysql database. However, how do I get the script to execute on the said time and date? will it require a cron job? I mean say at 2:15 on april 20th, the script wil...
A cronjob every minute or so would do it. If you're considering this, you might like to mind two things: 1 - How many e-mails are expected to be sent per minute? If it takes you 1 second to send an e-mail and you have 100 e-mails per minute, you won't finish your queue. 2 - What will happen if one job starts before th...
0.135221
false
2
538
2010-04-29 09:00:18.540
How to get debugging of an App Engine application working?
I've got 10+ years in C/C++, and it appears Visual Studio has spoilt me during that time. In Visual Studio, debbuging issimple: I just add a breakpoint to a line of code, and as soon as that code is executed, my breakpoint triggers, at which point I can view a callstack, local/member variables, etc. I'm trying to achi...
In fact setting a breakpoint in eclipse is very easy. You have two options: In the grey area next to your line numbers, doubleclick or right mouseclick -> toggle breakpoint.
1.2
true
1
539
2010-04-30 13:00:48.883
Change text_factory in Django/sqlite
I have a django project that uses a sqlite database that can be written to by an external tool. The text is supposed to be UTF-8, but in some cases there will be errors in the encoding. The text is from an external source, so I cannot control the encoding. Yes, I know that I could write a "wrapping layer" between the e...
Incompatible Django version. Check Django version for solving this error first. I was running on Django==3.0.8 and it was producing an error. Than I ran virtualenv where I have Django==3.1.2 and the error was removed.
0
false
1
540
2010-04-30 19:13:05.883
Running CPython Applications With Visual Studio?
I would like to know how to use Visual Studio with CPython (the official python.org python interpreter, not IronPython). In particular, I am interested in getting "build" and "run" commands in Visual Studio working. Other features such as color highlighting and auto-complete, I am less concerned about. Also, can the "b...
You can create custom project that will execute a bat file when building. I remember that I used this method to generate a Inoosetup installer so that you should work to run the py2exe script. I have no idea for the rest of the features. The syntax highlighting and the auto-complete should be much more challenging. I w...
0
false
3
541
2010-04-30 19:13:05.883
Running CPython Applications With Visual Studio?
I would like to know how to use Visual Studio with CPython (the official python.org python interpreter, not IronPython). In particular, I am interested in getting "build" and "run" commands in Visual Studio working. Other features such as color highlighting and auto-complete, I am less concerned about. Also, can the "b...
Eclipse and PyDev already provide an excellent development environment for Python. Is there any reason you cannot use them?
0.101688
false
3
541
2010-04-30 19:13:05.883
Running CPython Applications With Visual Studio?
I would like to know how to use Visual Studio with CPython (the official python.org python interpreter, not IronPython). In particular, I am interested in getting "build" and "run" commands in Visual Studio working. Other features such as color highlighting and auto-complete, I am less concerned about. Also, can the "b...
Are you trying to build CPython itself? Doesn't it come with project files suitable for use with Visual Studio? (I seem to remember that it did.) If you mean that you want to use CPython but not build it, then just type c:\pythonxx\python.exe into the debugging executable and in the arguments put your script's full p...
0.101688
false
3
541
2010-04-30 22:37:23.463
MUD (game) design concept question about timed events
I'm trying my hand at building a MUD (multiplayer interactive-fiction game) I'm in the design/conceptualizing phase and I've run into a problem that I can't come up with a solution for. I'm hoping some more experienced programmers will have some advice. Here's the problem as best I can explain it. When the player dec...
MUDs actions are usually performed on 'ticks' rather than immediately - this allows for limited affect of latency and for monster's commands to be inserted in the queue and processed fairly. Personally, I don't like this approach, but pretty much 99% of MUDs use it. You need to design a robust command queue & event que...
0.229097
false
5
542
2010-04-30 22:37:23.463
MUD (game) design concept question about timed events
I'm trying my hand at building a MUD (multiplayer interactive-fiction game) I'm in the design/conceptualizing phase and I've run into a problem that I can't come up with a solution for. I'm hoping some more experienced programmers will have some advice. Here's the problem as best I can explain it. When the player dec...
AI's are clients. They're "part of the server" only in the most distant view. They're actually outside the main game engine. They're specialized clients with no human being. An AI client has the same interface with the server that a human's client would.
0.173164
false
5
542
2010-04-30 22:37:23.463
MUD (game) design concept question about timed events
I'm trying my hand at building a MUD (multiplayer interactive-fiction game) I'm in the design/conceptualizing phase and I've run into a problem that I can't come up with a solution for. I'm hoping some more experienced programmers will have some advice. Here's the problem as best I can explain it. When the player dec...
I'll provide you an answer from an LPMud/LDMud point of view. Every player in the MUD is an instance of player.c. Player.c inherits from living.c. Things that are living have a heartbeat. The heartbeat function is processed once every 2 seconds for every living object on the mud (or anything that has a heartbeat() f...
0
false
5
542
2010-04-30 22:37:23.463
MUD (game) design concept question about timed events
I'm trying my hand at building a MUD (multiplayer interactive-fiction game) I'm in the design/conceptualizing phase and I've run into a problem that I can't come up with a solution for. I'm hoping some more experienced programmers will have some advice. Here's the problem as best I can explain it. When the player dec...
You could use threads to handle specific types of Mobs, and put all the instances into an array of some sort. Then, the thread simply goes through the list repeatedly applying logic. DelayTimeStart and Delay could be attributes of the parent Mob class, and when the thread goes through the loop, it can put off process...
0.116092
false
5
542
2010-04-30 22:37:23.463
MUD (game) design concept question about timed events
I'm trying my hand at building a MUD (multiplayer interactive-fiction game) I'm in the design/conceptualizing phase and I've run into a problem that I can't come up with a solution for. I'm hoping some more experienced programmers will have some advice. Here's the problem as best I can explain it. When the player dec...
A basic approach would be to have a data structure representing the evil monster's instance of its spell, with a cooldown timer on it. When the power is used, the cooldown is set (presumably to a number of seconds defined by the master definition of the spell); an attempt to use it again will fail just like with the p...
0
false
5
542
2010-05-01 04:57:23.553
What are some strategies for maintaining a common database schema with a team of developers and no DBA?
I'm curious about how others have approached the problem of maintaining and synchronizing database changes across many (10+) developers without a DBA? What I mean, basically, is that if someone wants to make a change to the database, what are some strategies to doing that? (i.e. I've created a 'Car' model and now I wan...
The solution is rather administrative then technical :) The general rule is easy, there should only be tree-like dependencies in the project: - There should always be a single master source of schema, stored together with the project source code in the version control - Everything affected by the change in the master s...
1.2
true
1
543
2010-05-01 14:43:37.153
Is www.example.com/post/21/edit a RESTful URI? I think I know the answer, but have another question
I'm almost afraid to post this question, there has to be an obvious answer I've overlooked, but here I go: Context: I am creating a blog for educational purposes (want to learn python and web.py). I've decided that my blog have posts, so I've created a Post class. I've also decided that posts can be created, read, upda...
Instead of calling it /post/52/edit, what if you called it /post/52/editor? Now it is a resource. Dilemma averted.
0.201295
false
2
544
2010-05-01 14:43:37.153
Is www.example.com/post/21/edit a RESTful URI? I think I know the answer, but have another question
I'm almost afraid to post this question, there has to be an obvious answer I've overlooked, but here I go: Context: I am creating a blog for educational purposes (want to learn python and web.py). I've decided that my blog have posts, so I've created a Post class. I've also decided that posts can be created, read, upda...
Another RESTful approach is to use the query string for modifiers: /post/52?edit=1 Also, don't get too hung up on the purity of the REST model. If your app doesn't fit neatly into the model, break the rules.
0.386912
false
2
544
2010-05-01 17:32:11.207
Google App Engine Python Unit Tests
I'd like to write some Python unit tests for my Google App Engine. How can I set that up? Does someone happen to have some sample code which shows how to write a simple test?
Since, gae is based on webhooks it can be easy to set your own testing framework for all relevant urls in your app.yaml. You can test it on sample dataset on development server ( start devel server with --datastore_path option ) and assert writes to database or webhook responses.
0.101688
false
1
545
2010-05-02 00:27:16.153
Algorithm detect repeating/similiar strings in a corpus of data -- say email subjects, in Python
I'm downloading a long list of my email subject lines , with the intent of finding email lists that I was a member of years ago, and would want to purge them from my Gmail account (which is getting pretty slow.) I'm specifically thinking of newsletters that often come from the same address, and repeat the product/servi...
I would first turn each string of characters into a set or multiset of words (ignoring punctuation and differences in lower/upper case). (If that's not powerful enough, in a second pass I could try pairs or even triples of adjacent words, known as bigrams and trigrams). The key measure of similarity between strings t...
1.2
true
1
546
2010-05-02 23:17:24.667
Using recursion to sum two numbers (python)
I need to write a recursive function that can add two numbers (x, y), assuming y is not negative. I need to do it using two functions which return x-1 and x+1, and I can't use + or - anywhere in the code. I have no idea how to start, any hints?
This sounds like homework. So this is probably cheating: a+b is the same as a.__add__(b), and a-b is the same as a.__sub__(b). So you can easily add or subtract two numbers without using +/-. No need for any recursion.
-0.265586
false
1
547
2010-05-03 14:48:44.343
Writing a file shredder in python or ruby?
In the effort to learn python and/or ruby, I was wondering how a file shredder would be implemented? I would like it to take in a file as an argument and then employ an algorithm to make that file unrecoverable. Would possibly add the support for multiple files or even whole directories later.
Since this is a learning exercise and not a professional attempt to secure data. How about this: 1. Discover the length of the file. 2. Write 0's to the same length of the file. 3. Save the file. 4. Delete the file. Then make another program that tries to recover the file. But yes, if looking to make something professi...
0.201295
false
1
548
2010-05-03 14:54:44.810
Regular expression that finds and replaces non-ascii characters with Python
I need to change some characters that are not ASCII to '_'. For example, Tannh‰user -> Tannh_user If I use regular expression with Python, how can I do this? Is there better way to do this not using RE?
I'd rather just call ord on every character in the string, 1 by 1. If ord([char]) >= 128 the character is not an ascii character and should be replaced.
0.116092
false
1
549
2010-05-03 16:41:14.363
How to maintain long-lived python projects w.r.t. dependencies and python versions?
short version: how can I get rid of the multiple-versions-of-python nightmare ? long version: over the years, I've used several versions of python, and what is worse, several extensions to python (e.g. pygame, pylab, wxPython...). Each time it was on a different setup, with different OSes, sometimes different architect...
install the python versions you need, better if from sources when you write a script, include the full python version into it (such as #!/usr/local/bin/python2.6) I can't see what could go wrong. If something does, it's probably macports fault anyway, not yours (one of the reasons I don't use macports anymore). I know...
0.050976
false
4
550
2010-05-03 16:41:14.363
How to maintain long-lived python projects w.r.t. dependencies and python versions?
short version: how can I get rid of the multiple-versions-of-python nightmare ? long version: over the years, I've used several versions of python, and what is worse, several extensions to python (e.g. pygame, pylab, wxPython...). Each time it was on a different setup, with different OSes, sometimes different architect...
What I usually do is trying to (progressively) keep up with the Python versions as they come along (and once all of the external dependencies have correct versions available). Most of the time the Python code itself can be transferred as-is with only minor needed modifications. My biggest Python project @ work (15.000+...
0.050976
false
4
550
2010-05-03 16:41:14.363
How to maintain long-lived python projects w.r.t. dependencies and python versions?
short version: how can I get rid of the multiple-versions-of-python nightmare ? long version: over the years, I've used several versions of python, and what is worse, several extensions to python (e.g. pygame, pylab, wxPython...). Each time it was on a different setup, with different OSes, sometimes different architect...
At least under Linux, multiple pythons can co-exist fairly happily. I use Python 2.6 on a CentOS system that needs Python 2.4 to be the default for various system things. I simply compiled and installed python 2.6 into a separate directory tree (and added the appropriate bin directory to my path) which was fairly painl...
0
false
4
550
2010-05-03 16:41:14.363
How to maintain long-lived python projects w.r.t. dependencies and python versions?
short version: how can I get rid of the multiple-versions-of-python nightmare ? long version: over the years, I've used several versions of python, and what is worse, several extensions to python (e.g. pygame, pylab, wxPython...). Each time it was on a different setup, with different OSes, sometimes different architect...
Some tips: on Mac OS X, use only the python installation in /Library/Frameworks/Python.framework. whenever you use numpy/scipy/matplotlib, install the enthought python distribution use virtualenv and virtualenvwrapper to keep those "system" installations pristine; ideally use one virtual environment per project, so ea...
1.2
true
4
550
2010-05-04 07:26:42.727
I am using Python on Windows. How do I delete my script after it is run?
I have written a Python script and compiled it into a MS Windows EXE file. I can modify the code, but how do I make it remove itself after running?
I think the easiest solution is make an external .bat file that executes your exe file and deletes it when finished.
1.2
true
1
551
2010-05-04 18:14:01.250
Lua parser in python
I'm looking into using Lua in a web project. I can't seem to find any way of directly parsing in pure python and running Lua code in Python. Does anyone know how to do this? Joe
@the_drow From Lua's web site: Lua is a fast language engine with small footprint that you can embed easily into your application. Lua has a simple and well documented API that allows strong integration with code written in other languages. It is easy to extend Lua with libraries written in other languages. It ...
0.135221
false
2
552
2010-05-04 18:14:01.250
Lua parser in python
I'm looking into using Lua in a web project. I can't seem to find any way of directly parsing in pure python and running Lua code in Python. Does anyone know how to do this? Joe
From your comments, it appears you a interested in a secure way of executing untrusted code. Redifining python builtins, as you suggested in a comment, is a horrible way to secure code. What you want is sandboxing, there are solutions for python, but I wouldn't recommend them. You would be much better of using Jython ...
0.265586
false
2
552
2010-05-06 01:41:56.053
Embed FCKeditor in python app
I have a python application which need a gui HTML editor, I know FCKeditor is nice, so how to embed the FCKeditor in a python desktop app?
To embed FCKeditor (or maybe better the current CKeditor?), you basically need to embed a full-fledged browser (with Javascript) -- I believe wxPython may currently be the best bet for that, as I hear it has wxIE for Windows and wxWebKitCtrl for the Mac (I don't know if old summer-of-code ideas about making something s...
1.2
true
2
553
2010-05-06 01:41:56.053
Embed FCKeditor in python app
I have a python application which need a gui HTML editor, I know FCKeditor is nice, so how to embed the FCKeditor in a python desktop app?
In order of difficulty: If you just need to support Windows, you can embed IE in wx - see the docs and demos. wxWebKit is looking a bit more mature, but it's still in development. You could just use the web-browser using webbrowser.open(url). Things will be very crude, and interaction will be a pain. A fourth option - ...
0
false
2
553
2010-05-06 10:43:07.383
why in python giving to str func a unicode string will throw an exception?
for example the following: str(u'לשום') will throw an error. how can i prevent these?
If you're running on Python 3, the u'' notation is a syntax error. Is this your problem? Because in Python <3, your code is absolutely correct, and since 'test' is plain ASCII there are no decoding issues.
0
false
2
554
2010-05-06 10:43:07.383
why in python giving to str func a unicode string will throw an exception?
for example the following: str(u'לשום') will throw an error. how can i prevent these?
Calling str() on a unicode is the same as calling .encode(sys.getdefaultencoding()) on it. If the unicode contains characters that can't be encoded in the default encoding then it will throw a UnicodeEncodeError. The fix is to explicitly encode the unicode in a useful encoding, such as 'utf-8'.
0.998178
false
2
554
2010-05-06 12:03:24.113
django authentication .htaccess static
In my app users can upload files for other users. To make the uploaded files accesible only for the addresse I need some kind of static files authentication system. My idea, is to create the apache hosted directory for each user and to limit access to this derectory using .htaccess. This means that each time new django...
Use python to rewrite the .htaccess automatically? Use a database with users and use a Apache sessions to authenticate?
0.081452
false
1
555
2010-05-07 22:05:37.713
python httplib httpexception error codes
Does httplib.HTTPException have error codes? If so how do I get at them from the exception instance? Any help is appreciated.
The httplib module doesn't use exceptions to convey HTTP responses, just genuine errors (invalid HTTP responses, broken headers, invalid status codes, prematurely broken connections, etc.) Most of the httplib.HTTPException subclasses just have an associated message string (stored in the args attribute), if even that. h...
1.2
true
1
556
2010-05-11 11:28:45.010
Can I get the raw SQL generated by a prepared statement in Python’s sqlite3 module?
If so, how can I do this?
When executing a prepared statement, no new SQL is generated. The idea of prepared statements is that the SQL query and its data are transmitted separately (that's why you don't have to escape any arguments) - the query is most likely only stored in an optimized form after preparing it.
0.386912
false
2
557
2010-05-11 11:28:45.010
Can I get the raw SQL generated by a prepared statement in Python’s sqlite3 module?
If so, how can I do this?
when you create a prepared statement, the "template" SQL code is sent to the DBMS already, which compiles it into an expression tree. When you pass the values, the corresponding library (python sqlite3 module in your case) doesn't merge the values into the statement. The DBMS does. If you still want to produce a normal...
1.2
true
2
557
2010-05-12 13:21:21.693
Eval IronPython Scripts during ASP.NET Web Request; Static Engine or Not
I would like to create an ASP.NET MVC web application which has extensible logic that does not require a re-build. I was thinking of creating a filter which had an instance of the IronPython engine. What I would like to know is: how much overhead is there in creating a new engine during each web request, and would it b...
I've just started using IronPython as extensibility point in my ASP.NET MVC aplication. I have one ipy engine (in static property) and for each request I create new scope and execute the script in that scope. Each scope should be independent on other scopes, no locking is needed. If I run into issues, I'll post it her...
1.2
true
1
558
2010-05-13 07:38:13.833
catch output from linux telnet to a python script
My problem is that i want to do something like this in linux console telnet 192.168.255.28 > process.py i.e i would like to do some transformation with console telnet output using python script. I'm see Popen in python for this case, but i can't understand how can i get input from telnet if it do not stop all time.. P...
As xitrium mentioned, it would be better if you used telnetlib. You can dispense with the whole mess of shell redirection etc. If you do something like telnet foo | process.py, you can read your programs stdin (sys.stdin) to get the output of the telnet program. When you're happy, you can exit and terminate the pipelin...
0.135221
false
1
559
2010-05-14 05:45:48.500
how to increase Speed of a component made from Javascript or JQuery?
I want to make my component faster, I am using Javascript and JQuery to build that. I am using JSON object to communicate with component and back-end is python. Is there any suggestion to make component faster?
If speed is the issue, and you by profiling discover that js is the culprit, then I would look into replacing the jQuery with vanilla javascript, or a more optimized library. As jQuery tries to do 'everything' and trains its users into wrapping everything in $(), its bound to introduce unnecessary method calls (I've se...
0
false
2
560
2010-05-14 05:45:48.500
how to increase Speed of a component made from Javascript or JQuery?
I want to make my component faster, I am using Javascript and JQuery to build that. I am using JSON object to communicate with component and back-end is python. Is there any suggestion to make component faster?
Setup some analysis to see what takes time to process. Then decide if you want to try to optimize the javascript and client code, the communication up/down with the server or the actual speed of the python execution. When you have decided what you want to make faster, you can post samples of that to this site and peopl...
1.2
true
2
560
2010-05-14 10:10:37.250
Data munging and data import scripting
I need to write some scripts to carry out some tasks on my server (running Ubuntu server 8.04 TLS). The tasks are to be run periodically, so I will be running the scripts as cron jobs. I have divided the tasks into "group A" and "group B" - because (in my mind at least), they are a bit different. Task Group A import d...
import data from a file and possibly reformat it Python excels at this. Be sure to read up on the csv module so you don't waste time inventing it yourself. For binary data, you may have to use the struct module. [If you wrote the C++ program that produces the binary data, consider rewriting that program to stop us...
1.2
true
1
561
2010-05-15 16:54:55.100
If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this summer?
I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C giv...
Sure Objective-C is quite easier to learn if you know C and quite a few books on Objective-C even asume you know C. Also consider learning a bit about MacRuby for GUI development ;)
0.081452
false
4
562
2010-05-15 16:54:55.100
If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this summer?
I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C giv...
Yes. Learn how to program in C.
0
false
4
562
2010-05-15 16:54:55.100
If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this summer?
I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C giv...
Learning C will definitely be of help, as Objective C inherits its many properties and adds to it. You could learn Objective C either from 'Learn Objective C on the Mac', this one's really a great book, and then if you plan to learn cocoa, get 'Learn Cocoa on the Mac' or the one by James Davidson, they should give you ...
0
false
4
562
2010-05-15 16:54:55.100
If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this summer?
I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C giv...
It's frequently helpful to learn programming languages in the order they were created. The folks that wrote Objective-C clearly had C and its syntax, peculiarities, and features in mind when they defined the language. It can't hurt you to learn C now. You may have some insight into why Objective-C is structured the ...
0.3154
false
4
562