Friday, November 04, 2011

XOR


XOR
 
<!DOCTYPE html>
<html>
  <head>
    <meta charset="windows-1252">
    <title>XOR</title>
    <meta name="description" content="Poem by Nari db.11x8.5" />
    <meta name="keywords" content="code poetry new media web net art
      ted warnell poem by nari database dataset 'off the page' 100
      HTML5 2011 windows-1252 XOR XOR XOR XOR XOR XOR XOR" />
    <script src="db11x85x.js"></script>
    <style type="text/css">
      @import url( "db11x85.css" );
      a {     color: #606069 }
      body {  color: #606069; background: #F9F9F0 }
      .fio0 { color: #606069 }
      .fio1 { color: #303039 }
      .bx0 {
        width: 850px;
        height: 850px;
        overflow: hidden }
    </style>
    <script>
      // <![CDATA[
      var a;
      function x_xor() {
           var x, y = ""; var _c = doc.getElementById(           "cnvs"
          ).getContext(          "2d" ); var sin = Math.sin( Math.PI /
         Math.random() ); var cos = Math.cos( Math.PI / Math.random()
        ); for ( x = 0; x < ( x_rnd( c_N03 ) + c_N02 ); x++ ) y += (
       x_rnd( c_N04 ) ? "•" : "·" ); _c.font = ( x_rnd( c_256    <<
      c_N04                ) + c_128 ) + "px 'arial', sans-serif";
     _c.globalCompositeOperation = "xor"; _c.lineWidth = ( x_rnd(
    c_N32   ) + c_N02 ); _c.strokeStyle = x_gold(); _c.fillText(
   "XOR", c_N75, 851, 0 ); _c.strokeText( y, x_rnd( c_256    ),
  x_rnd(  c_256 << c_N02 ), 0 ); for ( x = 0; x < x_boo(); x++
 ) _c.translate( sin, cos, sin, cos, 0, x_rnd( c_256 << x ) )
;                                                          }
      function x_gold() {
        return ( "#"
          + ( x_boo() ? "F" : "E" ) + c_HEX.charAt( x_rnd( c_HEL ) )
           + ( x_boo() ? "C" : "A" ) + c_HEX.charAt( x_rnd( c_HEL ) )
            + ( x_boo() + c_HEX.charAt( x_rnd( c_HEL  ) ) ) );       }
           var db_TI = "XOR";
          var db_YY = "2011";
         var db_FN = "xor";
        var db_ID = "warnell.com";
       var db_CO = "Canada";
      var db_FO = "";
      // ]]>
    </script>
  </head>
  <body id="main">
    <script>
      // <![CDATA[
        db11x85_page_header( "bx0", "FFFFFF" );
         db11x85_canvas( "", "850", "851", "" );
          for ( a = 0; a < c_N32; a++ ) x_xor();
           db11x85_page_footer5( "1px #000009 solid", "808089" );
      // ]]>
    </script>
  </body>
</html>
 
XOR
[ warnell.com/db11x85/xor.htm ]
 
xSA5xFF3xCH9
W3C HTML5
 

23 Comments:

Blogger Little Lamb said...

Oooooooooooooooooh!

3:06 AM  
Blogger /t. said...

yes, LL

  Oooooooooooooooooh!

or more precisely

  _c.globalCompositeOperation = "xor";

it is this that is responsible for the alternating black & white patterns in this work

variably-sized and stroked • and · characters in gold are placed at random locations on the white canvas -- a variably-sized word XOR in black is placed likewise -- where the characters and/or the words land, the canvas turns gold or black if white, or white if not white

XOR (eXclusive OR) like AND and OR and others is a nifty little bit (programmer's humor) of binary logic

  AND = true if ( 1 AND 1 )
  OR = true if ( 1 OR 1 )

but
  XOR = true if ( x AND NOT x )
    where x = 0 or 1

XOR allows for some very cool capabilities -- we can do things with XOR, LL, that we cannot do in reality(!) -- for example:

we have a cup of apple juice and a cup of orange juice -- we want to swap the juices in their cups -- to do it reliably, we need a temporary third cup -- the procedure then is to move the contents of the first into the temp, move the second into the first, and finally move the temp into the second -- then we have to wash the temp cup(!)

using binary logic XOR on the same challenge, where a=01 and b=10 -- watch the magic now:

  a = a XOR b (now a = 11)
  b = a XOR b (now b = 01)
  a = a XOR b (now a = 10)


contents of variables a and b are swapped in place -- that is, without use of a third temporary variable -- no temp to clean up!

so once again, LL, you've caught the essence of it in a word

  Oooooooooooooooooh!

thank you <3

× × ×

/t.

9:33 AM  
Blogger Little Lamb said...

That was very interesting.

6:31 PM  
Blogger /t. said...

LL,

thanks

this explanation,
although a bit sketchy,
is sufficient with a little reading
between the lines -- XOR would be a nice name for a lamb

× × ×

/t.

9:56 AM  
Blogger Little Lamb said...

How do you pronounce it? X O R?

10:46 AM  
Blogger /t. said...

X OR
or
EX OR
or
ECKS OR

short for
EXCLUSIVE OR

× × ×

/t.

11:19 AM  
Blogger Mo said...

Cor

4:30 AM  
Blogger /t. said...

mo,

i'll see your cor
and raise you a d'or

× × ×

/t.

1:44 PM  
Blogger foam said...

i might be in love with xor even though the character seems a bit shifty..

3:38 AM  
Blogger /t. said...

foam,

now this sounds like
dangerous dark foam speaking :)

but if you like 'em a bit shifty (AHA HAHA HA HA HA), you need look no farther than XOR's two cousins, << left bit shift and >> right bit shift -- remarkable boys

the bit shift brothers can perform bitwise integer multiplication and division without resorting to the muscle (and CPU cycle overhead) of MUL and DIV or the rest of that whole math coprocessor gang

a couple of very efficient and ultra fast operators these two -- limitations, yes, a few, but very powerful in the hands of a top-flight programmer -- very useful in Poem by Nari coding, too

here are the shifty bits (AHA HA HA): << and >>

× × ×

/t.

8:23 AM  
Blogger Nathalie said...

Your creativity never ceases to amaze me; thanks for the joy you bring to me every time I visit;

10:36 AM  
Blogger /t. said...

nathalie,

well, thank you
again for your kind words,
and
thanks for the joy you bring to me every time you visit(!)

× × ×

/t.

11:51 AM  
Blogger foam said...

muscle? maybe i might like MUL or DIV better then .. :)

3:51 PM  
Blogger /t. said...

foam,

you disappoint me...

those brawny math nerds get all the best action

(all the best bits AHA HAHA HA!)

× × ×

/t.

5:10 PM  
Blogger foam said...

That's me. Shallow and fickle..
:)

5:14 PM  
Blogger Mayden' s Voyage said...

You wrote...
AND = true if ( 1 AND 1 )
OR = true if ( 1 OR 1 )
but
XOR = true if ( x AND NOT x )
where x = 0 or 1


I liked it when x = kiss
and when 0 = hug
R would = "repeat" ;)

·(•°;o?§§¿o;°•)♥♥♥!

To me the image looks like it should be on a designer bag in a high end boutique. But then I'd never get to see it...so I like it better exactly where it is! Hugs and be well friend ♥

8:58 PM  
Blogger /t. said...

mayden,

X + O & R

kiss + hug & repeat

yours surely is a winning formula!

and i like your idea to see this pattern used in a practical way -- high or low end -- maybe something i should look into -- and thank you so much for saying(!)

X + O & R and ·(•°;o?§§¿o;°•)♥♥♥!

/t.

10:17 AM  
Blogger Ruela said...

Excellent!

4:53 PM  
Blogger /t. said...

ruela,

thanks, buddy

/t.

1:45 PM  
Blogger Nathalie said...

When I look at this work I see an ad for some expensive piece of jewelry - heavy gold, the big show off, glossy magazine stuff.

I guess in other words I'm saying the same thing as Mayden ("To me the image looks like it should be on a designer bag in a high end boutique").

I wonder if that's what you had in mind when you created it ?

1:46 PM  
Blogger /t. said...

nathalie,

this work relies
very much on chance
and binary logic (xor) --
my intention is that it show

1) some gold
2) lots of black & white
3) the word XOR on and thru the work

the rest is up to you :)

× × ×

/t.

4:43 PM  
Blogger Nathalie said...

It's the beauty of your work that it lets everyone put in their own interpretation :)

10:28 AM  
Blogger /t. said...

and wonderful creativity
of codepo() visitors

× × ×

/t.

12:04 PM  

Post a Comment

<< Home