undo

how to implement undo/redo operation without major changes in program

喜你入骨 提交于 2019-11-30 07:27:16
Hi I'm about to add new functionality to application which I'm currently writting. I need to write a undo/redo fnctionality. However 90% of our application is ready and I don't know what is the best way to implementing this functionality without affectig(too much ) code which has been already created. There aren't many details here. However, Undo/Redo functionality is typically handled via some variation of the Command Pattern . Depending on your architecture, this could be a simple reworking of your basic functionality into "commands", or a major overhaul. ArBR As Reed Copsey says the most

Oracle12c创建及删除PDB

廉价感情. 提交于 2019-11-30 06:33:21
  在12C R1版本中只支持Global Shared Undo模式,所有container共享一个UNDO表空间;在12C R2引入了PDB Local Undo模式,每个container都有自己的UNDO 表空间,对于RAC是每 个实例每个container都有自己的UNDO表空间。在DBCA时会有Local Undo选项,且默认勾选。   在12c R1版本中clone PDB源库需要打开在read only只读模式 ,12c R2版本中引入了local undo mode, PDB源库在read write读写模式也可以clone。 克隆PDB要求:   1. Archive Log Enabled   2. Local Undo Enabled   3. destination CDB must have a public database link to the source CDB,have sufficient privileges to use the database link 可以通过图形化工具DBCA、命令行、em express等方式创建和删除PDB,该处只描述命令行方式操作。 一、创建PDB 1. 克隆种子容器 SQL> select * from v$dbfile;      #查看路径 SQL> show parameter db_create

redo log和undo log、事务

徘徊边缘 提交于 2019-11-30 05:40:43
redo log和undo log、事务 redo log 如果系统突然崩溃,一些在缓存中的修改还没来的及同步到磁盘中,用redo log就可以恢复这些修改,Redo log就是记录这些修改的日志。这些对页面的修改有一些是原子操作,比如有些插入伴随着页面分裂和页的新建(悲观插入),此时这些分裂和修改必须一气呵成,这样的操作叫mini-transition,一条语句可能包含多个mini-transition,而一个又包含多个redo日志,这种原子性用一个特殊位来标记,在恢复时读到标志位才恢复之前的内容,否则放弃之前的日志。每次的redo日志也是存到buffer pool中,选择合适的时机刷新到磁盘,可以选择事务提交时同步到磁盘或写入缓存。 (LSN:记录的一个字段,一个redo日志对应的编号,一个页的LSN越大说明刚刚修改过) undo log 为了事务回滚而记录的日志信息,undo日志有几种类型,插入数据、删除数据、更新数据都会产生不同的undo log,记录有一个roll_pointer的指针指向它的undo log,所有关于这条记录的undo log都连成一条链表,称为版本链,根据undo log的事务ID来判断是哪个事务中修改了该记录,事务回滚时找到对应事务ID的undo log恢复数据除此之外,undo log还可以用来维护MVCC(多版本并发控制)。

Undo/redo with a UITextView (iOS/iPHone)

不打扰是莪最后的温柔 提交于 2019-11-30 05:31:06
I have a view where a UITextView always has focus. What I want to do is extend the built-in undo/redo behavior to support undo/redo for when I programmatically set the text (e.g., for when I clear it, by setting it to @""). Since only the firstResponder gets undo/redo events, I thought I'd simply use the UITextView's undoManager property to create my invocations. e.g., // Before clearing the text... [[self.myTextView.undoManager prepareWithInvocationTarget:self] undoClear:self.myTextView.text]; [self.myTextView.undoManager setActionName:@"Clear"]; // ... -(void)undoClear:(NSString *

Unable to use Undo in TextChanged

淺唱寂寞╮ 提交于 2019-11-30 03:18:29
问题 When using textbox.Undo(); I get the following error: Cannot Undo or Redo while undo unit is open. Now I understand why this is the case (because it is an active undoable event) but through what event can I perform validation on a text box and undo the change if the user has typed an invalid character? 回答1: Instead of using Undo and TextChanged, you should use the PreviewTextInput and DataObject.Pasting events. In the PreviewTextInput event handler, set e.Handled to true if the typed text is

Is fast (repeated) undo possible in emacs?

只愿长相守 提交于 2019-11-30 01:15:23
问题 I use emacs and I have a problem with it's undo. (Sorry, maybe this is a stupid question, but I did not find anything about it in the internet, whilst it should be a basic functionality of any editor). To invoke each undo step I need to press 'Ctrl-x' and then 'u'. But if I have done 200 steps and I wish to undo them, my hand and fingers get horrible pain from repeating 'Ctrl-x' and then 'u' 200 times, to say nothing that this operation takes about 5 minutes. In Microsoft Word, for example

How to perform the TFS-equivalent of 'Undo pending changes'

情到浓时终转凉″ 提交于 2019-11-29 21:22:15
How do I perform the equivalent of the TFS 'Undo pending changes' in Git, on one or multiple files? That basically means to do these steps: Undo changes on disk Resetting any changes Git has discovered Getting the latest changes on the file from Git It would be good to know the differences (if there are any) in commands for doing this if you've (1) just changed it on disk, without adding it , but also when you've (2) done the add-command and for a bonus, (3) even when you have commit the change . For 1 and 2, all you need to do is: git stash -u #same effect as git reset --hard, but can be

Undoing specific revisions in Subversion

早过忘川 提交于 2019-11-29 20:49:01
Suppose I have a set of commits in a repository folder... 123 (250 new files, 137 changed files, 14 deleted files) 122 (150 changed files) 121 (renamed folder) 120 (90 changed files) 119 (115 changed files, 14 deleted files, 12 added files) 118 (113 changed files) 117 (10 changed files) I want to get a working copy that includes all changes from revision 117 onward but does NOT include the changes for revisions 118 and 120. EDIT: To perhaps make the problem clearer, I want to undo the changes that were made in 118 and 120 while retaining all other changes. The folder contains thousands of

Using Vim's persistent undo?

安稳与你 提交于 2019-11-29 20:13:46
One of the new features in Vim 7.3 is 'persistent undo', which allows for the undotree to be saved to a file when exiting a buffer. Unfortunately, I haven't quite been able to get it properly enabled, or I must be using it wrong. Here's what I've tried so far: I added the following to ~/.vimrc set undofile " Save undos after file closes set undodir=$HOME/.vim/undo " where to save undo histories set undolevels=1000 " How many undos set undoreload=10000 " number of lines to save for undo After this, I supposedly should be able to open any file, edit it, then save-close it, and when I open it

Git pull into wrong branch

核能气质少年 提交于 2019-11-29 19:48:06
Myself and one other developer had been merging and pushing our work to a non-master branch called toolwork. That way, we didn't impact the rest of the team. My topic branch was called DPM-93 and my git workflow was this. # do some work git checkout DPM-93 git commit -m "did some work" # catch up git checkout toolwork git pull origin toolwork # rebase my topic branch git checkout DPM-93 git rebase toolwork # merge and push my changes git checkout toolwork git merge --no-ff DPM-93 git push origin toolwork That was mostly working fine until I accidently issued these git commands git checkout