Does Matlab support undo deletion for the codes - matlab

I'm just going to ask for a really basic question on Matlab which bugs me often when using Matlab.
I sometimes, by accident, delete some chunk of my codes when using Matlab; however, there seems to be no way to undo the deletion or recover those chunks back from my codes.
Is there an undo button or short-cut for deletion of codes?
It's not really a big deal if I cant remember those chunk and write again, but it just seems like a tedious work to do again.

The undo button is on the little toolbar in the top-right corner:
Or you can use Ctrl-Z if you are using the Windows shortcuts.

You could use a source control system (SCM) like git (git-scm.com) to make backups of your code code.
Note: you need to save in between and then add them to your SCM. Or you could do backups automatically with a cron job.

Related

There's no way to undo memory changes in windbg?

I'm trying to undo changes in Memory window:
But CTRL-Z does not work and there's no such menu item too:
Is this function supported?
When doing live debugging, there's not much use of an undo functionality in general. If a thread ends, you can't simply recreate it. If you step over a line, you can't easily go back to the state before. If you close a file handle, you can't easily reopen it.
If you changed memory, when should WinDbg disable the ability to undo that? Once that memory was written to by the process? Or do you want to be able to undo even if the memory was written to after your edit?
To what memory content should be undone then? To the values you entered (i.e. undo the action done by the process) or to the values before you entered them (i.e. undo the edits made by you, including the changes made by the process) or undo only those values which were edited by you and not changed by the process yet?
As you see, implementing an undo functionality in a debugging scenario can become really difficult. IMHO, WinDbg was never designed to have undo functionality.
I would even say people do not use the memory window to edit memory content. Why that?
When you do a debugging session, you want your steps to be recorded so that you yourself or someone else can verify and reproduce your actions. In such a scenario, you use .logopen and log everything you do. Actions done outside the command window will not be recorded and thus break the verification workflow.
What do you do instead? You use one of the display commands (db, dd, dp or similar) to show the memory contents before the edit. You then use an edit command (eb, ed, ...) to change the memory. Whenever you want the old values back, you look at the previous output of the d command and e those values again.

vscode: Automatically save all on build

In Visual Studio when I trigger a build it automatically saves all files first. I want the same behavior in vscode, but couldn't find a way to do it short of writing my own extension. Is there any simple method I'm missing?
It's not exactly what you're asking, but will also accomplish what you want: you could enable the auto-save feature:
"files.autoSave": "afterDelay"
After using IntelliJ for a while, I managed to get rid of my habit of pressing Ctrl+S after every second typed-out word, for the most part (since it has auto-save by default). I was happy to find out that VSCode support this somewhat less stressful workflow too.
Other than that, there's also a Files: Save All command you've probably already found.
I'm actually not sure you can do this with the extension API right now - you can definitely trigger the "save all" command easily, but you'd need to be notified of when a build occurs, and I couldn't find any events for this. I think it will definitely be possible after #15179 is resolved though, which should allow extensions to participate in builds.

Eclipse vrapper undo

I use Eclipse for programming in almost any language. I also like the vim shortcuts for quick editing so I installed vrapper.
The problem is when I write a lot of code, and I just want to undo some little things. It undos a lot of chunks of code back, instead of 2 or 3 little things.
I've found some threads which seem to resolve my issue by using "set noati", but it does nothing. It doesn't matter if I use "Ctrl+Z" or "u" from vim command mode.
Can someone please help me to resolve this issue ?
The set noati seems to be the solution for that (at least was for me and other people in vrapper forums)... simply to update to the latest version of vrapper then you either specific the set noati (no ":" here!) in the ".vrapperrc" (this config file should be placed in your home directory) or you simply run the :set noati command from Eclipse vrapper.
HTH.
Here are two things that might help you.
1) Stay out of insert mode.
The way undo works is in terms of vim commands. So if you change to insert mode and type a hundred words, that counts as a single command. On the other hand, if you press escape every once in a while to get out of insert mode, undo will behave much more pleasantly.
Once you get more familiar with vim, you will want to do less and less in a single insert. So the undo problem will likely be reduced as well.
2) Temporarily disable vrapper via the toolbar icon.
This is an alternative if you absolutely need the default undo behaviour of Eclipse.

Are there any apps that save backup versions of a file with one click (save, commit, etc) live while editing?

Just something that will save changes automatically, while i'm editing say in gedit, or notepad plus plus, or even windows text editor, etc.
I can't seem to find exactly what I'm looking for and svn, bzr, and Git are too complicated. One should be able to start a new project, start writing code, and that's it!
So... I'm going to create a whole new version control system that will be more amazing and simple than all the rest! Unless something already exists? Whether it be online, or a local install, whatevs.
EDIT: Ok, the above paragraph was a bit absurd now that I read it much later. I use Git now, and Git is awesome.
Many text editors will create a backup copy of the prior version when you do a save.
Of course, this is pitiful compared to an actual version control system. You should know that many VCS integrate with editors so commits are very simple quick commands.
The minor time it takes to create a repository is insignificant compared to the time it will save you during the project.
Frankly, this sounds like an argument from ignorance.
I found this nice little Gedit plugin: http://nerdblog.pl/2009/06/01/save-and-commit-to-git-plugin-for-gedit-2-26ave/

emacs local version control

I am wondering if there is local version control/snapshots for emacs independent of VC?
let me clarify:
every time I save buffer, I would like to be able to keep track of changes of each save in session. I know I can do something similar with backup files, but they are not automated like VC and a somewhat cumbersome.
I have searched Google, but did not find the solution.
Perhaps my query string was not good.
I found this for eclipse, am looking for emacs equivalent:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-55.htm
Thanks
AFAIK there is no such solution, but you can make some ad hoc one - like creating a local VCS repository and advice the save-buffer command to commit the changes in the repository.
I also came across a section of the manual that might be of interest to you.
I don't know of a way to get Emacs to save buffer snapshots, but keep in mind that it has an infinite undo facility. If you just want a way to get back to earlier versions, that might help you. If you want real version control, then I'd go with Bozhidar Batsov's solution and advice the save-buffer command.
http://www.emacswiki.org/emacs/BackupEachSave