alexpgp: (Default)
My client sends me a huge (50 MB) Word file that frankly, can only be transmitted using exceptional means (i.e., Dropbox, Skype) because few, if any, email systems will allow attachments of such size. My task is not to translate the monster, but to reduce the size of the file.

My first step involved doing a search-and-replace on the graphics, searching for ^g and replacing with nothing. The resulting file was less than 2 MB in size, so it's a safe bet that reducing the size of the graphics (in the sense of data volume, as opposed to display dimensions) is called for.

I did not quite write a macro to do this, but I think one could be written with little trouble. The general algorithm would be:
  1. Make sure ImageMagick is installed with the legacy convert option enabled.
  2. In Word, find the next graphic
  3. Cut the graphic to the clipboard.
  4. From a DOS command line, in a known directory (say, C:\temp) run the command convert clipboard:myimage image.png.
  5. In Word, click on Insert|Pictures, navigate to the known directory from step 4 (this only needs to be done the first time), select image.png and click on Insert.
  6. Unless all of the graphics have been replaced, go to step 2 and repeat the subsequent steps.

The final product was a hair over 6 MB in size, which is still large enough to make some email systems gag, but completely usable elsewhere.

Excelsior!
alexpgp: (Default)
I hadn't written a DOS batch file in years, but the following three-liner is pretty handy at "unsticking" a print queue when the spooler refuses to delete a job.
net stop spooler
del c:\windows\system32\spool\printers\*.* /Q
net start spooler
The first line stops a service called the print spooler, the second line gets rid of the data waiting to be printed (the /Q makes the operating system skip asking "are you sure?"), and the third line restarts the spooler.

I saved the three lines in a file called deleteprintjobs.bat in the directory that pops up when I click on Start|Run... and enter cmd as the program to run. In the window that appears, I type the name of the batch file, wait for it to complete, and then type exit to close the window.

Mouse addicts can attain the same goal by
  • clicking on Start|Control Panel,
  • double-clicking Administrative Tools,
  • double-clicking Services,
  • scrolling down to Print Spooler,
  • right-clicking and selecting Stop,
  • right-clicking again and selecting Start, and
  • closing the Services and Administrative Tools windows.
EIther way, it sure is a handy thing to know if you're running Windows XP.

Cheers...
alexpgp: (Default)
It occurs to me that the { DATE } field in Word documents isn't tremendously useful, since it seems to always show the current date.

One might argue that it would be useful to show a date, on paper, on which a document was printed, but then you'd never be able to tell what that date was unless you looked at the paper (in other words, the file would be of no help).

Better to use, perhaps:
  • { DATE } for the date on which the document was created;
  • { PRINTDATE } for the date on which the document was last printed;
  • { SAVEDATE } for the date on which the document was last saved.


Cheers...
alexpgp: (Default)
Boris R. gave me pretty rousing endorsement of the Google Desktop Search application, and after digging around on the 'net to learn more about it, I decided to install it on my VAIO. It's actually pretty neat, and beats the Sleuthhound Pro software pretty decisively. This is a good thing, as I hadn't really kept the Sleuthhound databases up to date and the software itself had some quirks that I had come to detest over time.

One of the things GDS doesn't do is search things like memory cards, and I can see why the folks at Google drew that line in the sand, but on the other hand, I've got a 1-GB memory stick and a 2-GB PCMCIA memory card more or less permanently installed in my VAIO, and I actually use them to store Files That Must Not Die™, so not being able to have them included in the GDS database is a little disappointing.

Of course, someone has come up with a plugin to solve the issue (and if I dig even harder, there are probably several solutions out there). However, before cataloging removable media, it makes sense to have a way of keeping track of said media. (Think of it this way: How does one get around the problem of cataloging the stuff on a USB flash drive mounted as drive H: if it's possible some other USB drive - or an iPod, or camera, or whatever - will get mounted as drive H: at some other time?)

I've played around with something called Datacatch, which seems to do the job. The free trial version sort of spooked me at first, because when it displays your removable media in a very Windows-like directory window, it shows each such item individually along with the total size of files on the volume. Clicking on the icon makes it look as if you're browsing the volume.

The only difference is that the initial icon one clicks on represents a catalog of the data, not the data itself. (But for a moment, there, it seemed to me that all the program was doing was copying files from media into one central location, which isn't the solution I was looking for.)

The next step - assuming I want to shell out money for Datacatch - would be to install a plugin that creates a link between the Librarian (the Datacatch program) and GDS. That is something I'll have to think about.

Cheers...
alexpgp: (Default)
I had this idea yesterday of creating a table of many narrow columns and short rows in Word - the effect would be not unlike graph paper - and then to use the merge-cell command to create a table whose format would very nearly match that of the tax return I'm to translate (or at least the first page of said return).

Having printed the table, I was faced with the problem of superposing the printed table and the printed document, and nothing short of a light table (which I do not have) would appear to do the trick. It then occurred to me that if I printed the table on something transparent (a sheet of plastic) my problem would be solved. Not having any such sheets available out-of-the-box, I cut up an A4-sized plastic folder that I use when I want to group several related items together, and sent one of the sheets through the laser printer.

Oops!

At about the time the leading edge of the plastic sheet should have been coming out of the printer, it wasn't and it dawned on me in a flash: laser printing involves a step in which the sheet being printed is run around a very hot roller to fuse the toner to the paper. At which point the plastic sheet stopped moving altogether and an alarm light started blinking.

Fortunately, I was able to extract the melted mess that was created without any apparent problem, since the printer continues to work without problems, but I think I may have just lucked out.

* * *
For the second time, I've run across a phenomenon in which an application appears to freeze or do nothing when invoked. The apparent reason? There's a part of it that was "left behind" on the "other" monitor when the machine was put to sleep from two-monitor mode.

What actually happened: In laptop-only mode, I fired up Semagic from the tray, whereupon it would not respond at all. Upon returning home and connecting the second monitor, it turns out there was a "History Item" dialog box open on the second screen. Something similar happened the other day when I tried to use The Sleuthhound, but in that case, I killed the process and continued on my merry way.

Just some things to keep in mind.

Cheers...
alexpgp: (Default)
I was simply too tired last night to explain why the "- 1" was important in the macro line
myRange.End = myRangeEnd - 1
but not decrementing the value ate a lot of time, so hopefully, this post will reinforce the knowledge gained. (Can you tell I don't want to settle down and translate?)

By the time we get to this point in the code, we've selected the contents of the table cell we're working with and assigned them to a range called myRange. We've also saved the value of the end point in a variable called myRangeEnd.

If the pattern we're looking for is found, the next step after copying the pattern is to shorten the range to exclude the found pattern. To do this, I wrote code to move the start of the range over by the length of the pattern and then set the end of the range to the original end value.

Schematically, the initial range looks like:

it's time for {123}all{124} good men and women to party
S------------------------------------------------------E


After the first pattern is found, the range is:

it's time for {123}all{124} good men and women to party
              S----E


Then we move the start point "over" the end point:

it's time for {123}all{124} good men and women to party
                   S


And we restore the original end point:

it's time for {123}all{124} good men and women to party
                   S-----------------------------------E


Only after instrumenting the code to show my selection did I realize what that did. If you work much with Word tables, have you ever noticed what happens if you select text in a cell and go one character past the end? The contents of the entire cell become selected!

That's what was killing me yesterday: everytime the code was executed, the range being examined was being reset to the original range, and I couldn't figure out why.

Extending the end point to one character shy of "the end," i.e., like this:

it's time for {123}all{124} good men and women to party
                   S----------------------------------E


solved the problem. The next time the pattern is searched for, "{124}" will be found (even if it's at the end of the text).

Apropos of which, the macro works like a charm and actually makes it much easier to deal with the source text. It was a good investment in time.

Cheers...

UPDATE: Wordfast has this concept of a "placeable," which basically is any source text string that's not translatable, such as document designations (e.g., the '50578' in "SSP 50578"). It turns out - I find out by accident - that strings such as "{123}" are treated as placeables as well, and since Wordfast has hotkeys for navigating and copying placeables, it turns out my macro sort of reinvented the wheel. Still, I don't regret the time spent developing the code.

Mojo...

May. 6th, 2007 12:05 am
alexpgp: (Default)
A while ago I got one of those new FreeAgent portable drives from Seagate, hoping that the advertised ability to take your work environment with you was something more than just a rewarmed version of U3 technology, which has been applied with almost imperceptible success in the thumb drive market (at least in my limited view). While hoping for the best, I was prepared for the worst, and figured that the "worst case scenario" was my acquiring a reasonably priced drive with twice the capacity of my laptop.

What I wanted to do was offload my iTunes application (and library) from my laptop to something that would hold both without leaving any permanent footprint on my VAIO. (Basically, this means installing iTunes on the FreeAgent drive so that no residue finds its way into the VAIO's registry.)

The FreeAgent add-on software - whose name I have forgotten - was only a trial version, requiring yet another module to implement the functionality that I sought. So I installed trial versions of the add-on software and the add-on to the add-on, and attempted to install iTunes.

No joy.

Somewhere in my gyrations about the Web, I picked up the name of something called MojoPac, which I downloaded and installed as a 30-day trial. I was pleased that iTunes installed like a champ. Office 97 installed like a champ as well, onto a drive called "C" that has nothing to do with the drive installed in my VAIO (and which drive is inaccessible while Mojo is running).

With the ability to switch back and forth between Mojo and my VAIO (as "host") it's like having two environments running on one piece of iron.

It's not all fun and games, though.

Primo, if I leave the system alone for a while, Windows (on the "host") will eventually try to go into standby mode, but is prevented by the Mojo application. If the host system is trying to go into standby because of a low battery condition, the results could be unpleasant (loss of data, file corruption).

Secondo, the ability to carry your environment with you, with your music, applications, data, etc. is a double-edged sword. An external drive is much easier to forget to take with you when you go on the road (I mean, it's not a computer, see?), and for the same reason, I imagine it'd be easier to misplace or have someone misplace it for you, if you get my drift, while you are on the road. I'll post more about this issue in some other rock, later.

Terzo - and this is a big one - there is iTunes.

...on authorizations, or lack of them, explained in geek behind the cut! )

Ya gotta love that DRM! (And I'm sure it's only going to get "better" as time goes by... but not for us poor users, but again, I digress...)

Quarto, portability only extends as far as the administrator of any given machine allows. You can't take the Mojo drive and connect it to a machine that has a lot of restrictions on it, because despite the fact you are isolated from the machine's drives, you are still running a program on the machine and are making use of resources such as network cards. Still, this really isn't a limitation of Mojo, but of Life.

* * *
The loaf I made earlier today... oops, yesterday, came out pretty well, except that the very top looks like it collapsed. I suspect there may have been too much water in the mix, this time. The product, however, is edible. I look forward to more experimentation.

So, it's just after midnight as I type this, and I have a pile of stuff that has to get done tomorrow, since today turned into one more of those "days off" that folks have from time to time. (This may be an indicator of burnout, I suspect, but I'm going to enjoy such indicators while I can!)

I plan to get up early tomorrow (around 5 am) and really hit it hard, and then try to get some sound sleep late in the afternoon, as another week of MSR night shifts starts tomorrow night.

Cheers...
alexpgp: (Default)
I had noticed, in playing "correspondence" chess over my BlackBerry, that opponents who stay mute for somewhere around 5 days or so forfeit their games, which makes sense, as some people would rather keep an opponent in thrall (to the extent that's possible when they're down a queen) rather than resign.

Lately, though, I had been noticing it's been harder and harder to get the software to behave. For the past few days, I have flat out been unable to get far enough through the procedure to actually get a move in.

Out of curiosity, I disabled the firewall on my phone (a constant nuisance) and zap! the connection to the game server went through with no hitch and I was able to make the next move in a game where I am the exchange and a pawn up.

So... just how necessary is it to run a firewall on a BlackBerry? Hmmm?

Cheers...
alexpgp: (Computing)
Now, in the real world, repeating the same actions over and over to get the same failed result is a pretty good definition of insanity. However, if you play with technology enough - and especially if you do any programming - you'll soon find that sometimes trying it just One More Time™ does the trick.

You see, the server has a "reset" button that didn't seem to do anything the previous 17.5 times I depressed it, but for some reason (or for some combination of arcane circumstances) actually reset the unit this last time I pressed it. From there onward, setting up the server was a piece of cake.

Not only that, but I learned how to clear out a print job that doesn't seem to want to go away using "conventional" methods (the way the gnomes of Redmond intended). Summarized without fluff:

1. NET STOP SPOOLER (entered from command prompt)
2. Delete the SPL and SHD files associated with the jammed job from %WinRoot%\System32\Spool\Printers (need to rely on file time stamps for this)
3. NET START SPOOLER (again, from command prompt)

Telecon tomorrow! Early start! (Good thing I napped this afternoon!)

Cheers...
alexpgp: (Default)
Back in the days before Unicode and UTF-8, Cyrillic was often encoded in that half of the 8-bit space that wasn't occupied by ASCII (i.e., in bytes with character values above 128). As these values were also used to encode accented Latin characters, you had to make sure you had the right font specified to read Cyrillic text, else all you'd see would be something that looked like: Àäàïòàöèÿ ê öèôðîâîìó çâó÷àíèþ.

Now, whenever I've run into one of these legacy files, it's generally been no problem to whip something up to convert them into proper Cyrillic. (I've even written a Word macro to do a global search and replace of 8-bit values with Unicode equivalents.)

It's been no problem until now, that is.

I've just gotten two small files that look like legacy files, except that the font representation is actually in UTF-8.

Stated another way, it's as if someone started with 8-bit Cyrillic, displayed it using a Latin font, and then saved the result as Unicode! I'll have to figure out a way to make sense of it, and stat (as the translation is due tomorrow).

Apropos of which, I have been suffering from intermittent cerebral flatulence these past few days. Two days ago, I accepted a job due on the 15th, thinking that the 15th is tomorrow, which it isn't. Fortunately, I managed to catch the error before blowing a deadline, but now I'm looking at too much work due too soon, and a time-consuming simulation looms within the next two hours.

I'll hope to find some time to outline a method for handling the "faux" UTF encoding during the sim.

Cheers...

UPDATE: The mapping from 8-bit Latin to Unicode Cyrillic is pretty straightforward, so much so that, as I mentioned, I wrote a macro a while back to do this tedious job in Word. As it turns out, there was a very simple fix to modify the macro so that it mapped Unicode Latin to Unicode Cyrillic.

The original macro has a line in it that read:
.Text = Chr(i)
The modified macro reads:
.Text = ChrW(i)
As I said... simple.

And yet another strange way of packaging Russian text bites the dust!
alexpgp: (Default)
One more note, and then I'll call it a night.

Some time ago, I downloaded a pretty nifty piece of software (USBDLM) that installs as a Windows service and allows you to control what drive letters are assigned to USB drives plugged into your system (for example, you could always have your "Geek Squad" USB drive always show up as drive K:). This is royally helpful if you use a backup routine that expects to see your backup directory, which resides on a USB drive, sitting on a particular drive.

To a lesser extent, from a usability standpoint, it also allows you to install applications, though they will still be tied to machine the USB drive is connected to and on which the application was installed (registry issues, dontchaknow).

And on that note, I shall go to sleep.

Cheers...

Zoom!

Feb. 1st, 2007 10:27 am
alexpgp: (Computing)
Events meshed well this morning. My telecon ended around 7:45 am and as I was heading for the car, I got a call from the cable installer to say he was on his way. I beat him to the house by a few minutes.

It turned out his job was to install a "trap" that is designed to keep me from getting cable TV while allowing me to get broadband service. As the fellow worked carefully in our waterlogged back yard, I called TimeWarner to see if I could set up their basic service and their one French channel and one Russian channel for what their brochure indicated would cost about $30 per month, with the idea being to avoid another service call (and installation charge).

I was rapidly disabused of the idea when the TW sales rep explained that, between this and that, getting the service I described would cost about $70 per month! Oh, well...

In any event, the broadband installation went well, although the installer wouldn't touch my wireless router, saying something about "liability issues." What he didn't say - and perhaps didn't know - was that upon initially connecting to the network, TW captured my VAIO's MAC address (a unique address that identifies my VAIO's network hardware), which thereupon became a necessary component of any connection to the system. Fortunately, I have DD-WRT running on my wireless router, which includes a capability to "clone" a MAC address, for just such an occasion.

So here I am, connected to the cloud via cable, and let me tell you: the throughput so far is pretty good, exceeding a half megabyte per second over my wireless link to the router!

I now return myself to my regularly scheduled day.

Cheers...
alexpgp: (Computing)
A client sent me a reminder a few minutes ago - part of a broader effort aimed at its entire freelance staff (about 100 names), since their names were included in the "From:" field - about the need to maintain confidentiality. There is a sort of quintessential irony there, which could have been avoided via the judicious use of the "bcc:" option, but in any event, the irony brought a smile to my face.

I've just discovered Pixel, an image editor that performs much the same functions as Photoshop, but at a much lower price. It does not use the cookie-cutter functionality (i.e., standard dialogs and controls) available through commercial Windows application frameworks, which gives it a slightly different look and feel, but the plus side is that Pixel is available for a number of platforms (including Linux). The trial version is said to be full-featured, except for a popup window exhorting the user to buy a copy of the program and the fact that processed images have a watermark applied to them.

I ran into a feature of TrueCrypt this morning that at first looked like a bug, which I discovered as follows: My VAIO went into hibernation from a Windows session yesterday, but as I am used to starting the machine by jogging the power switch (I am told one hits the "any key" to revive a hibernating Windows session), the unit came up in boot-ready configuration and booted into Ubuntu Linux.

An attempt to mount the TrueCrypt "partition" failed, which flummoxed me, as I was absolutely sure I had the passphrase right. I put it out of my mind until I rebooted the VAIO into Windows (restoring the "hibernating" session) where, hey, presto! it was apparent that the TrueCrypt "partition" was still mounted. I haven't checked to make sure, but I've since dismounted and remounted the partition using the right passphrase, and suspect my problem lay with the partition's having already been mounted (even if hibernating) when I tried to mount it again under Linux.

I'll verify that later, however. As it is, I'm behind the eight-ball for the day's work: I need to apply some effort now.

Cheers...
alexpgp: (Default)
This is not philosophy. The reason I am sitting in front of my computer at... 2:30 am instead of asleep like a good citizen is having started awake a few minutes ago wondering: "Where is my JSC badge?"

Heh. Without it, I'd be stuck high and dry and unable to work at the MCC until Monday, which would definitely be a bad thing, considering as how the start of my first shift - during the day, if luck holds - is just under 30 hours away.

Fortunately, I found my badge in the first place I looked.

I abandoned my hardware late last night to let LapLink continue to operate. So far, all is well, although the data transfer rate is currently being reported as something less than 200 kb/sec, with 36,000 or so of about 127,000 files transferred (4.9 of 8.6 GB) after nearly 8 hours. Hopefully, another 5 hours or so ought to do it.

On the way down here to my office, I noticed there is fresh snow around the house, but did not pause to see if the white stuff is flying. It better not be by tomorrow afternoon, or we'll have to devise a plan B for getting to Houston.

Now let me see if I can go back to sleep for a couple of hours.

Cheers...

Profile

alexpgp: (Default)
alexpgp

January 2018

S M T W T F S
  1 2 3456
7 8910111213
14 15 16 17181920
21222324252627
28293031   

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 17th, 2025 11:11 am
Powered by Dreamwidth Studios