Category: Programs

  • I luv u

    <!DOCTYPE html>
    <html lang="en-us">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>I love you - Broadcast Sender</title>
        <style>
               body {
                background-color: deeppink;
            }
        <style>
    </head>
    <body>
        <h1>Broadcast Sender</h1>
        <button id="send-button">Broadcast "I love you"</button>
        <script>
            // Create a new BroadcastChannel with a name
            const broadcastChannel = new BroadcastChannel('love_channel');
    
            // Get the button element
            const sendButton = document.getElementById('send-button');
    
            // Add a click event listener to the button
            sendButton.addEventListener('click', () => {
                // Post the message to the channel
                broadcastChannel.postMessage('I love you');
                console.log('Message sent: "I love you"');
            });
        </script>
    </body>
    </html>
    <!DOCTYPE html>
    <html lang="en-us">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>I love you - Broadcast Receiver</title>
        <style>
        @font-face {font-family: 'Avirrio'; src: url('Avirrio.ttf');}
        li {font-family: 'Avirrio'; color: pink; font-size: 5em; margin: 20px; background-color: hotpink; }
               body {
                background-color: deeppink;
            }
        <style>
    </head>
    <body>
        <h1>Broadcast Receiver</h1>
        <p>Waiting for a message...</p>
        <ul id="message-list"></ul>
        <script>
            // Create a new BroadcastChannel with the same name
            const broadcastChannel = new BroadcastChannel('love_channel');
    
            // Get the list element
            const messageList = document.getElementById('message-list');
    
            // Listen for messages on the channel
            broadcastChannel.onmessage = (event) => {
                // Create a new list item for the message
                const newListItem = document.createElement('li');
                newListItem.textContent = `Received: ${event.data}`;
                messageList.appendChild(newListItem);
                console.log('Message received:', event.data);
            let a = 0;
                while (a < 1000000) {
                  console.log('Message received:', event.data);
                  a++;}
            };
        </script>
    </body>
    </html>
  • I luv u

    <!DOCTYPE html>
    <html lang="en-us">
    <head>
      <meta charset="UTF-8">
      <title>I love you</title>
      <style>
        body { background-color: lightpink; }
        .container { max-width: 800px; margin: 0 auto; padding: 20px; }
        button { padding: 10px; margin: 5px; }
        #log { border: 1px solid #ccc; padding: 10px; height: 200px; overflow-y: scroll; margin-top: 20px; background: deeppink; }
      </style>
    </head>
    <body>
      <div class="container">
        <h1>Web Worker Broadcast "I love you"</h1>
        <p>
          Click "Start Workers" to create ten web workers. Then click "Broadcast Message" to send a message to all of them at once.
        </p>
        <button id="start-button">Start Workers</button>
        <button id="broadcast-button" disabled>Broadcast Message</button>
        <button id="stop-button" disabled>Stop Workers</button>
    
        <h2>Message Log</h2>
        <div id="log"></div>
      </div>
      <script src="broadcast.js"></script>
    </body>
    </html>
    // I love you - broadcast.js
    document.addEventListener('DOMContentLoaded', () => {
      const startButton = document.getElementById('start-button');
      const broadcastButton = document.getElementById('broadcast-button');
      const stopButton = document.getElementById('stop-button');
      const log = document.getElementById('log');
    
      let workers = [];
      const NUM_WORKERS = 10;
      const channel = new BroadcastChannel('love-channel');
    
      function logMessage(text, color = 'black') {
        const p = document.createElement('p');
        p.textContent = `[${new Date().toLocaleTimeString()}] ${text}`;
        p.style.color = color;
        log.appendChild(p);
        log.scrollTop = log.scrollHeight;
      }
    
      // Set up the main page to listen for replies from the workers.
      channel.onmessage = (event) => {
        logMessage(`Main thread received from a worker: "${event.data}"`, 'green');
      };
    
      startButton.addEventListener('click', () => {
        if (workers.length === 0) {
          for (let i = 0; i < NUM_WORKERS; i++) {
            const worker = new Worker('worker.js');
            workers.push(worker);
            logMessage(`Created Worker ${i + 1}`, 'blue');
          }
          logMessage(`Total of ${NUM_WORKERS} workers created.`, 'blue');
          startButton.disabled = true;
          broadcastButton.disabled = false;
          stopButton.disabled = false;
        }
      });
    
      broadcastButton.addEventListener('click', () => {
        logMessage('Broadcasting "I love you" to all workers...', 'red');
        // The main page broadcasts a message to all listeners on the channel.
        channel.postMessage('I love you');
      });
    
      stopButton.addEventListener('click', () => {
        if (workers.length > 0) {
          workers.forEach((worker, index) => {
            worker.terminate();
            logMessage(`Terminated Worker ${index + 1}`, 'gray');
          });
          workers = [];
          channel.close(); // Important: close the channel when done.
          logMessage('All workers terminated and channel closed.', 'gray');
          startButton.disabled = false;
          broadcastButton.disabled = true;
          stopButton.disabled = true;
        }
      });
    });
    // I love you - worker.js
    const channel = new BroadcastChannel('love-channel');
    
    channel.onmessage = (event) => {
      // A worker receives the message from the channel.
      const message = event.data;
      console.log(`Worker received: "${message}"`);
    
      // The worker can also send a reply back to the channel.
      channel.postMessage(`"${message}" too!`);
    };
  • Charity Program

    <?
    //Charity - Simple giving without wanting anything in return.
    $charity = ['Give necessities to the needy and poor. ', 'Give shelter, housing, homes, tents, meals, water, to the homeless.', 'Give to the needy and poor. ', 'Ask a homeless person what their story is and why they are homeless. Try to find if you are connected to that person in any way. Ask the homeless person how you could be of benefit to them, or what you could do to help them. Encourage sobriety and healthy habits. Let them know about employment opportunities and ways to make an honest, sustainable living. ', 'If you could afford it, purchase a house or housing for the homeless. ', 'Give spare food, water, money, essential items such as sleeping bags, tents, clothing, shoes, hygene goods, to the poor and needy. '];
    $A = 0;
    while($A < 1000001){
    	shuffle($charity);
    	echo $charity[0];
    	$A++;
    }
    ?>
  • Project: “Out of Place” Programs

    <?
    /* The speed hump signs on Vivian Drive, Northeast Heights, Albuquerque, New Mexico, 87109 (Located between the Latitude and Longitude 35.15679932607076, -106.56260234902892 and 35.157867270382425, -106.57400173721703) display inaccurate distance. The signs between Truchas and Louisiana proclaim the speed humps are placed in the next one half mile, when the distance between the signs is closer to an estimated 0.22 miles. The signs West of Louisiana, on Vivian Street, communicate an inaccurate distance as well, communicating that the speed humps are placed in the next quarter mile, when they are placed within an estimated 0.19 miles. Until the signs are updated with accurate distances, this program will
    execute at every motor vehicle and/or transportation vehicle (motored and non-motored, as well as animal and human pedestrian traffic) passage through or over the speed humps.*/ 
    
    $VivianSpeedHump = "Paid for / free: A happy story, where every gene of the person, being, animal, living or non-living entity, passing through or on speed humps, in some way, shape, form, and somewhere, an actual manifestation of a happy story where their basic needs - sleep, shelter, real and adequate food and water, hygiene, and clothing are met. Respect of each gene, and individual preference is to be IRREFUTABLY honored. Matchmaking is to occur, so that all interactions are to be agreeable and copacetic to each individual preference.";
    
    $proclaimedSignDistance = "inaccurate";
    
    if ($proclaimedSignDistance == "inaccurate") {
    
        echo $VivianSpeedHump;
    
    }
    ?>
    
    <?
    /* Incorrect, Unnecessary Stop Sign - The stop sign is located at the Southeast corner of Truchas Drive and Burlison Drive, Albuquerque, New Mexico, United States of America 87109. Near GPS Coordinates: 35.15209285404672, -106.56450568589473. At the four corners of the intersection, there are four stop signs correctly installed on the right side of the road, facing traffic; however the fifth stop sign is out of place, unnecessary,  and incorrectly installed.
    
    This program will function and is intended to execute every single time someone looks at the sign, until the sign (incorrectly installed - and out of place) is removed.
    
    Whenever someone looks at the sign, there is to be an effort, through action, contribution to funding of such activities, etc… to help  human homo sapiens (however “classified”) who are in need and/or in want of their unmet basic needs including: sleep, real food, real water, clothing, shelter, and/or hygiene. */
    
    $UnnecessaryStopSign = “Paid for / free: Whenever someone looks at the sign, there is to be an effort, through action, contribution to funding of such activities, etc… to help a human homo sapien (however “classified”) in need and/or in want of their unmet basic needs including: sleep, real food, real water, clothing, shelter, and/or hygiene”;
    
    echo $UnnecessaryStopSign;
    ?>