Author: scruss

  • pre-amalgamation bookplate, East York Public Library

    pre-amalgamation bookplate, East York Public Library

    pre-amalgamation bookplate, East York Public Library

    Instagram filter used: Normal

    View in Instagram ⇒

    (original birb is here, not scanned from a book: )

  • Raspblocks: Blocks-based Python coding for Raspberry Pi

    Update, 2019-01: raspblocks.com appears to be dead, with an “Account Suspended” error from the host

    Raspblocks is a new Blocks-based web programming environment for Raspberry Pi. You don’t even need to write the code on a Raspberry Pi, but the Python 3 code it produces will need to be transferred to a Raspberry Pi to run.

    For maximum authenticity (and slowness), I fired up  http://www.raspblocks.com/ on a Raspberry Pi Zero over VNC. It took a minute or more to load up the site in Chromium, but creating a simple program was all easy dragging and dropping:

    The code it produced was pretty much exactly what you’d write by hand:

    import RPi.GPIO as GPIO
    import time
    GPIO.setmode(GPIO.BCM)
    GPIO.setup(26, GPIO.OUT)
    
    while True:
        GPIO.output(26,True)
        time.sleep(1)
        GPIO.output(26,False)
        time.sleep(1)
    

    And, as you might expect, the code make an LED connected to GPIO 26 turn on and off. Science!

    Raspblocks isn’t as polished as its more established rival  EduBlocks, but Raspblocks doesn’t need any software installed. Edublocks installs its own Node.js-based web service, which would be painfully slow on a Raspberry Pi Zero. Raspblocks’ code needs to be run manually from a terminal, but I’d put up with that any day over having yet another Node server distribution installed under /opt.

  • It got difficult to take any more away from this

    It got difficult to take any more away from this

    It got difficult to take any more away from this
    worst jpeg artifacts ever, tho

    Instagram filter used: Normal

    View in Instagram ⇒

  • short sci-fi: “Mission: Survival”, by Curt Fischer – from Boy’s Life magazine, August 1988

    Mission: Survival

    by Curt Fischer
    Illustrated by Alex Gnidziejko
    from Boy’s Life, August 1988

    mission survival illo by alex gnidziejko

    “We need a shibboleth!”

    “A what?” said Tim Donaldson, the mining foreman of Xerxes 8, a mineral-rich planet on the far side of the Milky Way.

    “A Shibboleth,” repeated Harvey Wheeler. “A way to determine the identity of the enemy sooner than we do now.”

    Donaldson and the rest of the group stared at him blankly. The old man, Freiberg, leaned forward on his cane, as if to speak, but then he sat back quietly. The 20 others, like Donaldson, mostly uneducated miners, began to look at the floor, not wishing to show their ignorance.

    Only 13-year-old Bobby Hall, whose parents had left him with Wheeler while they visited his ill grandmother on Sagis, had the courage to ask: “How does a Shibboleth work? What’s it look like?”

    Wheeler, the planet’s Intelligence Technician, smiled. He had often felt useless since coming to this planet. The mining colony put high value on muscles, not brains. Now he had a chance to show his strength. ‘A Shibboleth isn’t a physical thing,” Wheeler said, “It’s a word, a password.”

    “So what kind of password?” Bobby asked. “A secret one?” “Secret passwords don’t work,” groaned Donaldson as he paced the cramped underground chamber where the final human survivors of Xerxes 8 had gathered. “You know the Ardon robotoids can tune in on all our conversations and radio communications. Our ‘secret password’ wouldn’t stay secret for 10 seconds!”

    “Just a minute, Donaldson,” the elderly Freiberg spoke up. “If I remember my Bible stories correctly, a shibboleth is not that kind of password.”

    “That’s right,” said Wheeler. “The term comes from the Bible, and a shibboleth isn’t secret. It just can’t be pronounced or understood by the enemy.”

    Bobby beamed with curiosity. “So what’s the Bible story. Mr. Freiberg?”

    Freiberg looked at Wheeler and then about the room. Everyone listened intently, knowing that the story could decide whether they lived or died.

    “Well,” Freiberg began, “in the early days of the kingdom of Israel, back on Earth, a battle occurred between two tribes. But it was hard for the tribes to tell each other apart, because they looked, dressed and talked alike. Then one tribe discovered that it could identify the enemy by asking each captured member to say a certain word. You see, because a distinct sound was missing in the speech of the one tribe, its people couldn’t say certain words, like … like … shibboleth. They instead said ‘sibboleth.’”

    “So you think this will work with the robotoids?” spat Donaldson. “Nonsense! The robotoids slip in among us and replace us. Like those tribes, we can’t tell them apart from us, Why? Because of their programming. They can mimic us perfectly. They could even be among us right now.”

    Freiberg, the mining company’s bookkeeper, shook his finger disapprovingly. “Look, Donaldson, they haven’t beaten us until our reason gives way to fear.”

    Donaldson made a vocal noise of disdain and folded his arms angrily.

    “Freiberg’s right,” Wheeler said. “The robotoids can slip in and replace any of us, but as long as one of us is still human, we must struggle to survive.”

    “But, Mr. Wheeler,” said Bobby, “Mr. Donaldson is right in a way too, The robotoids are programmed to be perfect. There aren’t any words in any language that they can’t say.”

    Neither Wheeler nor Freiberg spoke.

    “Absolutely,” Donaldson added darkly. “They know every language, every tone, every word. They even pick up slang quickly—”

    “And their ability to communicate with their fellow robotoids means we can only catch ’em once,” Wheeler said sadly. “Even if we made up a word or mispronounced one, we’d only catch ’em once.”

    “They have no flaws. It’s hopeless,” grumbled Donaldson.

    A miner stood so quickly that his chair fell over.

    “Look,” he said excitedly. “l know nothing you’re talking about! I’m not real smart. But I’m scared!”

    “Me too,” cried a man behind him. “I don’t want to die! But I’ve worked with robotoids and know that they won’t give up!”

    “That’s it,” Freiberg exclaimed. “They do have a flaw. Think about it. They’ve been programmed to avoid being trapped by unsolvable puzzles. But to do exactly that, they’re also been programmed to never give up in other areas—like linguistics.”

    “Right,” Wheeler said brightly. Then his enthusiasm died. “But how does that help us? That’s why slang words and made-up words won’t fool them. They just add to their memory banks, searching them until the problem is solved.”

    “Mr. Freiberg,” Bobby said, “what kind of unsolvable puzzle did you mean?”

    “Oh, things like asking a robotoids math or philosophy questions that have no answers,” Freiberg explained. “Ask a human for the last digit of pi, and he’ll admit he can’t find it because it’s somewhere in infinity.”

    “Years ago,” he continued, turning to the miners, “our soldiers could uncover a robotoid with such a question, literally make smoke come out its ears as the circuits burned up searching for the answers. Then they were reprogrammed to accept failure, so today a robotoid will laugh off such a challenge.”

    Wheeler brightened. “But, as you said, they still won’t accept failure in certain areas, like language. So… we could try some other branch of linguistics, like… spelling! We can feed ’em words that have silent letters.”

    “Like ‘pneumonia’ or ‘sarsaparilla’?” Bobby asked.

    “As Mr. Wheeler said,” Freiberg answered, “each would work only once. We need something to make a robotoid’s ‘brain’ go into a closed loop. Something that would force it to search for an answer until it actually burned up its circuits.”

    “What nonsense,” Donaldson snorted.

    “How about a rhyme?” Bobby suggested.

    Wheeler and Freiberg smiled.

    “No, Bobby,” said Wheeler, “I’m afraid a rhyme would be a bit too simple. A robotoid would come up with countless rhymes for every word that …”

    “But what if the word doesn’t have a perfect rhyme?” Bobby persisted.

    Freiberg said: “What do you mean, Bobby?”

    “What a bunch of hopeless fools!” Donaldson shouted. “We’re on the verge of extinction. The robotoids are picking us off one by one. They’re closing in every minute. We’re cut off from everyone else in the galaxy, and we sit here dreaming about a magic word, listening to a child.”

    Freiberg inhaled deeply. “Mr. Donaldson, first of all, we are neither fools nor hopeless. We are alive, and we are thinking. That’s two advantages we have over the robotoids. It’s also the key to survival. Secondly, Bobby is in as much danger as the rest of us. That fact gives him certain rights.”

    Donaldson mumbled something and moved away, but most of the miners nodded, agreeing with Freiberg.

    Freiberg turned to Bobby. “What word doesn’t have a perfect rhyme?”

    “Well,” Bobby began, “I’m not sure about other languages, but I remember learning that in English there’s no word that rhymes with ‘orange.’”

    Wheeler rubbed his chin. “‘Orange’ as a shibboleth?” He looked at Freiberg. “Can you think of a rhyme with ‘orange’?”

    “None that I can think of,” Freiberg said. “Nothing perfect anyway.”

    “Can you think of one, Donaldson?” Wheeler asked, turning to face the mining foreman.

    But Donaldson didn’t answer. He stood strangely erect, staring straight ahead.

    Smoke was coming out of his ears.

    — via Ask MetaFilter.

  • Glaikitron 3000

    Glaikitron 3000

    Glaikitron 3000

    Instagram filter used: Lo-fi

    View in Instagram ⇒

  • spods

    spods

    spods

    Instagram filter used: Earlybird

    View in Instagram ⇒

  • hexabubbly

    hexabubbly

    hexabubbly

    Instagram filter used: Perpetua

    View in Instagram ⇒

  • Now Here

    Now Here

    Now Here

    Instagram filter used: Normal

    View in Instagram ⇒

  • 7 by 7

    7 by 7

    7 by 7

    Instagram filter used: Normal

    View in Instagram ⇒

  • Chilling

    Chilling

    Chilling

    Instagram filter used: Lo-fi

    Photo taken at: Mauhaus

    View in Instagram ⇒

  • not-very-good MakeCode scratchpad

    Update:now updated all to include the Bluetooth module so these can be uploaded to your micro:bit with the (remarkably poor) mobile app. If you don’t include the Bluetooth module (or want to use the Radio module) you lose the ability to program over the air.

    Boring Blink:

    Shake temperature:

    Shake temperature in ËšF:

  • loblawcard.ca

    loblawcard.ca

    loblawcard.ca

    The language on the loblawcard.ca website makes me sick:

    Loblaw discovered that Canadians were overcharged for the cost of some packaged bread products in our stores and other grocery stores across Canada. In response, we’re offering eligible customers a $25 Loblaw Card, which can be used to purchase items sold in our grocery stores across Canada.

    How about:

    Loblaw discovered thatdeliberately and knowingly stole bread from Canadians were overcharged for the cost of some packaged bread products in our stores and other grocery stores across Canadafor fourteen years. In response, and without accepting culpability on our part, we’re offering eligible customers a $25 Loblaw Card, which can be used to purchasewill only cost us $10-20 wholesale on items sold in our grocery stores across Canada. You might have to sign away your right to participate in a class-action suit by accepting the card, though.

    Update, Jan 2018: terms and conditions are now posted (archive link). You won’t exactly have to sign away your class action rights, but “Information pertaining to your activation and use of the Loblaw Card may be shared between and amongst Loblaw, the Program Administrator [JND Legal Administration], Blackhawk [Blackhawk Network (Canada) Ltd.] and/or Peoples [Peoples
    Trust Company] and with the courts in any class actions relating to an overcharge on the price of packaged bread.” So it looks like your class action rights are affected if you apply for and activate a card.

  • Circuit Playground Express Chord Guitar

    Hey! This doesn’t work any more, as CircuitPython changed and I haven’t found a way to update it with the new interpreter.

    Since there are seven touch pads on a Circuit Playground Express, that’s enough for traditional 3-chord (â… , â…£, â…¤) songs in the keys of C, D and G. That leaves one pad extra for a â…¥min chord for so you can play Neutral Milk Hotel songs in G, of course.

    CircuitPython source and samples: cpx-chord_guitar.zip. Alternatively, on github: v1.0 from scruss/cpx_chord_guitar

    The code is really simple: poll the seven touch pads on the CPX, and if one of them is touched, play a sample and pause for a short time:

    # Circuit Playground Express Chord Guitar
    # scruss - 2017-12
    
    # these libraries should be installed by default in CircuitPython
    import touchio
    import board
    import time
    import neopixel
    import digitalio
    import audioio
    
    # touch pins, anticlockwise from battery connector
    touch_pins= [
        touchio.TouchIn(board.A1),
        touchio.TouchIn(board.A2),
        touchio.TouchIn(board.A3),
        touchio.TouchIn(board.A4),
        touchio.TouchIn(board.A5),
        touchio.TouchIn(board.A6),
        touchio.TouchIn(board.A7)
    ]
    
    # 16 kHz 16-bit mono audio files, in same order as pins
    chord_files = [
        "chord-C.wav",
        "chord-D.wav",
        "chord-E.wav",
        "chord-Em.wav",
        "chord-F.wav",
        "chord-G.wav",
        "chord-A.wav"
    ]
    
    # nearest pixels to touch pads
    chord_pixels = [ 6, 8, 9, 0, 1, 3, 4 ]
    
    # set up neopixel access
    pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=.2)
    pixels.fill((0, 0, 0))
    pixels.show()
    
    # set up speaker output
    speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
    speaker_enable.switch_to_output(value=True)
    
    # poll touch pins
    while True:
        for i in range(len(touch_pins)):
            # if a pin is touched
            if touch_pins[i].value:
                # set nearest pixel
                pixels[chord_pixels[i]] = (0, 0x10, 0)
                pixels.show()
                # open and play corresponding file
                f=open(chord_files[i], "rb")
                a = audioio.AudioOut(board.A0, f)
                a.play()
                # blank nearest pixel
                pixels[chord_pixels[i]] = (0, 0, 0)
                pixels.show()
                # short delay to let chord sound
                # might want to try this a little shorter for faster play
                time.sleep(0.2)
    

    This is roughly how I synthesized the samples, but I made them quieter (the MEMS speaker on the CPX went all buzzy at full volume, and not in a good way) and added a bit of reverb. Here’s the sox command from the modified script:

    sox -n -r 16000 -b 16 "chord-${chord}.wav" synth 1 pl "$first" pl "$third" pl "$fifth" delay 0 .05 .1 remix - fade p 0 1 0.5 norm -5 reverb

    Really, you do want to take a look at shortening the delay between the samples: you want it long enough for all of the notes of the chord to sound, but short enough that you can play faster songs. I came up with something that worked for me, kinda, and quickly; it’s worth fixing if you have the time.