Search Results

Search found 18 results on 1 pages for 'boda cydo'.

Page 1/1 | 1 

  • How to determine if the variable is a function in Python?

    - by bodacydo
    Since functions are values in Python, how do I determine if the variable is a function? For example: boda = len # boda is the length function now if ?is_var_function(boda)?: print "Boda is a function!" else: print "Boda is not a function!" Here hypothetical ?is_var_function(x)? should return true if x is a callable function, and false if it is not. Please advise! Thanks, Boda Cydo.

    Read the article

  • Which Debian to choose?

    - by Boda Cydo
    I just bought my first home server, and I want to install Debian Linux! Can anyone recommend me which one to use? I have read that there are 3 types, one for testing, one stable and then another one. But I don't know much more about it. Can you please advise me? Thanks, Boda Cydo.

    Read the article

  • Where to find URLs for sources.list for debian for running apt-get update?

    - by Boda Cydo
    Can anyone tell me where to find URLs to put in /etc/apt/sources.list for debian so that I could run apt-get update? I couldn't find the precise answer by searching Google. When I currently try running apt-get update I get: W: Failed to fetch ftp://ftp.debian.org/debian/dists/lenny/contrib/binary-i386/Packages Unable to fetch file, server said 'Failed to open file. ' [IP: 130.89.148.12 21] W: Failed to fetch ftp://ftp.debian.org/debian/dists/lenny/non-free/binary-i386/Packages Unable to fetch file, server said 'Failed to open file. ' [IP: 130.89.148.12 21] I have no idea how to solve this. Here is how my current sources.list looks like: deb ftp://ftp.debian.org/debian lenny main contrib non-free deb-src ftp://ftp.debian.org/debian lenny main contrib non-free deb ftp://ftp.debian.org/debian lenny/updates main contrib non-free deb-src ftp://ftp.debian.org/debian lenny/updates main contrib non-free I'm running debian_version 5.0.8: # cat /etc/debian_version 5.0.8 Thanks!

    Read the article

  • What exactly is NoSQL?

    - by bodacydo
    What exactly is NoSQL? Is it database systems that only work with {key:value} pairs? As far as I know MemCache is one of such database systems, am I right? What other popular NoSQL databases are there and where exactly are they useful? Thanks, Boda Cydo.

    Read the article

  • When to use weak references in Python?

    - by bodacydo
    Can anyone explain usage of weak references? The documentation doesn't explain it precisely, it just says that the GC can destroy the object linked to via a weak reference at any time. Then what's the point of having an object that can disappear at any time? What if I need to use it right after it disappeared? Can you please explain them with some good examples? Thanks, Boda Cydo.

    Read the article

  • Should I worry about circular references in Python?

    - by bodacydo
    Suppose I have code that maintains parent/children structure. In such a structure I get circular references, where child points to parent and parent points to child. Should I worry about them? I'm using Python 2.5. I am concerned that they will not be garbage collected and the application will eventually consume all memory. Thanks, Boda Cydo.

    Read the article

  • Can a database table be without a primary key?

    - by bodacydo
    Can anyone help me understand if a table in a relational database (such as MySQL) can be without a primary key? For example, I could have table day_temperature, where I register temperature and time. I don't see the reason to have a primary key for such a table. Thoughts? Thanks, Boda Cydo.

    Read the article

  • How to avoid a:hover to act on img in CSS?

    - by bodacydo
    Suppose I have the following selector: a { padding: 1em; } a:hover { backgrond-color: #FF0000; } And suppose I have the following HTML code: <a href="http://stackoverflow.com"><img src="so.jpg"></a> What happens is that <img> gets red-background color on mouse hover. Any ideas how to fix it? Thanks, Boda Cydo!

    Read the article

  • When to use Python special methods?

    - by bodacydo
    I know that classes can implement various special methods, such as __iter__, __setitem__, __len__, __setattr__, and many others. But when should I use them? Can anyone describe typical scenarios when I would want to implement them and they would simplify programming in Python? Thanks, Boda Cydo.

    Read the article

  • How to write the Visitor Pattern for Abstract Syntax Tree in Python?

    - by bodacydo
    My collegue suggested me to write a visitor pattern to navigate the AST. Can anyone tell me more how would I start writing it? As far as I understand, each Node in AST would have visit() method (?) that would somehow get called (from where?). That about concludes my understanding. To simplify everything, suppose I have nodes Root, Expression, Number, Op and the tree looks like this: Root | Op(+) / \ / \ Number(5) \ Op(*) / \ / \ / \ Number(2) Number(444) Can anyone think of how the visitor pattern would visit this tree to produce output: 5 + 2 * 444 Thanks, Boda Cydo.

    Read the article

  • How to Pythonically yield all values from a list?

    - by bodacydo
    Suppose I have a list that I wish not to return but to yield values from. What is the most Pythonic way to do that? Here is what I mean. Thanks to some non-lazy computation I have computed the list ['a', 'b', 'c', 'd'], but my code through the project uses lazy computation, so I'd like to yield values from my function instead of returning the whole list. I currently wrote it as following: List = ['a', 'b', 'c', 'd'] for item in List: yield item But this doesn't feel Pythonic to me. Looking forward to some suggestions, thanks. Boda Cydo.

    Read the article

  • In Perl, given two IO::Socket's how do I connect 1st socket's input to 2nd's output and vice versa?

    - by bodacydo
    Suppose I have made two connections in Perl with the help of IO::Socket. The first has socket $s1 and the second has socket $s2. Any ideas how can I connect them together so that whatever gets received from $s1 got sent to $s2 and whatever gets received from $s2 got sent to $s1? I can't understand how to do it. I don't know how to connect them together. I would expect to do something like $s1->stdin = $s2->stdout and $s2->stdin = $s1->stdout, but there are no such constructs in Perl. Please help me! Thanks, Boda Cydo.

    Read the article

1