Tuesday, May 28, 2019

taking for granted: URL bars and spellcheck

Just a random thought- if I were timeshifted back a decade or two and had to use the browsers of the time: one thing is how much people got used to one input box that is both the URL as well as a search box. Also, it's kind of cool that spellcheck is now near ubiquitous - I guess that extends beyond the browser and into the OS.

Saturday, May 25, 2019

vs code extensions i like

I'm realizing that I really need to get my mojo of making small things in React from scratch (just for practice), I went back to my old Hello, World in Parcel - I was frustrated that my home laptop's version of VS Code wasn't trivial to set up so that it was prettifying like my work machine, and a few guesses at what extensions I might want were R O N G wrong.

So fwiw, at work I've been using:

  • Babel JavaScript
  • ES7 React/Redux/GraphQL/React-Native snippets
  • Prettier - Code formatter
  • GitLens - Git supercharged
And I've grown to love that editor.formatOnSave setting...

Friday, May 24, 2019

css gradients, fun and easy

PorchfestMV, Martha's Vineyard, is the latest addition to my small legion of porchfest websites.

They used one of those "Free Logo" sites (honstly, more like $30-50 if you want to actually use it) and came up with:
Not setting the design world on fire, but serviceable. And the use of color gradients provides an easy visual hook for the website:


To make that bar, I made sure the wrapper div has a style position:relative, and then something like
.colorbar {
    height:100%;
    width:10px;
    position: absolute;
    left:-20px;
    background-image: linear-gradient(green, yellow, purple, red, blue);
}
I avoided ROYGBIV order for now, and might go back to color pick the actual colors the logo uses, but for now it's pretty sharp looking, and easy to code.

Monday, May 20, 2019

weird flex but ok

Guess 'cause I'm still getting over this fever, but it took a few stabs for making a sponsors display like:
(Looking at it now I realized it would have been a decent candidate for grid or even table, though it's nice that flexbox means you don't have to think about lining up with a row-like object)

I admit I'm falling into bad habit of "px" and non-semantic markup, but Oh Well...

(it is sad that it's 2019 and centering vertically isn't an instant no-brainer)

Anyway: markup like this, with "texty" for a sponsor that has no img:

<div class="sponsors">

<div class="texty"><div>Barry's Village Deli</div></div>
<div><img src="/img/sponsors2019/fastsigns.png"></div>
<div><img src="/img/sponsors2019/Justnextdoor.jpg"><div>Just Next Door</div></div>
//...
</div>
And then CSS like


.sponsors {
    display: flex;
    flex-wrap: wrap;
    width: 845px;
    margin: auto;
}
.sponsors > div {
    margin:20px 2px;
    width:270px;
    height:270px;

    display:flex;
    justify-content:center;
    align-items:center;
    flex-direction:column;
    
}
.sponsors > div > div {
    text-align: center;
    width:100%;
}
.sponsors .texty {
    color:white;
    background-color:#2b809e;
    font-size:1.5em;
}
.sponsors img {
    max-width:250px;
    max-height:250px;
}

Saturday, May 18, 2019

Spacewar!, exclamation point and all

I am fortunate to be Facebook Friends with Matt McIrvin - as you can see on his blog we share interests in old video games and he has lots of interesting things to say on the topic, not all of which makes to his blog.

He recently posted this video on the PDP-1. The PDP-1 was a computer system of a lot of firsts, including the first programmed video game, "Spacewar!" (in the 1980s, may aspiring geeks learned the story of its development in Steven Levy's book "Hackers: Heroes of the Computer Revolution" - I'm also lucky enough to share a Science + Spirituality reading group with Jack Dennis, one of the characters in it.)

I cued up this video to the Spacewar! section:


The game had a huge influence; you see it's sense of space motion and blasting in the early 80s hit Asteroids and then its 1;1 combat explored deeply in the 1990 game "Star Control", to name the two most obvious examples.

I found some interesting blog posts by Owen Macindoe on the MIT Game Lab site, back in its heyday as Gambit, as they go on a deep dive of the old MIT code:
Investigating the Spacewar! Source
The Night Sky in Spacewar!
Reconstructing the Vector Graphics in Spacewar!

In the video, we see bullets colliding and cancelling each other out - that's a detail that cheap duplicates of the game often miss (possibly being computationally expensive!) but that adds an important defensive aspect. It's also related to something that's always bugged me about the game: if one rocket ship is short stubby and the other long and sleek, isn't that unfair to one player? The answer is probably related to this explanation given by undergraduate Kaivan Wadia in a final blog entry on their work to reconstruct the game on Arduino, The Peculiar Spacewar!:
We finally decided to implement the collision algorithm used in the original game. The original algorithm considered imaginary circles around the spaceship and detected whether any object capable of blowing it up was within that circle. This resulted in a slightly mysterious effect where torpedoes could pass through the spaceship occasionally. Sometimes two spaceships could pass through each other at certain angles. A spaceship could also be blown up by a passing torpedo that was not going to hit it, but was simply within the circle. 
That jives well with this line in the commented source:

 000016 006000 6000  / collision "radius"

from my experience handcoding a lot of games, that's usually a telltale of some fast to calculate but rarely distractingly inaccurate math to know when things hit.

don normalization of user friendly design

Don Norman on user friendly design for the elderly - previously I responded to his "How Apple is Giving Design a Bad Name". I have less to say about this, but I'm glad he's giving more attention to how things look, how superficially it's good when things seem sculptural and not like medical devices.

Don Norman is famous for his book "The Design of Everyday Things". Ironically it didn't originally follow its own maxim of "function over form", since I knew it as its earlier title "The Psychology of Everyday Things" - a clever name that let him use its acronym "POET", but one that created much confusion for bookshelvers, many of whom weren't sure if it was going under psychology or design or what.