11 Jul 2014, 19:54
Generic-user-small

Iggy Glassman (4 posts)

I was trying to back track on some coding I did, by hitting command-z a bunch of times. After a bunch of times, everything (all my code) disappeared. I couldn’t get it back, as when it all disappeared, I accidentally hit z alone, without command, thus making it so the computer couldn’t redo. Is there any way to get my code back? I worked on it for weeks and was hoping to find someplace where it was saved, but I can’t. Can anyone help?

12 Jul 2014, 03:30
Chris_strom_headshot_200_pragsmall

Chris Strom (138 posts)

Sorry, Iggy. If Command-Shift-Z does not “undo the undo” (i.e. redo), then it really is lost :’(

Your only hope would then be to find a copy that you made along the way and restart there. The more copies that you made along the way, the less work you’d end up losing.

If you made no copies along the way, you really will have to start from scratch. That would really stink, but maybe it’s not quite as bad as it sounds. You learned more along the way that you probably realize. It will still take time to redo your work, but you’ll find that much of it goes quicker the second time around. And you’ll also find that much of the code will just be better. In fact, some programmers intentionally delete their first version of the program for just this reason—once you’ve written it once, it’s going to be better then next time.

I know that this is absolutely zero consolation, but every programmer out there has done exactly this. Multiple times. Something goes wrong (weird editor action, disk crashes, etc) and hours, days, weeks of work is lost. If you’re like me, you’ll do this again and again. If you’re better than me, you’ll makes copies at least daily.

Sorry I don’t have more help to offer. Good luck!

18 Jul 2014, 22:11
Generic-user-small

Nathan Tuvey (9 posts)

hello could you please give me the code up to chapter seven for the avatar. i reset my browser and lost it. thanks -nathan

19 Jul 2014, 14:17
Chris_strom_headshot_200_pragsmall

Chris Strom (138 posts)

If you have the ebook, there is an appendix at the end of the book with the complete code for each chapter. You can just copy & paste directly from there.

The entire source code for the book is located at: http://pragprog.com/titles/csjava/source_code.

20 Jul 2014, 20:35
Generic-user-small

Nathan Tuvey (9 posts)

thx

  You must be logged in to comment