fogbound.net




Fri, 28 Apr 2006

Redraw delay in Photoshop script.

— SjG @ 11:11 am

I’ve been working on a script to do a bunch of crazy manipulation of images in Photoshop. Basically, it sequentially opens all the image files in a directory, and displays a dialog box requiring user interaction to determine what to do with the image.

I was having the problem that the dialog box would come up before the image could redraw (in the case of large images), so the user would be asked what to do, but would be unable to see the image in question. This, of course, doesn’t work.

I tried writing delay code, to no avail. I had a very hard time finding help, because I didn’t know what search terms to use. None of “delay,” “repaint,” “refresh,” “sleep,” and “wait” yielded anything useful when combined with”Photoshop” and “Javascript.”

Finally I found this posting by Tom Hart in the Adobe forums, where he provides a function called WaitForRedraw which solves the exact problem!

Here’s a link to Tom’s Posting.


Thu, 12 Jan 2006

sa-exim config tweak

— SjG @ 11:13 pm

This is probably obvious to everyone in the universe but me, but I was having a problem where my outbound email was being scanned by sa-exim, in addition to the desired scanning of incoming email.

The trick is in setting your SAEximRunCond in sa-exim.conf correctly. This is probably documented somewhere, but I totally missed it. In any case, assuming you want to skip scanning of email originating in your local network (e.g., IP address of 10.3.2.0/24) and that you changed the secret SA-Do-Not-Run header’s name to SA-Do-Not-Think-Of-Running, you would use the following line in your sa-exim.conf:

SAEximRunCond: ${if and {{def:sender_host_address} {!eq {${mask:$sender_host_add
ress/24}}{10.3.2.0/24}} {!eq {$h_X-SA-Do-Not-Think-Of-Running:}{Yes}} } {1}{0}}

Voila, outbound emails are no longer checked. Of course, if you are sending spam, please do not make the above change, but instead please swallow whole six to ten large, unpeeled pineapples.


Sat, 7 Jan 2006

Ker-Ash!

— SjG @ 12:03 am

So, courtesy of the DWP, the Meier Quagg was without power for about 7.5 hours today. It’s not clear what was wrong. The other side of the street had power, as did several parallel streets nearby, but this side of Meier was out, as were patches of Venice like the Oakwood.
Anyway, when the power came back up, most of the servers came back with it. Intervention was required for the Golem, Pylonhead, and Sekhmet. Sekhmet was the worst. I only got the “LI” of LILO, which says that the /boot/boot.b file was bad, or the drive geometry was hosed.

So I tried my trusty Debian rescue disk. Typed rescue root=/dev/hda1 at the boot: prompt. The boot failed with a complaint that /dev/hda1 was an MSDOS partition. uh-oh… MSDOS?

Of course, it turns out that I was using the wrong rescue disk. I was using a Woody ISO, and I had upgraded the machine to Sarge — and EXT3, which evidently was not compiled into the rescue disk. When I finally tried the correct rescue disk, it came up neatly, repaired the journals, and gave me my precious root prompt.

I did the LILO replacement trick (lilo -u /dev/hda; lilo), popped out the CD, rebooted, and held my breath. Then I decided to breathe. It’s my second fastest server, but it’s still a four-plus-year-old Dell Optiplex. In any case, it came up cleanly and there was much rejoicing.

Now it’s just a matter of waiting for the mail secondary to forward on all the queued up spam.


Thu, 24 Nov 2005

The Information Future

— SjG @ 10:17 am

In the not-so-distant future, the average person will find information falling into one of three categories:

  1. Forbidden Information (circuit diagrams, satellite ephemeris, “intellectual property,” etc.)
  2. Purchased Information (“Entertainment,” music, movies, games)
  3. Pushed, Mandatory Information (advertising, propaganda)

Forbidden information, while available to some small group in order to perform their jobs, will be increasingly restricted under the twin guises of Intellectual Property and Homeland Security. Within twenty years, it will be illegal to design even simple circuits outside of sanctioned workplaces; similarly, computer programming will require licensing and security clearances.

Purchased information will be controlled by The Almighty Google Corporation (TAGC). Even information that people are permitted to create on their own will only be sharable to the world through a Google-controlled mini-payment system. Purchased information will also be inextricably meshed with Mandatory Information — to view your cousin’s wedding pictures, you will be obligated to view advertising from banquet companies or wedding registry providers, or perhaps even a Public Service Announcement on the evils of divorce.

The twist on all this is that bandwidth will be free. TAGC will have the world blanketed in a high-speed wireless network. You’ll site down in an overpriced coffee chain, open up your computer, and immediately be connected to virtually unlimited bandwidth so you can download as much Entertainment as you can afford. TAGC will, of course, use you location and search histories to inform you that you’re only a mile from a franchise of your favorite Bagel place, and it’s nearly lunchtime, and if you go now, you won’t get anxious and depressed later, so you can quit taking Paxil (that is why you were searching for information on the side-effects, isn’t it? Admit it. You sent a Gmail Message to your doctor on the subject too). What’s more, on the way, you’ll pass a Multinational Flower Distributor Outlet on the way, and you might want to keep in mind that you had a bit of a spat with the significant other (based on the frequency of the Gmails the other day, and the mood-assessor’s analysis of the vocabulary used), so this would be a good opportunity to patch things up — we would have recommend the Fancy Chocolatier across the way, but your significant other has been searching for diet information, so better play it safe…


Tue, 22 Nov 2005

Space Trader on your Treo 650

— SjG @ 8:56 pm

I occasionally get asked about Space Trader, a great game for the Palm originally by Pieter Spronck. Several years ago, I helped him write some of the code that was released as version 1.2, way way back in October of 2002.

Evidently, version 1.2 doesn’t run on the Treo 650. I don’t even have a Palm development environment at the moment, so I haven’t had a chance to fix the code that crashes it. But never fear! It’s Open Source, and someone going by the name of DrWowe fixed it. In addition, it looks like Pieter has fixed a few outstanding bugs (that all look like they were in code I wrote… how embarrassing).

Read all about it at:

http://discussion.treocentral.com/showthread.php?t=55952
http://www.cs.unimaas.nl/p.spronck/picoverse/spacetrader/STDownload.html