I am trying to do a chunked response (of large files) in libevent this way::
evhttp_send_reply_start(request, HTTP_OK, "OK");
int fd = open("filename", O_RDONLY);
size_t fileSize = <get_file_size>;
struct evbuffer *databuff = NULL;
for (off_t offset = ...
|
I'm trying to make a RLE (Run-Length Encoder) Programme just for characters.
I read the way it works on notes on net.
And I tried to fix my code! Regardless I think that ... |
I am trying to encode a string in hex8 using c. The script I have right now is:
int hex8 (char str) {
str = printf("%x", str);
if(strlen(str) == 1) {
... |
I am attempting to encode video using libavcodec/libavformat. Audio works great, but when I try to encode video I get the following errors:
[libx264 @ 0x10182a000]broken ffmpeg default settings detected
[libx264 ...
|
I am attempting to encode video using libavcodec/libavformat. I'm trying to change the standard output-example.c from ffmpeg source. The AVI file is created on the disk, but the only sound is ... |
Is there a simple way to do URL encode in C? I'm using libcurl but I haven't found a method. Specifically, I need to do percent escapes.
|
The w3.org (RFC2616) seems not to define a maximum size for chunks. But without a maximum chunk-size there is no space for the chunk-extension. There must be a maximum ... |
|
Can any one please provide me with good resource information about where and how I can understand the encoding of the "Address field" (in an HDLC frame) into Octets, using the ... |
How can I post ranges of data obtained from URL, not from file? Say I need to read 150-250000 bytes from http://localhost/video.mp4 (A) and POST this data to |
No that is what you want to use the run length encoding algorithm for; not what the algorithm actually does. donbock is asking if you have any knowledge of what the run length encoding algorithm does because knowing what it does is certainly a precursor to knowing how to implement it. If you don't know what it does, i.e. you are ... |
|
|
Alexander Adam Hi, I am a bit list in encoding related stuff. Let me explain what I am doing (yes it's C++ :)): I am getting some input content due Expat Xml Parser. I've setup Expat to use wchar_t. First question is this -- what is the difference of unsigned short, wchar_t and char? Okay, wchar_t is an built-in type of ... |
P: n/a hsmit.home@gmail.com Hi everyone, I'm having some difficulty with the following piece of code. I have stripped it to it's bare minimum to demonstrate the problem at hand. Compiler: MS Visual C++ 2005 Express Edition (similar problem arises with 2008) Runtime Library: All multi-threaded variants have been seen to fail [DLL/Static] | [Debug|Release] Purpose: define a user defined stream buffer ... |
|
* ?????: I deal with some text and the result is "......" (these words are chinese) how to distinguish what is the encoding style of the text? Could some give some experence? It's a very small sample you've given, but it looks like numeric HTML character entities. In that case it's Unicode specified in decimal. Anyway, it has nothing to do ... |
|
Hi I'm pretty new to programming and I need some help getting this code to work. Its supposed to offer the user a choice to either encode letters or decode them. Their supposed to enter 1 to encode, where they enter a number of random letters "khgdhf" and the result will be "1k2h1g1d1f" or 2 to decode where they enter the ... |
|
Run length encoding is a compression technique that takes advantage of repeated consecutive digits. Encoding involves putting a character followed by count. Example input: 123334455555AAA Output for above input: 1\12\13\34\25\5A\3 (1 is appearing once, 2 is appearing twice,k 3 is appearing 3 times, 4 is appearing twice, 5 is appearing 5 times, A is appearing 3 times. \ represents the ESCAPE ... |
|
If you haven't redone your algorithm yet, here's my version Restate the encoding process: Take any lower case letter ASCII value and add the key value. Modulo the sum of that to get a range of 0 to 95 inclusive. Now add 32 to the modulus result to get range of 32 to 127 using any key that is any positive ... |
Actually the procedures are: 1. Convert each character, including blank space, to its ASCII equivalent 2. Generate a positive random integer. Add this integer to the ASCII equivalent of each character. The same random integer will be used for the entire line of text. 3 Suppose that N1 represents the lowest permissible value in the ASCII code, and N2 represents the ... |
|
If I first might make a suggestion, The Compression Book by Mark Nelson and Jean-Loup Gailly is a book I've been looking at lately, and it does have source for pretty much everything. I'm going to umm, paraphrase their code now, basically an ineffecient version. First, a note on how character frequency is stored, Huffman Encoding does not need the ranking ... |
I have a question about C and mysql. I have a C program that connect to a mysql DB. One of the tables has a cp1251-encoded Cyrillic column and when I read it with C I get ???? ?? ??? So is there a way to specify the cp1251 encoding to the query (just as it is done in php) in ... |
I used the following code and it worked Code: #include void Ceasar_enc(char text[],int key) { char *p=text; long int temp; while(*p) { /* 127 - 32= 96 ascii values plus 32 to start from 32 not from 0 and end to ascii char 127 not 96 */ temp=(*p+key - 32)%96+32; *p++=(char)temp; } } void Ceasar_dec(char text[],int key) { char *p=text; ... |
Hey ya The way I understand Genetic Algorithms, when you create a random solution to the problem you have to encode it first. So if your solution is 2 + 2 + 4 you have to encode it to say binary wich will give you 0010 1111 0010 1111 0100 Now when you have to get a Fitness of that chromo ... |
conn = mysql_init(NULL); /* Connect to database */ if (!mysql_real_connect(conn, server, user, password, database, 0, NULL, 0)) { fprintf(stderr, "%s\n", mysql_error(conn)); // exit(1); } // razdeliane na ziavkata na chasti za da moga da sloja v neia promenliva sprintf(query1, "SELECT f.Tmin, Tmax, f.Phen, b.sin_kod, b.namen, LEFT(f.timea, 10), SUBSTRING(f.timea, 12, 2), s.sin_name " "FROM fcs f, bgc b, sinoptic s " "WHERE ... |
#include FILE *csis *fp; void getCode(char code[53]); int getMessage(int msg[]); void sortMessage(int msg[], int msgSize); void decodeMessage(char code[53], int msg[], int msgSize); void main(void){ int i; char code; //Calls methods getCode(char code[53]); getMessage(int msg[]); sortMessage(int msg[], int msgSize); decodeMessage(char code[53], int msg[], int msgSize); return 0; //....... calls the four methods }//end main void getCode(char code[53]) { fopen_s(&fp, "codefile.txt", "r"); ... |
Of course, you must call fopen before you will get any file contents (then fclose the file). What's a question... It does not matter where these calls placed: in the main routine or in a special function or what else... It seems you have another problem. There are lots of methods to encode or to decode cipher text (or binary data). ... |
Hey everyone. Been doing C for a little while now and this website has helped me in advancing my knowledge and skills in C programming. I have another question now... it's really bugging me actually... I'm trying to make a program basically just encode and decode. It seems too simple for me not to understand but... I'm teaching myself so that's ... |
Homework and Gimmecode in the same question... Well... - Get familiar on how should you open and work with files... - Once you've learnt how to open files, read the content. - You will need to use a bucle, an interator (the one that a 2 modulus operation will tell you if it is even or odd). ... |
|
|