Search:

Type: Posts; User: Can+~; Keyword(s):

Page 1 of 10 1 2 3 4

Search: Search took 0.17 seconds.

  1. Replies
    151
    Views
    9,843

    Re: Is Python really better than Perl?

    Well, close this thread, the power of bacon has been summoned, and we cannot discuss this further.

    Unless...

    http://bacolicio.us/http://www.python.org
  2. Replies
    2
    Views
    1,840

    Re: Problem with pyserial...

    I haven't used the pyserial library, nor I have experience on this subject, but let's see anyway.

    I would think that the buffer does get flushed, but it's still storing while on hold, and the next...
  3. Replies
    5
    Views
    427

    Re: localhost php not working

    Have you installed apache2 and libapache2-mod-php?

    Did you put your files inside /var/www?

    Did you check if the server is up (sudo service apache2 start)?

    Does apache2 have read access to...
  4. Re: [Python] Please Help me with my Script! [Objects and Loops]

    Here:


    rooms = [Room() for x in xrange(n_rooms)]

    This is a list comprehension, which goes like:


    rooms = [Action for Iterator in Iterable]
  5. Replies
    14
    Views
    11,226

    Re: #define a long long in C

    Yes, constants do have a type (i.e 20LLU). Constant definitions (i.e #define X 20) don't, as they haven't yet interpreted by the compiler itself, just the preprocessor.

    But I understand the...
  6. Replies
    14
    Views
    11,226

    Re: #define a long long in C

    Macros and constant definitions don't really have a type, they're replaced directly on the code on the preprocessing stage, for example:

    original code.c:

    #define X 1234
    #define MACRO(Y) Y+2...
  7. Thread: bash to python

    by Can+~
    Replies
    1
    Views
    304

    Re: bash to python

    Easy path:


    filename = raw_input("Name of the file:")
    permissions = raw_input("Octal Permissions:")

    The other way, would be to split, working on all this different inputs:


    "Name of the...
  8. Replies
    2
    Views
    301

    [SOLVED] Re: Python programming question

    I would first lower my expectations, if you don't know the basics of python, working with a client/server application, even with django, will be a daunting task.



    There's a better question to...
  9. Replies
    10
    Views
    4,584

    [SOLVED] Re: Run python function each minute

    f = urllib.urlopen("http://"+hosts).read()

    Do you close that file-like object, somewhere? I don't know if this is the responsible for the memory consumption, but you should consider it,...
  10. Replies
    3
    Views
    328

    [SOLVED] Re: Algorithm to determine -1, 0 or +1

    x/abs(x) when x != 0.

    For vectors, this is called normalization. Your problem is just a one-dimensional vector.
  11. Replies
    9
    Views
    464

    Re: Linked list problem

    You stopped at the first iteration and called it wrong. See for yourself:



    F -> A -> B -> C -> D; A > F? No, swap them
    ^
    A -> F -> B -> C -> D; B > F? No, swap them
    ^
    A -> B...
  12. Replies
    3
    Views
    1,527

    Re: Game programming in Processing

    Never heard about "Processing".

    But go ahead, try it, you can only gain experience from this, even if you fail.
  13. Replies
    3
    Views
    979

    [SOLVED] Re: Python - Splitting up strings

    Also, tuples can be split in the arguments of a function, for instance:


    mytuple = (9, 2)

    # Function that multiplies two arguments
    def multiply(first, second):

    return first*second
  14. Thread: C pointers

    by Can+~
    Replies
    8
    Views
    499

    Re: C pointers

    Instead of:


    char *pj = "$abc$";

    Do:


    char pj[] = "$abc$";
  15. Replies
    5
    Views
    468

    Re: I need help with a simple python script

    I just wrote this from the top of my head.


    filestate = open("/proc/acpi/battery/BAT1/state")

    for line in filestate:
    if line.startswith("charging state:"):

    if...
  16. Re: Looking for users, developers, and evangelists.

    So you're building a flock clone?
  17. Replies
    6
    Views
    470

    [SOLVED] Re: PHP Pregmatch???????? I just don't get it!

    Read about: Regular expressions.
  18. Replies
    4
    Views
    752

    Re: C coding problem.

    Either the istring is not long enough, or hSort_file is pointing to a wrong direction (or nonexistant).

    And the later, could be a result that a previous instrunction overwrote the hSort_file...
  19. Replies
    2
    Views
    556

    Re: Python example not making sense

    The "else" statement has a different effect depending if it's paired with an "if" or a "for" statement.


    for iteration in iterable:
    # Normal iteration
    else:
    # If a loop ends...
  20. Replies
    7
    Views
    435

    Re: Pseudocode problems

    Again, there's no pseudocode standard, you can make any assumption, make anything you want, as long as you're consistent.

    For instance, you could go like:


    procedure check(x:contact, L1:list,...
  21. Replies
    8
    Views
    570

    Re: How to insert data

    That SQL string should be marked as such, aka:


    int val = st.executeUpdate("INSERT into mysql.Profile VALUES(" + 101 + "," + "'Shahzad'" + ")");

    Btw, if all values are constant, then you can...
  22. Re: [C++] Questions about writing shared libraries.

    In short:

    1. The library is loaded into memory the first time is needed, subsequent requests will be redirected to the said memory page(s).

    2. Shared libraries don't store anything. In fact, no...
  23. Replies
    12
    Views
    2,493

    [SOLVED] Re: Pythons cluttergst module

    Well, you actually got a very helpful tip there:



    You lack automake, and I think automake comes with the basic build-essential package. Do you have build-essential installed? If not, click on...
  24. Replies
    31
    Views
    1,514

    Re: In Python, what does "x = 5" really do/mean?

    Another thing:

    Python has functions as first-class citizens, therefore, you can avoid wrapping the "incAfter" with "iA", just by declaring the shorthand methods in the __init__


    class...
  25. Replies
    34
    Views
    2,098

    Re: Simple Java vs Python question...I think

    I was quoting OP's code.
Results 1 to 25 of 250
Page 1 of 10 1 2 3 4