|
|
hi Adarsh
Get it from
http://www.dogma.net/DataCompression/SourceCode.shtml << this is a wonderful page
u have source for everything
Enjoy
|
|
|
|
|
I'm working on a binary expression tree parser and cannot figure out how to call the stack push method with a binary tree of only one node. I tried this, but got a segmentation fault: stack<char> theStack;
BinaryTree<char>* tree1;
tree1 = new BinaryTree<char> ('A');
theStack.push(*tree1);
As you can see, my BinaryTree uses only constructors to insert values (prevents the need for helper functions).
How would you push a binary tree onto a stack using these .h files? (i'm using c++ of course):
/*********BinaryTree.h*********/
#include <stddef.h>
#include <iostream.h>
template<class node_type="">
class BinaryTree
{
private:
template<class node_type="">
struct Tree_Node
{
Node_Type Node_Info;
BinaryTree<node_type> * left;
BinaryTree<node_type> * right;
};
Tree_Node<node_type> * root;
// prints value within a given node to screen void visit();
// helper function for remove
Node_Type replace(BinaryTree<node_type> *whichTree);
public:
// function: sets root to NULL
BinaryTree();
// function: sets Node_Info=nodeValue, left=NULL,
// and right=NULL
BinaryTree(Node_Type nodeValue);
// function: set Node_Info=nodeValue, left=leftTree,
// and right=rightTree
BinaryTree(Node_Type nodeValue,
BinaryTree<node_type> * leftTree,
BinaryTree<node_type> * rightTree);
// function: class destructor
~BinaryTree();
// function: accepts one parameter of Node_Type and
// removes the node with that value
BinaryTree<node_type> * remove(Node_Type nodeValue);
// function: accept one parameter of Node_Type and
// return true if that value is in the tree
// otherwise false is returned
bool search(const Node_Type nodeValue);
// function: returns true if root=NULL,otherwise,
// false is returned
bool isEmpty();
// function: performs an inOrder traversal of a tree
void inOrder();
// function: performs a preOrder traversal of a tree
void preOrder();
// function: performs a postOrder traversal of tree
void postOrder();
};
/******************************************************/
/********Stack.h*********/
template<class etype="">
struct Element
{
eType StackElement;
Element<etype>* Next;
};
template<class etype="">
class stack
{
private:
Element<etype>* Top_Pointer;
public:
stack();
// Class constructor
~stack();
// Class destructor
bool isEmpty() const;
// Function: Determines whether the stack is empty
// Pre: Stack has been initialized
// Post: Function value = true if stack is empty
void push(eType theStackElement);
// Function: Adds new element to the top of stack
// Pre: Stack has been initialized
// Post: New element is at the top of the stack
void pop();
// Function: Removes top item from the stack
// Pre: Stack has been initialized and is not empty
// Post: Top element has been removed from the stack
eType top();
// Function: Returns the value of the next element
// Pre: Stack has been initialized and is not empty
// Post: Function value = value of the next element
};
//end of class specification
|
|
|
|
|
|
Athaenna summa ??
Eathavathu sollavadiyathu thaanae ??
|
|
|
|
|
what is summa?????;P
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I'll be really happy if anyone out there has C++ code for Simplex alg...
|
|
|
|
|
Quite hard to code in C++, without some huge library to handle vectors and matrix operations. I have some code for Matlab, I think there's a sort of C/C++ compiler around to make stand-alone executables.
|
|
|
|
|
hy,
u can get it from
http://www.crt.umontreal.ca/~denis/
http://www.bates.edu/~apearson/code/simplex/dsimp.txt (but I guess tis in Java )
http://www-b2.is.tokushima-u.ac.jp/~ikeda/suuri/simplex/Simplex.html
And if ur really interested in more bout it .. u can goto "Michael Trick's Operations Research Page" at
http://mat.gsia.cmu.edu/
Enjoy
|
|
|
|
|
I need to make a custom toolbar for IE5.0. Need some help.
|
|
|
|
|
you can find some example for same in IE programming section
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I am writting a PC-POS program that runs 24 hours a day (hopefully). At some point during the night it sends to a designated master PC the sales data for that day. During this time period I would like to check if a later version of the application is waiting to be copied from the master PC.
If I use the CopyFile() function it fails because the program is running on the PC-POS unit and so cannot overwrite itself. I was thinking about using WININIT.INI or MoveFileEx() with the MOVEFILE_DELAY_UNTIL_REBOOT flag, but I realy do not want to reboot the machines (16 shops with upto 4 PC-POS units in each shop).
So how would I go about starting the new version of the application without restarting the machine.
Thanks in advance.
Joe.
|
|
|
|
|
Pretty simple: copy the new version to a temp file - proggy.new - and then start another program to do the copy and exit the first. This other program - copyupdate.exe - would back up the previous exe, rename/move the new one, and start the new exe, and then exit.
You could also do this with a little DCOM magic, but the above is the simplest to do and debug.
|
|
|
|
|
Hi,
I am looking for a source code (VC++) for Subclassing Control (Like MsgBlast or MsgHook)
|
|
|
|
|
Hi,
I am looking for a source code (VC++) for Subclassing Control (Like MsgBlast or MsgHook)
|
|
|
|
|
How do I make ini files to store info in, like the registry?
If u can help, please do, or ICQ me on 72044874!
Thanks
Ashman
|
|
|
|
|
Use this functions:
WritePrivateProfileString,
GetPrivateProfileString
see MSDN Chapter: PlatformSDK/Base Services/Registry/Registry Reference/Registry functions
Initialization-File Functions
|
|
|
|
|
Hey folks,
Just wondering if someone has any code out there to write a firewall on the Windows platform? Very low level programming stuff - and I'd be very interested in learing how to program one.
Thanks
Girish
|
|
|
|
|
hi girish
u can get it from
http://www.opensourcefirewall.com/trex_source_download.html
hope tis useful to u.
Enjoy
|
|
|
|
|
I need source code for a project called "Magic Square." If there's anyone out there who knows the code or can help me find it, I'd really appreciate it.
|
|
|
|
|
hy,
u can get source for Magic Square from the following sites....
http://user.chollian.net/~brainstm/source.htm (in C)
http://www.brokersys.com/~jguthrie/MagicSquare.java (in Java)
http://perso.club-internet.fr/spip/autres/CarreMagique.java (in Java)
Enjoy
|
|
|
|
|
Hi!
I am an engineering student from India, and am working on a project in Visual Basic-6.0. I need a little help with my project, and have gone through a lot of sites to solve my problem, but to no avail.It was then that I stumbled on to this site, and decided to set up a message.
Well a part of my project needs to acquire data from an ADC(Analog to Digital) card connected to the serial port and plot the data in real time.The only two controls which I can think of are MSComm and MS Chart.But I have a few questions as I have never worked with these controls before.The questions are as follows -
1. Is it possible using MS Chart to plot data in real time?
If not - Is there any other way-Maybe something like an activeX control available which could help me in real time data acquisition?
If it is - how do I go about it?I mean do I use dynamic arrays?If so, then how do I redimension them at run time?
2.Is it possible to set cursors(in the form of horizontal and vertical lines) on the plot?
3.Can I acquire data through an MSComm control from an ADC card and store it in a dynamic array?I want to avoid the modem.
Well, lots of questions , but no answers.I would really appreciate your help.Thanks for your time!!
Regards,
Alok Pradhan.
|
|
|
|
|
Hi,
I'm wanting to detect (on a mouse move) whether the mouse is over a popup menu (for which I have a handle). Does anyone have any ideas about how to go about finding the size and position of a menu on the screen, or even just doing a hit test? I cannot find anything in any documentation, but am probably looking in the wrong place!!!
thx
|
|
|
|
|
You'll get a WM_MENUSELECT message when the mouse moves over or off a menu item.
--Mike--
http://home.inreach.com/mdunn/
This must be Thursday. I never could get the hang of Thursdays...
|
|
|
|
|
I only seem to get this message when moving onto the menu item, not when it comes off (which is what I really need). MenuItemFromPoint sounds like it should do what I want, but it gives incorrect results under NT, although seems OK under '98.
Has anyone else had any trouble with MenuItemFromPoint?
|
|
|
|