I am taking a month off social media--by that I mean tumblr and twitter--to see if that helps calm me down. I'm officially bored with anxiety; I didn't know it was possible to experience both together, but here we are.

In the last few weeks;
1.) learned new exercises for PT.
2.) installed Home Assistant on my Pi, which is something like SmartThings hub but like, so fucking much cooler and better and more awesome.

After problems with SmartThings meant I de-integrated everything that wasn't z-wave or zigbee. SmartThings went to a new standard and also new app and lost functionality, so it was no longer fun; all my scripts were being killed and all the ones from the community were dying. However, it's still an exemplary z-wave and zigbee hub, so it could be used for that (a z-wave stick is about the same price as a SmartThings hub and that's without zigbee), so I finally sat down with my Pi and installed Home Assistant.

It's about a thousand times better than SmartThings. For one, it's web based, not app based, so the web components are both not an afterthought and also exist; for another it uses Javascript but mostly Python and YAML, and I've really been wanting to learn those two.

I will do an entry on this eventually because holy shit, this is fun.

Related....

3.) Did my first fork and pull on github to bug fix a python script. Yes, I'm finally using github as intended.
4.) Am finally learning python (and yaml). I learn by doing, which generally means I need a project to work on, specifically one that does something I really want to do and can't make work in any language I already know. Making my Sengled Color Bulbs work, as it turns out, was the trick.

When doing the integration for my Sengled bulbs into Home Assistant, the Sengled script had some problems and since python is Javacript With Indents, I went to read the script then read the developer's notes. He didn't have some of the bulbs I did, so I sent him my logs and then made some corrections to the scripts since it would be harder for him to do that part without the right bulbs to test (Sengled doesn't have a public API so he was doing it all with the app, a Sengled Hub, and watching traffic and jsons). Anyway, he invited me to submit a pull instead of sending him script bits, so I learned github while python to do the corrections. It was fun.



I really thought Python would be much harder, but honestly, it only took me a couple of scripts to get read and write and correcting was fairly simple after that; in some ways, it's a little more refined than Javascript, like someone sat down to correct JS's more wild-west approach and fix some of the more obvious workarounds. I mean, the reason I love JS is that 1.) you can use it pretty much anywhere, and 2.) you really can do anything with it, literally. If it can be done in a language, you can do it in Javascript; all the pieces are there, you just have to build them yourself.

Which is great; I have entire sheets of custom classes and constructors and prototypes when I learned about hashes and JS's tragic lack (and multi-dimensional hashes, for that matter, still the most interesting and least practically useful piece of scripting I ever did; what I needed it for its perfect but that's literally the only use. Still, it's so pretty you have no idea) and expanding Strings so I could do one-stop clean up and formatting of titles, the list goes on. Even better, Javascript translates to anything; if I write it in JS, I can translate it to VBA and Bash and even Groovy given a little time. And the reverse is also true: except for very specific things in VBA that are internal to Word and Excel, it's almost a one to one, and the specific things generally can be worked around.

(Javascript is honestly my One True Language. I don't have anything against languages requiring compiling, but anything big enough to need compiling is a project both way outside my general scope of interest and honestly, you'd have to pay me a lot to deal with Java's incredible bullshit. I like reading it and it's cool, don't get me wrong, but it's just not elegant and gets byzantine very fast. I thought for a while it was OOP thinking that was my problem, but once I wrote my own classes I accepted that I was just bored; the amount of time to write, debug, compile and test for one program to do one thing is the same as writing five scripts that do the same thing and the scripts I can use anywhere.

I admit, doing some vague work in C# has made me rethink my feelings on compiling--C# is surprisingly elegant and clean and doesn't require you to rediscover and redesign the wheel eight times in five functions and three includes--but I haven't run into anything I want to do that needed it. Projects that require it are generally ones you do for money to create things to sell and with more than one collaborator; other than making my own addons for Word and Excel, I've never yet run into a project smaller that I'd use it for, and for the addons, I had several much better options to use that didn't require a pauses for debug/compile.)

Python though: I can't entirely deny there is something rather nice about working in a language that I don't need to start off with a page of my custom constructors, classes, and prototypes, not to mention the ones I got from other people.

However: Python is tab based, with neither brackets (Javascript) nor closure statements (Bash, VBA) to visually demarcate the end of a function/if/else/for/loop and that's stressing me.

For example:

Javascript

if (x){
  stuff
}



VBA

If x Then
  stuff
End If



Bash:

if (x); then
  stuff
fi



Python:

if x:
  stuff



Note: yes that indent is literally all I get.

This isn't a problem in scripting--I keep strict indentation no matter what I'm writing because it's visually easier to read/write--but it gets weird fast when reading/editing because there's no visual end for an if/for/loop other than that indentation and if you're nesting loops and ifs, that gets old very fast. The only clue you have to the end is the lack of indentation, and if you have an if inside a for inside a for--I mean, if the IDE has a graph background I'm less annoyed but if a function or a loop goes more than a page or the IDE isn't graphed--yeah.

Python:

functionname:
  for x:
    stuff
    for y:
      more stuff
      if z:
        stuff if
      else:
        stuff else
        if a:
          yeah stuff
    for b:
      even more stuff
    if c:
      so much stuff
return



There's colons? I guess that's--something. But seriously, why? Why for the love of God remove literally every visual marker possible? Yeah, it looks clean, but like, too clean, like living in a clean room; a few germs never hurt anyone. On a guess, I'm going to be documenting like I'm writing a biography of the script's life and times to get some visual markers until I get used to it or work out a way to see (and count) empty space on a glance.


Adventure indeed.
akacat: A cute cat holding a computer mice by the cord. (Default)

From: [personal profile] akacat Date: 2020-09-24 05:30 pm (UTC)
I’m just going to pop in here with an example if your IF statement in MUMPS:

I X STUFF


Yup, that’s it. And yeah, a lot of MUMPS programmers stick to uppercase for everything.

And your function is:

 
F X D
.STUFF
.F Y D
..MORE STUFF
..I Z STUFF IF
..E  STUFF ELSE I A YEAH STUFF
.F B EVEN MORE STUFF
.I C SO MUCH STUFF
edited at: (Typo!) Date: 2020-09-24 05:32 pm (UTC)
jesse_the_k: room full of women keypunching (keypunchers)

From: [personal profile] jesse_the_k Date: 2020-09-24 05:44 pm (UTC)

...huh, maybe that explains why Epic Systems is so excellent at non-cooperation. They're all cranky from coding MUMPS.

jesse_the_k: Scrabble triple-value badge reading "triple nerd score" (word nerd)

From: [personal profile] jesse_the_k Date: 2020-09-24 05:46 pm (UTC)

The only code I know is what I've just looked up and pasted into my editor window (no memory here!) and yet I could follow your argument and sympathize with your brace-less Python wilderness.

So, good writing!

renenet: (Default)

From: [personal profile] renenet Date: 2020-09-24 11:31 pm (UTC)
Yes, this! I really enjoy reading your tech experiments posts, although I only ever understand 30% of the techie bits because that's my level of caring. but I get main ideas and have fun along the way, so yay!
renenet: (Default)

From: [personal profile] renenet Date: 2020-09-25 11:54 pm (UTC)
Cool, cool, cool! I totally appreciate your pubic service attitude there.
lillian13: (Justified quote English)

From: [personal profile] lillian13 Date: 2020-09-26 07:31 am (UTC)
...and this, ladies and gentlemen, is why she will either be the first person eliminated during the AI Uprising...or the last.
olanthanide: (Default)

From: [personal profile] olanthanide Date: 2020-09-27 08:22 pm (UTC)
Yeah, I've always found that aspect of anxiety to be maddening -- that with any chronic conditions, if it goes on long enough, it just gets boring. Like, even the adrenaline dump of panic attack can no longer erase the "what? Again? SIGH" -- apparently even pain can get boring if it goes on long enough. I mean I can see the evolutionary advantages of it but also it kind of makes you want to set things on fire.

From: [personal profile] nymphaea1 Date: 2020-10-16 01:05 am (UTC)
I'm also trying to take a break from media, though mostly twitter. It was dialing my anxiety up to 35. Oddly enough I'm going back to very old fanfic and old fan acquaintances like you. I'm finally writing that 10 year old prequel to Chimera.

Profile

seperis: (Default)
seperis

Tags

Quotes

  • If you don't send me feedback, I will sob uncontrollably for hours on end, until finally, in a fit of depression, I slash my wrists and bleed out on the bathroom floor. My death will be on your heads. Murderers
    . -- Unknown, on feedback
    BTS List
  • That's why he goes bad, you know -- all the good people hit him on the head or try to shoot him and constantly mistrust him, while there's this vast cohort of minions saying, We wouldn't hurt you, Lex, and we'll give you power and greatness and oh so much sex...
    Wow. That was scary. Lex is like Jesus in the desert.
    -- pricklyelf, on why Lex goes bad
    LJ
  • Obi-Wan has a sort of desperate, pathetic patience in this movie. You can just see it in his eyes: "My padawan is a psychopath, and no one will believe me; I'm barely keeping him under control and expect to wake up any night now to find him standing over my bed with a knife!"
    -- Teague, reviewing "Star Wars: Attack of the Clones"
    LJ
  • Beth: god, why do i have so many beads?
    Jenn: Because you are an addict.
    Jenn: There are twelve step programs for this.
    Beth: i dunno they'd work, might have to go straight for the electroshock.
    Jenn: I'm not sure that helps with bead addiction.
    Beth: i was thinking more to demagnitize my credit card.
    -- hwmitzy and seperis, on bead addiction
    AIM, 12/24/2003
  • I could rape a goat and it will DIE PRETTIER than they write.
    -- anonymous, on terrible writing
    AIM, 2/17/2004
  • In medical billing there is a diagnosis code for someone who commits suicide by sea anenemoe.
    -- silverkyst, on wtf
    AIM, 3/25/2004
  • Anonymous: sorry. i just wanted to tell you how much i liked you. i'd like to take this to a higher level if you're willing
    Eleveninches: By higher level I hope you mean email.
    -- eleveninches and anonymous, on things that are disturbing
    LJ, 4/2/2004
  • silverkyst: I need to not be taking molecular genetics.
    silverkyst: though, as a sidenote, I did learn how to eviscerate a fruit fly larvae by pulling it's mouth out by it's mouthparts today.
    silverkyst: I'm just nowhere near competent in the subject material to be taking it.
    Jenn: I'd like to thank you for that image.
    -- silverkyst and seperis, on more wtf
    AIM, 1/25/2005
  • You know, if obi-wan had just disciplined the boy *properly* we wouldn't be having these problems. Can't you just see yoda? "Take him in hand, you must. The true Force, you must show him."
    -- Issaro, on spanking Anakin in his formative years
    LJ, 3/15/2005
  • Aside from the fact that one person should never go near another with a penis, a bottle of body wash, and a hopeful expression...
    -- Summerfling, on shower sex
    LJ, 7/22/2005
  • It's weird, after you get used to the affection you get from a rabbit, it's like any other BDSM relationship. Only without the sex and hot chicks in leather corsets wielding floggers. You'll grow to like it.
    -- revelininsanity, on my relationship with my rabbit
    LJ, 2/7/2006
  • Smudged upon the near horizon, lapine shadows in the mist. Like a doomsday vision from Watership Down, the bunny intervention approaches.
    -- cpt_untouchable, on my addition of The Fourth Bunny
    LJ, 4/13/2006
  • Rule 3. Chemistry is kind of like bondage. Some people like it, some people like reading about or watching other people doing it, and a large number of people's reaction to actually doing the serious stuff is to recoil in horror.
    -- deadlychameleon, on class
    LJ, 9/1/2007
  • If imitation is the sincerest form of flattery, then Fan Fiction is John Cusack standing outside your house with a boombox.
    -- JRDSkinner, on fanfiction
    Twitter
  • I will unashamedly and unapologetically celebrate the joy and the warmth and the creativity of a community of people sharing something positive and beautiful and connective and if you don’t like it you are most welcome to very fuck off.
    -- Michael Sheen, on Good Omens fanfic
    Twitter
    , 6/19/2019
  • Adding for Mastodon.
    -- Jenn, traceback
    Fosstodon
    , 11/6/2022

Credit

November 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 2022
Page generated Apr. 23rd, 2025 06:53 am
Powered by Dreamwidth Studios