Monthly Archives: June 2008

Advertising Templates

From “The Fundamental Templates of Quality Ads” (pdf).

  1. Pictorial Analogy
    • Replacement
    • Extreme analogy
  2. Extreme Situation
    • Absurd alternatives
    • Extreme Attribute
    • Extreme Worth
  3. Consequences
    • Extreme consequences
    • Inverted consequences
  4. Competition
    • Attribute in competitition
    • Worth in competition
    • Uncommon Use
  5. Interactive Experiment
    • Activation
    • Imaginary Experiment
  6. Dimensionality
    • New Parameter Connection
    • Multiplication
    • Division
    • Time Leap

Time Machine – ouch

This morning my Mac’s backup (time machine) reported that the backup disk (a sparse bundle on a time machine) was read only and it couldn’t backup.  A bit later I noticed the error was more serious: “The disk “Backup of Pra…” was not repairable by this computer.  It is being made available to you with limited funtionality.  You must backup your data and reformat the disk as soon as possible.” (sic).

So I fired up Disk Utility; hit open; browsed to find that sparse disk image.  Found it.  But, it wasn’t available to open;  grayed  out.  Browsing the web I found the suggestion that I should drag the image into Disk Utility’s window – that opened it.

At that point I tried letting disk utility try to repair the sparse image.  No luck “Invalid sibling link.”  Argh.  I found a posting that implies I can buy a more potent disk repair utility ($50), but instead I’m just going to discard the backups and start over. 

This, and reading various postings about the problems people are having with their Time Machine backups is quite distressing.

 

Better data, fewer customers

Here’s an amusing business tactic: lock out the customers. You know the drill. You visit the website, log-in, and the vendor inserts an extra page forcing you to provide your missing zip code, or what ever. “Our data quality is more important than your time.”

So this company, a health club, locked their patrons out of the club. If they went to the desk they were told that their account was missing their email address.

It’s always good to keep things neat and tidy, but it’s impossible to get across how much this kind of thing drives customers away. Particularly because it drives off the most lightly connected customers. The ones that are hardest to model. The ones you desperately need going forward. There is probably some deep design principle here. You need to design the system to maximize the amount of chaos in your data. Homogeneity is a false God.

Meanwhile, if you enjoy keeping account data tidy you might want to drop by the Useless Account web site. Sign up! Edit your account profile to your hearts content.

Water’s series, using producing

Posting for the memory book.  Appendix A in the Common Lisp manual is a package Richard Water’s created known as series.  A series is a kind of hybrid between sequences (think lists) and streams.  They are cool because the resulting code is damn fast; usually compiling down to raw loops.  In anycase I had more trouble writing the following than I expected.  I kept writing setf rather than setq; which creates some bizarre errors.  Errors printing results actually.  It would also be good if I’d actually read the doc for producing, rather than just skimming it, for any given FOO or BAR the (next-in FOO ...) and (next-out BAR ...) forms should appear once and only once.    You get extra points if they appear at the start or tail of the tagbody respectively.

In this example we want to inhale two series nibbling off one or the other as appropriate.  Series a pain to use when doing this kind of mingling; but mostly because they don’t have a way to seek forward more rapidly than pulling items off the inputs one at a time.  What also makes them painful to use at this level is that you have to write at a level that is enjoyably only because it invokes a nostalgia for assembler language.  No doubt it one was writing a lot of his kind of code then you’d make a micro language that compiles into this pseudo assembler.  The series sources do something along those lines; making them wonderfully hard to read.

I’m really not fluent in using this package, so critiques from more expert users would be welcome.


(defun union-integer-series (s1 s2)
  "Given two ascending series of integers return a series of those integers
    which appear in both."
  (declare (optimizable-series-function)
                    (series s1 s2))
  (producing (items) ((g1 s1) (g2 s2) i1 (i1-ok nil) i2 (i2-ok nil))
      (loop
            (tagbody
                  --TOP--

                  (if i1-ok (go --I1-OK--))
                  (setq i1 (next-in g1 (terminate-producing)))
                  (setf i1-ok t)
                  --I1-OK--

                  (if i2-ok (go --I2-OK--))
                  (setq i2 (next-in g2 (terminate-producing)))
                  (setf i2-ok t)
                  --I2-OK--

                  (unless (= i1 i2)
                      (cond
                          ((< i1 i2)
                            (setq i1-ok nil))
                          (t
                            (setq i2-ok nil)))
                      (go --TOP--))

                  (setq i1-ok nil)
                  (setq i2-ok nil)
                  (next-out items i1)
                ))))

By example

> (setf *print-length* 7)
7
> (scan-range :from 5)
#Z(5 6 7 8 9 10 11 ...)
> (scan-range :upto 9)
#Z(0 1 2 3 4 5 6 ...)
> (union-integer-series * **)
#Z(5 6 7 8 9)
>