Saturday, September 17, 2022

JavaScript Crash Course Code


<!DOCTYPE html>
<html lang="en">
<head>
    <!--
    Mr. Brautigam
    JavaScript Crash Course
    -->
    <meta charset='utf-8' />
    <title>JavaScript Crash Course</title>
    <style>
    
        body { background-color: #438; 
            font-family: Courier, monospace;
        }
        h1 { text-align: center; color: lavender; 
            font-size: 1.75em;
        }
        div#console {
            background-color: lavender;
            padding: 0.5em;
            min-height: 10em;
            width: 75%;
            max-width: 1000px;
            margin: 1em auto;
            white-space: pre;
        }

    </style>
    <script>
        // do not change anything here
        function print (s) {
            document.getElementById("console").innerHTML += s;
        }
        
        function println (s) {
            if (typeof s !== 'undefined') {
                print (s)
            } 
            print ("\n");
        }
    </script>
</head>

<body>
    <h1>JavaScript Crash Course</h1>
    
    <div id='console'></div>

    <script type='text/javascript'>
    // your scripts will go here

        println ('This is the first line');

    </script>
</body>
</html>


Sunday, January 30, 2022

Advice for buying a Mac - January 2022 Edition

This is an update to my 2015 edition. Please read it first:

The quick version:

  • Your friend who works at Apple may be able to get you a discount.
  • Buy refurbished.
    • https://www.apple.com/
      • Scroll to bottom of page
      • Look for Refurbished and Clearance
    • Tech Restore, Small Dog, Mac Connection, and Mega Macs are all still in business.
    • Amazon? Just be sure to buy from Amazon or a reputable third party, not an individual.

How much memory?

  • The low end Apple models always come with 8 GB of RAM. This is never enough.
  • If you wish to run Xcode, get at least 16 GB of RAM.

How much disk?

  • The low end Apple models always come with 256 GB of SSD. This is usually enough for Xcode alone.
  • If you wish to subscribe to Adobe products or do audio processing, consider upgrading to 512 GB of SSD. This allows room for all the Adobe programs, which take up a lot of space.
  • If you wish do do video processing in the future or just make videos in general, consider upgrading to 1 TB of SSD. Video files can be very large.
  • Upgrading to 1 TB of internal SSD may cost $400 more than 256 GB. As an alternative, many choose to buy 1 TB of external spinning disk (around $50) or SSD (around $100). This can be effective if you expect to have a lot of video files. But it's better to keep large programs like Adobe on the internal drive.
  • The latest models come with a USB-C connector that may not connect to your USB-A devices. You may need to buy an inexpensive adapter (about $10).

Upgrades? On the Macs since around 2015, doing your own upgrades is rarely possible. Choose the most memory and disk you can afford at the time you buy it, and assume you won't be able to upgrade either RAM or SSD in the future.

Keyboard. Mac laptop keyboards from late 2015 until early 2018 (called "butterfly") are known to have problems. Don't buy a computer from before 2015; they are good, but not good enough for Xcode. Buy a computer from late 2018 or later and if it's a laptop, make sure to get a "scissor" keyboard.

Operating system and Xcode. 

  •  You can run Xcode 12.4 on "Catalina," vintage 2019. We have this in the classroom. You may need a computer made after 2014 or so to run this. You can talk to a device running up to iOS 14.4 with this setup.
  • You can run Xcode 12.5 or 13+ on "Big Sur," vintage 2020. You may need a computer made after 2015 or so. You can talk to a device running iOS 14.6 or later.
  • The latest Macs come with "Monterey," which came out in Fall 2021. You can talk to the latest versions of iPhones and iPads.

Comparison of models:

  • Mac Mini requires you supply your own monitor, keyboard, and mouse. Also requires adapter cables for all those. Suitable for intense work for 3–4 years.
  • Mac Book Air is suitable for intense work for 3–4 years. 
  • Mac Book Pro can last for 8–10 years. The more powerful processor will keep going longer.
  • The latest models (2021–2022) all have the new M1 chip, instead of the older Intel i5 or i7 chip.

Current prices for 16 GB of RAM:

Model256 GB512 GB256 EDUC512 EDUC
Mac Mini90011008301030
Mac Book Air1200140010801260
Mac Book Pro1500170013801580

At the top of each product page, I see a link that says Shop Education Store. I see lower prices when I click on that link. You can see those lower prices above. Save about $70 (7%) on Mac Mini. Save about $120 (10%) on Mac Books.