If you have an addiction to nicotine, you can go to a physician for a transdermal patch to decrease your desire to smoke (nicotine).

If you have an addiction to a piece of code (computer game or program), you can go to a website or a business and get a patch to increase your addiction.

If you have a relationship problem, go see a professional counselor and patch things up.

Guess which one of these three has any lasting success?

In music, a patch is a sound, or the set of preset parameters that make up the sound, on a synthesizer or keyboard instrument (or an effects device with patch memory). For example, my Korg DW8000 had a halfway-decent Hammond organ patch.

The term itself derives from the days of modular synthesizers, when the individual modules (oscillators, filters, amplifiers and so on) had to be connected with patch cords in order to produce sounds.

pastie = P = patch pumpkin

patch

1. n. A temporary addition to a piece of code, usually as a quick-and-dirty remedy to an existing bug or misfeature. A patch may or may not work, and may or may not eventually be incorporated permanently into the program. Distinguished from a diff or mod by the fact that a patch is generated by more primitive means than the rest of the program; the classical examples are instructions modified by using the front panel switches, and changes made directly to the binary executable of a program originally written in an HLL. Compare one-line fix. 2. vt. To insert a patch into a piece of code. 3. [in the Unix world] n. A diff (sense 2). 4. A set of modifications to binaries to be applied by a patching program. IBM operating systems often receive updates to the operating system in the form of absolute hexadecimal patches. If you have modified your OS, you have to disassemble these back to the source. The patches might later be corrected by other patches on top of them (patches were said to "grow scar tissue"). The result was often a convoluted patch space and headaches galore. 5. [Unix] the patch(1) program, written by Larry Wall, which automatically applies a patch (sense 3) to a set of source code.

There is a classic story of a tiger team penetrating a secure military computer that illustrates the danger inherent in binary patches (or, indeed, any patches that you can't -- or don't -- inspect and examine before installing). They couldn't find any trap doors or any way to penetrate security of IBM's OS, so they made a site visit to an IBM office (remember, these were official military types who were purportedly on official business), swiped some IBM stationery, and created a fake patch. The patch was actually the trapdoor they needed. The patch was distributed at about the right time for an IBM patch, had official stationery and all accompanying documentation, and was dutifully installed. The installation manager very shortly thereafter learned something about proper procedures.

--The Jargon File version 4.3.1, ed. ESR, autonoded by rescdsk.

patch is Larry Wall's program for applying a diff (context diff, unified diff, or even an ed-script produced by "diff -e") to files. Why bother? Well, suppose I give you my program in file a.c. You fix a bug and end up with a patched version fix/a.c. Rather than send me the entire file, you say

% diff a.c fix/a.c > diffs
and send me just the file diffs. With patch, a.c and diffs available, I can generate fix/a.c.

If that were all, patch wouldn't be remarkable (or even particularly useful -- "diff -e" produces a script you can run through ed!). patch has some additional useful features, though. For instance, with the -R switch I can apply the diff in reverse to get a.c from fix/a.c. patch is also careful: if the diffs don't match, it refuses to apply them without some user application of force.

But wait! There's more!

patch's truly amazing ability is to apply the diffs to a different version of the file! For instance, suppose N-Wing has produced his own version of a.c (presumably supporting EJB, XML, Perl/Tk and Python's tkinter). Being the nice spaceship that he is, N-Wing also emails me his diffs. N-Wing's version is based on my original a.c, too, but doesn't fix your bugs. By applying N-Wing's patches to my original a.c, I can get N-Wing's version; by applying your patches, I can get your version. But patch lets me get both additions!

patch can apply diffs to a changed version of the original file. It uses lucky guessesheuristics to identify where the changes occurred, and apply the diffs where they were meant to be. The closest thing is probably the action of a merge -- except that merges have 3 files available, while patch only has 2! Of course, if conflicts occur, patch cannot resolve them; it "rejects" them, leaving them in a separate file for a human to resolve. It's a bit like working with CVS -- except there is no central repository.

Larry Wall wrote patch after writing the then- wildly popular newsreader rn (which popularised the revolutionary UI concept of "just keep pressing SPACE, and it'll do the right thing"). Many people offered patches to rn in the form of diffs, and these were circulated by email and by Usenet. With n patches on a single version, there are 2n possible subversions people might have -- and Wall couldn't support them all. Worse, if a diff was dropped or rejected by Wall, it would become impossible to apply when the next version of rn came out, because all the line numbers were wrong. Wall's patch problem made it possible for each person to accept or reject patches on the original version. By distributing upgrades (also) in the form of diffs, it also became possible to update your version, while keeping in place any private hacks you might have added to make it work on your particular computer.

Wall didn't write rn in Perl. At the time, he hadn't yet written perl. But it does have the feel of a program by Wall: solid, safe, somewhat predictable, and delegating responsibility to the user only when it must. In short -- a UN*X programmer's program.

Patch (?), n. [OE. pacche; of uncertain origin, perh. for placche; cf. Prov. E. platch patch, LG. plakk, plakke.]

1.

A piece of cloth, or other suitable material, sewed or otherwise fixed upon a garment to repair or strengthen it, esp. upon an old garment to cover a hole.

Patches set upon a little breach. Shak.

2.

Hence: A small piece of anything used to repair a breach; as, a patch on a kettle, a roof, etc.

3.

A small piece of black silk stuck on the face, or neck, to hide a defect, or to heighten beauty.

Your black patches you wear variously. Beau. & Fl.

4. Gun.

A piece of greased cloth or leather used as wrapping for a rifle ball, to make it fit the bore.

5.

Fig.: Anything regarded as a patch; a small piece of ground; a tract; a plot; as, scattered patches of trees or growing corn.

Employed about this patch of ground. Bunyan.

6. Mil.

A block on the muzzle of a gun, to do away with the effect of dispart, in sighting.

7.

A paltry fellow; a rogue; a ninny; a fool.

[Obs. or Colloq.] "Thou scurvy patch."

Shak.

Patch ice, ice in overlapping pieces in the sea. -- Soft patch, a patch for covering a crack in a metallic vessel, as a steam boiler, consisting of soft material, as putty, covered and held in place by a plate bolted or riveted fast.

 

© Webster 1913.


Patch (?), v. t. [imp. & p. p. Patched (?); p. pr. & vb. n. Patching.]

1.

To mend by sewing on a piece or pieces of cloth, leather, or the like; as, to patch a coat.

2.

To mend with pieces; to repair with pieces festened on; to repair clumsily; as, to patch the roof of a house.

3.

To adorn, as the face, with a patch or patches.

Ladies who patched both sides of their faces. Spectator.

4.

To make of pieces or patches; to repair as with patches; to arrange in a hasty or clumsy manner; -- generally with up; as, to patch up a truce.

"If you'll patch a quarrel."

Shak.

 

© Webster 1913.

Log in or register to write something here or to contact authors.