Stuff that occurs to me

All of my 'how to' posts are tagged here. The most popular posts are about blocking and private accounts on Twitter, also the science communication jobs list. None of the science or medical information I might post to this blog should be taken as medical advice (I'm not medically trained).

Think of this blog as a sort of nursery for my half-baked ideas hence 'stuff that occurs to me'.

Contact: @JoBrodie Email: jo DOT brodie AT gmail DOT com

Science in London: The 2018/19 scientific society talks in London blog post

Showing posts with label undelete. Show all posts
Showing posts with label undelete. Show all posts

Thursday, 13 September 2012

How to avoid deleting stuff and how to recover from it - at a fairly basic level I think

Edit: 2 December 2012 - instructions are for PCs, which is what I wrote this post on. Now I'm using a Mac the instructions are more or less the same but wherever it says Ctrl use the Command key . Where I've referenced notepad or paint - use TextEdit or TextWrangler and [need to check name of Paint version!]. 

When I started using computers for writing documents in earnest (the days of AmiPro, WordPerfect and early versions of Word) I soon learned that saving often and backing up was important. 

The first thing I ever learned, and probably the thing I type most with my left hand, is Ctrl+S which is your basic 'save whatever I'm working on now' keyboard command on a PC. As far as I'm aware it'll work on anything where you can type.

If you've not saved the document before (ie, it's a new document) then pressing Ctrl+S will likely bring up a little box inviting you to name the document and say where you want to store it.

Generally programmes like Word don't crash anything like as often as they used to and recovery appears to be built in as default (if not, try File > Options > Save, making sure relevant boxes are ticked).

Even if your computer needs to be switched off and on again to restart things, Word, when you restart it, will show you the last saved version (the programme automatically saves at intervals, you can change the intervals yourself [see below] and of course Ctrl+S overrides and saves with the current version) and ask if you want to keep or discard it.

A couple of quick ways of grabbing your text before things crash, that is if you get any warning, are...
(1) use Ctrl+A which selects all of the text in the currently-active typing window, then Ctrl+C to copy that text to the clipboard (which is hidden, so it looks like nothing happens). Ctrl+V will then paste the text into a fresh window - I often use notepad for most of my editing (in fact I'm drafting this post in notepad now) which is a much smaller programme and quicker to save a file in, in an emergency. My preference is to start in notepad and then transfer (using Ctrl+A, C and V) into Word for a document or email, or into a blog post, comment window or whatever.

Or (less brilliantly)

(2) to press the Print Screen button on your keyboard (PrtScn on mine, next to Scroll Lock) and then open up Paint (basic picture editing software that's bundled with every version of Windows I've ever seen, used to be called Paintbrush) which you can find by Start » Paint (type it in the search box). Pressing PrtScn copies an image of the entire desktop (you can also do Alt+PrtScn just to copy the current window) which you can then paste (Ctrl+V) into Paint and save it. Admittedly all that will do is save a couple of hundred words or so which you'll then have to retype them. We've all done it ;)

Recap
  • To save your document as you go, use Ctrl+S
  • To select all the text in the window that you're currently writing in, use Ctrl+A
  • To copy the text that you've selected (you can use your mouse to click and drag a smaller selection of text of course) - Ctrl+C  || Use PrtScn or Alt+PrtScn to grab a 'photo' of what you were working on, save it in Paint and re-write it when you've recovered.
  • To paste the text that you've copied somewhere, use Ctrl+V (you need to position your mouse cursor into the spot where you want your text to appear).
We're also writing a lot of stuff these days directly 'onto the internet' in terms of drafting blog posts or writing comments on YouTube. Here there are greater risks of losing stuff when you press send and the page refreshes itself taking my / your pithy insights to the grave. Swearingly annoying when that happens. 

I do sometimes weaken and type directly into an internet comment box (I include 'compose new Gmail message' in this category) but before I press send / publish / comment or any other 'go' button I usually do a quick Ctrl+A (to select all) and Ctrl+C (to copy it to the clipboard) ready to paste it again (Ctrl+V) in case of disaster.

A free program that autosaves as you write: Evernote
Evernote acts both as a local filestore and as a place to store files on the internet. You can create a new note, type text in it and press Ctrl+S and it's saved to your computer. If you're connected to the internet it will miraculously synchronise with the Evernote server providing (a) back up of your note and (b) let you read your note on any other device that you've chosen to sync with your Evernote account (eg iPhone). You can also click the Sync button to manually synchronise.

I use this a lot when going to a place I've not visited before - I use Google Maps to find information, take screenshots on my PC, stick them into an Evernote note then click Sync to synchronise. Once done I can then view this information on my iPhone while on the move (the iPhone version of Evernote needs to be synchronised too so do this before you leave in case the signal's poor when you're out). Very useful.


Free online filestore: Google Drive née Google Docs
If you've a Gmail / Googlemail account (and if not it's pretty easy to get one) you already have a large free internet space to create and store files on Google Drive. If you use the Chrome browser (it's Google's) you can work offline but will need to synchronise once you are online again, so that you can access the files from another computer. You can also export your documents to doc, pdf, rtf etc.

Thanks to Erik J Cox and Joe Dunkley (@joedunckley) for suggesting Google Drive and also for what to say about it, in response to a related tweet of mine.

If you've done something you didn't mean to: Ctrl+Z
I have always felt a bit like this XKCD cartoon [where someone says they've never seen the diet coke and mentos demo before and you get the joy of showing them] whenever I've shown someone how to recover whatever they were doing with the Ctrl+Z command.

With a-bit-too-sensitive laptop pointers it's annoyingly easy to unwittingly select a bunch of text and overwrite it. I do this a lot by accident when I'm actually trying to paste something (Ctrl+V) on top of some text I want to replace and mistakenly end up just pressing the letter v, replacing an entire paragraph of text with "v". Pressing Ctrl+Z fixes this (it reverts you back one step) - it's exactly the same as 'undo' and works anywhere you can type. 

You can toggle between 'undo' (Ctrl+Z) and 'redo' (Ctrl+Y) all you like (although ironically it's not that effective in notepad!)

In programmes like Word you can do several steps backwards if you press and hold Ctrl and press Z a few times and you can probably set how many times you're able to go back - although I've not found out how to do it. It seems I can go back several steps on my copy of Word so I think the default setting is pretty forgiving.

Recap
  • You've done something you wish you hadn't and want to go back a step (undo), use Ctrl+Z
  • You've done several somethings you wish you hadn't, use Ctrl+Z, Z, Z (keep holding the Ctrl button while pressing Z!)
  • Actually that was fine, you didn't need to undo that (redo), use Ctrl+Y
A free tool to back up your files: Dropbox
This is a file storage system that, like Evernote, works locally and on a remote server. When you save a file you save it to a location on your own computer but it is also synchronised with a copy of that file on the Dropbox servers. I use this to work on something in the office, save it, close... and then pick it up at home. As long as you don't have the work and home copies open simultaneously you'll never run into problems (even then it just saves two copies and marks one as a copy, for you to decide which one to keep). 

Both Dropbox and Evernote have pretty much eliminated the need to email documents to myself. 

Even if you delete a file on your computer's Dropbox and didn't mean to you can undelete and recover it via the web server - http://dropbox.com

Learning objectives: you should now be familiar with... ;)
  • Use Ctrl+A, Ctrl+C to copy a bit of text before publishing it somewhere, using Ctrl+V to paste it, just in case you lose it.
  • When working in a document type of programme use Ctrl+S regularly to save it.
  • Recover from error with Ctrl+Z to undo (or Ctrl+Y to redo)
  • Use 'cloud' type services like Evernote or Dropbox (free versions available) to 'type and save' as you go.
  • If writing on the web (eg a blog post or comment) draft it in something like notepad first before transferring the text. Or if writing directly onto the web copy the text before you publish it in case the page loses it when you press 'publish'. 
Miscellaneous things about Word that I've mentioned above
Tweaking the time between automatic saving of your document.
These instructions work for Word 10 (the one with ribbons) - they're slightly different from earlier ribbon-free versions of Word.
  • Click on File (it's probably highlighted in blue and is to the left of the Home tab). 
  • Choose Options which is towards the bottom of the menu.
  • Choose 'Save' to view the options for saving documents.
In the main panel you'll see an option for "Save AutoRecover information every ... minutes" - make sure it's ticked and set a time, eg 10 minutes, or lower if you type fast. There's also a "Keep the last autosaved version if you close without saving" - I'd be surprised if this wasn't already ticked as default but tick it if not.

Temporary copies of your Word documents are probably available somewhere on your computer
It used to be the case that when you were working on older versions of Word every time you saved the document the system would create a temporary (.tmp) file which was overwritten once you closed Word.

It was possible to recover these when disaster occurred and sometimes to get the text out (this was not always straightforward and required a bit of prior knowledge and patience). I vividly remember lovely IT folk helping me access these types of files in the first place so that I could then work on one to try and recover the text. The contents were usually fairly unreadable and it wasn't simply a matter of opening up the .tmp file and carrying on as you were - you had to pick the closest correct format to open and then do quite a bit of processing of the mangled text to fix things. 

This is where I learned to use things like Edit / Replace All but that's not particularly relevant to this post, but see this one for more on that.

I've honestly no idea where the .tmp files are to be found on my current laptop - I've never needed to look for them as the software hardly ever crashes (sometimes it hangs, but it recovers a few moments later). This is probably a useful technique to record so if anyone knows more and tells me I'll add it here but I've found all the other methods above tend to solve everything for me.

Meanwhile, I suggest trying to search for *.tmp / *.tmp* / *.doc or *.doc* to see what's there. If your file is called important.doc you could replace the first asterisk with important, the second asterisk covers all eventualities of your file ending being .tmp$ or .docx etc. See Retrophile's second comment below.

More posts in the Word tips series...

Saturday, 21 July 2012

How to find deleted files using Google Cache

Note: there is a window of opportunity for being able to access a recently deleted page or file and once Google Cache has reindexed* the page this window closes. You'd probably not be able to do this if a week or more had elapsed.

*Google indexes / crawls web pages periodically and saves a cached version of the page as it appears when the crawl happens. If a page changes between two crawls then Google clears its previously cached version and replaces with the new one. At that point it's much harder to recover the older material but you might find it on the Wayback Machine (although stuff usually takes about six months to appear).

This is a 'worked example' from something I've just tried to do - it might not work in every situation. It really helps if you have a Gmail / Google account and use Google Drive (formerly known as Google Docs).

1. My source page was a job advert and job description that closed on Friday 19 July 2012 and the page now returns a '404 not found', as both page and job is no longer available. 

The URL of the page was
http://www.britishscienceassociation.org/web/AboutUs/_CRESTExpansionCoordinator2012.htm
which gives enough information to find the cached version two days later. 

A quick way of doing this is just to paste that URL into Google. In this case you get (predictably) a single result.




2. You need to hover your mouse to the right hand side of the search result until the >> arrows show up (highlighted with a vertical yellow oval), click on those and the panel appears on the right hand side. Click on Cached (highlighted with horizontal yellow oval). You can then access the text of interest if needed.

3. Capturing the file might work here - it depends on whether or not the file has been removed as well as the page. Often the page itself isn't removed and only the link pointing to it is, but the page can be deleted of course. Neither situation necessarily means that the file that was originally uploaded with the page has been deleted too though, they're separate things.

However in this case clicking on the link for the file didn't work, so my next plan was to look for the cache of the PDF by searching for the URL of the PDF, which was 
http://www.britishscienceassociation.org/NR/rdonlyres/28AC5D8C-C584-4E23-959A-62D1C243B236/0/JobDescriptionCRESTRoleJune2012final.pdf <-- this live link no longer works.

4. Searching for the file's URL in Google brings up the following - click on 'Quick View' - this will bring up the cached version of the file in a Google Docs format. I've never tried doing this without being logged into Google, not sure how well it will work if you don't use Google Drive / Docs.



You can keep a copy of the file in your Google Drive / Docs folder using the 'Save in Google Docs' link, you can share it with others using the obvious link. The best bit is that you can send yourself (or anyone else) a PDF copy.

5. To acquire a PDF copy first 'Save in Google Docs' then click on the 'documents list' notification that appears. Click on the name of the file to open it as a Google Doc and then click on File >> Email as an attachment. That's not the only way of doing it though (as of 21 Aug I managed this a slightly different way).

Although there's a File menu option when you first save the doc the 'email as attachment' option isn't there (I checked) so you have to do this extra step first.

Hopefully you'll have a copy of your searched-for file, but there are no guarantees alas!