Posts
 
Reputation
Joined
Last Seen
Ranked #590
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
92% Quality Score
Upvotes Received
11
Posts with Upvotes
10
Upvoting Members
8
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
5 Commented Posts
~48.6K People Reached
About Me

:)

Interests
C++,Algorithm
PC Specs
Linux
Favorite Tags
Member Avatar for stereomatching

Just food for thought: Performance of network programming mainly depends on how you are processing your datas. How you are sharing the data among several component of your software? How you are sharing the data among several processes on the machine? (shared memory/pipe/file fifo, mapped memory) How you have distributed …

Member Avatar for stereomatching
0
1K
Member Avatar for stereomatching

Looks like its all about function pointer. But I think your code has little bit definition issue? If I am right it should be like this: [CODE] typedef void ( *set_malloc_handler)( void(*f)() ) ; //Which means set_malloc_handler is a function pointer, which takes another function pointer as argument. [/CODE] Here …

Member Avatar for stereomatching
0
139
Member Avatar for vidit_X
Member Avatar for Rashakil Fol
0
154
Member Avatar for SCass2010

@vijayan121 Cool.. Little optimization if there are millions of keys and million of values per keys. [CODE] template< typename K, typename T, typename C, typename A > typename std::multimap<K,T,C,A>::size_type num_unique_keys( const std::multimap<K,T,C,A>& mmap ) { if( mmap.size() < 2U ) return mmap.size() ; const C& cmp = mmap.key_comp() ; typename …

Member Avatar for vijayan121
0
1K
Member Avatar for dospy

[QUOTE]ps: thx mike, i didn't know auto could be used this way, i thought that keyword is useless [/QUOTE] That is [URL="http://en.wikipedia.org/wiki/C%2B%2B11#Type_inference"]C++11[/URL] Here is the another way to do it in c++11 :) using for_each and lambda [CODE] for_each(v.begin(), v.end(), [](int n) { cout << n << " "; }); …

Member Avatar for dospy
0
180
Member Avatar for moonray

Can you give more information to understand what exactly the project requirements are. Initially I thought you want to know about the tools to find out the performance of a program/server, Rubberman already gave a reply for this. I want to add my 2 cets. Valgrind, one of the top …

Member Avatar for raptr_dflo
0
122
Member Avatar for sneekula

When you read almost every reply of this thread and try to match which one you are..

Member Avatar for Netcode
0
669
Member Avatar for teha_toshio

Hi, Your entire program is almost correct. Only problem is you are resetting your cinemas in display function: [CODE] // This is in your display function. so just before display its resetting your entire array. for( int row = 0; row < 17; ++row ) for( int column = 0; …

Member Avatar for teha_toshio
0
172
Member Avatar for ChaseRLewis

Hi, Inheritance with virtual functions and virtual inheritance are two different things. After reading your initial question, I think you first need to read about normal inheritance with virtual functions. Virtual functions are for implementing polymorphism. If a class is derived from another class and when you create a object …

Member Avatar for mike_2000_17
0
162
Member Avatar for stereomatching

Hi, Narue's example doesn't have polymorphic/virtual methods. If you want to develop any robust C project, you need to use struct in such a way that you can write generic codes. Here is an example using the vector(as we are talking about vector) I wrote it hurriedly and haven't been …

Member Avatar for nezachem
0
1K
Member Avatar for Muralidharan.E

Here is a compile time Polymorphism example for JAVA using the above classes. EDIT: ITS SHOWING C++ CODE, BUT THESE ARE ACTUALLY JAVA CODE. [CODE] package com.generic.myanimal; public interface GenericAnimal { public void makeAnimalCry(); } [/CODE] [CODE] package com.generic.myanimal; public class Dog implements GenericAnimal { @Override public void makeAnimalCry() { …

Member Avatar for Fbody
0
593
Member Avatar for 4everct01

Hi, What do you mean by repeated cards. I just skimmed through the code and looks like it may shuffle same card multiple times, but it shouldn't create any duplicate card. Your shuffling algorithm is based on rand(), and if modular is too small then you might get same index …

Member Avatar for 4everct01
0
457
Member Avatar for alwaysLearning0

Hi, I was thinking of writing this post as a reply of [URL="http://www.daniweb.com/software-development/cpp/threads/375854"]Need small example for compile time polymorphism and runtime polymorphism in c++.[/URL] But later decided to open this new thread as some expert may want to give some expert opinion on this. On the above mentioned thread, mike_2000_17 …

2
201
Member Avatar for afi@alvi

Please try to make some effort to do your OWN homework!!!! Here several programmers can solve it without even blink of an eye, BUT I am pretty sure no one will take this bait to solve your school homework.

Member Avatar for arkoenig
0
104
Member Avatar for marcux

Hi, You need to setup your ethernet card in promiscuous mode, in linux you can use the commands to see every packet. ifconfig eth0 promisc - Put nic into promiscuous mode to sniff traffic. tcpdump -n host not XXX.XXX.XXX.XXX | more - Sniff net but ignore IP which is your …

Member Avatar for marcux
0
370
Member Avatar for bimoweemo

Hi, You havent mentioned what error you are getting. But I am assuming that isFull() is there and you will be able to fix the normal errors like [ICODE]using namespacestd;[/ICODE] should be acutlaly [ICODE]using namespace std; [/ICODE] and [ICODE]top[/ICODE] and [ICODE]elements[/ICODE] need to be declared. Still you gonna face linker …

Member Avatar for alwaysLearning0
0
84
Member Avatar for IndianaRonaldo

Hi, Dont worry about subset. First try to do permutation for a word. If you can generate permutation of a word, then subset is really easy. You can treat each substring as a word and generate permutation for that word, you can use std::set to get rid of duplicates. So, …

Member Avatar for IndianaRonaldo
0
287
Member Avatar for brynjar

Hi, You can not return a local array. returning a local array will create invalid memory access. Your [ICODE]double f_g [2];[/ICODE] is a local array and as soon as you are getting out of the function, your address is invalid. So [CODE] cout << "asd: " << asd[0] << ", …

Member Avatar for lcordero
0
227
Member Avatar for alwaysLearning0

Mike_2000_17 and Narue Just a thought: You should write a beginner's tutorial on C++0x for Daniweb. That will be a great way to promote this site. I can also contribute on some easier topics!!.

Member Avatar for mike_2000_17
1
159
Member Avatar for munitjsr2

[QUOTE]You sure can but they must be initialized thus declared static[/QUOTE] A class can also have non static constant, it has to be initialized at initialization list. [CODE] class A{ const int a; public: A(int a) : a(a){ } }; [/CODE] You can not do [CODE]int &var=NULL;[/CODE] and there is …

Member Avatar for kanuxy
-2
184
Member Avatar for winecoding

You already have it!! If you are using linux and you have development environment setup then you will find it in the : /usr/include/c++ In windows I dont know exact location, but you should still able to browse it from any IDE. Just include the header file and click on …

Member Avatar for alwaysLearning0
0
430
Member Avatar for tikoti

I have just run it on Mac, didn't get any compilation error, what platform you are using? [CODE] #include <iostream> #include <complex> #include <functional> #include <numeric> #include <vector> using namespace std; double accumSq(double sum_so_far, double x) { return sum_so_far + x*x; } void doIt(const std::vector< std::vector<double> > &values ) { …

Member Avatar for tikoti
0
274
Member Avatar for perfectBing

Best way to make a singleton class will be to implement a singleton template which can hold anyclass and can make any class singleton. Here is a very simplified version of it: [CODE] #include <iostream> using namespace std; //A is a simple normal class class A{ int x; public: A(): …

Member Avatar for alwaysLearning0
0
84
Member Avatar for ravenous

Hi, Can you please check sizeof(real) and sizeof(double) is same or not, may be lame check but only invalid memory access is the reason that making your first matrix corrupted. On a first glance, code looks so far fine, only potential invalid memory access in the above code is while …

Member Avatar for ravenous
1
381
Member Avatar for Stefano Mtangoo

Are you asking about a PHP related question? Like how you can make use of PHP to interact between several layers? Or are you asking about a more general MVC related question like how each layer should interact? Sorry I didn't get your question. BTW there should be many light …

Member Avatar for Stefano Mtangoo
0
393
Member Avatar for melfoy

[QUOTE]Thank u for ur advice but it would be better if u elaborate little better as i went through Dijkstra' Algo and got that it is for weighted graph for least weight path rather than least number of path .[/QUOTE] Dijkstra is a least number path problem, it will give …

Member Avatar for alwaysLearning0
0
232
Member Avatar for TheWolverine

[CODE] classB predefinedClassBObject_; // This is local variable, so when you leave the scope this variable doesn't exist anymore, and hence you wont be able to access it. This is definitely causing the crashing/garbage value as you are accessing invalid memory. [/CODE] Second thing is: [CODE] predefinedClassAObject.pointerToClassBBase->testValue; //I am not …

Member Avatar for TheWolverine
0
396
Member Avatar for CPT

you input and output operator takes a CGuser by reference. Do following: [CODE] cout<< *user; [/CODE]

Member Avatar for mike_2000_17
0
174
Member Avatar for Celtrix

Hi, A straight forward error is: [CODE] void lsmain(lua_State* L, SDL_Event event){ //Takes a SDL_Event } //and from main you are passing: lsmain(L, &Event); //address of SDL_Event, this would definitely cause crash and i am kind a surprise why its not giving an compiling error! [/CODE] Now about the thread …

Member Avatar for Celtrix
0
248
Member Avatar for v_janssens

Why you want to declare N objects with name n1, n2, n3..nN? It wont help you any how. There is ways to generate name at compile time but not on runtime but still those are mainly for template programming to generate struct/class type on fly. Can you explain why you …

Member Avatar for alwaysLearning0
0
212