undo

Why is there no undo/redo in Git?

只愿长相守 提交于 2019-12-05 19:28:06
问题 As far as I know, when you want to undo something in Git you have to explicitly find the command to undo whatever it is you've done and issue it. For instance, one way among many to undo a commit and redo it is to follow the example from here, $ git commit ... $ git reset --soft HEAD^ $ edit $ git add .... $ git commit -c ORIG_HEAD Or to undo a pull, you can follow the instructions from here, $ git reset --hard But these commands do not necessarily work interchangeably. Is there a reason why

How to use NSUndoManager with a UIImageView or CGContext

痞子三分冷 提交于 2019-12-05 18:23:58
I have an app that uses cgcontext to draw things onto a UIImageView that the user draws using touch events, and I want to be able to undo the drawings made by the user. Edit: I am trying to use my touchesBegan to save theUIImage at the begining of a touch to the NSUndoManager And then how do I use it to undo using a UIAlertView. Meaning, I want to call a method from my UIAlertView that undo's then another that will redo, but I don't know how to accomplish this. Please help I write graphics software for the iPhone ( http://www.layersforiphone.com/ ) and I spent a while trying to figure this out

Qt Clear Undo History in a QTextEdit/QPlainTextEdit?

喜你入骨 提交于 2019-12-05 17:20:55
I have a QPlainTextEdit and I'm building a progress dialog for it when opening large files. Rather than using setText, I want to add one line of text at a time by using QTextCursor.insertText. The problem is that when I do it this way, I can undo each line that was added... is there a way to clear the undo history? Use QTextDocument::clearUndoRedoStacks . Code: editor->document()->clearUndoRedoStacks(); // default clears both See docs if you want to clear just undo. Also, it's good idea to read docs of QTextDocument (and QTextCursor) when working with the editor widgets. Lots of functionality

H3C交换机常用配置命令转载

两盒软妹~` 提交于 2019-12-05 11:34:13
一.用户配置: <H3C>system-view [H3C]super password H3C 设置用户分级密码 [H3C]undo super password 删除用户分级密码 [H3C]localuser bigheap 123456 1 Web网管用户设置,1(缺省)为管理级用户,缺省admin,admin [H3C]undo localuser bigheap 删除Web网管用户 [H3C]user-interface aux 0 只支持0 [H3C-Aux]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟 [H3C-Aux]undo idle-timeout 恢复默认值 [H3C]user-interface vty 0 只支持0和1 [H3C-vty]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟 [H3C-vty]undo idle-timeout 恢复默认值 [H3C-vty]set authentication password 123456 设置telnet密码,必须设置 [H3C-vty]undo set authentication password 取消密码 [H3C]display users 显示用户 [H3C]display user-interface

Don't add changes made via VBA to the undo history

落花浮王杯 提交于 2019-12-05 11:33:49
I have a set of Word macro's that format documents that are sent to from an external source. Usually there are a lot of changes made to the document, all of which are recorded in the undo history, which I don't want. Is there a way to not add all of these changes to the undo history, but rather just add one undo action that will undo everything the macros have done? Thanks. This is not available for Word 2007 or earlier. The UndoRecord object was added in Word 2010 and lets you "clump" actions made in VBA into a single UndoRecord, to which a custom "label" for the Undo list can be assigned.

Can a `range.insertNode` be undone using browser's undo, in a contenteditable div?

老子叫甜甜 提交于 2019-12-05 07:57:03
I am working on a contenteditable div to make a simple RichText-Editor. One of the requirement I have is to be able insert html chunk at cursor postion on a button event. I was able to get that part working fine by using range , selection , range.insertNode(nodeHTML) or range.pasteHTML(nodeHTML) based on browser. But I couldn't get two things, which ideally I would like to have To be Able to undo the inserted node, using browser's undo. Somehow, browser ignores above actions. To move the cursor at the end of inserted node. So that user can start writing after I know I can use something out of

redo和undo的区别

与世无争的帅哥 提交于 2019-12-05 06:57:54
转摘: http://blog.163.com/jing_playboy/blog/static/757362222012520104521864/ redo--> undo-->datafile insert一条记录时, 表跟undo的信息都会放进 redo 中, 在commit 或之前, redo 的信息会放进硬盘上. 故障时, redo 便可恢复那些已经commit 了的数据. redo->每次操作都先记录到redo日志中,当出现实例故障(像断电),导致数据未能更新到数据文件,则 数据库 重启时须redo,重新把数据更新到数据文件 undo->记录更改前的一份copy,但你系统rollback时,把这份copy重新覆盖到原来的数据 redo->记录所有操作,用于恢复(redo records all the database transaction used for recovery) undo->记录所有的前印象,用于回滚(undo is used to store uncommited data infor used for rollback) redo->已递交的事务,实例恢复时要写到数据文件去的 undo->未递交的事务. redo的原因是:每次commit时,将数据的修改立即写到online redo中,但是并不一定同时将该数据的修改写到数据文件中

js小测

心已入冬 提交于 2019-12-05 06:48:30
今天: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>白云霞'boyfriend</title> </head> <body> <div align="center"> <form action="" method="post" onsubmit="return avg()"> <thead> <tr ><th colspan=2 style="text-align:center">比赛算分</th></tr> </thead> <table> <tr> <td>评委1</td> <!--只能输入数字,能输小数点.--> <td><input onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" id="score1"></td> </tr> <tr> <td>评委2</td> <td><input onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" id="score2"></td> </tr> <tr> <td>评委3</td>

MySQL InnoDB 实现高并发原理

和自甴很熟 提交于 2019-12-05 01:49:18
MySQL 原理篇 MySQL 索引机制 MySQL 体系结构及存储引擎 MySQL 语句执行过程详解 MySQL 执行计划详解 MySQL InnoDB 缓冲池 MySQL InnoDB 事务 MySQL InnoDB 锁 MySQL InnoDB MVCC MySQL InnoDB 实现高并发原理 MySQL InnoDB 快照读在RR和RC下有何差异 转载: 《InnoDB并发如此高,原因竟然在这?》 并发控制 为啥要进行并发控制? 并发的任务对同一个临界资源进行操作,如果不采取措施,可能导致不一致,故必须进行并发控制(Concurrency Control)。 技术上,通常如何进行并发控制? 通过并发控制保证数据一致性的常见手段有: 锁(Locking) 数据多版本(Multi Versioning) 锁 如何使用普通锁保证一致性? 操作数据前,锁住,实施互斥,不允许其他的并发任务操作; 操作完成后,释放锁,让其他任务执行; 如此这般,来保证一致性。 普通锁存在什么问题? 简单的锁住太过粗暴,连“读任务”也无法并行,任务执行过程本质上是串行的。 于是出现了共享锁与排他锁: 共享锁(Share Locks,记为S锁),读取数据时加S锁 排他锁(eXclusive Locks,记为X锁),修改数据时加X锁 共享锁与排他锁的玩法是: 共享锁之间不互斥,简记为:读读可以并行

第九章 MySQL的备份和恢复

不羁的心 提交于 2019-12-05 00:42:13
一.备份的原因 运维工作的核心简单概括就两件事: 1)第一个是保护公司的数据. 2)第二个是让网站能7*24小时提供服务(用户体验)。 1)备份就是为了恢复。 2)尽量减少数据的丢失(公司的损失) 二.备份的类型 冷备份: 这些备份在用户不能访问数据时进行,因此无法读取或修改数据。这些脱机备份会阻止执行任何使用数据的活动。这些类型的备份不会干扰正常运行的系统的性能。但是,对于某些应用程序,会无法接受必须在一段较长的时间里锁定或完全阻止用户访问数据。 温备份: 这些备份在读取数据时进行,但在多数情况下,在进行备份时不能修改数据本身。这种中途备份类型的优点是不必完全锁定最终用户。但是,其不足之处在于无法在进行备份时修改数据集,这可能使这种类型的备份不适用于某些应用程序。在备份过程中无法修改数据可能产生性能问题。 热备份: 这些动态备份在读取或修改数据的过程中进行,很少中断或者不中断传输或处理数据的功能。使用热备份时,系统仍可供读取和修改数据的操作访问。 三.备份的方式 1.逻辑备份: 基于SQL语句的备份 1)binlog 2)into outfile mysql> select * from world.city into outfile '/tmp/world_city.data'; 3)mysqldump 4)replication 5)mysqlbinlog 2.物理备份: