|
I have an instance of a class heirarchy populated with data that I want to write to a file so that it can be instantly read back into memory the next time the program is run. Is there a fast way to do this, or do I have to painstakingly iterate through the whole tree and write every item to the file one at a time? The class has subclasses that go four levels deep with about 10 or 12 different vectors in each level. PLEASE tell me there's an easy way to do this!
Why not throw away a dime?
I throw away ten pennies all the time.
|
|
|
|
|
|
I didn't entirely understand that tutorial. It looks like I'll be iterating through the whole structure after all.
Thanks for your help, anyway.
Why not throw away a dime?
I throw away ten pennies all the time.
|
|
|
|
|
Have each node be responsible for writing itself to an Archive (presuming you're suing MFC), then in that node's save method, have it call it's children's save methods, so that you only have to iterate the root level nodes (or node).
--
Andrew.
|
|
|
|
|
Do you know if there's a problem submitting an article by the submission wizard and also directly by mail?
rechi
|
|
|
|
|
Hi,
Can anyone give me some advice on writing an SMTP gateway. What I want to do is scan all incoming SMTP messages content types for a certain type of message and then redirect them to the appropriate SMTP server accordingly.
Is there any way this can be done by connecting to an existing SMTP server without having a seperate log in for every user on the server or would I have to write my own application that stores and forwards the messages?
Cheers
Steevie
|
|
|
|
|
do you want code or application ?
I made one with MX DNS searching ... but I`m not really willing to give source !
We`ll see ! Keep your eye open on my posts !
be cool
create a server
start receiving commands line by line !
get the smpt reference from www.faqs.org !
response to them accordingly ! Save the messages !
Parse them !
Resolve mail servers !
Redirect messages !
modify bcc filed to "" !
.....
use a thread for client communication and onther one or more for sending messages !
if you cant` resolve mail server try using one you know ! if it don`t work dump the message !
Maybe I`ll post it after i finish it completely !
//be cool
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
i think i`ll post it in 2 weeks ! is it ok ?
you ain`t in a hurry , right ?
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
I need an algorith that computes piling. For example, you have a grid of 9 squares by 9, and you drop one bucket of sand in the center. THen you drop another bucket of sand onto that one, but the height isn't 2 buckets high, it's one and a little bit and the surrounding squares are also a little bit higher. And then if you keep piling more and more sand onto it it gradually gets taller and wider at the same time.
I've been trying to think of an algorithm to compute this for a little "underwater volcano" function in a program I'm working on. I'm measuring the piling effect in each grid square in terms of elevation from -100 to +100 "units" relative to sea level. It has to eventually generate a random island every time.
Please help me. I'm stumped!
Why not throw away a dime?
I throw away ten pennies all the time.
|
|
|
|
|
Assuming your piles are all dropped on the same point, your total pile will be a cone with the volume of all of the sand.
|
|
|
|
|
Perhaps something like this (pseudocode):
const float pileFloat = 0.1;
const int floatMin = 1;
<br>
doFloat(int i, int j)
{bool floating = true;
pile[i,j].sandFloat = pile[i,j].sand * pileFloat;
<br>
if (sandFloat > floatMin)
while(pile[i,j].sandFloat > 0 && floating)
{floating = false;
for(int x = i-1; x <= i+1; x++)
for(int y = j-1; y <= j+1; y++)
if(pile[x,y].sand + pile[i,j].sandFloat/8 < pile[i,j].sand)
if( addSand(x,y, pile[i,j].sandFloat/8) )
{
floating = true;
pile[i,j].sand -= pile[i,j].sandFloat/8;
}
}
}
<br>
bool addSand(int i, int j, float sand)
{
pile[i,j].sand += sand;
doFloat(i,j);
return
}
Edited this quite a few times now, but I think it should work....
I hope an reply is not sent every time the message is edited..
Hope this helps
/moliate
|
|
|
|
|
I was think something more like this:
loop {
Drop sand onto x,y
loop {
If adjacent square's elevation is lower,
Drop sand onto randomly chosen adjacent lower square
}
If all adjacent squares are equal then rest.
}
Why not throw away a dime?
I throw away ten pennies all the time.
|
|
|
|
|
I don't know how many times I edited that code... I guess I messed it up pretty badly in the end.
/moliate
|
|
|
|
|
Wow! All that trouble for me?
Why not throw away a dime?
I throw away ten pennies all the time.
|
|
|
|
|
Any Body can help me with my project?
It's in assembly language, and it's concerning GIF Format.
so First I need Info about Gif format.
second I need to write a program in assembly that can change the resolution of an image from 265 bit to 16 bit.
Thanks for all of you who can help me
|
|
|
|
|
|
hi nick
I want to thank you for your help.
|
|
|
|
|
Well, I want to write my third article, about ASP, databases or so. I like writing them, but I got no idea !
Maybe you got an idea..
- Dan
"Intel inside - Idiot outside"
|
|
|
|
|
I don't remember if anybody do it before or not,but you can write an article about using database in ASP. SELECT,INSERT,UPDATE,DELETE database from ASP.(with JavaSpcribt,I'm C++ developer)
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I thought to do it, but I recently came across such an article by Chris Maunder. Also, I'm using VBScript
I wrote an article about SQL , but it's not related to ASP.
- Dan
"Intel inside - Idiot outside"
|
|
|
|
|
You could write about paging a recordset, there are some articles already on the web, however there always seems to be more that you can implement than what I have found online. Just a suggestion.
Nick Parker
|
|
|
|
|
if anyone has any thing remote to this please let me know.....working for a mass emailer and they got me doing the kills now and its f***ing insane how many i get every damn hour.......i hate spam and iam against it as well, so any help will that will get me started will be appreiated and just might get someone on this message board off our lists.
|
|
|
|
|
Hi,
I'm currently designing a generic canvas for a personal project and I would like to receive any idea concerning it. The idea is to develop a kind of drawing board, generic enough to draw any kind of drawings (bitmaps, vectorial).
It could be used in the following projects :
- diagrams (UML, organizational tool, chain of tasks in a script, algorithms, HTML files links, ...)
- vectorial drawings like Corel softs
- Presentation drawings (like powerpoint, thumbnails of images, scrolling text for a news ticker for example, ...)
- Finally the imagination would be the limit
Basic features I have planned :
- instant panning and zooming
- multi-selection of elements
- move and resize of the selection
- Layout : align, center, space evenly (like in the dialog editor of visual products).
- Z order (move to front, ...)
- Layers
- Transparency
- support for drag and drop
- Linking of elements
- Elements as plugins in libraries
- Built-in drawing elements like a background, a grid, links, ...
If this post stimulates your imagination, feel free to include your 2 cents. All together we may develop the best canvas ever made. If I'm too ambitiout, say it also
Thanks you
Nicolas
|
|
|
|
|
I see an example on your site, http://www.codeproject.com/shell/shellextguide8.asp where it is discussed on how to write a shell extension that adds columns to Windows Explorer, like the tags in an mp3.
What I want to know, I have posted a comment on the above article... http://www.codeproject.com/shell/shellextguide8.asp#xx144107xx
I was wondering, I bet people have suggested this, I have WinXP, and the extra columns that you can add are great, but one is really missing, filezise in bytes...
Know it's a stupid request but i really miss the ability to display a filename with the exact filesize in bytes, not the explorer way of kb etc...
How much would it take to do one withis feature... Or has anyone seen anything like this before (I have one that is a right click extension that provies extra info and the file size in bytes, but not in a column in winxp!)..
Mark.
|
|
|
|
|
Sounds like it'd be pretty easy. The code in Part 8 implements several columns. You can take that code, remove everything but one column, and have it show the exact file size. If you're thinking of replacing the Size column, that can't be done. Explorer will ignore your extension if you try to override a built-in column.
--Mike--
"Jobs that don't allow you to visit the Lounge 25 times a day at the minimum are not worth having anyway."
-- Nish, 3/28/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|