User Profile

Collapse

Profile Sidebar

Collapse
patelss23
patelss23
Last Activity: Oct 30 '09, 08:35 PM
Joined: Jul 27 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • patelss23
    replied to segmentation fault while using ctypes
    hi Banfa,

    Yeah I have declared all variables correctly in the function body, just didn't mention here. fp_feed_short is an API call to some library which returns me 1 to stop. and hash_calculate is doing some (customized) kind hasing on a file.
    See more | Go to post

    Leave a comment:


  • patelss23
    started a topic segmentation fault while using ctypes

    segmentation fault while using ctypes

    Hello All,

    I am dealing with this weird bug.
    I have a function in C and I have written python bindings for it using
    ctypes.

    I can call this function for couple of times and then suddenly it
    gives me seg fault.
    But I can call same function from a C code for any number of times.

    I cannot get what's going on.

    here is my code.

    /*************** *************** *************** */...
    See more | Go to post

  • how to convert pymedia.audio.acodec ACString to ctypes.c_char_p

    Hello All Experts,

    I am quite new to Ctypes. I am using one c library and writing python
    bindings for it.
    I need to pass a character pointer to one function.

    I am reading one mp3 file and decoding it to raw pcm using pymedia.
    Now I need to pass this raw data in to a
    C function. Here is my code.

    Code:
    # /*********
    from ctypes import *
    import pymedia.audio.acodec as codec
    ...
    See more | Go to post
    Last edited by bvdet; Dec 20 '08, 12:13 AM. Reason: Add code tags

  • SimpleJson is slow .... is there any C Compiled version ?

    Hello All,

    I have created an API which fetches some data from the database.
    I am using simplejson to encode it and return it back.

    Now the problem is that, this API is being called for millions of
    times in a sequence.
    I ran a profiler and saw that most of the time is consumed in encoding
    my database results in to json.
    So I was just wondering is there any C compiled version of simplejson...
    See more | Go to post

  • patelss23
    replied to Does None reserve any space in memory?
    Thanks elcron,
    I will try that....
    See more | Go to post

    Leave a comment:


  • patelss23
    replied to Does None reserve any space in memory?
    Hello jlm699,
    Thanks for your reply.

    Using dictionary for search would be faster thats why I want to use dictionary instead of list. I only want to know if the integer is in List( or in map) or not?

    Thanks,
    Sanket...
    See more | Go to post

    Leave a comment:


  • patelss23
    started a topic Does None reserve any space in memory?

    Does None reserve any space in memory?

    Hello All,

    I have a list containing around a million integers.
    And I have to search this list for several million times. This really slow downs my
    program. I was thinking to convert this list to a dictionary.

    I will keep all integers as a key and None as their values.

    But I think it is going to need double amount of memory than list.
    So what I really don't know is that if None requires...
    See more | Go to post

  • patelss23
    replied to regarding storage classes in C
    in C
    Yes .. There are some .....
    For example, there are two programs which are using the same resource, it could be a file, some shared area of memory or anything. But What I am not getting is ..... why do we need to keep it volatile ? I havent seen this keyword in any code I have come across. Does this have some relation to access protection mechanism of Operating System ? I am not getting any concrete solution to this.

    Thank...
    See more | Go to post

    Leave a comment:


  • patelss23
    replied to regarding storage classes in C
    in C
    Hello sicarie,

    This is not a homework question. Actually I am done with my graduation already. And I have also got some field experience too. I have started revising C so I can look at things from different perspective.

    I read that by keeping your variable volatile any other process can change it. But I haven't come across such situation. So I was wondering where and how such storage specifiers are used.

    ...
    See more | Go to post

    Leave a comment:


  • patelss23
    started a topic regarding storage classes in C
    in C

    regarding storage classes in C

    Hello All,
    how are you?

    Can you please make me aware of storage specifiers like volatile, extern, and register ? I know the in what situations they can be used. But till this date I haven't seen any practical example using volatile or register.

    can you please let me know ?

    Thank you in advance,
    Sanket
    See more | Go to post

  • I found one library called ftblib. It did my work. It has got one functions which checks whether the remote file is newer than the local copy or not?...
    See more | Go to post

    Leave a comment:


  • patelss23
    replied to Unsigned Integer mystery
    in C
    Thank you so much for clearing my concepts....
    See more | Go to post

    Leave a comment:


  • patelss23
    replied to Unsigned Integer mystery
    in C
    Thank you Ganon11.

    I got the point. That means When we compare them or use them in any expression, it will be treated as unsigned. as an example

    Code:
    unsigned int x1;
    for(x1 = 10; x1>=0; x1--){
    		printf("\nx1 = %d  : ",x1);
    	}
    This for loop will never end as x1 is unsigned and it wont be less than 0.
    m I going right way ?

    Thank you,...
    See more | Go to post

    Leave a comment:


  • patelss23
    started a topic Unsigned Integer mystery
    in C

    Unsigned Integer mystery

    Hello all,
    how are you?

    let me put a code snippet here. I used microsoft vc++ 6.0 on my windows xp machine.

    /*************** *************** ****
    Code:
    unsigned int x1 = 10;
    unsigned int y1 = 20;
    
    printf("\n (x1-y1) = %d",(x1-y1));  //prints -10
    
    if((x1-y1) < 0)
      printf("\n(x1 - y1) < 0");
    else
     printf("\n(x1 - y1) > 0");
    ...
    See more | Go to post

  • I am sorry...... I forgot to mention........ ..
    I am using python 2.5 on my windows XP.......
    See more | Go to post

    Leave a comment:


  • How to download latest file based on timestamp through FTP

    Hello All,

    I want to download latest file based on its timestamp from one FTP server.
    So can you please tell me is there any way to find the timestamp of files
    weather they are on local machine or remote server ?

    I appreciate your help.

    Regards,
    sanket
    See more | Go to post
No activity results to display
Show More
Working...