@sgf@mastodon.xyz
@sgf@mastodon.xyz avatar

sgf

@sgf@mastodon.xyz

SRE manager on Google Compute Engine (only speak for me), ex-quant dev. Fan of maths, Haskell, Rust and retrocomputing. London, UK. CS PhD. Fuck cancer.

Available on Twitter while stocks last.

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

simontatham, (edited ) to random
@simontatham@hachyderm.io avatar

You can represent an eventually-periodic infinite string as two finite strings: an initial segment and a repeating one. The representation isn't unique, e.g. (ABC, DECDECDEC) is the same string as (AB, CDE).

How do you find the minimal string pair equivalent to an input one?

Cute answer I just thought of: make a ρ-shaped finite state machine, and run the standard DFA minimisation algorithm, iteratively refining an eq rel on the states, to give a minimal equivalent ρ.

https://tartarus.org/~simon/20240527-minimise-rho.py.html

sgf,
@sgf@mastodon.xyz avatar

@simontatham I'm probably missing something, but:

Can't you normalise by looking at the last letter on the initial and repeat section, and if they're the same, remove it from the initial and move it from the back to the front on the repeat? Do repeatedly until they differ.

(And don't forgot to remove repeats from the repeats section.)

Patricia, to random
@Patricia@vivaldi.net avatar

Ok, I’m sorry, I’m going to ruffle feathers here but… I’m trying to read some newer development process books and… oh my… even super popular ones are so immensely long winded and unconvincing in their dogmatic argumentation: this is bad, this is good, because I said so that’s why.

Recent examples that I’m struggling to finish: “Team Topologies” and “Data Mesh” - I mean they might be great but I’m getting strong “this should’ve been a blogpost” feels.

sgf,
@sgf@mastodon.xyz avatar

@Patricia This thread got me writing a blog post about methodologies and the Spotify Thing - https://arbitrary.name/blog/all/spotify.html .

Then I watched the video and was horrified to find that some fraction of the video was criticism of the Spotify model similar to what I'd blogged, and the rest, while I wouldn't necessarily agree with, was at least comprehensible to me. Obviously management has brain-damaged me.

Yes, the video is wrapped up in word soup.

Do you have any questions I could usefully answer?

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

I assume this isn't a problem for EEs but for CS types who are taught logic gates, etc, in their curriculum I wonder if timing should be included in a first course. I'm still trying to help the person I mentioned earlier in a private chat and it sounds like that's the source of almost all their confusion. They think logic gates are instant and one of the "counterexamples" they came up for why delays seem logically inconsistent is y = xor(x, not(x)). Which is a standard edge detector.

sgf,
@sgf@mastodon.xyz avatar

@pervognsen On the one hand I think you can handwave latches etc. without propagation delays by talking about fixed points.

On the other hand propagation delays are the entire justification for the pipelined processors which form the basis of so many CS architecture courses, so it's rather hard to pretend they don't exist.

sgf,
@sgf@mastodon.xyz avatar

@pervognsen I should phrase my posts better. I do think delay-based models are basically better for digital logic - closer to reality and easier to explain etc., but I think the fixed-point based approach as an alternative is interesting (but tricky).

Compare with opamps, where a fixed-point-based approach is pretty standard for all the introductory material, even if it's not called that, and it works well.

Different techniques for different domains, I guess.

danderson, to random
@danderson@hachyderm.io avatar

Last few days: okay sure an eeprom is the best way to implement this without a programmable microcontroller, but what if logic gates

Today: okay so logic gates is annoying but doable, however consider this: core rope memory

It's extremely silly and pointless, but it's okay therapy tbh

sgf,
@sgf@mastodon.xyz avatar

@danderson Or, for something in-between, a discrete diode-based ROM. Use LEDs and you can even visualise the data being read out!

sgf, to random
@sgf@mastodon.xyz avatar

Random fun fact: They don't want you to think too hard while waiting for your PET scan in case it makes your brain glow.

(Some technical liberties may have been taken with this explanation.)

danderson, to random
@danderson@hachyderm.io avatar

Ask your doctor if yosys logic gate fuckery is right for you

sgf,
@sgf@mastodon.xyz avatar

@danderson For four, a GAL? Smaller footprint than an EEPROM, bit less overkill than a microcontroller?

sgf,
@sgf@mastodon.xyz avatar

@danderson While my personal bar is "still readily available" rather than "being manufactured", I can't see any end-of-line notices on e.g. https://www.mouser.co.uk/c/semiconductors/integrated-circuits-ics/programmable-logic-ics/?mounting%20style=Through%20Hole&product%20type=EEPLD%20-%20Electronically%20Erasable%20Programmable%20Logic%20Devices%7C~SPLD%20-%20Simple%20Programmable%20Logic%20Devices&sort=pricing and https://www.microchip.com/en-us/product/ATF16V8CZ suggests these kinds of chips are (just) still in production.

(If you're distinguishing the specific implementation of GAL-like tech, I'm also being a bit blurry on that front.)

They're cost-ineffective, but I love 'em.

sgf, to random
@sgf@mastodon.xyz avatar

I thought I'd use gnuplot. I wanted a stacked line chart. Easy, surely?

https://stackoverflow.com/questions/40487935/gnuplot-draw-stacked-line-chart

Two answers, saying it's not supported directly, you have to calculate the stacking sums yourself, and both using the word "easy".

You know what's easy? Not reinventing the stacked line graph.

Anything where you have to include a little algorithm to do it, that's not easy.

pervognsen, to random
@pervognsen@mastodon.social avatar

"The algorithm uses exactly the same terminology and is presented in bottom-up form. (If you prefer top-down design, please read the rest of this section backwards.)"

sgf,
@sgf@mastodon.xyz avatar

@pervognsen @TomF Am I missing something, or can this specific case be written as

i := w;
while i <> 0 and x[i] = 0 do
i := i - 1;
length := i + 1;

?

(The case where x is entirely 0s returning 1 seems odd to me, but matches the original's behaviour.)

sgf,
@sgf@mastodon.xyz avatar

@pervognsen @TomF Aha! All becomes clear! Thanks.

I guess you could use Pascal's nested functions to make a loop termination test that hand-implements the short-circuiting, which I think would be clearer than the sentinel shenanigans, but yeah, "break" still wins.

sgf, to random
@sgf@mastodon.xyz avatar

I'm surprisingly disappointed to find out that Stack Overflow wasn't taking a stand against lazy, truthy auto-generated LLM output in order to give humans better answers and prevent the proliferation of unhelpful noise on the internet, but was instead doing it in order to sell training data free of AI-generated content.

azonenberg, to math
@azonenberg@ioc.exchange avatar

Ok, this one is for the discrete gurus out there.

Let N = CRC32(X)

Given N, is it possible to efficiently calculate CRC32(concat(X, Y)) where Y is a known sized, but very long, sequence of 0xFF bytes?

Obviously you can just seed the CRC with N and iterate, feeding 0xFF in each cycle, but is there any kind of shortcut you can take if you know the input is always a 1 bit?

sgf,
@sgf@mastodon.xyz avatar

@jix @azonenberg Thank you for coming here and saying what I was going to say, but more mathematically.

+1 to treating the CRC step as a matrix multiplication and doing matrix exponentiation to fast forward in log time.

johncarlosbaez, (edited ) to random
@johncarlosbaez@mathstodon.xyz avatar

If I tell you the radii of the spheres 𝑎 and 𝑏 in this picture, can you figure out the radii 𝑟₁,...,𝑟₆ of the six spheres that touch them and snugly fit inside the big sphere? Can you at least do it if you know 𝑟₁?

Irisawa Shintarō Hiroatsu did it in 1822! He was a merchant who sold tea, textiles and ingredients for traditional Chinese medicine - and he had a hobby of solving math puzzles.

In 1932 his technique was rediscovered by a Nobel-prize-winning chemist, so it's often called Soddy’s Hexlet Theorem. But Hiroatsu did it earlier as part of a Japanese mathematical tradition called 𝑤𝑎𝑠𝑎𝑛 - and as part of this tradition, he donated a plaque containing this result to a shrine!

He wasn't the only one who did this sort of thing. This kind of plaque is called a 𝑠𝑎𝑛𝑔𝑎𝑘𝑢. These plaques were used to commemorate newly discovered solutions to hard math problems during the Edo Period from 1603 to 1868. There's a lot of interesting math in these 𝑠𝑎𝑛𝑔𝑎𝑘𝑢, and you can see some of them here:

• Abe Haruki, Japan’s “𝑊𝑎𝑠𝑎𝑛” mathematical tradition: surprising discoveries in an age of seclusion, https://www.nippon.com/en/japan-topics/c12801/

You can also learn more about the solution to the puzzle I gave! The most surprising thing is that the reciprocals of the opposite pairs of spheres in the "hexlet" of 6 spheres add up to the same number:

1/𝑟₁+1/𝑟₄ = 1/𝑟₂+1/𝑟₅ = 1/𝑟₃+1/𝑟₆

See also:

• Wikipedia, Soddy's hexlet, https://en.wikipedia.org/wiki/Soddy%27s_hexlet

This math is secretly all about conformal transformations, which map spheres to spheres... or planes!

Thanks to @highergeometer for pointing this out!

sgf,
@sgf@mastodon.xyz avatar

@johncarlosbaez Oh wow, I like the conformal mapping angle: I can see mapping the problem to an easier one would be extremely helpful. Reminds me a little bit about how some geometric results about conic sections are just literal projections of results about circles!

lily, to random
@lily@glaceon.social avatar

frequency can be used to measure things that really feel like they should use different units.

"how often should my OS check the state of the keyboard"

"middle C"

this is technically a coherent answer

sgf,
@sgf@mastodon.xyz avatar

@astrid @lily @andrewt What I particularly like is /why/ people get all golden ratio on music (*):

An octave has: Five black notes. Eight white notes. Thirteen notes. 5, 8, 13, Fibonacci, Φ!

Unfortunately, the 8 and 13 double count the first/last note, and it's really about the twelfth root of two.

So you've got a whole branch of musical numerology based on incorrect 1-based indexing!

((*) Sorry, Andrew, if this is what you were referring to, but I didn't see it explicitly mentioned.)

mekkaokereke, (edited ) to random
@mekkaokereke@hachyderm.io avatar

If Kendrick weren't rapping about insulting Drake, would you still be this interested?

Kendrick always raps like this. So why the sudden attention? Are you celebrating the lyrical skill? Or the fact that he's threatening another Black man's life?

What specifically are we celebrating?🤔

Everyone's celebrating "bars." I've been watching all day, haven't seen anyone talk about the bars where K Dot said he'd take the Draco to Drake. Or where he said he'd extort Drake next time he checks-in in LA.

sgf,
@sgf@mastodon.xyz avatar

@mekkaokereke This whole thread is 😱 to me.

As a non-rap person in a different country, I'd assumed all the beef stuff was machismo and hopefully kayfabe, and...

It all comes down to multi-million money-grubbing criminal extortion? WTAF?!

hrefna, to random
@hrefna@hachyderm.io avatar

"I bet I could prototype a website faster than you in my chosen language than you could in your chosen language."

What is this, grade school?

I'm pretty sure you could prototype a website faster in my chosen language than I could in the same language.

If you are going to talk about your frustrations with "machoism" then maybe start by asking yourself about why you think speed of implementing a website is a good test of literally anything.

That is all I have to say about that.

sgf,
@sgf@mastodon.xyz avatar

@phillmv @hrefna So what you want is a site that's easy to modify, which isn't necessarily the same as the quickest to build the initial cut of.

I'm not a web person, but I can iterate more quickly and confidently on a program with decent tests than one without, but building a first cut with comprehensive tests is slower than without.

polotek, to random
@polotek@social.polotek.net avatar

“We have a culture of vibrant, open discussion that enables us to create amazing products and turn great ideas into action,” he said in the memo, which the company posted online. “But ultimately we are a workplace and our policies and expectations are clear: this is a business.”
https://www.washingtonpost.com/technology/2024/04/22/google-nimbus-israel-protest-fired-workers/

sgf,
@sgf@mastodon.xyz avatar

@polotek I think SREs are in a position where a walkout could seriously affect a company. OTOH, while I know a lot of SREs are politically active, they also feel strongly responsible for their systems, and wouldn't deliberately destabilise them (thinking of the guy fired while on-call, whose first reaction, despite losing corp access, was to find a way to properly hand his shift off).

simontatham, to random
@simontatham@hachyderm.io avatar

The novel "1984" opens with clocks striking thirteen, perhaps intended to indicate that in the book's world, even church clocks with bells have adopted the 24-hour system.

Of course, it's impractical. You'd lose count late at night. "Was that 23 bongs, or only 22? Got to ask myself one question: do I feel sleepy?"

But here's a scheme that might make it work. Specify three clearly distinguishable types of bong representing I, V and X – and chime the hour in Roman numerals!

sgf,
@sgf@mastodon.xyz avatar

@simontatham In world, "Of course it's impractical" is no blocker! Pushing for the universal adoption of 24-hour clocks and don't care if it makes the bells ridiculous would be part of the state approach, demanding subservience to the state over practically.

sgf, to random
@sgf@mastodon.xyz avatar

Reading about LISP machines has given me the sad realisation that Unix is RISC.

LISP machines were as CISC as you could get, closing the "semantic gap" by all the way up to LISP primitives.

RISC was "don't do that, don't make assumptions about the high-level workload, just provide fast machine-aligned primitives".

LISP OSes aligned with LISP. Unix may align with C, but in a fairly generic way. Really it's an OS trying to be dumb and hardware aligned. Push the clever up the stack.

1/

sgf,
@sgf@mastodon.xyz avatar

At some level, I have to ask myself "Is this true?". In the same way that fish might not question water, is the C model really a "neutral" model on which to build flexibly?

Well, C was, at one point, pretty "hardware independent assembly", so I think it's fair to treat it as quite hardware-aligned.

Probably the weirdest bit of hardware/OS co-evolution is the MMU. It feels a little contrived.

The rest, though? Reasonably good hardware sympathy for a load-store machine.

2/2

dukepaaron, to random
@dukepaaron@babka.social avatar

Look folks...

First of all a holocaust museum isn't the same as a Jewish museum. It's a slice of Jewish experience sure but we've been around a long time.

Second all of these holocaust museums have not achieved the objective. Nobody gives a fuck and they haven't stopped antisemitism. Consider them a failure.

Third how much of our resources are we going to pile into these things so people can yell at us online about how we think we're special? At this point the holocaust is a curiosity outside of Jews and Germans. The next time your Rabbi says some racist actor or athlete needs to go to a holocaust museum tell them to stfu.

Fourth, and this is important, the holocaust is ready to transition to one of our historical narratives. And we should eat a lot of food on the holiday and talk about how "we're still fucking here you shitty fuckers!"

End of rant.

https://www.sdjewishworld.com/2024/04/15/oped-san-diego-county-needs-a-jewish-museum/

sgf,
@sgf@mastodon.xyz avatar

@dukepaaron What I see as a non-Jew is Holocaust memorial stuff being primarily focused on Jews, but the underlying message being the horror of these orchestrated mass murders generally.

e.g. Auschwitz museum social media feed mentions the gay people, Roma etc. murdered too & generally the Holocaust is seen in the context of other genocides.

In some sense, this is good, to see the wider picture of humanity, but it also loses the important depth of history specifically for Jews.

1/

sgf,
@sgf@mastodon.xyz avatar

@dukepaaron Also, by focusing on the insane, horrifying end point, people detach it from the route to get there. The take-away from Holocaust memorials is "mass murderer is bad", not "anti-Semitism is bad", despite one enabling the other; people don't viscerally understand the connection.

I think this tallies with what's seen in US politics, where people claiming they don't want genocide are still supporting fascist politics.

2/

sgf,
@sgf@mastodon.xyz avatar

@dukepaaron

So, yeah, I don't think Holocaust memorials are effective at bringing the message "don't be anti-Semitic" to non-Jews. Almost (?) by design.

3/3

azonenberg, to random
@azonenberg@ioc.exchange avatar

Assembling the trigger crossbar board over lunch.

Not thrilled with the paste print quality, very inconsistent. the top left corner was way too thick as the board flexed during printing, the middle BGA skipped some pads, and the WLCSP in the bottom right was near perfect.

These big boards bend too much in my paste fixture, I need to find a way to prevent that before I do any more boards of this scale.

sgf,
@sgf@mastodon.xyz avatar

@azonenberg @laird Dumbest possible explanation: It's a network-connected high-performance patch-board?! :)

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