goose's recent activity
-
Comment on EU paves the way for iPhones and Android devices to ditch USB-C entirely in ~tech
-
Comment on EU paves the way for iPhones and Android devices to ditch USB-C entirely in ~tech
goose Curious to see your source on this? I was under the impression that even under the most ideal circumstances, wireless transmission will never be faster than wired, by the nature of electrons...that use 2.4GHz and essentially have the same or better latency than wired
Curious to see your source on this? I was under the impression that even under the most ideal circumstances, wireless transmission will never be faster than wired, by the nature of electrons moving through a copper wire. If I recall correctly, a typical signal traveling through a copper wire approach about 2/3's of c (the speed of light), roughly 200,000 km/s. While typical 2.4 GHz transmission can travel at approximately c, roughly 300,000 km/s, you have to add time to receive the data, encode the data, transmit it, decode the data, and then transmit the data to the USB receiver. The initial receiving and final transmission both rely on signal over copper, in addition to processing of encoding/decoding the data.
In real life application it may be a difference of 1ms to 2ms, but my interest in physics leads me to wonder/question the veracity of the idea that wireless transmission can be faster than wired.
-
Comment on ShellCheck: a static analysis tool for shell scripts in ~comp
goose Trouble is, I was fresh out of goats, I just sold them all to Lumonwhen you could easily have just sacrificed a goat to the gods of sed
Trouble is, I was fresh out of goats, I just sold them all to Lumon
-
Comment on ShellCheck: a static analysis tool for shell scripts in ~comp
goose I love shellcheck! It's a staple in my ability to bash script. Although it did fail me, once. I was working on a multi-hundred line bash script, with some big changes that required significant...I love shellcheck! It's a staple in my ability to bash script. Although it did fail me, once.
I was working on a multi-hundred line bash script, with some big changes that required significant edits that couldn't be tested until I had re-written many many lines. Upon running the script, I got a syntax error. But shellcheck reported no such errors. I was stumped. 15 minutes of Google and Stack Overflow later, I was led to believe that I had dropped a character relating to defining something, somewhere.
So, I wrote another bash script,
find_mismatch.bash
:#!/bin/bash # Provide an input file, get a breakdown of lines that do not have matching single ticks, square brackets, or curly brackets n="1" while read -r line; do unset footer count="0" for (( i=0; i<${#line}; i++ )); do if [[ "${line:${i}:1}" == "[" ]]; then (( count++ )) footer="${footer}${line:${i}:1}" elif [[ "${line:${i}:1}" == "]" ]]; then (( count++ )) footer="${footer}${line:${i}:1}" elif [[ "${line:${i}:1}" == "{" ]]; then (( count++ )) footer="${footer}${line:${i}:1}" elif [[ "${line:${i}:1}" == "}" ]]; then (( count++ )) footer="${footer}${line:${i}:1}" elif [[ "${line:${i}:1}" == "'" ]]; then (( count++ )) footer="${footer}${line:${i}:1}" else footer="${footer} " fi done if [[ "${count}" -ne "0" ]]; then if ! [[ "$((count%2))" -eq "0" ]]; then echo "Line ${n}" echo "${line}" echo "${footer}" echo "" read -n 1 -s -r -p "Press any key to continue" </dev/tty fi fi (( n++ )) done < "${1}" echo "" exit 0
And set it loose on my original multi-hundred line script. Sure enough, I found an associate array variable incorrectly defined:
fileRatingKey["${fileId}"="${ratingKey}" ^
With a missing closing
]
as indicated above. Surprisingly, shellcheck couldn't/wouldn't pick this up and alert me to it. But other than that one time it failed me, it's been an absolute staple for me. Extremely helpful tool. -
Comment on Apple restricts Pebble from being awesome with iPhones in ~tech
goose Glad to see Pebble still kicking around. I gave mine up 4 or 5 years ago, but my Pebble Time was the best smart watch I ever had, I wish there was a modern version of it. I'll forever resent their...Glad to see Pebble still kicking around. I gave mine up 4 or 5 years ago, but my Pebble Time was the best smart watch I ever had, I wish there was a modern version of it. I'll forever resent their buyout killing their product/company.
-
Comment on What do you like about your job? in ~talk
goose I spent the first ten years of my life as a firefighter/paramedic in a moderately high volume 911 system. At the end of it I decided I wanted to go back to school to get a better (paying) job, so...I spent the first ten years of my life as a firefighter/paramedic in a moderately high volume 911 system. At the end of it I decided I wanted to go back to school to get a better (paying) job, so I left public safety to work as a paramedic in a hospital, while also taking classes. I started out in the emergency department, I now work on the IV team.
I like that even full time, my job(s) have just been a few days a week. I also like that specifically the roles I've picked are ones that not just anyone can do. It gives me fulfillment to be the person with the knowledge and skills who can show up and get stuff done, when others aren't able to. To better illustrate this, many in healthcare choose not to work in an ED as they don't want to be constantly surrounded by the chaos and sometimes critically ill patients requiring fast paced life saving interventions while in an actively chaotic environment. Which I respect, it's not for everyone, but I loved it. Now, on the IV team, I'm sort of the "guy who shows up and puts the line in when we really need it and no one else can". I joked that "in the ED, I had to be good at a lot of things. Now, I just have to be really, really good at one thing." And while my patient facing role can sometimes be frustrating, on the whole, I enjoy making people's lives better. I have some very genuine encounters with people, many who are appreciative for the help being given to them, and when I go home at the end of the day I can often feel good about what I did for others at work.
-
iOS 18.4 adding RCS support for Google Fi and other T-Mobile based carriers
14 votes -
Comment on Some US carriers are still missing RCS on iPhone: who’s to blame? in ~tech
goose While I'm an Android user on Fi with RCS support, I regularly text with two iPhone users on Mint, who currently lack RCS support. I also want to port my iPhone using wife to my Fi plan, as we're...While I'm an Android user on Fi with RCS support, I regularly text with two iPhone users on Mint, who currently lack RCS support. I also want to port my iPhone using wife to my Fi plan, as we're planning a vacation in Europe this summer and I'd like her to have the same effortless intentional roaming I get to experience.
I wish there was some more transparency around these carrier bundles, purely so I could better understand where the breakdown is. In any case, in the year 2025, it's a wonder why we're still having so much difficulty deploying the next generation of text messaging.
-
Some US carriers are still missing RCS on iPhone: who’s to blame?
9 votes -
Comment on My thoughts on writing a Minecraft server from scratch (in Bash) in ~comp
goose Any. He's suggested python, node, and most recently go. And he's not wrong ... I'm just not motivated to learn a programming language.Any. He's suggested python, node, and most recently go. And he's not wrong ... I'm just not motivated to learn a programming language.
-
Comment on My thoughts on writing a Minecraft server from scratch (in Bash) in ~comp
goose His response, for completeness:His response, for completeness:
“The code is currently lost, due to my extensive use of tmpfs as a project directory, and a system crash”
What is wrong with bash diehards??
Do you not have a hard drive!?
-
Comment on My thoughts on writing a Minecraft server from scratch (in Bash) in ~comp
goose I've been trolling a friend of mine with all these fun bash posts who (friendly) despises my bash scripting and constantly reminds me that I should use a real language. When I sent him my little...I've been trolling a friend of mine with all these fun bash posts who (friendly) despises my bash scripting and constantly reminds me that I should use a real language. When I sent him my little "how to turn any bash script into a one liner", he described it as "the worst thing he's ever seen coded".
Years ago he was pretty heavy in development for minecraft, with plugins/mods and such. I can't wait to send him this. Thanks @hungariantoast !
-
Comment on Today I learned that Bash has hashmaps in ~comp
goose Anything would be a better drop-in solution. My primary job is a patient care facing role in healthcare, I'm pretty far from anything tech, IT, or development. I started tinkering around on Ubuntu...Anything would be a better drop-in solution. My primary job is a patient care facing role in healthcare, I'm pretty far from anything tech, IT, or development. I started tinkering around on Ubuntu as a teen back in 2007, and all of my *nix experience comes from using it for hobby/passion projects over the years. I should have learned Python, or something, years ago. But I just didn't have the time or mental fortitude when I could cop out and be like "Eh, bash script".
-
Comment on Today I learned that Bash has hashmaps in ~comp
goose I make great use of associative arrays (hashmaps) to reduce calls to an sqlite database I store static information in. I make an API call to return 10 values I care about for a data point. I store...I make great use of associative arrays (hashmaps) to reduce calls to an sqlite database I store static information in.
I make an API call to return 10 values I care about for a data point. I store these values in the database for future use. I also store them in the associate array
val_one[${dataPoint}]="${value_one}"
. By doing this, if I need that data point later in the script (or on a future run, in which I'm getting the data from the sqlite db instead of an additional API call), I can call functiongetValOne "${dataPoint}"
function getValOne { if [[ -z "${1}" ]]; then echo "give me a data point u luddite" return 1 fi if [[ -n "${val_one[${1}]}" ]]; then # Value already assigned return 0 fi # No value assigned, get one from sqlite val_one["${1}"]="$(sqlite3 [...])" }
It's sped up my scripts a decent amount that have a large number of potential sqlite lookups.
Unfortunately, I've started having to pad my array elements with an underscore, as some of my data points are mixed strings of integers and letters. Every now and then a string beginning with an integer will be interpreted (I forget, it's either interpreted lexicographically and it shouldn't be, or it shouldn't be and it is. Either way, padding with a leading underscore fixed that.)
-
Comment on OpenGL bindings for Bash in ~comp
goose Wrote it in standard markdown to make sure it worked, then manually combined it to a single line because I have a smooth brain and didn't think to use it on itself. The readable/original: while...Wrote it in standard markdown to make sure it worked, then manually combined it to a single line because I have a smooth brain and didn't think to use it on itself.
The readable/original:
while IFS= read -r line; do # Strip leading tabs and white space while [[ "${line:0:1}" =~ ($'\t'| ) ]]; do line="${line:1}" done # If it's a comment or blank line, skip it if [[ "${line:0:1}" == "#" || -z "${line}" ]]; then continue fi # If it has a trailing comment, remove the trailing comment if [[ "$line" =~ [^\\#][[:space:]]+# ]]; then line="${line% #*}" fi # If we still do not have a blank line, combine the output if [[ -n "${line}" ]]; then [[ "$line" =~ \b(do|then)$ ]] && output+="$line " || output+="$line; " fi done < "${1}" # Remove redundant semicolons output="${output//;;/;}" # Trim any accidental leading semicolons echo "${output#;}
-
Comment on OpenGL bindings for Bash in ~comp
goose Never much cared for or used heredoc's myself, so didn't account for them. I guess I should say, turn most other bash scripts into a one line script.Never much cared for or used heredoc's myself, so didn't account for them. I guess I should say, turn most other bash scripts into a one line script.
-
Comment on OpenGL bindings for Bash in ~comp
goose (edited )Link ParentYour bash++ post inspired me to whip up a fun little one liner. I say, with enough semicolons, any bash script can be a one line bash script! May I present, a bash one line script that will turn...Your bash++ post inspired me to whip up a fun little one liner.
If you are writing a script that is more than 100 lines long, or that uses non-straightforward control flow logic, you should rewrite it in a more structured language now.
I say, with enough semicolons, any bash script can be a one line bash script! May I present, a bash one line script that will turn any other bash script into a one line script:
while IFS= read -r line; do while [[ "${line:0:1}" =~ ($'\t'| ) ]]; do line="${line:1}"; done; if [[ "${line:0:1}" == "#" || -z "${line}" ]]; then continue; fi; if [[ "$line" =~ [^\\#][[:space:]]+# ]]; then line="${line% #*}"; fi; if [[ -n "${line}" ]]; then [[ "$line" =~ \b(do|then)$ ]] && output+="$line " || output+="$line; "; fi; done < "${1}"; output="${output//;;/;}"; echo "${output#;}"
-
Comment on Bash++: Bash with classes in ~comp
goose I mean, with enough semicolons, any multi-hundred line bash script can become a one liner! Or two, if you need a shebang, I guess.I mean, with enough semicolons, any multi-hundred line bash script can become a one liner! Or two, if you need a shebang, I guess.
-
Comment on Bash++: Bash with classes in ~comp
goose Me, looking at my 6,033 line bash scriptIf you are writing a script that is more than 100 lines long, or that uses non-straightforward control flow logic, you should rewrite it in a more structured language now.
-
Comment on What are you reading these days? in ~books
goose My most recent reads are The Mercy of Gods, and Livesuit. Same series, by James S.A. Corey, the same duo responsible for The Expanse series. Really enjoyed this new series, and I'm eagerly...My most recent reads are The Mercy of Gods, and Livesuit. Same series, by James S.A. Corey, the same duo responsible for The Expanse series. Really enjoyed this new series, and I'm eagerly awaiting the next release.
No worries, I didn't mean to knit-pick you or anything. I TA'ed for physics while getting my degree, as I found the subject interesting enough that if I weren't already in a healthcare path, I could have definitely enjoyed going down a physics career path. The idea didn't match up with the concepts in my head, so I wanted the opportunity to better educate myself, if my ideas were incorrect/outdated. Thanks for the response!