Thursday, March 21, 2024

Interfaces and Implementations

 Sometimes you want the implementation, sometimes you want the interface.

If you think about people and software, knowing how someone or something works is important. It can help you interact with this thing. If I know my significant other snores at night when they sleep on their back, then maybe I can give them an extra pillow or more room so they roll over on their side and snore less so I can sleep more. I potentially know more about the the thing under inspection than it does, so I can help interact with it better to make my and hopefully their world better.


Sometimes interfaces are useful too. I don’t know how everything in a bank works, I just know that if I deposit money, I should be able to get it back later (maybe with some interest). I don’t have to know how loans work, or interest rates, or how they interact with the Fed to get their own money to help pay me my interest.


There is also a aspect about ourselves where this is important. From the objects’ perspective, if you will. If I am grumpy and don’t want to talk to anyone while walking through the subway back from work, perhaps I put on a meanish demeanor, and people understand that I don’t want any social interaction. Or perhaps I really have no idea what I’m doing at work on a particular task, and I would really benefit me if my boss knew I was working on something I wasn’t very skilled at yet, so they figure out how to give me extra help. Or I’m a baby and my mom knows that I will need a new diaper a few hours after I eat even if I have no clue.


What is an interface exactly? It’s the surface that we present to the outside world. It’s how we want to be interacted with. What is the nitty-gritty details of how something works? That’s the implementation. Sometimes you care, sometimes you don’t.


In software, an interface is a really powerful thing. It lets people who are trying to use me know how I should be interacted with to do so. I have these things you can do to me. I may not exactly do those things, but I should. It’s the expected behavior, a contract. If you do one of these fixed things to me, I will respond in a reasonable fashion.


Knowing how people want to be interacted with can be extremely useful. Seeing a pretty girl at a bar, who's all dressed up and smiling, probably wants to be approached. A programming language class representing a bank account with a "deposit" function that takes an numerical amount probably wants to accept dollars to be added to that account.


Knowing the implementation can also be extremely useful. If I have something in a Java class that implements the List interface will allow appending items and iterating through them, but if I want the 4000th element, then I might definitely want to know I'm using an ArrayList which has O(1) direct memory access so that if I'm walking each element of it, I don't end up accidentally traversing a LinkedList instead which will be extremely inefficient because it has to traverse and re-count each element every time to get to the next item.


Maybe you have a friend who always cares about appearances. So they are always looking like they have everything together on the outside. But they are your good friend, and you know something really bad just happened to them. You know their implementation, that they are potentially hiding that they are very down, so it's really useful to look beyond that interface and offer support.


These are powerful distinctions. How does something want to be interacted with, and how does it actually work. Knowing the distinction with people and software is important.

Sunday, August 20, 2023

Techno Gecko WTF project radio setup

Overview

I thought my learnings/notes from this project to setup a few ham radios to do APRS broadcasting for my Burning Man project were pretty useful. There are lots of Youtube videos of doing basic setup, but here is a list of my basic settings. We used multiple Kenwood TH-D72a radios with GPS and APRS enabled to beacon each other so we could locate our art car out in the playa from our camp.

Questions

  • What is North America APRS frequency?
    • 144.390
    • Europe uses 144.380
  • Which APRS waypoint format does tgwtf expect?
    • NMEA? (Tgecko had this set)
    • Kenwood?
    • Magellan?
  • Do we want PC output for all radios? Just tcamp?
    • 350
  • What is “PACKET 12” versus “APRS 12” ?
    • Looks like BCON “beacon” button only works when APRS 12 is selected
      • Also looks like setting power output to EL “extra low” with [F][MENU] makes the radios not power cycle

  • Why does the TNC make the guppy radio power cycle?
    • Can I disable it without interfering with WTF use?
      • Also looks like setting power output to EL “extra low” with [F][MENU] makes the radios not power cycle
    • Does it actually save battery?
    • Should we disable the second band to save power?

      • Click [DUAL] to toggle disabling

  • Figure out how to set GPS location to a fixed position for TCAMP so we can save power
  • What is QSY?
    • Q codes are various 3 letter codes with specific radio meanings 
    • QSY in particular means “change frequency”

Radios

    • Configure

      • Instructions below for full reset for sending/receiving just from radio

      • serial port connection

        • From Mac

        • `screen tty.usbmodem14101 1200` with the TH-D74a connected


        • From RPi

    • Which was the better channel for APRS? A or B? Find comment from Youtuber

RPi’s

    • Check that camp RPi boots

    • Recompile binary

      • Install Docker

      • Try to actually recompile from Linux

      • Install to RPi

      • Go through Pivotal Tracker with details about Linux setup

    • Get new coordinates from Dmitry

    • Setup Camp RPi as best as possible

    • Setup Guppy


Basic Setup

For TH-D74a (for Glenn’s newer radio)

  • Make sure it’s not in KISS12 mode (you should see APRS12 and not missing icon altogether)

    • To switch, use F shortcut button and switch to option 5 to toggle to APRS mode

For TH-D72a (older TG radios)

  • https://www.youtube.com/watch?v=r4IuACLGTqs

  • In General

    • Hitting Menu button will help you escape to main screen

    • GPS MUST be flashing to beacon APRS signals!

    • guy had non 144.390 (other channel) set to "144.530" for his friend or something?

  • To RESET Completely

    • Reset radio

      • turn off radio

      • hold down power + function button (blue circle with F inside)

      • select FULL reset

      • hit right button on round button (DPAD)

  • Enable GPS

    • hit Function

    • select Function-1 using up/down

    • hit right on GPS

    • select "on"

    • hit right to select

    • Main screen should show "iGPS" in top right corner now

  • Disable Battery Saver

    • Hit Menu

    • select "110"

    • select "Off" to disable battery saver

  • Turn off "APO"

    • Hit Menu

    • select "111"

    • select "Off"

  • Set date

    • hit menu

    • select "194"

    • enter date

  • Set time

    • select "195"

    • enter time

  • Set UTC Offset

    • select "196"

    • enter UTC -7 for California/Nevada

  • Disable Battery Saver in GPS

    • select "201"

    • select "off"

  • Set Callsign

    • select "301"

    • enter "TGUPPY" or "TGCAMP" or "TGLENN" or “...”

  • Setup frequency for 144.000 (A Channel)

    • hit "ENT" key to directly enter number

    • using numeric buttons

    • enter "144.390" - for United States! "144.380" is Europe

  • Turn on APRS lock

    • Select 302

    • Select “On + PTT + TNC”

    • This disables trying to use voice over data signal as well as change the aprs frequency as well as disabling the TNC

  • iGPS should hopefully be flashing now indicating that it has a GPS lock!

  • Enable TNC

    • should see "APRS12" to right of the "H"

    • should see "D" in white on black right of "144.390"

  • Verify GPS Coordinates

    • Select POS button to see your current location

    • hit right to see speed and angle

    • shows "TP" which is trust point which is a pre-entered location to go to

  • To used "fixed location" if GPS isn't working

    • you can hit "F" function key and go to "2" to disable track log

    • track log is breadcrumbs of your locations

  • Turn on Voice Alert

    • F "7"

Enabling Computer Output

  • Set computer output on / set baud rate / set waypoint……

Screen icon meanings

  • Settings

    • "H" in far top left

    • "iGPS" in top right corner

  • Far Top Left

    • shows "H" "L" "El" for High Low Extra low

    • Toggle by hitting Function + MENU

    • should be "H"


Acronyms

  • APO - Automatic Power Off


Tuesday, February 01, 2022

Intolerance

 

Unlimited tolerance must lead to the disappearance of tolerance. If we extend unlimited tolerance even to those who are intolerant, if we are not prepared to defend a tolerant society against the onslaught of the intolerant, then the tolerant will be destroyed, and tolerance with them.—In this formulation, I do not imply, for instance, that we should always suppress the utterance of intolerant philosophies; as long as we can counter them by rational argument and keep them in check by public opinion, suppression would certainly be most unwise. But we should claim the right to suppress them if necessary even by force; for it may easily turn out that they are not prepared to meet us on the level of rational argument, but begin by denouncing all argument; they may forbid their followers to listen to rational argument, because it is deceptive, and teach them to answer arguments by the use of their fists or pistols. We should therefore claim, in the name of tolerance, the right not to tolerate the intolerant. We should claim that any movement preaching intolerance places itself outside the law and we should consider incitement to intolerance and persecution as criminal, in the same way as we should consider incitement to murder, or to kidnapping, or to the revival of the slave trade, as criminal.

-Karl Popper

Wednesday, April 19, 2017

TSA-Pre - take someone else's money and liberty, thanks

TSA-Pre is a such a con. TSA gets to take $100 bucks of your money for the honor and privilege of not tearing apart your luggage to find serious threats like the tube of toothpaste that’s more than 4 ounces. Recently I got put through a “pilot program” which meant people now had to take out their tablets and any electronics bigger than a cell phone.

The really insidious part of these increasing “security” measures is that they are effectively slowing down the main line, or the “happy lane”[1] as the TSA Chief John Pistole calls it. Why would a burgeoning bureaucracy add more silly measures? So they make you want to shell out the extra cash for the line with the smiling agent who doesn’t make you take off your shoes, make you take your laptop out, and you don’t get radiated by a microwave machine that probably causes cancer.

What effectively does this do to the main line for those who cannot afford the $100? They get increasing pressure and scrutiny and are more likely to miss their flight because some agent doesn’t like they way they look.


My credit card even has a program where I can get this for free, but I refuse. You aren’t taking my money or the freedom of people who can’t afford this luxury. Its not more secure, it further divides the haves and the have-nots, it puts more money into the pockets of an organization that has lied to us and isn’t regulated by the government. Nope, not this time and not ever TSA. Go take someone else’s money and liberty.

Wednesday, December 02, 2015

Clojure is cool

Fibinocci in a one-liner

(defn fib [n] (cond (= n 0) 1 (= n 1) 1 :else (+ (fib (dec n)) (fib (dec (dec n))))))

Polymorphism

(defprotocol Talkable (talk [self]))

(defrecord Cat [] Talkable (talk [self] "meow"))
(defrecord Dog [] Talkable (talk [self] "woof"))

(def c (Cat.))
(talk c) => "meow"

(def d (Dog.))
(talk d) => "woof"

(map talk [c d]) => ("meow", "woof")

Wednesday, April 02, 2014

Landed in Japan

Alright, time to blow the dust off this old blog and detail my travels.

Everything is going pretty well. I've had some difficulty getting a phone working because I can't sign up for an account without a permanent address, but its also hard to navigate around without a phone to see these places. Bit of a chicken and egg problem, but really it just slows stuff down a bit.

I landed at this place owned by a guy named Yasuomi who is about 35. He was a little hesitant at first with me but warmed up. He dragged me around town for about an hour trying to talk to 5 or 6 different phone companies about how I can get a phone for anything less than a 2 year contract.

Yasuomi shares his 3 room place with 3 or 4 people. Seems to be kind of a revolving door of roommates. One guy works away from home frequently who's room I'm using. Another guy is a German dude who works at a cafe and is mostly fluent in Japanese, but quit because his boss stopped paying him and his coworkers. He's a real character. The other couple Japanese guys are all pretty chill but I don't know them well. We were up fairly late drinking and just hanging out. Half the time they talk in Japanese, and then at some point some one will turn around and translate a bit.

I've been picking up a lot of Japanese already, somewhat to my surprise. I asked a guy which train was the one to Ikebukuro (where I am currently) and he told me how to get off this train after a couple stops and transfer. I might actually survive out here ;).

Today I'm going to meet up with a guy to talk about his company. Later, I'll be seeing a apartment in Meguro which is more central Tokyo, about an hour train ride. I'll ride back up to Ikebukuro and meet up with my Japanese friend from college. I haven't seen her in a long time so it should be fun. I think her and her American husband will be returning more permanently to Japan in not too long.

Labels: , ,

Wednesday, April 04, 2012

DMZ, Palace, and Noise Basement

Woke up at 6:45 to get breakfast
7:30am got picked up by personal driver to be delivered to Meyongdong bus
8:30am rode bus to Dorasan Train Station where the South Korean train tracks connect up to North Korea. Then we rode to 3rd Tunnel where North Koreans attempted to tunnel all the way to Seoul underground in a 7 foot wide passage way to send troops in to capture Seoul. We ended our trip seeing the Unification Bridge and then a last stop at the Amethyst factory which is mined from Korea.
Next we went took a cab from Itaewon where we were dropped off to the Palace near Meyondong.
Finally we arrived back in Hongdae and finally got some dinner at a Hof Bar which serves chicken and beer.
We bar hopped all over Hongdae including NB (Noise Basement). We also drove over to Gundam and found the NB there. I almost got in a fight with a bro over a girl, and met some cool Australians.

Labels: ,