e0qdk

joined 2 years ago
[โ€“] e0qdk@reddthat.com 1 points 5 minutes ago

When I was a kid, we had a class on Logo in, I think, 4th grade? (It was either that or 5th grade.) It wasn't particularly hard to make various geometric drawings with it, but it also wasn't clear how to use it to do anything beyond that.

I used to tinker with Visual Basic on the school's computer lab at recess sometimes around then. One of the people who ran the lab showed me just enough to try to make a calculator UI (e.g. push number buttons and have it add numbers to the display) but didn't really explain the principles enough for me to get further than that. (I think he loaned me a book on BASIC that I tried to read on the school bus, but I couldn't get very far with it at that age.) I ran into a macro virus back then as well, and I was able to understand the logic for erasing files on a particular date when it was pointed out, but I wasn't able to make something like that or analyze it myself at that age.

I also tinkered with HyperCard and some other creative software at home at around that age. I did not understand HyperTalk but could do a few simple things. I also stumbled into AppleScript but didn't understand it. I think I recorded macros with it, and tried to modify what it spat out without much success. I remember running into something about timezone conversion that was really cryptic to me as a kid -- that might have been the first time I encountered the term "GMT"? There's a lot of little things like that which will trip up a young beginner...

I think I also checked out a book on Java from the library that had a CD-ROM with the compiler on it somewhere in that 4th~6th grade age range (don't remember more specifically when) -- I was definitely too young to for that. I was able to install the software, type in a program from the book, and make it run but I wasn't able to do anything beyond that with it and it was too tedious for me to persevere through the cryptic parts when I was that young.

Somewhere around 5th ~ 6th grade I found Game Maker and taught myself that by tinkering with the sample games. For example, by making alternative level layouts for the Pac-Man clone and adding in some simple things like one-way teleporters. I used the drag and drop interface at that age with one of the really early versions before the 4.0 UI re-design -- it was a lot more approachable as a beginner, IMO, before that redesign. (With the changes it was better for me as a hobbyist as I got older though.) I eventually taught myself how to use its scripting language through a mixture of reading the manual and trial-and-error. The manual didn't explain the basics of programming very well, but the reference documentation for it was easy enough to understand that once I got a handle on the basics I could do a lot with it. I'm not sure how old I was when I got a good handle on it. Maybe 7th or 8th grade? I was able to make some fairly complex things from scratch by 9th grade and taught myself C++ in high school.

I definitely could've learned a lot more conceptually earlier if I'd had more direct mentoring from someone who could code; I had to figure out a lot by trial and error. My knowledge of math, reading ability, etc. limited my ability to self-teach from books. People around me were also rarely able to answer questions when I hit something above my expected grade level (e.g. I remember asking what "sigma" meant to a math teacher in 7th grade after encountering it in a book and she didn't really understand my question and told me it was another variable like x instead of recognizing that I was asking about summations but didn't know that word yet... I eventually made the connection between it and for loops but I could've understood it then if I'd had the vocabulary to ask the right questions or had the sample text handy when I asked...) In retrospect, I'm surprised at how bad my teachers in high school were when I tried to get help with figuring out how to move things in circles in a game I was writing -- that was all just basic trig.

I guess to summarize: if they're motivated, yeah, you can get a surprisingly long way very young.

[โ€“] e0qdk@reddthat.com 4 points 1 hour ago (1 children)

No kids Trick-of-Treating showed up at my door yesterday, but holy shit it was loud outside. People (adults) were lining up stretching around the block to get into some event, I guess, in an adjacent building. Lots of yelling / very loud talking, honking, etc. Bunch of police sirens at like 3am or so. Some Friday nights are kind of like that normally around here, but this one was extra rowdy.

Downtown area of a city on the US West Coast.

[โ€“] e0qdk@reddthat.com 3 points 12 hours ago

A breakfast burrito is kind of like a quick quiche. ๐Ÿค”๏ธ

[โ€“] e0qdk@reddthat.com 15 points 1 day ago (4 children)

Just run a web server and expose the specific files you want to share through that?

[โ€“] e0qdk@reddthat.com 3 points 3 days ago

Yeah, it's not a great idea to leave it out for hours and hours; I usually portion and freeze a half hour or so after cooking -- it's usually cooled off enough that I can handle it by then.

[โ€“] e0qdk@reddthat.com 17 points 3 days ago (3 children)

Cooked plain rice freezes well too. I cook a big batch and use a small bowl to split it into individual portions. I wrap those in a little plastic wrap, and freeze it. ~2 mins in the microwave (reusing the wrap as a cover for the bowl) and I've got almost-as-good-as-fresh rice.

[โ€“] e0qdk@reddthat.com 3 points 3 days ago (1 children)

No; the calculation is using bytes not bits, so 3 is correct. (24 would be correct if it were bits.)

[โ€“] e0qdk@reddthat.com 3 points 3 days ago (3 children)

Been a long time since I've used a laptop, but usually when I've got a terminal open I'm doing something with Python these days. Often I just use it interactively as a calculator with some nice extra features. (I have some libraries like humanize installed in a local environment that I fire up frequently for quick tasks. That library can turn a number of bytes or seconds into easily readable approximations -- e.g. humanize.naturalsize(1920*1080*3*60) spits out 373.2 MB for the size of 60 frames of uncompressed HD video.) I also have a bunch of custom scripts for various things -- like a trivial spellchecker, custom image viewers, tools for converting timestamps between formats I use frequently, etc. Occasionally, I'm checking the load on a system with tools like htop, or logged into a remote system with ssh to fix something, running a long download with wget (or other tools), or re-encoding a video with particular settings using ffmpeg. Rarely I'm searching through my files with grep or other tools.

[โ€“] e0qdk@reddthat.com 72 points 5 days ago (1 children)

Insert real world money to continue/for advantage. Whether it's modern FTP with MTX or old school quarter eaters, it's poison to games.

[โ€“] e0qdk@reddthat.com 34 points 1 week ago (3 children)

Yeah; @Sxan@piefed.zip uses รพ a lot to mess with people trying to train LLMs off the Fediverse, IIRC, but I don't think I've seen anyone else using it regularly.

[โ€“] e0qdk@reddthat.com 7 points 1 week ago

Here's one of mine. I got annoyed at the complexity of other command line spellcheckers I tried and replaced them with this simple python script for when I just want to check if a single word is correct:

#!/usr/bin/env python3

import sys

try:
  query = sys.argv[1].lower()
except Exception:
  print("Usage: spellcheck <word>")
  exit(1)

with open("/usr/share/dict/words") as f:
  words = f.readlines()

words = [x.strip().lower() for x in words if len(x.strip()) > 0]

if not query in words:
  print("Not in dictionary -- probably a typo")
  exit(1)
else:
  print("OK")
  exit(0)
[โ€“] e0qdk@reddthat.com 37 points 1 week ago

No; I don't use AI at all for programming currently.

 

I had some free time this weekend and I've spent some of it trying to learn Go since mlmym seems to be unmaintained and I'd like to try to fix some issues in it. I ran into a stumbling block that took a while to solve and which I had trouble finding relevant search results for. I've got it solved now, but felt like writing this up in case it helps anyone else out.

When running most go commands I tried (e.g. go mod init example/hello or go run hello.go or even something as seemingly innocuous as go doc cmd/compile when a go.mod file exists) the command would hang for a rather long time. In most cases, that was about 20~30 seconds, but in one case -- trying to get it to output the docs about the compile tool -- it took 1 minute and 15 seconds! This was on a relatively fresh Linux Mint install on old, but fairly decent hardware using golang-1.23 (installed from apt).

After the long wait, it would print out go: RLock go.mod: no locks available -- and might or might not do anything else depending on the command. (I did get documentation out after the 1min+ wait, for example.)

Now, there's no good reason I could think of why printing out some documentation or running Hello World should take that long, so I tried looking at what was going on with strace --relative-timestamps go run hello.go > trace.txt 2>&1 and found this in the output file:

0.000045 flock(3, LOCK_SH)         = -1 ENOLCK (No locks available)
25.059805 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3691, tv_nsec=443533733}) = 0

It was hanging on flock for 25 seconds (before calling clock_gettime).

The directory I was running in was from an NFS mount which was using NFSv3 unintentionally. File locking does not work on NFSv3 out of the box. In my case, changing the configuration to allow it to use NFSv4 was the fix I needed. After making the change a clean Hello World build takes ~5 seconds -- and a fraction of a second with cache.

After solving it, I've found out that there are some issues related to this open already (with a different error message -- cmd/go: "RLock โ€ฆ: Function not implemented") and a reply on an old StackOverflow about a similiar issue from one of the developers encouraging people to file a new issue if they can't find a workaround (like I did). For future reference, those links are:

view more: next โ€บ