futurebird, to random
@futurebird@sauropods.win avatar

Who wants a recursive headache?
One of my very bright students is writing a program to evaluate the total resistance in a network of resistors. She came up with these nested lists to represent the network. The top level is in series and it alternates series and parallel as you go deeper.
[r1, [r2, r3],[[r4, r5,],r6],r7]
That’s r1 + 1/[1/r2+ 1/r3]+ 1/[1/(r4+r5) + 1/r6] + r7
Or
s(r1, p(r2,r3), p(s(r4, r5), r6), r7)
So this ought to be a piece of cake to parse recursively right? right??

futurebird,
@futurebird@sauropods.win avatar

@hrefna

This is how we ended up doing it. Not as elegant, but I want to try to help students find a way to make it work in their own framework, not just rewrite everything.

Program to calculate the total value of an arbitrary resistance network represented as a nested list:

r1 = resistor(10) r2 = resistor(20) r3 = resistor(30) r4 = resistor(40) r5 = resistor(50) r6 = resistor(60) r7 = resistor(70) r8 = resistor(80) r9 = resistor(90) r10 = resistor(170) #correct value print(

mattblaze, to random
@mattblaze@federate.social avatar

Periodic reminder that the "Direct Message" / "Private Mention" function here is dangerously broken with confusing semantics.

  • Anyone mentioned anywhere in the body of a PM gets a copy.

  • "Disabling" PMs in your profile merely means YOU never see messages sent to you; senders can still send them, with no error indication.

  • Nothing is encrypted, which means administrators on any instance that processes a message can see them.

I strongly recommend using something else for private messages.

cazabon,

@GuyDudeman @mattblaze @ligniform

This is clearly and . It does not mean it is the , user-friendly to the .

breton, to FreeSpeech
@breton@mstdn.social avatar

Haaretz Editorial: "The freedom from arbitrary arrest marks a line between real, freedom-seeking democracies and 'pseudo democracies.' The police under Ben Gvir’s shadow cannot be relied to give freedom of expression the importance it warrants"

https://www.haaretz.com/opinion/editorial/2023-11-23/ty-article-opinion/israels-eager-to-please-police-and-its-dangerous-arrests/0000018b-f8f6-d473-affb-f9fe80cb0000

breton,
@breton@mstdn.social avatar
ThePublicIntellectual, to random

Both the MAGA element in Israel (Likud) and the MAGA element in Palestinians (Hamas) reject the 2-state cc @chrislhayes @thestalwart

which is all u need to know what the is, the answer if u will

Susan_Larson_TN, to trans
@Susan_Larson_TN@mastodon.online avatar

would prefer two years in over using a ’s .

Then. If she feels the same in two years, extend the sentence for two more years, then ask her again, repeat until she changes her mind.

https://www.thepinknews.com/2023/10/19/jk-rowling-correct-pronouns-trans-jail/

herewegohh, to languagelearning
@herewegohh@mastodon.green avatar

Are you practicing #languages on #Mastodon. I'm a #Spanish native speaker and I'd like to help you with my language by correcting your #toots. Just add #correctMyEs and I'll try and #correct them.

If you like this idea you can also help correct others. Look for your native-language #hashtag and turn on notifications.

For English: #correctMyEn
For German: #correctMyDe
For Italian: #correctMyIt
More language codes: https://en.m.wikipedia.org/wiki/List_of_ISO_639-1_codes

Share please! We can #learn from #cooperation #langtoot

atomicpoet, to random
@atomicpoet@mastodon.social avatar

The Mastodon centralists are coming out of the woodwork today with, “But it makes onboarding easier!”

So what?

The goal here isn’t to grow for the purpose of growth. Growth, in and of itself, is meaningless.

The goal is to decentralize social media.

IAmDannyBoling,
@IAmDannyBoling@mstdn.social avatar
NickEast, to writingcommunity
@NickEast@geekdom.social avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • magazineikmin
  • everett
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • love
  • khanakhh
  • kavyap
  • tacticalgear
  • GTA5RPClips
  • DreamBathrooms
  • provamag3
  • modclub
  • mdbf
  • normalnudes
  • Durango
  • ethstaker
  • osvaldo12
  • cubers
  • ngwrru68w68
  • tester
  • anitta
  • cisconetworking
  • Leos
  • JUstTest
  • All magazines