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.
User Profile
Collapse
-
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.
/*************** *************** *************** */... -
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
-
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... -
-
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...Leave a comment:
-
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... -
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...Leave a comment:
-
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.
...Leave a comment:
-
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 -
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?...Leave a comment:
-
-
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
This for loop will never end as x1 is unsigned and it wont be less than 0.Code:unsigned int x1; for(x1 = 10; x1>=0; x1--){ printf("\nx1 = %d : ",x1); }
m I going right way ?
Thank you,...Leave a comment:
-
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"); -
I am sorry...... I forgot to mention........ ..
I am using python 2.5 on my windows XP.......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
No activity results to display
Show More
Leave a comment: