Click here to Skip to main content
15,908,254 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Setting breakpoints in a DLL...how? Pin
dandy726-Jul-05 10:23
dandy726-Jul-05 10:23 
AnswerRe: Setting breakpoints in a DLL...how? Pin
Toby Opferman5-Jul-05 10:02
Toby Opferman5-Jul-05 10:02 
Generalan interview question of undo/redo Pin
qudayong5-Jul-05 8:16
qudayong5-Jul-05 8:16 
GeneralRe: an interview question Pin
Jose Lamas Rios5-Jul-05 8:40
Jose Lamas Rios5-Jul-05 8:40 
GeneralRe: an interview question Pin
David Crow5-Jul-05 9:18
David Crow5-Jul-05 9:18 
GeneralRe: an interview question Pin
qudayong5-Jul-05 9:46
qudayong5-Jul-05 9:46 
GeneralRe: an interview question Pin
David Crow5-Jul-05 9:55
David Crow5-Jul-05 9:55 
GeneralRe: an interview question Pin
Toby Opferman5-Jul-05 9:59
Toby Opferman5-Jul-05 9:59 
Just think of the stack:

character: rowpos, colnumber

For graphics you could have something like:

OperationType, MetaData

For example. So it's just a stack of commands. You could even determine that a "word" is basically a state, so once an entire word is typed you put it on the stack.

So, some considerations could be:

1. How much data are you storing per-letter/state operation?
2. How long of a history buffer do you want?

If you store a letter as being character, followed by rowposition, column number you are actually storing 2 bytes (unicode let's say), then 2 bytes (say you can't have a line longer than 65536), then say 4 bytes (you have up to 4 billion lines in the document).

2+2+4 = 8 bytes per character operation. If you type 10,000 words and say each word is an average of 7 characters, that's 70,000 characters, that's 560,000 bytes or about 560k of undo changes. That's also 70,000 entries in your undo list. Not to mention possible optimizations in referencing and things or combining operations that cancel each other out.

How many does word go back to?







8bc7c0ec02c0e404c0cc0680f7018827ebee
GeneralRe: an interview question Pin
Tim Smith5-Jul-05 13:20
Tim Smith5-Jul-05 13:20 
GeneralRe: an interview question Pin
qudayong5-Jul-05 15:14
qudayong5-Jul-05 15:14 
GeneralRe: an interview question of undo/redo Pin
Chris Losinger5-Jul-05 15:27
professionalChris Losinger5-Jul-05 15:27 
GeneralRe: an interview question of undo/redo Pin
qudayong6-Jul-05 1:59
qudayong6-Jul-05 1:59 
GeneralRe: an interview question of undo/redo Pin
Chris Losinger6-Jul-05 2:13
professionalChris Losinger6-Jul-05 2:13 
GeneralRe: an interview question of undo/redo Pin
Mister Transistor14-Jul-05 3:30
Mister Transistor14-Jul-05 3:30 
GeneralRe: an interview question of undo/redo Pin
qudayong6-Jul-05 4:34
qudayong6-Jul-05 4:34 
GeneralRe: HELP VC++ my program is stuck. Pin
Wes Aday5-Jul-05 7:51
professionalWes Aday5-Jul-05 7:51 
GeneralRe: HELP VC++ my program is stuck. Pin
Anonymous5-Jul-05 8:44
Anonymous5-Jul-05 8:44 
QuestionHow to execute a file in memory being of type CMemFile Pin
Anonymous5-Jul-05 7:15
Anonymous5-Jul-05 7:15 
AnswerRe: How to execute a file in memory being of type CMemFile Pin
David Spain5-Jul-05 17:56
David Spain5-Jul-05 17:56 
GeneralRe: How to execute a file in memory being of type CMemFile Pin
Jose Lamas Rios5-Jul-05 18:25
Jose Lamas Rios5-Jul-05 18:25 
GeneralRe: How to execute a file in memory being of type CMemFile Pin
David Spain5-Jul-05 19:10
David Spain5-Jul-05 19:10 
GeneralProxy authentication Pin
Geert van Horrik5-Jul-05 6:04
Geert van Horrik5-Jul-05 6:04 
GeneralRebar controls Pin
__makaveli__5-Jul-05 5:36
__makaveli__5-Jul-05 5:36 
Questionhow to protect dll from replacement. Pin
Abdul Munaf Chhatra5-Jul-05 3:26
Abdul Munaf Chhatra5-Jul-05 3:26 
AnswerRe: how to protect dll from replacement. Pin
David Crow5-Jul-05 3:43
David Crow5-Jul-05 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.