User Profile

Collapse

Profile Sidebar

Collapse
Andr3w
Andr3w
Last Activity: Apr 7 '11, 08:28 PM
Joined: Nov 6 '07
Location: Greece
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Andr3w
    replied to Python XML-RPC localhost problem
    Hey mate,

    I am 99 % sure that's not a python related issue...most likely the server goes and binds in 127.0.0.1...whi ch on most (if not all) systems is defined as a local only and loop-back interface so you can't access it outside the machine you are running the server, so the connection refused error is quite normal. There is of course a chance that you have a multi-homed host with bridged interfaces, so even if you bind using 'local-host'...
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to TRUE/FALSE values: Point / Counterpoint
    in C
    weeee thanks for pointing it out...stupid typos are a common mistake...for all programmers...

    Anyway I'll be more careful next time...to avoid typos

    be safe
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to TRUE/FALSE values: Point / Counterpoint
    in C
    Well, I am careful with my code in order to get it working and bug free. I have a coding style and you have yours. It's a matter of preference and I know this behavior is present if I set the values that way...

    Anyway really I don't think there is a point continuing this really as there is no argument to begin with, or at least I think so
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Wierd Visual Studio Problem
    in C
    Well, in any case whatever differences we have in our coding style in this post we are not here to debate on how we write code :P at least I think that...
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Wierd Visual Studio Problem
    in C
    Well, in unix systems true is supposed to be 0 (if a thread is successful it returns 0) and most main function do so. Also most ANSI C functions return 0 when they succeed and a non-zero value if they don't or want to indicate a status (like strlen) Please try to compile the program and see what I am saying by uncommenting the +1 offset that I have in line 122.

    Now for the pragma in newer versions of visual studio microsoft has new more...
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Wierd Visual Studio Problem
    in C
    Hey guys,

    First of all the weakness of cats, if you run the code in a example and try to free it the way the code is posted the program just hangs, while being responsive (i mean the console cursor is flashing) no crashes occur and no exception either. If you are in debugger more in VS you have to either press Cntl + F5 to exit the program or press X to close it while in release build you have to press X to exit it.

    If...
    See more | Go to post

    Leave a comment:


  • Hey mate,

    You can check also this link http://en.wikipedia.org/wiki/Hexadecimal which besides historical information gives you information on how to convert hex values to other systems ( not only decimal ) and the opposite.

    Hope this helps
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Check string for blank spaces
    in C
    Hey I can't seem to find a button to edit my previous post so I'll post a new one. If you don't want to take in account the length of the data type you want to check and the sign of the number ( only in case of positive sign ) you can use also the following code to check for your number

    Code:
    char buff[] = "15.000";
    float p;
    
    if ( sscanf( buff, "%f", &p ) <= 0 ) )
    {
      //
    ...
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Wierd Visual Studio Problem
    in C
    Technically speaking yea I agree, but in this case he created a one-dimensional array of string pointers that point to the actual string. That's why he also had a problem during free because it didn't find where to end deallocation and caused the function to lock ;)
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Check string for blank spaces
    in C
    Hey mate,

    All these that you ask I think you could possibly solve them if you saw the source code of a int to char manipulation function like atoi to toupper and so on.

    Now for your first question, in the ASCII table 0x20 (30 in decimal number system) is the white space (also known as spacebar :D) character so you could recursively (or not? depends on you) the string and check with a counter how many white spaces...
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to socket programming
    in C
    Please can you post your code so we can see what's the problem and help you if possible?

    Thanks!
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Wierd Visual Studio Problem
    in C
    Hey m8,

    Well as it seems maybe linux has a better memory management (and smarter) but it's kinda off the standard to perform such actions. Your code is correct and absolutely right but with one exception, the size needed for allocation of the string.

    Picture this:

    Code:
    char *str = "aaaa";
    
    printf("%d", strlen(str));
    The code above would return...
    See more | Go to post

    Leave a comment:


  • Andr3w
    started a topic Avoid duplicates at the end of the file during read
    in C

    Avoid duplicates at the end of the file during read

    Hi,

    I was working on something when I noticed that the following code produced a duplicate char before reaching at the end of the file if it had a blank line (with no chars at the file) before the end of the file and without it, it would run file.

    [code=c]
    int ReadFromFile(in t argc, char **argv)
    {
    // our file pointer, initialized at NULL
    FILE *fStream = NULL;

    char buf[10];...
    See more | Go to post

  • Andr3w
    replied to Basic Array Problem
    in C
    Because when you have something more convinient to use..unless you are instructed to make your life harder (i.e. your teacher or boss wants you to do it that way) you use it....
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Read from text file1
    in C
    That's the simplest solution you could give, another one (not so common) would be to have a counter and search for 3 /n; when the counter is at 3 start reading...
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to char* and char[]?
    in C
    Well, for the last used declariation with the zero you initialize the variable to be like this:

    [code=c]
    int index[1][10] = { 0 };
    [/code]

    Also you don't need a "duo" of curly brackets for that like you used... Anyway I think that weaknessforcats meant the following use:

    [code=c]
    #include <stdio.h>

    int Size(int index[][3]);
    int main(int argc, char...
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Why Java codes take more run time than C/C++ ?
    in C
    Well, languages that use interpreters tend to be slower than languages that use compilers....
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Contiguous Memory allocation
    in C
    I see, but as I said I think it's a general topic in all languages and applications of computers. That's why I said too see the general basic-low level information that are mentioned in that lecture notes. Anyway, good point ;). Sorry sicarie I'll be carefull next time ;)
    See more | Go to post

    Leave a comment:


  • Andr3w
    replied to Contiguous Memory allocation
    in C
    it has a section in the start that says all about contiguous memory allocation, though ;)
    See more | Go to post
    Last edited by sicarie; Jan 2 '08, 03:34 PM. Reason: You forgot the last half of 'though'. (Complete English, please ;)

    Leave a comment:


  • Andr3w
    replied to perfect square root
    in C
    Well, there is another way to do that. You could use modf and break the fraction in 2 pieces, thus saving a multiplication. Now in order to get the perfect square you could just check if the decimal part was equal to zero. The following code shows that

    [code=cpp]
    ...deleted...
    [/code]

    Hope this helped ;)
    See more | Go to post
    Last edited by RedSon; Jan 9 '08, 10:04 PM. Reason: NO!

    Leave a comment:

No activity results to display
Show More
Working...