@diazona@techhub.social avatar

diazona

@diazona@techhub.social

Software engineer, former particle physicist, occasional blogger. I support the principle of cake.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

desertplains, to python
@desertplains@mastodon.social avatar

I wonder if there's a more efficient way of implementing decimal to conversion in

Without recursion, it's ok, but there will be variable assignments operations, which seems to me as something not so efficient, comparing with recursion...

image/png

diazona,
@diazona@techhub.social avatar

@desertplains You could make a helper function which is a generator and just yield digits instead of appending to a string. Then call ''.join(helper_function(n)) to get the final result. That avoids a bunch of string concatenations. Or another (slightly less elegant IMO, but totally valid) way to do it is to build up a list of characters in the loop instead of appending to a string. You may find working with a list is more efficient.

If you really want to get into high efficiency (within the constraints of what Python allows, of course; it'll never be as fast as C), you might try something like using a lookup table and accumulator to produce blocks of 3 bits at a time. I don't know if that'd actually turn out faster, but it may be worth checking. I can elaborate if you're interested.

#Python #programming

misty, to random
@misty@digipres.club avatar

Oh man, this news story. Former MLA from Manitoba asks Meta's own "ask AI" chatbot if a phone number he found on Google is really Meta support. It tells him yes. It isn't, and he's scammed out of $500 and control of his accounts. https://www.cbc.ca/news/canada/manitoba/facebook-customer-support-scam-1.7219581

diazona,
@diazona@techhub.social avatar

@misty "a hyper-intelligent eight-year-old that desperately wants to please you. It knows everything about everything, but it will give you a wrong answer rather than say, 'I don't know.'"

I like that description, I might use that in the future

diazona,
@diazona@techhub.social avatar

@bornach @misty No, an LLM "knows" a lot, in the sense that there's a lot of raw information encoded in the model. Of course it doesn't have perfect recall of that information, but neither do humans.

I'm also not denying that an LLM can "recall" things that are completely different from the information it "knows", which humans also do but much less often and less egregiously, but that doesn't mean that it "knows" nothing, at least under what I would consider a reasonable definition of "knowing" for a language model.

diazona,
@diazona@techhub.social avatar

@resuna @bornach @misty I think it's pretty well established at this point that you're using a different definition of "know" than I am. (of course neither of us really knows which definition was intended in the original quote)

andrew, to random
@andrew@esq.social avatar

IRS Direct File is a major win for the #Biden administration that doesn’t get a lot of attention.

Giving taxpayers an option to remove themselves from the marketplace of scammy for-profit preparation services is a major victory for all parties.

Other than the scammy for-profit preparation services, I guess.

https://www.forbes.com/sites/andrewleahey/2024/05/30/irs-direct-file-expands-to-all-50-states-for-2025/?sh=35669f5b825f

diazona,
@diazona@techhub.social avatar

@andrew woohoo! Very exciting. I never thought I'd see the day when this would happen.

(I think I'm over the income limit for it myself, but it's more about breaking the hold that the tax preparation industry has over the whole process)

diazona, to random
@diazona@techhub.social avatar

does the giant mantis play baseball, I want it on my fantasy team

kde, to random
@kde@floss.social avatar

KDE Gear 24.05 is out! It comes with new versions of Dolphin, Kdenlive, Merkuro, Elisa, Kate, many more apps, and no ads or spyware.

https://kde.org/announcements/gear/24.05.0

@kde

diazona,
@diazona@techhub.social avatar

@SigHunter Huh, well I can report that I have used Audex for many regular pressed audio CDs I purchased, and it never has a problem ripping them.

My best guess is that whoever wrote the website was a little careless and used "CD-ROM" as a generic term for any kind of CD. 🤷

ehmatthes, to random
@ehmatthes@fosstodon.org avatar

Where do people put guidelines around implementation choices in a project?

For example I want to make a note to use path.read_text() instead of with open(), and a brief rationale.

diazona,
@diazona@techhub.social avatar

@SnoopJ @ehmatthes Huh interesting, I've never seen that name.

Personally I'd probably expect to find this sort of info called "coding guidelines" or "coding conventions", but there isn't any standard file name I would look at to find it.

neverbeaten, to random
@neverbeaten@mas.to avatar

#Monsterdon
The eponymous pit!

diazona,
@diazona@techhub.social avatar

@neverbeaten It only took nearly the whole movie

#Monsterdon

moira, to random
@moira@mastodon.murkworks.net avatar

now SURPRISE she's a vampire! and she can start building her harem!

#monsterdon #ThePitAndThePendulum

diazona,
@diazona@techhub.social avatar

@moira yes yes yes yes yes this is what I'm here for

#Monsterdon

davidism, to random
@davidism@mas.to avatar
diazona,
@diazona@techhub.social avatar

@rgottlieb @davidism Yeah seriously... I never considered going to #PyConUS myself but y'all are making it look pretty awesome!

matthewskelton, to random
@matthewskelton@mastodon.social avatar

"Surprisingly, our results show that women's contributions tend to be accepted more often than men's. However, when a woman's gender is identifiable, they are rejected more often. Our results suggest that although women on GitHub may be more competent overall, bias against them exists nonetheless."

https://www.researchgate.net/publication/308716997_Gender_bias_in_open_source_Pull_request_acceptance_of_women_versus_men

🤬

diazona,
@diazona@techhub.social avatar

@dahukanna @matthewskelton The paper says "We hypothesized that pull requests made by women are less likely to be accepted than those made by men. Prior work on gender bias in hiring [...] suggests that this hypothesis may be true." The way I read it, it sounds like that's why they were surprised: the results came out opposite to their hypothesis. Nothing to do with actual competence.

Plus, even though they didn't say so, I'd guess that bias against women in software engineering is discussed widely enough that the authors would have been aware of it and expecting to find that bias reflected in the rates of PR acceptance. I know not everyone is "tuned in" to the conversation about gender bias (and not everyone believes it 😠), but it seems unlikely that four people with the qualifications to write an academic paper on the topic would be unaware of it or in denial.

diazona,
@diazona@techhub.social avatar

@then_three_more @itsnotits I don't see how "its a new feature" is grammatical, because we don't use "a" along with a possessive. "Its new feature" would be perfectly normal but I think "its a new feature" doesn't make sense.

jason_w_karpf, to StarTrek
@jason_w_karpf@mastodonbooks.net avatar

New Study Achieves Breakthrough in Warp Drive Design - Press Release

A warp drive concept that works within known physics. At last!

@bookstodon @religion https://apple.news/AZ2WX4m78Qnq0LETaaeToJg

diazona,
@diazona@techhub.social avatar

@jason_w_karpf @bookstodon @religion Huh, well it'll be interesting to see what additional research happens along these lines. It sounds interesting but the press release sounds very promotional, so I'm reserving judgment.

(I wonder what the religion group's interest in this is? 🤷)

dickrubin716, to bookstodon
@dickrubin716@bookstodon.com avatar

I would love to get your thoughts and feedback on my from my latest book, The Challenges of Being Me. Do you like it? Does it capture your attention? Without knowing anything about the book, what genre would you say this cover best fits? @bookstodon

diazona,
@diazona@techhub.social avatar

@negative12dollarbill @dickrubin716 @bookstodon Interesting, I kind of had the opposite guesses: the title makes me think of self-help, but the image suggests something else (possibly YA)

brettcannon, to random
@brettcannon@fosstodon.org avatar

Looking for a Bash one-liner to tell by exit code whether your Git checkout is dirty?

if [ -n "$(git status --porcelain)" ]; then (exit 1); fi

I sought this out for GitHub Actions so that I could set up a formatting command for a project and then check in CI if it would change anything instead of having a second command just for the check (e.g. black followed by this in CI instead of having a separate, dedicated black --check just for CI). Basically trying up the DRY on maintenance stuff

diazona,
@diazona@techhub.social avatar

@brettcannon There's also git diff --quiet HEAD, which is what I often see used in Git scripts (e.g. the Git bash prompt uses a slightly more robust version of this)

git diff --quiet or git diff --staged --quiet if you want to check for only unstaged or only staged changes respectively

diazona,
@diazona@techhub.social avatar

@brettcannon Ah no it doesn't. Are you in the market for something to show untracked files as well? If so, it's probably worth noting the caveat that git status only reports untracked files if status.showUntrackedFiles is set to true (I keep it at false and TBH I can never really understand the mindset that makes some people set it to true, but to each their own 🙂), or if you pass the -u option to git status (or whatever its long form is, I don't remember offhand).

diazona,
@diazona@techhub.social avatar

@brettcannon haha no worries, well if I remember correctly --porcelain only affects how the information is displayed, it doesn't affect what information is collected and reported (like which files are considered). But don't take my word for it, I'm going by memory here.

diazona, to random
@diazona@techhub.social avatar

It's strangely comforting to get a good old classic #Monsterdon non-ending

Thanks for hosting @Taweret!

diazona, to random
@diazona@techhub.social avatar

Is that supposed to be a spider he drew on the airplane

Worst spider drawing ever

It looks like an amoeba

#Monsterdon

jonny, to random
@jonny@social.coop avatar

Posting from one account to reply from another account to be on the feed without polluting the local feed. others who wish to do the same but don't have an alt can reply to this as well (but untag me)

diazona,
@diazona@techhub.social avatar

@jonny What would become of #Monsterdon with that kind of logic though

#Monsterdon

diazona,
@diazona@techhub.social avatar

@jonny Good point in general, but I do think the continuing erosion of the amount of spider-safe space the main characters had to deal with was also a pretty effective way of building tension

#Monsterdon

diazona, to python
@diazona@techhub.social avatar

I remember having a discussion about argument parsing in a while ago where someone recommended a small library that was kind of like argparse except that instead of returning an argparse.Namespace, it returns a fully typed object (which you define), a dataclass or something similar. Anyone know what I'm talking about? I wanted to try that library but I forgot what it is and I can't find the discussion.

diazona,
@diazona@techhub.social avatar

@pawamoy Yep that's the one. Thanks for finding it! I have too much in my posting history 😅

simon, to random

For several months now, I've been using an app called Due for reminders, and I think it is helping me more than any other app I've tried. It has interactive notifications that let you reschedule or complete reminders from the lock screen; Siri support; a set of really nice sounds that can be chosen per-reminder; all the usual recurring features; and best of all, customizable auto-snoowhze, which causes the reminder to repeat until you either reschedule or complete it. Its tagline is "never forget anything again", and I'm not sure the developer could have done a better job making that happen. https://apps.apple.com/ca/app/due-reminders-timers/id390017969

diazona,
@diazona@techhub.social avatar

@simon Sounds nice, I wish there were an Android equivalent

cory, to tech
@cory@social.lol avatar

📝: A retrospective on a year without streaming music https://coryd.dev/posts/2024/a-retrospective-on-a-year-without-streaming-music/

diazona,
@diazona@techhub.social avatar

@tinheadned @cory The throwing away part is very much optional 😛

I mean, I know CDs take up space, it's just wild to me to think of buying a CD to use once and immediately dispose of

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines