<?php

require_once (dirname(__FILE__) . "/fetch.php");

// Move file pointer to the corresponding closing bracket of the current
// element.
function move_to_closing_bracket($fp, &$char)
{
   if ($char == CLOSE_ELEMENT_CHAR) return;

   $ii = 1;
   while (($char = fgetc($fp)) != NULL && !feof($fp))
   {
      if ($char == OPEN_ELEMENT_CHAR) $ii++;
      else
      {
         if ($char == CLOSE_ELEMENT_CHAR) $ii--;
         if ($ii == 0) break;
      }
   }
}

// Store the file contents as a string, replace the specified string with a new
// string, and re-write the file.
function replace_string_in_file($file_name, $old, $new="")
{
   $file_contents = file_get_contents($file_name);
   $file_contents = str_replace($old, $new, $file_contents);

   $fp = fopen($file_name, 'w');
   
   fwrite($fp, $file_contents);
}

// Erase file contents between and including element's brackets.
function read_raw_element_string($fp, &$char)
{
   $element_open_position = ftell($fp)-1;
   move_to_closing_bracket($fp, $char);
   $element_close_position = ftell($fp);

   if (char_is_white_space($char = fgetc($fp)))
   {
      skip_white_space($fp, $char);
      $element_close_position = ftell($fp)-1;
   }

   $byte_range = $element_close_position - $element_open_position;
   fseek($fp, $element_open_position);
   $element = fread($fp, $byte_range);

   return $element;
}

// If the submitted element points to an object, convert the element to its
// raw string representation.  Otherwise, leave the string unchanged.
function convert_element_to_raw($element)
{
   if (is_object($element))
   {
      $element = $element->convert_to_raw_string();
   }

   return $element;
}

// Replace in a file the element identified by specified ID w/ a new element.
// The new element can be an object, element string, or empty.  If empty, the
// old element will be removed and replaced with nothing.
function replace_element_by_id($file_name, $id, $element="")
{
   if (file_exists($file_name))
   {
      $fp = fopen($file_name, 'r+');
      move_to_element_by_id($fp, $char, $id);
      if (feof($fp)) return;
      $old_raw_element = read_raw_element_string($fp, $char, $id);
      $new_raw_element = convert_element_to_raw($element);
      fclose($fp);

      if ($old_raw_element != NULL)
      {
         replace_string_in_file(
            $file_name, $old_raw_element, $new_raw_element);
      }
      return $old_raw_element;
   }
}

// Replace an element with a new element.  If the new element is unspecified,
// the old element will be deleted.
function run_replace($file_name, $id, $element)
{
   if (!file_exists($file_name)) return;

   replace_element_by_id($file_name, $id, $element);
   $message = "!! Removing element $id... !!\n\n";
   if ($element != NULL)
   {
      $message .= "Replacing with\n--------------\n";
      $message .= convert_element_to_raw($element);
      $message .= "\n\n";
   }
   $message .= "New file\n--------\n";
   $message .= run_parse($file_name);

   return $message;
}
<?php

require_once (dirname(__FILE__) . "/fetch.php");
require_once (dirname(__FILE__) . "/replace.php");

// Insert a string into the file, leaving the current data intact.
function insert_string_at_cursor($fp, $string)
{
   $position = ftell($fp);
   $file_meta_data = fstat($fp);
   $length = $file_meta_data["size"] - $position;

   $tail = fread($fp, $length);
   fseek($fp, $position);
   $new_content = $string . $tail;

   ftruncate($fp, $position);
   fwrite($fp, $new_content);
}

// Insert the element data at the end of the file.
function insert_element_into_file($fp, $element)
{
   fwrite($fp, $element);
}

// Insert an element into the element referenced by id.  This will create a new
// child for the referenced element.
function insert_element_into_element($fp, $element, $id)
{
   move_to_element_by_id($fp, $char, $id);
   move_to_closing_bracket($fp, $char);
   fseek($fp, ftell($fp)-1);
   insert_string_at_cursor($fp, $element);
}

// Move to the position either before or after the element currently under the
// cursor.
function move_cursor_based_on_insertion_method($fp, $char, $before)
{
   if ($before == False)
   {
      move_to_closing_bracket($fp, $char);
   }
   else
   {
      fseek($fp, ftell($fp)-1);
   }
}

// Insert an element before or after the element referenced by id.
function insert_element_at_id($fp, $element, $id, $before=False)
{
   move_to_element_by_id($fp, $char, $id);
   move_cursor_based_on_insertion_method($fp, $char, $before);
   insert_string_at_cursor($fp, $element);
}

// Open file for writing or appending based on where the new element will be
// inserted.
function open_file_based_on_method($file_name, $id)
{
   if ($id != NULL)
   {
      $fp = fopen($file_name, 'r+');
   }
   else
   {
      $fp = fopen($file_name, 'a');
   }

   return $fp;
}

// Choose one of three methods for insertion based on the existence and values
// of the id and child parameters.
function apply_insertion_method($fp, $raw_element, $id, $child, $before)
{
   if ($child == True)
   {
      insert_element_into_element($fp, $raw_element, $id);
   }
   elseif ($id != NULL)
   {
      insert_element_at_id($fp, $raw_element, $id, $before);
   }
   else
   {
      insert_element_into_file($fp, $raw_element);
   }
}   

// Insert an element into the specified file.  The before parameter indicates
// whether or not the incoming element should be placed before the referenced
// element.
function insert_element(
   $file_name, $element, $id=NULL, $child=False, $before=False)
{
   $fp = open_file_based_on_method($file_name, $id);
   $raw_element = convert_element_to_raw($element);
   apply_insertion_method($fp, $raw_element, $id, $child, $before);
}

// Insert an element into the specified file.  Return relevant messages for
// verbose output.
function run_insert($file_name, $element, $id=NULL, $child=False, $before=False)
{
   $message = "Inserting\n---------\n";
   $message .= convert_element_to_raw($element) . "\n\n";

   $child = ($child && $child != '0') ? True : False;
   $before = ($before && $before != '0') ? True : False;
   insert_element($file_name, $element, $id, $child, $before);

   $message .= "New File\n--------\n";
   $message .= run_parse($file_name);

   return $message;
}
216.73.216.37
216.73.216.37
216.73.216.37
 
March 3, 2021

Video 📺

Computers are a gun. They can see the target; they can pull the trigger. Computers were made by the military to blow people's brains out if they stepped out of line. Google Coral is the same technology that pollutes the oceans, and so is the computer I'm using, and so are the platforms I'm using to post this.

Game 🎲

Games are a context in which all play is purposeful. Games expose the fundamentally nihilistic nature of the universe and futility of pursuing any path other than the inevitability of death and the torture of an evil that knows and exploits absolute freedom. Games are not educational; they are education.

Propaganda 🆒

Education is propaganda — ego driven by-product conveying nothing that would enable us to expose that vanities made for gain subject us further to an illusion created by those in control: the illusion that quantity can represent substance and that data or observation can replace meaning. And why say it, or how, without contradicting yourself, that everything, once registered, no longer exists, and in fact never did, exists only in relation to other non-existent things, and when you look, it's not there, not only because it's long vanished, but because where would it be?


fig. 2: Gamer goo is a lubricant — not for your skin, but for facilitating your ability to own the competition (image from Gamer goo review)

As a result of video games, the great Trojan horse 🎠 of imperialist consumerist representationalism, people are divided in halves to encourage them to act according to market ordained impulses, to feign assurance, penetrating themselves deeper into a tyranny from which every action signals allegiance, confusing the world with definitions and borders, constantly struggling to balance or brace themselves against forces that threaten the crumbling stability of their ego.

F

or example, a cup 🥃 is designed and built to hold something, maintain order and prevent chaos. It keeps water from spilling back to where it belongs, back where it wants to go and gravity wants it to go. The cup is a trap, and it is used to assert dominance over nature, to fill with thoughts about existence, time and self, thoughts regarding dissimilarity between equal parts and patterns that manifest in variation. These ruminations disguised as revelations boil away to reveal isolated and self-aggrandizing thoughts about an analogy fabricated to herald the profundity of one's campaign's propaganda. You have no authentic impulse except to feed a delusion of ultimate and final supremacy. That is why you play games. That is your nature. That is why you eventually smash the cup to bits 💥 or otherwise watch it disintegrate forever because it, by being useful, threatens your facade of ownership and control.


fig. 3: worth1000

The cup is you; it reflects you; it is a lens through which you see yourself; it reassures you, confirming your presence; it says something, being something you can observe. When you move, it moves, and it opens after being closed. You can use it as a vessel for penetration fantasies, keeping you warm and fertile, a fine host for the plague of consciousness, you reptile, you sun scorched transgressor that not only bites the hand that feeds, but buries it deep within a sterile chamber where nothing remains for it as a means of escape except the corpses of others that infringed upon your feeding frenzy.