Archive for July 20, 2023

Thursday, July 20, 2023

Fixing Launch Services Problems

Howard Oakley:

When a document is set to be opened by an app other than the default for its UTI, a extended attribute is added, containing a property list specifying[…]


When an app is first run from the Finder and GUI, information about it is extracted from its Info.plist file and added to LaunchServices’ database. This includes custom document types specified by the app and its abilities to open and edit different types of document. These are then used to match document UTIs against the apps that can open them. Unless you’ve set any different, LaunchServices should normally open the most recent version of the specified app in your Applications folder[…]


There are two command tools that can be valuable for tackling harder problems: lsappinfo for getting information from LaunchServices’ database, and lsregister for changing it.


Edward Fredkin, RIP

Alex Williams:

An autodidact who left college after a year, he nonetheless became a full professor of computer science at M.I.T. at 34. He later taught at Carnegie Mellon University in Pittsburgh and at Boston University.

Not content to confine his energies to the ivory tower, Professor Fredkin in 1962 founded a company that built programmable film readers, allowing computers to analyze data captured by cameras, such as Air Force radar information.


A developer of an early processing system for chess, Professor Fredkin in 1980 created the Fredkin Prize, a $100,000 award that he offered to whoever could develop the first computer program to win the world chess championship.


With a pair of innovations […] he demonstrated that computation is not inherently irreversible. Those advances suggest that computation need not consume energy by overwriting the intermediate results of a computation, and that it is theoretically possible to build a computer that does not consume energy or produce heat.

Rachel Gordon and Alex Shipps:

One of the early computer programmers, Fredkin served as director of Project MAC from 1971 to 1974, spearheading efforts to develop and improve computer time-sharing systems.


Fredkin wrote a PDP-1 assembler language called FRAP (Free of Rules Assembly Program, also sometimes called Fredkin’s Assembly Program), and its first operating system (OS). He organized and founded the Digital Equipment Computer Users’ Society (DECUS) in 1961, and participated in its early projects. Working directly with Ben Gurley, the designer of the PDP-1, Fredkin designed significant modifications to the hardware to support time-sharing via the BBN Time-Sharing System. He invented and designed the first modern interrupt system, which Digital called the “Sequence Break”.


Fredkin was broadly interested in computation, including hardware and software. He was the inventor of the trie data structure, radio transponders for vehicle identification, the concept of computer navigation for automobiles, the Fredkin gate, and the Billiard-Ball Computer Model for reversible computing.


The Auto Layout Comprehendium

Mischa Hildebrand (2017, via Tanner Bennett):

Auto Layout is essential for creating modern, responsive user interfaces on iOS and macOS. Its core idea is easy to grasp – yet, it feels like a jungle full of hidden secrets to many. Once you dive a little deeper into the topic, you will discover that there is much more below the simple surface. The Auto Layout Comprehendium™️ is intended as a compendium for you to look up certain topics and to fully understand the internal mechanics behind the technology. While following an intuitive approach, it will help you master Auto Layout at a deeper level and empower you to build adaptable layouts without conflicts or ambiguities.


If there was only a single constraint for the intrinsic content size that couldn’t be satisfied that constraint would simply be ignored and the view would have an undefined size.

That’s why in reality the intrinsic content size (for one dimension) is represented by two inequality constraints[…]


UUID Formats 6–8

IETF (via Hacker News):

The fact that UUIDs can be used to create unique, reasonably short values in distributed systems without requiring synchronization makes them a good alternative, but UUID versions 1-5 lack certain other desirable characteristics:

  1. Non-time-ordered UUID versions such as UUIDv4 have poor database index locality. Meaning new values created in succession are not close to each other in the index and thus require inserts to be performed at random locations. The negative performance effects of which on common structures used for this (B-tree and its variants) can be dramatic.
  2. The 100-nanosecond, Gregorian epoch used in UUIDv1 timestamps is uncommon and difficult to represent accurately using a standard number format such as [IEEE754].
  3. Introspection/parsing is required to order by time sequence; as opposed to being able to perform a simple byte-by-byte comparison.


An inspection of these implementations and the issues described above has led to this document which attempts to adapt UUIDs to address these issues.


This is the working area for the IETF UUIDREV Working Group Internet-Draft, “A Universally Unique IDentifier (UUID) URN Namespace”.


Update (2023-10-30): Buildkite (via Hacker News):

The upcoming UUIDv7 standard offers the best of both worlds; its time-ordered UUID primary keys can be utilized for indexing and external use. This blog post will take you on the journey Buildkite took that led to our eventual adoption of UUIDv7 as the primary key of choice. We’ll explore the tradeoffs of database indexes; from sequential integers, randomly generated UUIDs, through to time-based identifiers.