Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~10.8K People Reached
Favorite Tags
c++ x 66
c x 7
php x 1
Member Avatar for AutoC

Hi, I have data coming over a socket that looks like this [code] (h)(int,char,float,int,char)(/h)(d)(2,a,1.32,45,d)(3,d,3.45,32,a)(/d) [/code] the datatype of the data arriving is dynamic and is only known when the header is received.I then have to create corresponding vectors(stl) to store the data. In this case, 2 int,2 char and one …

Member Avatar for Ancient Dragon
0
83
Member Avatar for AutoC

Hi, Here's my scenario. I am given records and the datastructure of each column in the records at runtime. A sample looks like this, [code] char[] | int16 | int32 | double abcd | 2 | 96 | 1024 ghi | 3 | 104 | 2048 [/code] I cannot predefine …

Member Avatar for embooglement
0
111
Member Avatar for AutoC

Hi, I have a string that looks like this \\x\\y\\z-Select * from x where y=z I need to split this at the '-' into two strings. When I use substr as, [code] string s = "\\x\\y\\z-Select * from x where y=z"; size_t p = s.find("-"); if(p!=string::npos) string query = s.substr(p+1); …

Member Avatar for AutoC
0
247
Member Avatar for AutoC

Hi, I have a struct that looks like this [code] struct Info { char **field_names; double **data; int *cindex; } [/code] I have to serialize an object of this struct and send it over a socket and deserialize at the other end. What is the best option for this?

Member Avatar for Ancient Dragon
0
108
Member Avatar for AutoC

Hi, I have a situation I need help with. I have c++ s/w from two vendors each of whom have given me a library and a header. Only problem is that one of them is compiled with vc++ and the other with g++.I cant use them both in the same …

Member Avatar for Stefano Mtangoo
0
208
Member Avatar for AutoC

Hi. I have a character array of the form "0abcdef" or "1defghi". I have to remove the first character and convert the rest to a string. So in this case, the strings would be abcdef and defghi. I know that saying string s(char array) does a direct conversion but I …

Member Avatar for AutoC
0
134
Member Avatar for AutoC

I'm getting this error at the end of my program... [code] *** glibc detected *** ./a.out: free(): invalid pointer: 0x00617ca0 *** ======= Backtrace: ========= /lib/libc.so.6[0x684ac1] /lib/libc.so.6(cfree+0x90)[0x6880f0] /usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xc986f1] ./a.out[0x804ce2f] ./a.out[0x804973d] /lib/libc.so.6(__libc_start_main+0xe0)[0x631390] ./a.out(__gxx_personality_v0+0x7d)[0x8048de1] ======= Memory map: ======== 00110000-00111000 r-xp 00110000 00:00 0 [vdso] 005fc000-00617000 r-xp 00000000 08:01 687043 /lib/ld-2.7.so 00617000-00618000 r-xp 0001a000 …

Member Avatar for vikashkumar051
0
812
Member Avatar for AutoC

Hi, I'm not clear as to when memory is allocated from the stack, free store or data area.Can someone please elaborate?

Member Avatar for chunalt787
0
99
Member Avatar for AutoC

Hi, I need an array of approx. 2,00,000 elements.But malloc fails to allocate beyond 65872. When I give (short int*)malloc(sizeof(short int)*65000); It works but seg faults when I give (short int*)malloc(sizeof(short int)*66000); whatsup with that?

Member Avatar for Salem
0
159
Member Avatar for AutoC

Hi, Here's my code [code] #include<iostream> #include<fstream> #include<string.h> #include<math.h> #include<stdlib.h> #include<stdio.h> using namespace std; int cIndex(char *x,char **featlist,int len) { int i; for(i=0;i<len;i++) if(strcmp(x,featlist[i])==0) return i; } int main(int argc,char *argv[]) { std::ifstream featFile(argv[1],ios::in); std::ifstream trainFile(argv[2],ios::in); // std::ofstream svmFile(argv[3],ios::out); char line[20000]; char feat[100]; char **featlist; int i=0,len=0,fl=0,j; char* x; int …

Member Avatar for AutoC
0
139
Member Avatar for AutoC

Hi, I'm implementing kd trees and have pseudo code for most of the functions but the delete operation.Its quite complicated and I have no idea how to implement it.Any help is appreciated

Member Avatar for ArkM
0
92
Member Avatar for AutoC

Hi, I'm new to php.I had to include common content to a lot of webpages in my website like menubar etc. and i was told i could load them dynamically from a single file using php.Can someone help me with this?

Member Avatar for kadimi
0
117
Member Avatar for AutoC

I have a code snippet that strangely works one way on a fedora 6 machine and another way on a fedora 8 machine. [code] void Form1::SendToApp() { vector<int> isciistream; vector<int> fontstream; cout<<"Entering Form1::SendToApp()"<<endl; isciistream=wwnd->OnOK(); isciistream.push_back(32); char str[255]=""; cout<<"Size of IsciiStream:"<<isciistream.size()<<endl; for (int i=0;i<(int)isciistream.size();i++) { sprintf(str,"%s%c",str,isciistream[i]); cout << "isciistream[i] :" << …

Member Avatar for AutoC
0
152
Member Avatar for AutoC

Hi, I've got a program that I wish to run in a powerful server so that it can run on several cores simultaneously and work faster.I need to do client server programming for this.That is, I recieve input in my local system which I forward to the server, it does …

Member Avatar for AHUazhu
0
192
Member Avatar for AutoC

I have a c++ program that performs a functionality. generate.h [code] struct code { bool out; bool *reg; }; class Cyclic { private: struct code *cy; int rgsize; bool *gen; int gensize; unsigned short cycodes[256]; public: Cyclic(int a, int b,bool c[]); void leftShift(); bool* cyclicCode(bool mssg[],int msize); void printReg(); bool* …

Member Avatar for ArkM
0
224
Member Avatar for AutoC

Hi, In an assignment I'm supposed to introduce packet errors and bit erasures in the packets.packet errors I can do.Bit erasures mean we have no idea if its a 1 or a 0.how can I introduce something other than a 0 or a 1 in a bit?

Member Avatar for Salem
0
158
Member Avatar for AutoC
Member Avatar for AutoC
0
4K
Member Avatar for AutoC

Hi, I need help with implementing cyclic codes.Its much like crc.I've found a lot of software implementations for crc but havent understood them.I've looked at a crc guide which gave, [code] So to implement CRC division, we have to feed the message through a division register. At this point, we …

Member Avatar for vijayan121
0
151
Member Avatar for AutoC

Hi, I want to transfer a file as it is via a socket...not read the file contents and send it.How can I do this?

Member Avatar for AutoC
0
1K
Member Avatar for AutoC

Hi, I need to write C++ code to find the factors of a polynomial.For eg. X^2-1 should return x-1 and x+1...anyone have any ideas on how to do this?

Member Avatar for ddanbe
0
107
Member Avatar for AutoC

Hi, I'm implementing linear block coding and need some ideas on how to go about storing the cosets. i.e. If i have an alphabet C={000,101,010,111} I need to perform C+000={000,101,010,111} C+001={001,100,011,110} C+010={010,111,000,101} C+011={011,110,001,100} etc... observed here is that there are only 2 sets and it keeps repeating.So, i need to …

Member Avatar for iamthwee
0
31
Member Avatar for AutoC

Hi, We are doing some audio data collection.So I need to write a program which when run would generate a beep and record from a microphone until the next beep and save it as a wave file.This repeats for n beeps with a gap of 5 seconds between beeps. Can …

Member Avatar for dmanw100
0
40
Member Avatar for AutoC

Hi, Thanks to everyone I was able to submit my huffman coding assignment successfully.Now I've got to do arithmetic coding and it seems really confusing.I've looked at arturo campos's page [URL="http://www.arturocampos.com/ac_arithmetic.html"]http://www.arturocampos.com/ac_arithmetic.html[/URL] and havent understood using the range 0000h to ffffh instead of [0,1) and adjusting probabilities to be limited to …

Member Avatar for Ancient Dragon
0
66
Member Avatar for AutoC

I'm reading a file and I'd like to get short,int etc. apart from the usual char because I want to read 16 bit values...is there a way?

Member Avatar for Ancient Dragon
0
52
Member Avatar for AutoC

Hi, Whenever a user types ./a.out with the wrong number of arguments I want my program to output something like Usage: ./a.out <-e/-d> <FIlename> <Value> how can I do this?

Member Avatar for Nick Evan
0
87
Member Avatar for AutoC

Hi, In a function of my program, I open and close the file once every recursion...and the recursion is very large....I've made sure im not writing when its closed or not opening when its open or any of those trivial issues.Will this be a problem with the operating system?...because I'm …

Member Avatar for AutoC
0
93
Member Avatar for AutoC

hi, I've completed huffman coding..but there is one small issue...in my decoded file the character "ΓΏ" keeps appearing at random places...I checked the problem and a second parse of the input file gives some characters that are not in my tree which ends up adding a code 0 of length …

Member Avatar for AutoC
0
101
Member Avatar for AutoC

hi, This is a doubt about the pseudo-eof.If i have an 8 bit system, Then the pseudo eof has to be above 8 bits...so should i allocate 16 bits for every character just so that my eof can exist?..if its a 16 bit system I have to use 24 bits?

Member Avatar for ArkM
0
129
Member Avatar for AutoC

Hi, Lets assume my preorder traversal gives me a unique tree.How do I get the tree from the preorder traversal? Any help is appreciated

Member Avatar for Alex Edwards
0
131
Member Avatar for AutoC

Hi, I've coded huffman coding.I've formed my codebook.Its correct upto that point.I'm using unsigned int(32 bits) and packing the codes into it and writing to file whenever 32 bits get filled.Somehow..my resultant file is larger than my source file.Am i doing something wrong?

Member Avatar for AutoC
0
273