@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.

grimalkina, to random
@grimalkina@mastodon.social avatar

I want to see absolutely no sensible and practical advice here. What programming language should I start vaguely and in a chill way teaching myself if I just want to experience something fun or elegant or interesting in and of itself, assuming I have no goal for using it to do anything really (outside of learning)

diazona,
@diazona@techhub.social avatar

@grimalkina Since I see Piet and APL have already made the list, let me throw in a suggestion for jq (https://jqlang.github.io/jq/) - but specifically, doing something complex in jq. Like, I've been writing little jq one-liners for ages, but it was only when I wrote a full 100-ish line program in jq that I started to appreciate its stream processing model as being something distinctly different from the typical paradigms (functional, procedural, OOP, async, all that jazz).

jonny, to random
@jonny@neuromatch.social avatar

Enemies of freedom mention

diazona,
@diazona@techhub.social avatar

@jonny Personally I think it made a decent amount of sense, it just had enough other problems to make up for it

Super weird regardless

diazona,
@diazona@techhub.social avatar

@Canageek @jonny Yeah that bit was just weird

diazona,
@diazona@techhub.social avatar

@jonny Well yeah the last 10 minutes were a real curveball for sure, but other than that I actually thought it made a fair bit of sense. Like, not that everything was explained, but there was a coherent plot, and most of the events of the movie contributed to advancing that plot.

mcnees, to random
@mcnees@mastodon.social avatar

LaTeX friends!

I’m looking for a modern and native (not electron) mac OS text editor that might take the place of textmate in my latex workflow.

I'm hoping to find something with existing bundles / scripts / extensions comparable to textmate’s LaTeX bundle. The great "Watch Document" feature works so much better than “latexmk -pvc”.

Any recs? I feel like the pickings are slim. When a nice native editor has any LaTeX support it's usually just syntax highlighting and a basic build script.

diazona,
@diazona@techhub.social avatar

@mcnees As a "side-channel" suggestion, have you looked into Typst? It aims to be a LaTeX replacement which is faster and easier to use, and it natively supports incremental compilation and watching source documents and so on. It doesn't have the benefit of LaTeX's huge library of packages, but for the basic stuff it seems pretty solid.

This may or may not be a practical thing for you depending on how much you're tied to specific LaTeX classes and packages.

glyph, to random
@glyph@mastodon.social avatar

this technique is… too powerful, right? the world is not ready for it https://gist.github.com/glyph/c95e59a3c04a07110766db584ad0171a

diazona,
@diazona@techhub.social avatar

@glyph haha definitely 👍

ChrisMayLA6, to VideoGames
@ChrisMayLA6@zirk.us avatar

While its good to see that books still hold their own (in revenue generating terms) with films & music (they outperform both), the big news is that video games generated more revenue globally than books & music combined.

As someone who has never played a video game, but reads a lot of books, I'm not sure how I feel about this... but it tells us something about where the globe's creative & receptive energies seem to be spent.


@bookstodon

diazona,
@diazona@techhub.social avatar

@ChrisMayLA6 @bookstodon Video games have much more revenue potential than any of the others, though - people can spend hundreds or thousands of dollars on a single game by buying in-game content. If this graph includes all that revenue, then I bet it's not giving an accurate impression of how many people play video games compared to reading books, and shouldn't be taken as a representation of how people's "creative & receptive energies" are spent.

scottmiller42, to python
@scottmiller42@mstdn.social avatar

It's really a bummer that enumerate doesn't have an option to tell it to go backwards.

Also, it took me way too long to figure out that code like this doesn't do what I wanted it to do. (The index doesn't match the location in MyString.)

MyString = "Hello"
for index , Char in enumerate (MyString[::-1]):
print (index, Char)

0 o
1 l
2 l
3 e
4 H

diazona,
@diazona@techhub.social avatar

@scottmiller42 That works. Personally I would do this:

reversed(enumerate(MyString))

That could get you in some trouble with memory usage if MyString is really long (like hundreds of millions of characters), but otherwise it's nice and simple.

You could also write your own reverse-enumerate function:

def reverse_enumerate(iterable):
return zip(range(len(iterable), 0, -1), iterable)

although this doesn't work for all iterables, but it will work for strings and lists.

diazona,
@diazona@techhub.social avatar

@scottmiller42 Oh, yeah sorry I always forget that step (even in my own coding). Yes, you have to convert it to a list, and yes it does take up memory for that list, but unless the thing you're iterating over (MyString) is really huge, I think it's fine. I mean, yes it's a little inelegant, but really not bad IMO.

If you want to work around that, you could write your own reverse enumerate function. Just zip your "reverse range()" with the iterable and return that. Of course that won't work on single-use iterables (like generators, enumerate(), filter(), map(), or so on), but I think there's no way to handle those without storing a copy of their data.

And FWIW you're not wrong that it would be convenient if enumerate() did this itself. But perhaps the fact that you have to choose between (at least) two different implementations depending on what type of iterable you're dealing with is part of why they didn't make it do that.

diazona,
@diazona@techhub.social avatar

@scottmiller42 @tshirtman Yeah no sense losing sleep over it 😛 FWIW this is the cod for the second option I mentioned, so you're still looking at just two alternatives. (I mean, yes there are other ways to do it, but I'm not sure if any of them are as clean as these two)

rochacbruno, to python

It is disappointing that TypedDict doesn't support setting default values.

from typing import TypedDict

class Con(TypedDict):  
 host: str  
 port: int = 9090

data = {"host": "test.com"}  
connection = Con(**data)  

I expected it to give me "port": 9090 by default but it does not!

Looks like building the dict as instance of Con doesn't make any difference than just building a {} and that is very confusing.

diazona,
@diazona@techhub.social avatar

@rochacbruno @cpontvieux @nedbat Yes, I'm not surprised that making a dataclass that also extends TypedDict doesn't work. I'd expect the two to conflict.

diazona,
@diazona@techhub.social avatar

@cpontvieux @rochacbruno @nedbat I don't remember offhand if this works, but what about giving the TypedDict subclass a custom constructor that fills in the default values? It wouldn't be quite as convenient as the dataclass-like syntax, but for a one-off use it should do the trick.

I guess if you really wanted to you could write a metaclass that enables defaults in TypedDict. (Maybe. Again, not sure if it'd work but I can't think of a reason it wouldn't off the top of my head) It may not be worth the effort though.

OwenTyme, to writing
@OwenTyme@mastodon.social avatar

I've found another online store that respects the price I've set on print copies of my books.

Has anyone ever heard of bookshop.org? Anything good or bad to say about them?

I found my books on it recently and the site has good reviews online, so I've added bookshop.org links to the list that shows up when you click on one of my books2read links.

My books on their site: https://bookshop.org/contributors/owen-tyme

@bookstodon

diazona,
@diazona@techhub.social avatar

@OwenTyme @bookstodon I haven't heard a lot, but what I have heard has been good.

I haven't gotten the chance to use them myself since I so rarely buy physical books these days and the few times I did I couldn't find what I was looking for on bookshop.org, but I always check.

aldi80s, to books
@aldi80s@mastodon.social avatar

I gave up on #Bookwyrm

Need another good alternative for the control of books.
I wanna keep doing the year reading goal and other stuff.

#Readers #Books #Reading

diazona,
@diazona@techhub.social avatar

@aldi80s What are the key features you're looking for? (or not looking for? ie why didn't you like about )

diazona,
@diazona@techhub.social avatar

@aldi80s Makes sense. I wonder if it's a problem with the Bookwyrm software or with the server? Because in the latter case, maybe you could try making an account on a different server and it would do better.

Other than that, I don't know if anything else quite compares to the social features of Bookwyrm. I see someone else recommended The Story Graph, which I use and it's pretty good, but it does have a different set of priorities.

kushal, to random
@kushal@toots.dgplug.org avatar

I am not seeing enough about what is going on US university campuses on mastodon. Maybe I am following different crowd.

diazona,
@diazona@techhub.social avatar

@kushal Yeah, some people will be posting about it (with varying frequency) and some people won't, and it makes sense that if you're not seeing as much of that content as you want to, you can change that by following (or unfollowing) people. Or hashtags of course; I've seen a few relevant ones.

I don't think an appeal that there should be more posts about the topic - in the sense that people who aren't posting about it should be - is the way to go.

RomanOnARiver, to python
@RomanOnARiver@mastodon.social avatar

Is it better to have multiple python lists or one giant list with multiple lists embedded? Taking from perspective of speed and ram/CPU usage.

diazona,
@diazona@techhub.social avatar

@RomanOnARiver Probably depends on what you're doing with them?

I guess the RAM usage would likely be more with multiple lists, although probably not much more. But other than that it could be context-dependent.

otheorange_tag, to random
@otheorange_tag@mstdn.social avatar

Late to the party did they f-off into the sea .. of tranquillity?! --Dad

diazona,
@diazona@techhub.social avatar

@otheorange_tag @msh I'm glad somebody made a "fucking off into the Sea of Tranquility" joke, it needed to be said

I tried but wasn't quick enough and then there was a space wedding

ottaross, (edited ) to random
@ottaross@mastodon.social avatar

Got the movie going - is the movie just on Mystery science Theatre 3000 via Tubi?

Would rather watch it without the jokey overlay. Couldn't find it as a stand alone movie.

diazona,
@diazona@techhub.social avatar
diazona,
@diazona@techhub.social avatar

@ottaross It's on the Internet Archive and various streaming sites, I can post a link shortly

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

just for the record this one doesn't get better on repeat viewings

diazona,
@diazona@techhub.social avatar

@moira Gotta admit I had a momentary bout of disbelief at the idea that anyone would choose to watch this movie again (until I realized you were probably alluding to having watched it before, and then #Monsterdon was the second time)

Lazarou, to random
@Lazarou@mastodon.social avatar

Leaving Earth a one star review:
"Hostile, Belligerent, Racist. Avoid."

diazona,
@diazona@techhub.social avatar

@Lazarou This is going in the latest Hitchhiker's Guide I presume

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

. o O ( Don't blame me, >I< voted for KAIJU! )

diazona,
@diazona@techhub.social avatar

@moira I wouldn't say no to some space kaiju though

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

so ... xenophobia was the real monster all along?

diazona,
@diazona@techhub.social avatar

@moira Always is TBH

diazona, to academia
@diazona@techhub.social avatar

Later this week I'm giving a colloquium to my old grad school department (physics) about my experience getting out of and working as a software engineer. It'd be interesting to crowd-source this: grad students and other former grad students of Mastodon, what would you want to hear in this kind of a talk?

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