Better HN
topnewbestaskshowjobs
Log inSign up

panic

29,749 karma · joined Sep 16, 2009 (17y ago) · 3,592 submissions

Submissions

571.

Formalising Mathematics: An Introduction(xenaproject.wordpress.com ↗)

205 points · by panic · 5y ago · 116 comments

572.

TypeScript: Messages from Interfaces and Back(eighty-twenty.org ↗)

1 points · by panic · 5y ago · discuss

573.

Bookfeed.io – An RSS feed of newly released books from your favorite authors(bookfeed.io ↗)

1 points · by panic · 5y ago · discuss

comment 5y ago · link · parent

My money is on Linux's cpu_idle_loop().

575.

My history with Forth and stack machines (2010)(yosefk.com ↗)

95 points · by panic · 5y ago · 25 comments

comment 5y ago · link · parent

This kind of attitude is just as unhealthy as the sociopathic management style it assumes is universal. It’s hard to hire good software engineers. You have more power to leave toxic situations than you might think.

comment 5y ago · link · parent

Does this mean I’ll be automatically unsubscribed from a mailing list if my mail client doesn’t load the tracking pixel? How long does this take to happen?

578.

Investigating Quadratic Time Complexity When Adding Subviews in UIKit (2016)(blog.benjamin-encz.de ↗)

1 points · by panic · 5y ago · discuss

579.

How museum collector-trustees recapture charitable donations(backbeat.substack.com ↗)

1 points · by panic · 5y ago · discuss

580.

Architecture Astronauts Take over (2008)(joelonsoftware.com ↗)

2 points · by panic · 5y ago · discuss

comment 5y ago · link · parent

Modern renderers typically draw scrollable content into a separate texture (or collection of smaller textures that tile the scrollable region) and use the GPU to scroll rather than bitblting on the CPU. You can use the same technique to render the scrollable part of the UI in an immediate mode system.

comment 5y ago · link · parent

Immediate mode is great, but it can be hard to implement nice custom event handling on top of it. For example, say you have a collection of buttons. You want to be able to click on one button (the button highlights), drag onto another button (that button highlights and the first button unhighlights), and release on that second button to trigger its action. This is a real issue I ran into while building an immediate-mode UI... I found it hard to implement an interaction like this without a reified "layout" that I could query as the mouse moved around.

comment 5y ago · link · parent

It's easy to skip drawing frames when no state changes, and for frames where state does change, you can use techniques like rxi's cached software rendering to avoid redrawing the entire screen: https://rxi.github.io/cached_software_rendering.html

comment 5y ago · link · parent

> I suppose as soon as something becomes too complex, keeping track of all interactions is just too complicated and rerendering the entire world efficiently looks like an easier problem to deal with.

In fact, it can actually be less work, since you're coalescing changes into a single update() call rather than sprinkling them across observer callbacks. Also, if your update function starts running too slowly, you can always make it more precise by keeping track of which states have changed internally to the view. For example, if setting the background color takes a long time for whatever reason, you can do something like this:

    def View.update():
      if self.lightWasTurnedOn != model.lightTurnedOn:
        if model.lightTurnedOn:
          self.backgroundColor = red
        else:
          self.backgroundColor = ibmGray
        self.lightWasTurnedOn = model.lightTurnedOn
Now backgroundColor will only be set if lightTurnedOn actually changed since the last update.

comment 5y ago · link · parent

I've found the best way to handle this problem is a variation on "lift the state up", but instead of binding synchronous listeners to state changes in the model, have these state changes mark any involved views as "dirty". Then, after all events have been processed for the current run loop, go through all the dirty views and call a single update function on each.

For the example given in the article, the update function could look something like

    def View.update():
      if model.lightTurnedOn:
        self.backgroundColor = red
      else:
        self.backgroundColor = ibmGray
This way, all view property changes happen in one place, where you can read the code and understand how the view will appear in each possible state. Circular listener loops are impossible, and view properties for animations can even be computed by calling update twice (once before and once after the state change).

comment 5y ago · link · parent

> What do we do with all these smart people?

Every community (families, neighbors, fandoms, friends, online chatrooms, religious groups, video game guilds...) has needs. What if smart people helped attend to the needs of the communities they're a part of rather than trying to solve the entire world's problems in a uniform way?

587.

What Can Covid-19 Teach Us About the Mysteries of Smell?(nytimes.com ↗)

1 points · by panic · 5y ago · discuss

comment 5y ago · link · parent

At least in C, "header only" libraries typically require a #define LIBRARYNAME_IMPLEMENTATION somewhere in a .c file to define the symbols declared in the header. That way you're not including a copy of every function in every object file, which is what would slow down compile times. C compilers are very fast at skipping #ifdef blocks.

comment 5y ago · link · parent

> News stories about ML invariably invite readers to imagine autonomous agents analogous to robots: either helpful servants or inscrutable antagonists like the Terminator and HAL. Boring paternal condescension or boring dread are the only reactions that seem possible within this script....

The point is that AIs are typically imagined by our culture as independent agents that act kind of like humans, not as tools or forces that participate in human culture in a more inhuman way.

590.

Work Towards Solving Ultimate Tic Tac Toe(minimax.dev ↗)

2 points · by panic · 5y ago · discuss

comment 5y ago · link · parent

And if you block the housing that would let these employees walk or bike to work, they'll have to drive in from out of town, increasing traffic (one of the primary arguments made against new housing).

592.

You’re Doing It Wrong: Notes on Criticism and Technology Hype(sts-news.medium.com ↗)

3 points · by panic · 5y ago · discuss

593.

Internet as Hyper-Liberalism (1996)(web.inter.nl.net ↗)

1 points · by panic · 5y ago · discuss

comment 5y ago · link · parent

> The only two relevant pieces of Fedi software are Pleroma and Mastodon. ActivityPub is such a horrible protocol, and Mastodon has butchered it so much, it’s impossible to make an interoperable implementation without man-months of work. To reimplement Mastodon from the ground up would be a nightmare.

Interoperability through simple protocols is such an underrated property of a social network. Despite being a proprietary service, AIM's TOC protocol could be implemented from scratch in just a few hundred lines of code -- remember how many third party AIM clients there were? Even implementing the ActivityStreams system that ActivityPub is built on top of takes more code than that. From what I've seen, IPFS has the same problem -- an exciting decentralized model locked behind a nightmarishly overengineered protocol. Who is working on simpler alternatives to these systems?

1
192021
120