John Wargo

Home
johnwargo.com
Writing a Book, Part 2 – Batch Archiving PDF Print E-mail
Wednesday, 05 May 2010 19:49
AddThis Social Bookmark Button

As I mentioned in the first article in this series (here), I needed a way to have a sort of version control system (VCS) without installing a version control system. I wanted something simple, something that would work regardless of whether I was connected to a network. What I decided to do was use the batch file processing capabilities of WinZip to create complete backups of the manuscript (including all documents and images). With this system in place, I could execute the batch process at the end of any editing session (or in the middle if I had a lot of changes) and have a complete backup of everything in case I needed to revert to some older version or dig up some old content I’d deleted and shouldn’t have.

Before I begin, it’s probably important to let you know that while I was working on the manuscript and before I had a contract with a publisher, my working title for the book was Fundamentals of BlackBerry Application Development. Throughout this article and others in the series, you’ll probably notice that I named everything with the abbreviated version of the title: FoBAD. What’s funny though is that I also registered a web domain for the book as a placeholder. All of the options I wanted were already taken, so I went ahead and registered bbdevfundamentals.com. I figured I’d grab that domain and later, when I had the final title, at least I’d have a domain to use if the one connected to the official title was taken. As I negotiated with the publisher for the title, imagine my surprise when the final name my publisher came up with was BlackBerry Development Fundamentals which, when abbreviated, matched the name of the domain I already secured for the book’s site.

The requirements for the solution were:

1.    The ability to execute the backup without selecting the files I wanted backed up every time
2.    The ability to automatically set the backup archive file name using the current date and time – this allowed me to have a unique file name for every backup which would automatically sort as needed in any file listing (Windows Explorer or My Computer).
3.    Take up as little file space as possible

 

Now let’s dig into how to setup the batch process I needed for my project. When you open any of the later versions of WinZip in Classic mode, you’ll see a window similar to the one shown in Figure 1. You’ll need to click on the ‘Backup’ tab to expose the options you need to create batch processes.

Figure 1

As highlighted in the figure, select ‘Create’ to create a new backup job. WinZip will prompt you to provide a file name for your backup job. I suggest you put the job somewhere else than the folder you will be backing up. Use either you’re my Documents folder or, as shown in the figure, a folder immediately above the folder you will be backing-up. In this case, I named the file FoBAD Backup.

Figure 2

With the WinZip job created, it’s time to start configuring the settings for the backup archive. WinZip uses a wizard metaphor for setting up jobs, so you’ll be stepping through multiple screens as the job’s settings are defined.

In the next part of the wizard, you’re prompted to identify the files and folders that are included and excluded from the backup job.  In this case, I want to backup the contents of my FoBAD folder, but I don’t want to have to store my backups somewhere else. So, I’m including the FoBAD folder but excluding my Backup folder (as shown in Figure 3. For the manuscript, I also had a folder where I stored all of the source code and research documentation I used as reference for the book. Since the content of that folder never got updated (only new items added to it) I didn’t feel the need to include those files in my backup – it would take up too much hard drive space to be useful and I can always replace the content through an internet search. You can see the folders I’m excluding by looking for the ‘Exc+Sub’ in the Action column in the figure.

Figure 3

Click the ‘Select items…’ button to pick the items that are included and excluded from the backup job. The file selection dialog is shown in Figure 4. Place a check mark on the files or folders you want included.

Figure 4

In the next step of the wizard, you can select which type of backup being performed. For my manuscript backup, I selected a normal backup which grabs all files regardless of the file’s archive attribute setting. You can also use settings that allow for an incremental backup, differential backup or an update (refresh the contents of an existing backup archive).

Figure 5

Next the wizard prompts you to select some additional settings for the archive. I like to use the selection for relative folder information – that way I don’t end up with the full folder path in my archive. With relative folders set, only the folder structure information below the starting folder is included with each file.

Figure 6

In the next step is where the batch processing capabilities of WinZip become most useful. As you can see in Figure 7, you can specify a root file name for the backup (in the ‘Zip File Name’ field) then append the current date and/or time to the file name as well.

Figure 7

This feature supports additional options as shown in Figure 8.

Figure 8

You can also click the ‘Subfolder Options…’ button to specify the output folder options shown in Figure 9.

Figure 9

Or you can click the ‘Special Folders…’ button to specify the output folder options shown in Figure 10

Figure 10

Clicking the next button gives you a summary of the job’s settings as shown in Figure 11.

Figure 11

As this point, what I have is a backup job that backs up my manuscript folder but ignores the Backup and Research folders. The archive is called ‘FoBAD BackupFILEDATETIME.zip’ or ‘FoBAD BackupFILEDATETIME.zipx’ depending on which system I created the backup on. Figure 12 shows a snapshot of my Backup folder listing all of my backups.

Figure 12

Notice the difference between the file extensions on many of the backups. On my laptop I have WinZip configured for Legacy mode (standard Zip file format) but on my desktop I have the new and improved file format in use (zipx). I did this because on my laptop I needed to share zip files with other people who didn’t have a version of zip that supported the new file format. On my desktop I work in isolation, so the format of the zip files doesn’t matter.

After the job was all setup, I created a shortcut on my desktop pointing to the backup job. To perform a backup, I merely double-click on the shortcut and the backup launches, runs and closes when it’s all done. The first time you try this, WinZip will ask you whether you wish to execute or edit the job when it’s opened; be sure to tell the program to execute it and you’re all set. You’ll have a quick and easy way to backup any project so you have access to all previous versions.

Look for other articles in the series:
Writing a Book, Part 1 = Getting Started
Writing a Book, Part 2 – Batch Archiving
Writing a Book, Part 3 – Synchronizing Files
Writing a Book, Part 4 – Fixing File Synchronization Errors

Look for other articles in the series:

Writing a Book, Part 1 = Getting Started
Writing a Book, Part 3 – Synchronizing Files
Writing a Book, Part 4 – Fixing File Synchronization Errors

 
Writing a Book, Part 1 – Getting Started PDF Print E-mail
Sunday, 02 May 2010 19:46
AddThis Social Bookmark Button

After I completed BlackBerry Development FundamentalsBlackBerry Development Fundamentals, I thought I’d write some articles that outlined some of the process I followed to complete the manuscript. What follows is the first part of a series of articles that document the tools and procedures I used to help make the creation of the manuscript as painless as possible. In this installment, I’ll lay out the issues I had to address and in subsequent articles describe each of the solutions I used to solve them.

Writing a large word document is not that hard, but dealing with a complete manuscript (and associated image files) was rather challenging. As I worked, I quickly noticed that I was going to have a problem keeping my chapter files in good shape. I knew I’d be working on the manuscript from both my desktop PC when working at home and my laptop while on the road. The issue then was how do I keep all of the files accurately synchronized between the two systems and how do I maintain the integrity of the files as I worked on them.

The first thing I had to concern myself with was what tool I would use to craft the manuscript. Since I’d written a complete, 600 page product manual for ADT in Word, I knew that I could easily do it there. Having written my first bookmy first book in Word then switched to Adobe FrameMaker for layout, I knew that I didn’t want to do anything with the book in FrameMaker. I thought of using Open Office just for grins or perhaps Google Docs, but I know just how to put Word through its paces, so I knew I had to do all of my writing in Word.

The first thing I did then was created a folder for the manuscript and create separate Word documents for each chapter. Since I knew I’d have a different document for each chapter, I knew I wouldn’t have to deal with any issues Word had with large files. I had a pretty good outline of what I wanted in the book (the end book ended up looking nothing like it) so I thought I’d be OK setting up each chapter and plugging through one at a time until I got it done.

When I started the project, I forced myself to work on one chapter at a time, in sequence. I knew that if I jumped around, I’d never feel like I was making any real progress and I also knew I’d omit things. I started on chapter one then wrote each chapter in sequence until I completed it. That ended up being a very good decision and allowed me to demonstrate real progress to my publisher. Most published authors I’ve spoken with complained regularly about the schedules imposed on them by their publishers. I was already 6 chapters into the book when I received my contract from PearsonPearson and ended up never getting a schedule from my editor. He got chapter by chapter from me in timely installments, so he knew he didn’t have to worry.

I made a couple of big mistakes with my manuscript as I started writing…

First of all, I put each chapter file into the same folder. This seemed like a good idea until I started associating image files with each chapter. With each of the chapters in the same folder, all of the image files were there too. As I started placing images into the chapters as I worked through them, it got harder and harder to navigate through the folder to get to later chapter’s image files. I quickly learned (well OK, not that quickly; I think I figured this out long past the halfway mark in the book) that the best thing to do was make a separate folder for each chapter and image files. That way, everything was together and it was very easy for me to zip up each chapter folder to submit a chapter to the editor for review. With the files all in one folder, I was able to right click on a folder in Windows Explorer and have WinZip package up all of the files in a zip file already named for the chapter (since the folder already referenced the chapter name). Once I got all that figured out, it became much easier to manage the manuscript files. If you’re writing a novel, you can probably put all chapter files in the same folder; if writing a technical book or a book with a lot of illustrations; use a separate older for each chapter.

The second mistake I made was related to the Word Template my publisher wanted me to use. I took a look at it as after I began the project and felt that it was too ugly to work in day to day as I wrote the manuscript. They had a lot of special stuff you had to put in there (like a separate style for the first and last bullets in a list) and I thought it would be easier to write in a generic template then apply the publisher’s template before submitting it for review by the editor. Wrong! As I got further and further into my manuscript, I started having to submit early ones for editing and found myself wasting a lot of time fixing a document (by applying the publisher’s template and applying all of the special styles the publisher wanted me to use) when I should have been finishing up other chapters. When you write a book, get the publisher’s template ASAP and start working with it right away – it will save you a lot of stress later (and ultimately shorten the amount of time required to create the manuscript).

OK, now that I’ve described the mistakes I made, let’s dig into the issues I had to address and how I addressed them.

The first thing I needed to do was figure out how I was going to be able to keep every possible version of every chapter’s content. Being a developer geek, you’d think I’d use some sort of version control system, but I didn’t have one at my disposal and didn’t want to take the time to set one up and learn its tricks when I just needed to be writing.

When working with deliverables for my employer or a customer, I always save a new version of the file every time I open it for editing and use the current date in the file name to keep them separate. What I do is append the date to the end of the file name in the following format: yyyymmdd. Using this format, the file names for a particular file would look like this:

Samplefile 20100131.docx 
Samplefile 20100215.docx 
Samplefile 20100303.docx 
Samplefile 20100421.docx

What happens when you do it this way is Windows automatically sorts the file names by date in the file name. It’s easy to do and automatic in Windows. It always surprises me when people try to do this, but use the date in a different format (mmm-dd-yyyy, mmddyyyy, mmm ddyyyy or ddmmmyyyy) because Windows will sort these alphabetically and December will come before January. If you’re going to append the date to a file name, do it in a way that saves you time later searching for the file (use yyyymmdd format).

Anyway, when it came to my chapter files, I didn’t want to use that approach. I knew that when I submitted the chapter files to the publisher that I had to have them in a particular format (author initials plus chapter number – so: JMW01, JMW02, JMW03 and so on) and I didn’t want to have to rename the files before I submitted them (remove the date from the file name). So, I had to stick with a single file name for each chapter, but still wanted to keep an archival copy of each file. What I ended up doing was using the batch processing capabilities of WinZip to create a file I would execute at the end of every editing session (or in the middle as well if I was making a lot of serious changes) to create a zip archive of the manuscript. By doing this, I used more disk space than I needed to, but had every single version of every file at my disposal. It was never any trouble to go back and find a previous edit of the file. I’ll walk you through how I set this up in a later installment of this series.

The next thing I had to do was figure out how to make sure an exact copy of the manuscript was available to me on both my desktop and laptop systems. I knew that Windows has the ability to sync files with the server, but I didn’t want to sync the whole My Documents folder – only the manuscript files. A very long time ago, a customer (Jay Luteran from Euclid Hitachi) introduced me to an award winning piece of software called Second CopySecond Copy from Centered SystemsCentered Systems. I’ve been using this software package for years and it allows me to easily synchronize files between multiple systems. In a subsequent article in this series, I’ll show you how I used Second Copy to accomplish this.

Synchronizing the files ended up creating a huge problem for me as I adjusted the chapters and moved things around; I’ll explain this too in a subsequent article.

Another thing I wanted to do was make a single file out of all of the individual chapter files. I wanted this file so I could easily look at the complete page count and occasionally print out a full copy of the manuscript so I could stare at it in awe. What I did to accomplish this was use Adobe Acrobat Professional to create a complete PDF out of each chapter file and use Acrobat’s ‘Combine’ function to merge multiple chapter files into one complete manuscript. I’d written a program to do (in Delphi) a very long time ago, but for some reason the program wasn’t working on Vista 64, so I had to use the tools available from Adobe. Unfortunately with my home grown program, I could save the file list with the project and easily recreate the file by launching the program and clicking a button. For some bizarre reason, Acrobat doesn’t allow you to do that, so you have to select all of the files every time – I wish it worked differently, but Adobe hasn’t been asking me for my opinion.

OK, that’s about it – that’s all I have to tell you now. I will be writing subsequent articles that dig deeper into the topics I described above. Look for other  articles in the series:

Writing a Book, Part 2 – Batch Archiving
Writing a Book, Part 3 – Synchronizing Files
Writing a Book, Part 4 – Fixing File Synchronization Errors

 
WES Update PDF Print E-mail
Wednesday, 28 April 2010 10:57
AddThis Social Bookmark Button

I’m attending Research In Motion’s Wireless Enterprise Symposium (WES) this week. There haven’t been a lot of big announcements, but some of merit.

RIM announced two new phones on Monday – the BlackBerry Pearl refresh (the 9100) which is supposed to be slated for release by AT&T but not really announced by the carrier. The BlackBerry Bold is making its way to CDMA carriers (Verizon Wireless in the US) with the new BlackBerry 9650.

They also announced BlackBerry Mobile Voice System (MVS) 5.0 which now adds support for Wi-Fi calling (VOIP) through MVS.  I had an MVS account when I worked at Research In Motion and it was pretty cool. It’s an interesting concept and great to have your desk phone ring on your BlackBerry.

During the opening session, Research In Motion showed a video that highlighted the features and capabilities of BlackBerry Device Software 6.0. Research In Motion’s been getting so much pressure in the market to update their UI to match that found on the iPhone and Android platforms and looks like they’re set to deliver. I truly can’t wait to get my hands on the new device software (It’s not the OS although that’s what many people call it – the BlackBerry OS is running at different versions numbers, it’s the BlackBerry Device Software that the user interacts with) to see what’s new. Apparently Research In Motion has done a complete UI refresh on all of the applications. The BlackBerry messages application is already VERY capable for my email use (I just can’t stand the mail client on the iPhone) and I can only imagine this will be even better. It looked from the video Research In Motion showed that it’s got a lot of cool new features.

There’s a lot of speculation that Research In Motion’s got plans for a hybrid device (one with a touch screen and a keyboard) and I’m not sure I believe it’s true. It’s likely they will do this – especially with BlackBerry Device Software 6.0’s cool touch-based UI capabilities, but they’re being pretty closed mouthed about it. Historically every ‘leaked’ BlackBerry device has turned out to be a hoax – I can’t tell you how many times I’d hand a person the BlackBerry Bold 9000 and see them press on the screen. So many web sites said it’d be a touch screen device (even though I knew it wasn’t slated to be) but there has never been a touch screen version and people still push on the screen with their fingers.

I’m looking for some more big announcements coming at the conference, but I doubt there’s any more pending. They did announce the dates for the BlackBerry Developer Conference – September 27 through 30. I’m hoping I can attend the conference again this year.

 
The View Advisory Board PDF Print E-mail
Friday, 23 April 2010 16:12
AddThis Social Bookmark Button

The View updated its web site today and I'm now listed as a Technical Advisor for the publication. I'm excited and looking forward to writing mobility-related articles for the publication and getting other mobile domino geeks like me to publish articles. Let me know if you have a topic in mind.

Here's a link to the advisor listing.

 
Accessing Domino Databases from Android and iPhone PDF Print E-mail
Thursday, 22 April 2010 20:03
AddThis Social Bookmark Button

Last year I wrote a series of articles about how to build a BlackBerry application that talked to a Domino database. I intended it to be a series of three articles but it quickly grew to 4 and those articles have been heavily read and frequently commented on. I’m probably going to write a fifth article in that series that talks about some of the issues related to web services and JME and hopefully another article that shows how to talk to the same Domino web service from a BlackBerry Widget. I hope to get a chance to work on those articles in a while, but in the mean time I have some other things to write about.

At Lotusphere this year, I presented a session that basically covered everything that’s in that original article series plus demonstrated writing a Windows Mobile application that talked to the same service (let me know if you’d like me to write an article about it – I’d thought of doing it, but wasn’t sure if people cared). For this year’s conference I wanted to spice things up a little bit and add Android and possibly iPhone examples of the same application to my session.

The thing about Android and iPhone is that unlike BlackBerry and Windows Mobile, the platforms do not have native support for consuming Web Services. So, in order to be able to work with Domino from Android or iPhone you have to find another way to do it. What I did for those sample applications was rewrite the code for the service into a Domino agent that returned JavaScript Object Notation (JSON – www.json.org) when called through a web URL. It didn’t take me that long to do and it works very well, so I have what I need to work with the other mobile platforms. So, in the next few weeks, I’m going to publish an article that describes the JSON-based web service.

I wasn’t able to get the Android example done in time for Lotusphere (not without trying, I killed a lot of nights in Orlando during the conference furiously trying to get the app done – god thing I was recovering from pneumonia and didn’t want to party anyway). A while after Lotusphere I finally got the application done, so I’m going to cover that application at the View conference in a few weeks. After the conference (perhaps before if I get time) I’m going to publish an article that illustrates how to build an Android application that talks to the JSON-based web service. Just so you believe that it works, here’s a screen shot of the application.

I’m most of the way through building the same application for the iPhone. It’s been a nightmare building the application – Objective-C is so weird and complicated that I’m really struggling to finish the last part of the application. I’m planning to finish the application in time for the conference, I think I can do it, but like I said, I’m struggling. I’m probably not going to publish anything here about the iPhone application – I’m going to see if I can get an article about the application published in the View. Stay tuned on that one. Just to whet your appetite here’s a screen shot of the application.

 

 
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>

Page 3 of 24

My Book

InformIT (Pearson Education)