Hexbyte  News  Computers Introducing Matrix 1.0 and the Matrix.org Foundation | Matrix.org blog

Hexbyte News Computers Introducing Matrix 1.0 and the Matrix.org Foundation | Matrix.org blog

Hexbyte News Computers

Matrix 1.0

Hi all,

We are very excited to announce the first fully stable release of the Matrix protocol and specification across all APIs – as well as the Synapse 1.0 reference implementation which implements the full Matrix 1.0 API surface.

This means that after just over 5 years since the initial work on Matrix began, we are proud to have finally exited beta!! This is the conclusion of the work which we announced at FOSDEM 2019 when we cut the first stable release of the Server-Server API and began the Synapse 0.99 release series in anticipation of releasing a 1.0.

Now, before you get too excited, it’s critical to understand that Matrix 1.0 is all about providing a stable, self-consistent, self-contained and secure version of the standard which anyone should be able to use to independently implement production-grade Matrix clients, servers, bots and bridges etc. It does not mean that all planned or possible features in Matrix are now specified and implemented, but that the most important core of the protocol is a well-defined stable platform for everyone to build on.

On the Synapse side, our focus has been exclusively on ensuring that Synapse correctly implements Matrix 1.0, to provide a stable and secure basis for participating in Matrix without risk of room corruption or other nastinesses. However, we have deliberately not focused on performance or features in the 1.0 release – so I’m afraid that synapse’s RAM footprint will not have got significantly better, and your favourite long-awaited features (automatically defragmenting rooms with lots of forward extremities, configurable message retention, admin management web-interface etc) have not yet landed. In other words, this is the opposite of the Riot 1.0 release (where the entire app was redesigned and radically improved its performance and UX) – instead, we have adopted the mantra to make it work, make it work right, and then (finally) make it fast. You can read the full release notes here. It’s also worth looking at the full changelog through the Synapse 0.99 release series to see the massive amount of polishing that’s been going on here.

All this means that the main headline features which land in Matrix 1.0 are vitally important but relatively dry:

  • Using X.509 certificates to trust servers rather than perspective notaries, to simplify and improve server-side trust. This is a breaking change across Matrix, and we’ve given the community several months now to ensure their homeservers run a valid TLS certificate. See MSC1711 for full details, and the 2 week warning we gave. As of ~9am UTC today, the matrix.org homeserver is running Synapse 1.0 and enforcing valid TLS certificates – the transition has begun (and so far we haven’t spotted any major breakage :). Thank you to everyone who got ready in advance!
  • Using .well-known URIs to discover servers, in case you can’t get a valid TLS certificate for your server’s domain.
  • Switching to room version 4 by default for creating new rooms. This fixes the most important defects that the core room algorithm has historically encountered, particularly:
  • Specifying the ability to upgrade between room versions
  • Full specification of lazy loading room members
  • Short Authentication String (Emoji!) interactive verification of E2EE devices
  • …and lots and lots and lots of bugfixes and spec omission fixes.

That said, there is a lot of really exciting stuff in flight right now which sadly didn’t stabilise in time for Matrix 1.0, but will be landing as fast as we can finalise it now that 1.0 is at last out the door. This includes:

  • Editable messages! (These are in Synapse 1.0 and Riot already, but still stabilising so not enabled by default)
  • Reactions! (Similarly these are in develop)
  • Threading!! (We’ve planted the seeds for this in the new ‘aggregations’ support which powers edits & reactions – but full thread support is still a bit further out).
  • Cross-signed verification for end-to-end encryption (This is on a branch, but due to land any day now). We’ve also held off merging E2E backups into the Matrix 1.0 spec until cross-signing lands, given it may change the backup behaviour a bit. Once this is done, we can seriously talk about turning on E2E by default everywhere.
  • Live-tracking of room statistics and state in Synapse! (This is in Synapse 1.0 already if you check out the new room_stats and room_state tables, but we need to provide a nice admin interface for it).
  • Support for smaller footprint homeservers by reducing memory usage and stopping them from joining overly complex rooms.

Then stuff which we haven’t yet started, but is now unlocked by the 1.0 release:

  • Fixing extremities build-up (and so massively improving performance)
  • Rewriting Communities. Groups/Communities deliberately didn’t land in Matrix 1.0 as the current implementation has issues we want to fix first. MSC1772 has the details.
  • Rewritten room directory using the new room stats/state tables to be super-speedy.
  • Super-speedy incremental state resolution
  • Removing MXIDs from events (MSC1228)

Just to give a quick taster of the shape of things to come, here’s RiotX/Android, the all-new Riot client for Android, showing off Edits & Reactions in the wild…

…and here’s a screenshot of the final test jig for cross-signing devices in end-to-end encryption, so you will never have to manually verify new devices for a trusted user ever again! We demoed a *very* early version of this at FOSDEM, but this here is the testing harness for real deal, after several iterations of the spec and implementation to nail down the model. + means the device/user’s cross-signing key is trusted, T means it’s TOFU:

So, there you have it – welcome to Matrix 1.0, and we look forward to our backlog of feature work now landing!

Massive massive thanks to everyone who has stuck with the project over the years and helped support and grow Matrix – little did we think back in May 2014 that it’d take us this long to exit beta, but hopefully you’ll agree that it’s been worth it 🙂

Talking of which, we were looking through the photos we took from the first ever session hacking on Matrix back in May 2014…

Hexbyte  News  Computers Whiteboard 1

…suffice it to say that of the architectural options, we went with #3 in the end…

Hexbyte  News  Computers Whiteboard 2

…and that nowadays we actually know how power levels work, in excruciating and (hopefully) well-specified detail 🙂

There has been an absolutely enormous amount of work to pull Matrix 1.0 together – both on the spec side (thanks to the Spec Core Team for corralling proposals, and everyone who’s contributed proposals, and particularly to Travis for editing it all) and the implementation side (thanks to the whole Synapse team for the tedious task of cleaning up everything that was needed for 1.0). And of course, huge thanks go to everyone who has been helping test and debug the Synapse 1.0 release candidates, or just supporting the project to get to this point 🙂

The Matrix.org Foundation

Finally, as promised, alongside Matrix 1.0, we are very happy to announce the official launch of the finalised Matrix.org Foundation!

This has been a long-running project to ensure that Matrix’s future is governed by a neutral non-profit custodian for the benefit of everyone in the Matrix ecosystem. We started the process nearly a year ago back with the initial proposal Towards Open Governance of Matrix.org, and then legally incorporated the Foundation in October, and published the final governance proposal in January.

As of today the Foundation is finalised and operational, and all the assets for Matrix.org have been transferred from New Vector (the startup we formed in 2017 to hire the core Matrix team). In fact you may already have seen Matrix.org Foundation notices popping up all over the Matrix codebase (as all of New Vector’s work on the public Matrix codebase for the forseeable is being assigned to the Matrix.org Foundation).

Most importantly, we’re excited to introduce the Guardians of the Matrix.org Foundation. The Guardians are the legal directors of the non-profit Foundation, and are responsible for ensuring that the Foundation (and by extension the Spec Core Team) keeps on mission and neutrally protects the development of Matrix. Guardians are typically independent of the commercial Matrix ecosystem and may even not be members of today’s Matrix community, but are deeply aligned with the mission of the project. Guardians are selected to be respected and trusted by the wider community to uphold the guiding principles of the Foundation and keep the other Guardians honest.

We have started the Foundation with five Guardians – two being the original founders of the Matrix project (Matthew and Amandine) and three being entirely independent, thus ensuring the original Matrix team forms a minority which can be kept in check by the rest of the Guardians. The new Guardians are:

  • Prof. Jon Crowcroft – Marconi Professor of Communications Systems in the Computer Lab at the University of Cambridge and the Turing Institute. Jon is a pioneer in the field of decentralised communication, and a fellow of the Royal Society, the ACM, the British Computer Society, the Institution of Engineering and Technology, the Royal Academy of Engineering and the Institute of Electrical and Electronics Engineers.

    Jon is a global expert in decentralisation and data privacy, and is excellently placed to help ensure Matrix stays true to its ideals.

  • Ross Schulman – Ross is a senior counsel and senior policy technologist at New America’s Open Technology Institute, where he focuses on internet measurement, emerging technologies, surveillance, and decentralization. Prior to joining OTI, Ross worked for Google.

    Ross brings a unique perspective as a tech- and decentralisation-savvy lawyer to the Foundation, as well as being one of the first non-developers in the Matrix community to run his own homeserver. Ross has been known to walk around Mozfest clutching a battery-powered Synapse in a box, promoting decentralised communication for all.

  • Dr. Jutta Steiner – As co-founder and CEO of Parity Technologies, Jutta is dedicated to building a better internet – Web 3.0 – where users’ privacy & control come first. Parity Technologies is a leader in the blockchain space – known to many as the creator of one of the most popular Ethereum clients, it is also the creator of two ambitious new blockchain technlogies, Polkadot and Substrate, that make it easier to experiment and innovate on scalability, encryption and governance.

    Parity has been pioneering Matrix enterprise use since the moment they decided to rely on Matrix for their internal and external communication back in 2016, and now run their own high-volume deployment, with end-to-end encryption enabled by default. Jutta represents organisations who are professionally dependent on Matrix day-to-day, as well as bringing her unique experiences around decentralisation and ensuring that Web 3.0 will be a fair web for all.

We’d like to offer a very warm welcome to the new Guardians, and thank them profusely for giving up their time to join the Foundation and help ensure Matrix stays on course for the years to come.

For the full update on the Foundation, please check out the new website content at https://matrix.org/foundation which should tell you everything you could possibly want to know about the Foundation, the Guardians, the Foundation’s legal Articles of Association, and the day-to-day Rules which define the Open Governance process.

And finally…

Matrix 1.0 has been a bit of an epic to release, but puts us on a much stronger footing for the future.

However, it’s very unlikely that we’d have made it this far if most of the core dev team wasn’t able to work on Matrix as their day job. Right now we are actively looking for large-scale donations to the Matrix.org Foundation (and/or investment in New Vector) to ensure that the team can maintain as tight a focus on core Matrix work as possible, and to ensure the project realises its full potential. While Matrix is growing faster than ever, this perversely means we have more and more distractions – whether that’s keeping the Matrix.org server safe and operational, or handling support requests from the community, or helping new members of the ecosystem get up and running. If you would like Matrix to succeed, please get in touch if you’d like to sponsor work, prioritise features, get support contracts, or otherwise support the project. We’re particularly interested in sponsorship around decentralised reputation work (e.g. publishing a global room directory which users can filter based on their preferences).

Finally, huge thanks to everyone who has continued to support us through thick and thin on Patreon, Liberapay or other platforms. Every little helps here, both in terms of practically keeping the lights on, and also inspiring larger donations & financial support.

So: thank you once again for flying Matrix. We hope you enjoy 1.0, and we look forward to everything else landing on the horizon!

– Matthew, Amandine & the whole Matrix.org Team.

Read More

Hexbyte  News  Computers And voilà!

Hexbyte News Computers And voilà!

Hexbyte News Computers

Hexbyte  News  Computers Go to the profile of QuantStack

… from Jupyter notebooks to standalone applications and dashboards

The goal of Project Jupyter is to improve the workflows of researchers, educators, scientists, and other practitioners of scientific computing, from the exploratory phase of their work to the communication of the results.

But interactive notebooks are not the best communication tool for all audiences. While they have proven invaluable to provide a narrative alongside the source, they are not ideal to address non-technical readers, who may be put off by the presence of code cells, or the need to run the notebook to see the results. Finally, following the order as the code often results in the most interesting content to be at the end of the document.

Another challenge with sharing notebooks is the security model. How can we offer the interactivity of a notebook making use of e.g. Jupyter widgets without allowing arbitrary code execution by the end user?

We set ourselves to solve these challenges, and we are happy to announce the first release of voilà.

Voilà turns Jupyter notebooks in standalone web applications.

  • Voilà supports Jupyter interactive widgets, including the roundtrips to the kernel.
  • Voilà does not permit arbitrary code execution by consumers of dashboards.
  • Built upon Jupyter standard protocols and file formats, voilà works with any Jupyter kernel (C++, Python, Julia), making it a language-agnostic dashboarding system.
  • Voilà is extensible. It includes a flexible template system to produce rich application layouts.

Installation and first-time use

Voilà can be installed from pypi:

pip install voila

or conda-forge:

conda install voila -c conda-forge

Upon installation, several components are installed, one of which is the voila command-line utility. You can try it by typing voila notebook.ipynb. It results in the browser opening to a new tornado application showing markdown cells, rich outputs, and interactive widgets.

From a notebook to a standalone web application

As you can see in the screencast, Jupyter interactive widgets remain fully functional even when they require computation by the kernel.

You can immediately try out some of the command-line options to voilà

  • with --strip_sources=False, input cells will be included in the resulting web application (as read-only pygment snippets).
  • with --theme=dark, voilà will make use of the dark JupyterLab theme, which will apply to code cells, widgets and all other visible components.
Making use of the dark theme and including input cells

Note that code is only shown, voilà does not allow users to edit or execute arbitrary code.

Voilà’s execution model

The execution model of voilà is the following: upon connection to a notebook URL, voilà launches the kernel for that notebook, and runs all the cells as it populates the notebook model with the outputs.

The execution model of voilà

After the execution, the associated kernel is not shut down. The notebook is converted to HTML and served to the user. The rendered HTML includes JavaScript that establishes a connection to the kernel. Jupyter interactive widgets referred in cell outputs are rendered and connected to their counterpart in the kernel. The kernel is only shut down when the user closes their browser tab.

The current version of voilà only responds to the initial GET request when all the cells have finished running, which may take a long time, but there is ongoing work on enabling progressive rendering, which should make it into a release soon.

An important aspect of this execution model is that the front-end does not determine what code is run by the backend. In fact, unless specified otherwise (with option --strip-sources=False), the source of the rendered notebook does not even make it to the front-end. The instance of the jupyter_server instantiated by voilà actually disallows execute requests by default.

Support for custom interactive widgets

Voilà can render custom Jupyter widget libraries, including (but not limited to) bqplot, ipyleafet, ipyvolume, ipympl, ipysheet, plotly, ipywebrtc, etc.

Including bqplot figures with voilà

Together with ipympl, voilà is actually a simple means to render interactive matplotlib figures in a standalone web application:

Rendering interactive matplotlib figures in a web application with voilà

Voilà is language-agnostic

Voilà can be used to produce applications with any Jupyter kernel. The following screencast shows how voilà can be used to produce a simple dashboard in C++ making use of leaflet.js maps, with the xeus-cling C++ kernel and the xleaflet package.

A standalone voilà page making use of the C++ Jupyter kernel, xeus-cling (input cells display enabled).

We hope that voilà will be a stimulant to other languages (R, Julia, JVM/Java) to provide stronger widgets support.

Richer layouts with Voilà templates

The main extension point to voilà is the custom template system. The HTML served to the end-user is produced from the notebook model by applying a Jinja template, which can be defined by the user.

An example template for voilà is the voila-gridstack template, which can be installed from pypi with

pip install voila-gridstack

You can try it by typing voila notebook.ipynb --template=gridstack.

Making use of the Gridstack template to produce a dashboard with bqplot charts

The gridstack voilà template makes use of the cell metadata to lay out the application.

A roadmap item for the gridstack voilà template is to support the entire spec for the deprecated jupyter dashboards and to create a WYSIWYG editor for these templates in the form of a JupyterLab extension.

Note that voila-gridstack template is still at an early stage of development.

How to make custom voilà templates?

A voilà template is actually a folder placed in the standard directoryPREFIX/share/jupyter/voila/templates and which may include

  • nbconvert templates (the jinja templates used to transform the notebook into HTML)
  • static resources
  • custom tornado templates such as 404.html etc.

All of these are optional. It may also contain a conf.json file to set up which template to use as a base. The directory structure for a voilà template is the following:

PREFIX/share/jupyter/voila/templates/template_name/

|

├── conf.json # Template configuration file

├── nbconvert_templates/ # Custom nbconvert templates

├── static/ # Static directory

└── templates/ # Custom tornado templates

The voilà template system can be used to completely override the behavior of the front-end. One can make use of modern JavaScript frameworks such as React or Vue.js to produce modern UI including Jupyter widgets and outputs.

Another example template for voilà is voila-vuetify, which is built upon vue.js:

The voila-vuetify template makes use of Vue.js

The voila-gridstack and voila-vuetify templates are still at an early stage of development, but will be iterated upon quickly in the next weeks as we are exploring templates.

A Jupyter server extension

Beyond the voila command-line utility, the voilà package also include a Jupyter server extension, so that voilà dashboards can be served alongside the Jupyter notebook application.

When voilà is installed, a running Jupyter server will serve the voilà web application under BASE_URL/voila.

The Jupyter Community Workshop on Dashboarding

From June 3rd to June 6th 2019, a community workshop on dashboarding with Project Jupyter took place in Paris. Over thirty Jupyter contributors and community members gathered to discuss dashboarding technologies and hack together.

The participants to the Paris Jupyter community workshop on dashboarding

Several dashboarding solutions such as Dash and Panel were presented during the workshop and featured at the PyData Paris Meetup which was organized on the same week.

The workshop was also the occasion for several contributors to start working on voilà. Custom templates, a dashboard gallery, logos and UX mockups for JupyterLab extensions have been developed.

We will soon publish a more detailed post on the workshop, detailing the many tracks of development that have been explored!

What is coming?

There is a lot of planned work around voilà in the next weeks and months. Current work streams include better integration with JupyterHub for publicly sharing dashboard between users, as well as JupyterLab extensions (a voilà “preview” extension for notebooks, and a WYSIWYG editor for dashboard layouts). There are also ongoing discussions with the OVH cloud provider (which already supports binder by handling some of its traffic) on hosting a binder-like service dedicated to voilà dashboards. So stay tuned for more exciting developments!

Last but not least, we are especially excited about what you will be building upon voilà!

Acknowledgments

The development of voilà and related packages at QuantStack is sponsored by Bloomberg.

We are also grateful to the attendees of the Jupyter Community Workshop on Dashboarding for their numerous contributions to voilà!

We would like to thank Chris Holdgraf for his work on improving documentation, and integration with JupyterHub.

We should mention Yuvi Panda and Pascal Bugnion for getting the voila-galleryproject off the ground during the workshop. We are grateful to Zach Sailer for his continued work on improvingjupyter_server. We should finally not forget to mention the prior art by Pascal Bugnion with the Jupyter widgets server which was also an inspiration for voilà.

About the Authors

Sylvain Corlay is the founder and CEO of QuantStack and a core team member for Project Jupyter.

Maarten Breddels is an independent scientific software developer partnering with QuantStack on numerous projects, and a core developer of Project Jupyter.











Read More

Hexbyte  News  Computers From Design Patterns to Category Theory

Hexbyte News Computers From Design Patterns to Category Theory

Hexbyte News Computers

How do you design good abstractions? By using abstractions that already exist.

When I was a boy, I had a cassette tape player. It came with playback controls like these:

Hexbyte  News  Computers Rewind, play/pause, and fast forward symbols.

Soon after cassette players had become widely adopted, VCR manufacturers figured out that they could reuse those symbols to make their machines easier to use. Everyone could play a video tape, but ‘no one’ could ‘program’ them, because, while playback controls were already universally understood by consumers, each VCR came with its own proprietary interface for ‘programming’.

Then came CD players. Same controls.

MP3 players. Same controls.

Streaming audio and video players. Same controls.

If you download an app that plays music, odds are that you’ll find it easy to get started playing music. One reason is that all playback apps seem to have the same common set of controls. It’s an abstraction that you already know.

Understanding source code #

As I explain in my Humane Code video, you can’t program without abstractions. To summarise, in the words of Robert C. Martin

“Abstraction is the elimination of the irrelevant and the amplification of the essential”

With such abstractions, source code becomes easier to understand. Like everything else, there’s no silver bullet, but good coding abstractions can save you much grief, and make it easier to understand big and complex code bases.

Not only can a good abstraction shield you from having to understand all the details in a big system, but if you’re familiar with the abstraction, you may be able to quickly get up to speed.

While the above definition is great for identifying a good abstraction, it doesn’t tell you how to create one.

Design patterns #

Design Patterns explains that a design pattern is a general reusable solution to a commonly occurring problem. As I interpret the original intent of the Gang of Four, the book was an attempt to collect and abstract solutions that were repeatedly observed ‘in the wild’. The design patterns in the book are descriptive, not prescriptive.

Design patterns are useful in two ways:

  • They offer solutions
  • They form a vocabulary

In my opinion, however, people often overlook the second advantage. Programmers are often eager to find solutions. “I have a problem; what’s the solution? Oh, here’s a design pattern that fits!”

I have no problems with ready-made solutions, but I think that the other advantage may be even bigger. When you’re looking at unfamiliar source code, you struggle to understand how it’s structured, and what it does. If, hypothetically, you discover that pieces of that unfamiliar source code follows a design pattern that you know, then understanding the code becomes much easier.

There are two criteria for this to happen:

  • The reader (you) must already know the pattern
  • The original author (also you?) must have implemented the pattern without any surprising deviations

As a programmer (code author), you can help readers (users) of your code. Don’t use every design pattern in the book, but when you use one, make it as obvious to the reader as you can: Use the terminology, class names, and so on from the book. Add comments where your naming deviates. Add links that the novice user can follow to learn more.

Ambiguous specification #

Programming to a well-known abstraction is a force multiplier, but it does require that those two conditions are satisfied: prior knowledge, and correct implementation.

I don’t know how to solve the prior knowledge requirement, other than to tell you to study. I do, however, think that it’s possible to formalise some of the known design patterns.

Most design patterns are described in some depth. They come with sections on motivation, when to use and not to use, diagrams, and example code. Furthermore, they also come with an overview of variations.

Picture this: as a reader, you’ve just identified that the code you’re looking at is an implementation of a design pattern. Then you realise that it isn’t structured like you’d expect, or that its behaviour surprises you. Was the author incompetent, after all?

While you’re inclined to believe the worst about your fellow (wo)man, you look up the original pattern, and there it is: the author is using a variation of the pattern.

Design patterns are ambiguous.

Universal abstractions #

Design Patterns was a great effort in 1994, and I’ve personally benefited from it. The catalogue was an attempt to discover good abstractions.

What’s a good abstraction? As already quoted, it’s a model that amplifies the essentials, etcetera. I think a good abstraction should also be intuitive.

What’s the most intuitive abstractions ever?

Mathematics.

Stay with me, please. If you’re a normal reader of my blog, you’re most likely an ‘industry programmer’ or enterprise developer. You’re not interested in mathematics. Perhaps mathematics even turns you off, and at the very least, you never had use for mathematics in programming.

You may not find n-dimensional differential topology, or stochastic calculus, intuitive, but that’s not the kind of mathematics I have in mind.

Basic arithmetic is intuitive. You know: 1 + 3 = 4, or 3 * 4 = 12. In fact, it’s so intuitive that you can’t formally prove it -without axioms, that is. These axioms are unprovable; you must take them at face value, but you’ll readily do that because they’re so intuitive.

Mathematics is a big structure, but it’s all based on intuitive axioms. Mathematics is intuitive.

Writers before me have celebrated the power of mathematical abstraction in programming. For instance, in Domain-Driven Design Eric Evans discusses how Closure of Operations leads to object models reminiscent of arithmetic. If you can design Value Objects in such a way that you can somehow ‘add’ them together, you have an intuitive and powerful abstraction.

Notice that there’s more than one way to combine numbers. You can add them together, but you can also multiply them. Could there be a common abstraction for that? What about objects that can somehow be combined, even if they aren’t ‘number-like’? The generalisation of such operations is a branch of mathematics called category theory, and it has turned out to be productive when applied to functional programming. Haskell is the most prominent example.

By an interesting coincidence, the ‘things’ in category theory are called objects, and while they aren’t objects in the sense that we think of in object-oriented design, there is some equivalence. Category theory concerns itself with how objects map to other objects. A functional programmer would interpret such morphisms as functions, but in a sense, you can also think of them as well-defined behaviour that’s associated with data.

The objects of category theory are universal abstractions. Some of them, it turns out, coincide with known design patterns. The difference is, however, that category theory concepts are governed by specific laws. In order to be a functor, for example, an object must obey certain simple and intuitive laws. This makes the category theory concepts more specific, and less ambiguous, than design patterns.

The coming article series is an exploration of this space:

I believe that learning about these universal abstractions is the next step in software design. If you know design patterns, you have a vocabulary, but the details are still open to interpretation. If you know category theory, you have a better vocabulary. Just like design patterns, you have to learn these things, but once you’ve learned them, you’ve learned something that transcends a particular software library, a particular framework, a particular programming language. Learning about functors, monoids, and so on, is a good investment, because these concepts are rooted in mathematics, not any particular technology.

Motivation #

The purpose of this article series is two-fold. Depending on your needs and interests, you can use it to

  • learn better abstractions
  • learn how functional programming is a real alternative to object-oriented programming

You’ve already read how it’s in your interest to learn universal abstractions. It’ll make your code clearer, more concise, and you’ll have a better software design vocabulary.

The other goal of these articles may be less clear. Object-oriented programming (OOP) is the dominant software design paradigm. It wasn’t always so. When OOP was new, many veteran programmers couldn’t see how it could be useful. They were schooled in one paradigm, and it was difficult for them to shift to the new paradigm. They were used to do things in one way (typically, procedural), and it wasn’t clear how to achieve the same goals with idiomatic object-oriented design.

The same sort of resistance applies to functional programming. Tasks that are easy in OOP seem impossible in functional programming. How do you make a for loop? How do you change state? How do you break out of a routine?

This leads to both frustration, and dismissal of functional programming, which is still seen as either academic, or something only interesting in computation-heavy domains like science or finance.

It’s my secondary goal with these articles to show that:

  1. There are clear equivalences between known design patterns and concepts from category theory
  2. Thus, functional programming is as universally useful as OOP
  3. Since equivalences exist, there’s a learning path

If you’re an object-oriented programmer, you can use this catalogue as a learning path. If you’d normally use a Composite, you can look it up and realise that it’s the same as a monoid.

Work in progress #

I’ve been thinking about these topics for years. What’s a good abstraction? When do abstractions compose?

My first attempt at answering these questions was in 2010, but while I had the experience that certain abstractions composed better than others, I lacked the vocabulary. I’ve been wanting to write a better treatment of the topic ever since, but I’ve been constantly learning as I’ve grappled with the concepts.

I believe that I now have the vocabulary to take a stab at this again. This is hardly the ultimate treatment. A year from now, I hope to have learned even more, and perhaps that’ll lead to further insights or refinement. Still, I can’t postpone writing this article until I’ve stopped learning, because at that time I’ll either be dead or senile.

I’ll write these articles in an authoritative voice, because a text that constantly moderates and qualifies its assertions easily becomes unreadable. Don’t consider the tone an indication that I’m certain that I’m right. I’ve tried to be as rigorous in my arguments as I could, but I don’t have a formal education in computer science. I welcome feedback on any article, both if it’s to corroborate my findings, or if it’s to refute them. If you have any sort of feedback, then please leave a comment.

I consider the publication of these articles as though I submit them to peer review. If you can refute them, they deserve to be refuted. If not, they just may be valuable to other people.

Summary #

Category theory generalises some intuitive relations, such as how numbers combine (e.g. via addition or multiplication). Instead of discussing numbers, however, category theory considers abstract ‘objects’. This field of mathematics explore how object relate and compose.

Some category theory concepts can be translated to code. These universal abstractions can form the basis of a powerful and concise software design vocabulary.

The design patterns movement was an early attempt to create such a vocabulary. I think using category theory offers the chance of a better vocabulary, but fortunately, all the work that went into design patterns isn’t wasted. It seems to me that some design patterns are essentially ad-hoc, informally specified, specialised instances of basic category theory concepts. There’s quite a bit of overlap. This should further strengthen the argument that category theory is valuable in programming, because some of the concepts are equivalent to design patterns that have already proven useful.

Next: Monoids, semigroups, and friends.

Read More

Hexbyte  News  Computers Apple is making corporate ‘BYOD’ programs less invasive to user privacy

Hexbyte News Computers Apple is making corporate ‘BYOD’ programs less invasive to user privacy

Hexbyte News Computers

When people bring their own devices to work or school, they don’t want IT administrators to manage the entire device. But until now, Apple only offered two ways for IT to manage its iOS devices: either device enrollments, which offered device-wide management capabilities to admins or those same device management capabilities combined with an automated setup process. At Apple’s Worldwide Developer Conference last week, the company announced plans to introduce a third method: user enrollments.

This new MDM (mobile device management) enrollment option is meant to better balance the needs of IT to protect sensitive corporate data and manage the software and settings available to users, while at the same time allowing users’ private personal data to remain separate from IT oversight.

According to Apple, when both users’ and IT’s needs are in balance, users are more likely to accept a corporate “bring your own device” (BYOD) program — something that can ultimately save the business money that doesn’t have to be invested in hardware purchases.

The new user enrollments option for MDM has three components: a managed Apple ID that sits alongside the personal ID; cryptographic separation of personal and work data; and a limited set of device-wide management capabilities for IT.

The managed Apple ID will be the user’s work identity on the device, and is created by the admin in either Apple School Manager or Apple Business Manager — depending on whether this is for a school or a business. The user signs into the managed Apple ID during the enrollment process.

From that point forward until the enrollment ends, the company’s managed apps and accounts will use the managed Apple ID’s iCloud account.

Meanwhile, the user’s personal apps and accounts will use the personal Apple ID’s iCloud account, if one is signed into the device.

Third-party apps are then either used in managed or unmanaged modes.

That means users won’t be able to change modes or run the apps in both modes at the same time. However, some of the built-in apps like Notes will be account-based, meaning the app will use the appropriate Apple ID — either the managed one or personal — depending on which account they’re operating on at the time.

To separate work data from personal, iOS will create a managed APFS volume at the time of the enrollment. The volume uses separate cryptographic keys which are destroyed along with the volume itself when the enrollment period ends. (iOS had always removed the managed data when the enrollment ends, but this is a cryptographic backstop just in case anything were to go wrong during unenrollment, the company explained.)

The managed volume will host the local data stored by any managed third-party apps along with the managed data from the Notes app. It also will house a managed keychain that stores secure items like passwords and certificates; the authentication credentials for managed accounts; and mail attachments and full email bodies.

The system volume does host a central database for mail, including some metadata and five line previews, but this is removed as well when the enrollment ends.

Users’ personal apps and their data can’t be managed by the IT admin, so they’re never at risk of having their data read or erased.

And unlike device enrollments, user enrollments don’t provide a UDID or any other persistent identifier to the admin. Instead, it creates a new identifier called the “enrollment ID.” This identifier is used in communication with the MDM server for all communications and is destroyed when enrollment ends.

Apple also noted that one of the big reasons users fear corporate BYOD programs is because they think the IT admin will erase their entire device when the enrollment ends — including their personal apps and data.

To address this concern, the MDM queries can only return the managed results.

In practice, that means IT can’t even find out what personal apps are installed on the device — something that can feel like an invasion of privacy to end users. (This feature will be offered for device enrollments, too.) And because IT doesn’t know which personal apps are installed, it also can’t restrict certain apps’ use.

User enrollments will also not support the “erase device” command — and they don’t have to, because IT will know the sensitive data and emails are gone. There’s no need for a full device wipe.

Similarly, the Exchange Server can’t send its remote wipe command — just the account-only remote wipe to remove the managed data.

Another new feature related to user enrollments is how traffic for managed accounts is guided through the corporate VPN. Using the per-app VPN feature, traffic from the Mail, Contacts and Calendars built-in apps will only go through the VPN if the domains match that of the business. For example, mail.acme.com can pass through the VPN, but not mail.aol.com. In other words, the user’s personal mail remains private.

This addresses what has been an ongoing concern about how some MDM solutions operate — routing traffic through a corporate proxy meant the business could see the employees’ personal emails, social networking accounts and other private information.

User enrollments also only enforces a six-digit non-simple passcode, as the MDM server can’t help users by clearing the past code if the user forgets it.

Some today advise users to not accept BYOD MDM policies because of the impact to personal privacy. While a business has every right to manage and wipe its own apps and data, IT has overstepped with some of its remote management capabilities — including its ability to erase entire devices, access personal data, track a phone’s location, restrict personal use of apps and more.

Apple’s MDM policies haven’t included GPS tracking, however, nor does this new option.

Apple’s new policy is a step toward a better balance of concerns, but will require that users understand the nuances of these more technical details — which they may not.

That user education will come down to the businesses that insist on these MDM policies to begin with — they will need to establish their own documentation, explainers, and establish new privacy policies with their employees that detail what sort of data they can and cannot access, as well as what sort of control they have over corporate devices.

Read More

Hexbyte  News  Computers Spain: Unfinished Gaudí church gets permit after 137 years

Hexbyte News Computers Spain: Unfinished Gaudí church gets permit after 137 years

Hexbyte News Computers

BARCELONA, Spain (AP) — Property owners have a new yardstick by way of Spain for measuring frustration over building permit requests they suspect got lost in a local government bureaucracy.

Barcelona City Hall finally has issued a work permit for the unfinished church designed by architect Antoni Gaudí 137 years after construction started on La Sagrada Familia Basilica

The city said Friday it granted the current builders a license that is valid through 2026. The builders think that will be enough time to finish raising the landmark Roman Catholic church’s central towers.

The basilica’s first stone was laid in 1882, but Barcelona officials said there was no record showing a building permit first requested in 1885 ever was granted or rejected.

Barcelona officials said the city will be paid 4.6 million euros ($5.2 million) in fees under an agreement negotiated with a foundation devoted to completing and preserving La Sagrada Familia.

The agreement between the city and the foundation puts an end to “a historical anomaly in our city,” Barcelona official Janet Sanz.

Over 4.5 million visitors pay 17-38 euros each to tour the cathedral-sized church every year. The Barcelona government estimates 20 million tourists stand outside to marvel at the bell towers; Gaudí envisioned 12, one for each of Christ’s disciples, but they all may never get built.

When completed, work on one of the central towers that is expected to get done while the building permit is valid will make La Sagrada Familia the tallest religious structure in Europe at 172.5 meters (566 feet) tall, according to the builders.

Barcelona has the largest concentration of buildings designed by Gaudí, whose bold modernist aesthetic still inspires architects. A fervent Catholic, he dedicated much of his professional life to Sagrada Familia, for which he incorporated elements of Christian symbolism along with the organic forms he often employed.

Gaudí died in 1926 after being struck by a trolley when just one facade was complete. He is buried in the church crypt.

Ongoing construction work is based on the architect’s plaster models, and photos and publications of his original drawings, which were destroyed in a 1930s fire, according to Sagrada Familia foundation.

Read More

Hexbyte  News  Computers The RadioInstigator: A $150 Signals Intelligence Platform Consisting of a Raspberry Pi, RPiTX, 2.4 GHz Crazyradio and an RTL-SDR

Hexbyte News Computers The RadioInstigator: A $150 Signals Intelligence Platform Consisting of a Raspberry Pi, RPiTX, 2.4 GHz Crazyradio and an RTL-SDR

Hexbyte News Computers


Circle City Con is a yearly conference that focuses on information security talks. At this years conference Josh Conway presented an interesting talk titled “SigInt for the Masses Building and Using a Signals Intelligence Platform for Less than $150”. Josh’s talk introduces his “RadioInstigator” hardware which is a combination of a Raspberry Pi, CrazyRadio and an RTL-SDR all packaged into a 3D printed enclosure with LCD screen. The idea behind the RadioInstigator is to create a portable and low cost Signals Intelligence (SIGINT) device that can be used to investigate and manipulate the security of radio signals.

The RadioInstigator makes use of the RPiTX software which allows a Raspberry Pi to transmit an arbitrary radio signal from 5 kHz up to 1500 MHz without the use of any additional transmitting hardware – just connect an antenna directly to a GPIO pin. Connected to the Pi is a CrazyRadio, which is a nRF24LU1+ based radio that can be used to receive and transmit 2.4 GHz. And of course there is an RTL-SDR for receiving every other signal. Josh has made the plans for the RadioInstigator fully open source over on GitLab.

In his talk Josh introduces the RadioInstigator, then goes on to discuss other SDR hardware, antenna concepts and software installed on the RadioInstrigator like RPiTX, GNU Radio, Universal Radio Hacker, Salamandra, TempestSDR and more.

[First seen on Hackaday]

“>

Track 3 07 SigInt for the Masses Building and Using a Signals Intelligence Platform for Less than 15

Read More

Hexbyte  News  Computers The Mysterious And Potentially Revolutionary Celera 500L Aircraft May Fly Soon

Hexbyte News Computers The Mysterious And Potentially Revolutionary Celera 500L Aircraft May Fly Soon

Hexbyte News Computers

Hexbyte News Computers New details about its engine, together with other design features, point to extremely efficient performance that could change commercial air travel.

Hexbyte  News  Computers

SoCal Airshow Review

More than two years after The War Zone
was first to report on a mysterious bullet-shaped aircraft appearing at the Southern California Logistics Airport near Victorville, a refined version of the plane has conducted taxi tests and looks to be getting close to its first flight. Even though much about its design and purpose remain unclear, we do know now that the aircraft, which is called the Otto Aviation Celera 500L, is definitely focused on potentially game-changing high-efficiency flight that has the potential to disrupt the aerospace marketplace.

In January 2019, new pictures of the pusher-propeller Celera 500L, which carries the U.S. civil registration code N818WM, emerged showing it in a markedly more mature state than what we had seen in the past. The plane now has winglets at the tips of both wings, but it’s not clear if the wings themselves are entirely new. The aircraft also had a black propeller in place of the earlier white one and an aerodynamic spinner over the propeller hub. There’s also a much better view of the trapeze-like landing gear assemblies, which are of the general style found in patent documents that Otto Aviation has submitted relating to a number of the aircraft’s features.

In addition, as compared to earlier images, the aircraft finally has conformal cowlings fitted in place over its rear-mounted engine compartment. Each one features a single large air intake and an exhaust port.

Hexbyte  News  Computers

SoCal Airshow Review

Hexbyte  News  Computers

SoCal Airshow Review

For comparison, below you can see a picture of the Celera 500L as it existed in June 2017.

Hexbyte  News  Computers

Ryan Notestine

In May of 2019, NASA pilot and photographer Scott Howe also spotted the Celera 500L doing high-speed taxi tests at the Southern California Logistics Airport as he flew by. This further supports the assessment that the aircraft is getting closer to a first flight.

Beyond what we can see, there’s still limited information about the aircraft’s specifications or even its manufacturer, Otto Aviation Group, which has been operating virtually in secret on this project for around a decade. In April 2019, there was a public notice about the company renewing its lease on space at the Southern California Logistics Airport. Beyond that, the patent documents do lay out a case for disrupting traditional ‘hub-and-spoke’ commercial aviation models and offering improved efficiency in aircraft performance to, in turn, reduce inefficiencies in passenger air travel.

“Such a transportation system requires a unique aircraft. It must be capable of operation from any current airfield,” one of the patent documents says in its background section. “Preferably, it would have operating costs well below current costs and competitive with commercial airliners, cruise at higher system speed than current commercial aircraft, have a longer range with full passenger and luggage load than most current business aircraft, provide passenger comfort comparable to commercial aircraft, and be capable of all weather operation. The plane should also provide for ease of maintenance and require only a single pilot.”

The patent goes on to describe a notional aircraft that would cruise between 460 and 510 miles per hour at an altitude of up to 65,000 feet, yielding a fuel efficiency rate of between 30 and 42 miles per gallon. To put this in perspective, the Pilatus PC-12, a popular light, single-engine turboprop aircraft has a service ceiling of 30,000 feet, a cruising speed just under 330 miles per hour, and still burns, on average, 66 gallons of jet fuel per hour, for a fuel economy of roughly five miles to the gallon. Even going to a Learjet 70, which has similar speed performance to what’s stated in the Celera patent documents, but still nowhere near as high a ceiling, we are talking about roughly three miles per gallon of gas at cruise. So, Otto Aviation is talking about performance that is at least
10 times more efficient than existing light business jets with similar cruise capabilities. 

New information in the plane’s public profile on the Federal Aviation Administration website offers clues as to how the Celera 500L expects to offer this revolutionary new capability. Most importantly, FAA says that the aircraft’s airworthiness was approved in February 2019 and that it uses the Raikhlin Aircraft Engine Developments (RED) A03 V12 engine. 

Hexbyte  News  Computers

RED

The RED A03 engine.

It is unclear from the available information whether the Celera 500L uses one or two A03 engines. The FAA’s profile describes the aircraft as a “single engine,” but patent documents had described two engines driving a single propeller. Of course, they had also said these would be diesel engines with multi-stage turbochargers and intercoolers, the latter of which redirect heat to improve efficiency and keep the entire system cool while the former would theoretically provide enough power even at very high altitudes where super-efficient flight can be realized. 

The engine type and configuration may not be final, either. Otto Aviation has been working on the aircraft for nearly a decade already and it is clear the company has been considering different engine arrangements in that time. A source has told The War Zone that a single V8 engine from now-defunct TRACE Engines was originally supposed to power the aircraft via a reduction drive. TRACE’s engine was derived from the high-efficiency OE600 design, which another company, Orenda, had first begun work on in the 1990s.

RED promotes its A03, a kerosene-powered 500-horsepower water-cooled design, which also uses a multi-stage turbocharger, as offering high fuel efficiency, low fuel consumption, and excellent reliability with limited maintenance as compared to more traditional piston engines with similar horsepower ratings. The German company also says it can configure the engine itself for “optimal” performance in “close cooperation with the airframe manufacture [sic; manufacturer].” Initial flight testing of the engine began in 2012 using a modified Yakovlev Yak-52 aircraft and the A03 received European Aviation Safety Agency approval in 2014. The engine is now set to power the new Yak-152, which the Russian Air Force plans to purchase as replacements for its Yak-52s.

One of Otto Aviation’s patents also says that the intakes and exhausts we mentioned before are supposed to help leverage this engine design to provide even greater efficiency. The exhaust setup is also supposed to include a novel heat exchanger that combines heated cooling air with exhaust gases provide a small additional boost in thrust. It all remains to be seen whether or not the combination of an A03 optimized for the Celera 500L specifically, together with intercoolers and specialized exhausts, will be enough to get the plane anywhere close to the kind of high-altitude performance Otto is clearly aiming for broadly.

Hexbyte  News  Computers

USTPO

A diagram from one of Otto Aviation’s patents showing the proposed heat exchanger arrangement that would send air over intercooler tubes and the engine turbochargers themselves, before mixing that then heated air with exhaust gases and forcing it out the tailpipe for a small boost in thrust.

The Celera 500L’s other design features are certainly also meant to help with highly efficient flight, including its teardrop fuselage which offers aerodynamic efficiency while maintaining a large internal volume. Schematics and other details in the patent describe the use of composite materials and a single primary center spar for structural stability, all of which helps keep the aircraft light, too.

It’s not clear from the pictures available what the final wing configuration might look like, but those same patents indicate that Otto Aviation has been working on an advanced, multi-part flap arrangement. This could give the Celera 500L acceptable takeoff characteristics from smaller runways—as short as 3,000 feet—while still offering optimal efficiency in other flight regimes, including high-altitude flight. This is something that would be extremely valuable for commercial aviation applications since the aircraft could operate from small airports and still retain the ability to conduct non-stop flights to destinations a significant distance away.

Hexbyte  News  Computers

USTPO

A schematic of the multi-part flap arrangement from one of the Otto Aviation patents.

Hexbyte  News  Computers

USTPO

Another schematic showing the system at full extension.

All told, it’s not clear whether Otto Aviation expects the Celera 500L design to actually serve as the basis for a new kind of passenger aircraft design or whether it is more of a technology testbed to prove certain parts of a future aircraft. But the patent drawings do show a similarly sized version with passenger windows and what appears to be a side-mounted emergency exit. It’s still hard to say for sure given the remarkable amount of secrecy surrounding the aircraft.

Hexbyte  News  Computers

USTPO

A patent drawing similar to the Celera 500L design as it exists now, but with passenger style windows and emergency exit.

Regardless, by all indications, Otto Aviation is working on what could be a very exciting and potentially revolutionary design. Being able to fly direct to smaller airfields near one’s destination on smaller aircraft at a very low cost could open up private-like air travel to the masses.

With taxi tests already underway, and possibly complete, a first light could be just around the corner. We will be definitely be keeping a close eye out for when the bullet-shaped aircraft takes to the skies for the first time, which will hopefully lead to more information about just what it can really do.

Contact the author: Tyler@thedrive.com

Don’t forget to sign up

Your Email Address

Read More

Hexbyte  News  Computers NixOS/nixpkgs

Hexbyte News Computers NixOS/nixpkgs

Hexbyte News Computers

let maybePkgs = import ../../../../../. {}; in{ stdenv ? maybePkgs.stdenv, runCommand ? maybePkgs.runCommand, fetchurl ? maybePkgs.fetchurl, writeText ? maybePkgs.writeText, curl ? maybePkgs.curl, cacert ? maybePkgs.cacert, nix ? maybePkgs.nix}:let inherit (stdenv) lib; sources = if builtins.pathExists ./upstream-info.nix then import ./upstream-info.nix else {}; bucketURL = https://commondatastorage.googleapis.com/ + chromium-browser-official; mkVerURL = version: ${bucketURL}/chromium-${version}.tar.xz; debURL = https://dl.google.com/linux/chrome/deb/pool/main/g; getDebURL = channelName: version: arch: mirror: let packageSuffix = if channelName == dev then unstable else channelName; packageName = google-chrome-${packageSuffix}; in ${mirror}/${packageName}/${packageName}_${version}-1_${arch}.deb; # Untrusted mirrors, don’t try to update from them! debMirrors = [ http://95.31.35.30/chrome/pool/main/g http://mirror.pcbeta.com/google/chrome/deb/pool/main/g http://repo.fdzh.org/chrome/deb/pool/main/g ];in rec { getChannel = channel: let chanAttrs = builtins.getAttr channel sources; in { inherit channel; inherit (chanAttrs) version; main = fetchurl { url = mkVerURL chanAttrs.version; inherit (chanAttrs) sha256; }; binary = fetchurl (let mkUrls = arch: let mkURLForMirror = getDebURL channel chanAttrs.version arch; in map mkURLForMirror ([ debURL ] ++ debMirrors); in if stdenv.is64bit && chanAttrs ? sha256bin64 then { urls = mkUrls amd64; sha256 = chanAttrs.sha256bin64; } else if !stdenv.is64bit && chanAttrs ? sha256bin32 then { urls = mkUrls i386; sha256 = chanAttrs.sha256bin32; } else throw No Chrome plugins are available for your architecture.); }; update = let csv2nix = name: src: import (runCommand ${name}.nix { src = builtins.fetchurl src; } esc() { echo “”$(echo “$1″ | sed -e ‘s/”\$/\&/’)””; } # ohai emacs “ IFS=, read -r -a headings <<< "$(head -n1 "$src")" echo “[” > “$out” tail -n +2 “$src” | while IFS=, read -r -a line; do echo ” {“ for idx in “”${!headings[@]}”; do echo ” $(esc “”${headings[idx]}”) = $(esc ”${line[$idx]});” done echo ” }” done >> “$out” echo “]” >> “$out” ); channels = lib.fold lib.recursiveUpdate {} (map (attrs: { ${attrs.os}.${attrs.channel} = attrs // { history = let drvName = omahaproxy-${attrs.os}.${attrs.channel}-info; history = csv2nix drvName http://omahaproxy.appspot.com/history; cond = h: attrs.os == h.os && attrs.channel == h.channel && lib.versionOlder h.version attrs.current_version; # Note that this is a *reverse* sort! sorter = a: b: lib.versionOlder b.version a.version; sorted = builtins.sort sorter (lib.filter cond history); in map (lib.flip removeAttrs [os channel]) sorted; version = attrs.current_version; }; }) (csv2nix omahaproxy-info http://omahaproxy.appspot.com/all?csv=1)); /* XXX: This is essentially the same as: builtins.tryEval (builtins.fetchurl url) … except that tryEval on fetchurl isn’t working and doesn’t catch errors for fetchurl, so we go for a different approach. We only have fixed-output derivations that can have networking access, so we abuse SHA1 and its weaknesses to forge a fixed-output derivation which is not so fixed, because it emits different contents that have the same SHA1 hash. Using this method, we can distinguish whether the URL is available or whether it’s not based on the actual content. So let’s use tryEval as soon as it’s working with fetchurl in Nix. */ tryFetch = url: let # SHA1 hash collisions from https://shattered.io/static/shattered.pdf: collisions = runCommand sha1-collisions { outputs = [ out good bad ]; base64 = QlpoOTFBWSZTWbL5V5MABl///////9Pv///v////+/////HDdK739/677r+W3/75rUNr4 Aa/AAAAAAACgEVTRtQDQAaA0AAyGmjTQGmgAAANGgAaMIAYgGgAABo0AAAAAADQAIAGQ0 MgDIGmjQA0DRk0AaMQ0DQAGIANGgAAGRoNGQMRpo0GIGgBoGQAAIAGQ0MgDIGmjQA0DRk 0AaMQ0DQAGIANGgAAGRoNGQMRpo0GIGgBoGQAAIAGQ0MgDIGmjQA0DRk0AaMQ0DQAGIAN GgAAGRoNGQMRpo0GIGgBoGQAAIAGQ0MgDIGmjQA0DRk0AaMQ0DQAGIANGgAAGRoNGQMRp o0GIGgBoGQAABVTUExEZATTICnkxNR+p6E09JppoyamjGhkm0ammIyaekbUejU9JiGnqZ qaaDxJ6m0JkZMQ2oaYmJ6gxqMyE2TUzJqfItligtJQJfYbl9Zy9QjQuB5mHQRdSSXCCTH MgmSDYmdOoOmLTBJWiCpOhMQYpQlOYpJjn+wQUJSTCEpOMekaFaaNB6glCC0hKEJdHr6B mUIHeph7YxS8WJYyGwgWnMTFJBDFSxSCCYljiEk7HZgJzJVDHJxMgY6tCEIIWgsKSlSZ0 S8GckoIIF+551Ro4RCw260VCEpWJSlpWx/PMrLyVoyhWMAneDilBcUIeZ1j6NCkus0qUC Wnahhk5KT4GpWMh3vm2nJWjTL9Qg+84iExBJhNKpbV9tvEN265t3fu/TKkt4rXFTsV+Nc upJXhOhOhJMQQktrqt4K8mSh9M2DAO2X7uXGVL9YQxUtzQmS7uBndL7M6R7vX869VxqPu renSuHYNq1yTXOfNWLwgvKlRlFYqLCs6OChDp0HuTzCWscmGudLyqUuwVGG75nmyZhKpJ yOE/pOZyHyrZxGM51DYIN+Jc8yVJgAykxKCEtW55MlfudLg3KG6TtozalunXrroSxUpVL StWrWLFihMnVpkyZOrQnUrE6xq1CGtJlbAb5ShMbV1CZgqlKC0wCFCpMmUKSEkvFLaZC8 wHOCVAlvzaJQ/T+XLb5Dh5TNM67p6KZ4e4ZSGyVENx2O27LzrTIteAreTkMZpW95GS0CE JYhMc4nToTJ0wQhKEyddaLb/rTqmgJSlkpnALxMhlNmuKEpkEkqhKUoEq3SoKUpIQcDgW lC0rYahMmLuPQ0fHqZaF4v2W8IoJ2EhMhYmSw7qql27WJS+G4rUplToFi2rSv0NSrVvDU pltQ8Lv6F8pXyxmFBSxiLSxglNC4uvXVKmAtusXy4YXGX1ixedEvXF1aX6t8adYnYCpC6 rW1ZzdZYlCCxKEv8vpbqdSsXl8v1jCQv0KEPxPTa/5rtWSF1dSgg4z4KjfIMNtgwWoWLE sRhKxsSA9ji7V5LRPwtumeQ8V57UtFSPIUmtQdOQfseI2Ly1DMtk4Jl8n927w34zrWG6P i4jzC82js/46Rt2IZoadWxOtMInS2xYmcu8mOw9PLYxQ4bdfFw3ZPf/g2pzSwZDhGrZAl 9lqky0W+yeanadC037xk496t0Dq3ctfmqmjgie8ln9k6Q0K1krb3dK9el4Xsu44LpGcen r2eQZ1s1IhOhnE56WnXf0BLWn9Xz15fMkzi4kpVxiTKGEpffErEEMvEeMZhUl6yD1SdeJ YbxzGNM3ak2TAaglLZlDCVnoM6wV5DRrycwF8Zh/fRsdmhkMfAO1duwknrsFwrzePWeMw l107DWzymxdQwiSXx/lncnn75jL9mUzw2bUDqj20LTgtawxK2SlQg1CCZDQMgSpEqLjRM sykM9zbSIUqil0zNk7Nu+b5J0DKZlhl9CtpGKgX5uyp0idoJ3we9bSrY7PupnUL5eWiDp V5mmnNUhOnYi8xyClkLbNmAXyoWk7GaVrM2umkbpqHDzDymiKjetgzTocWNsJ2E0zPcfh t46J4ipaXGCfF7fuO0a70c82bvqo3HceIcRlshgu73seO8BqlLIap2z5jTOY+T2ucCnBt Atva3aHdchJg9AJ5YdKHz7LoA3VKmeqxAlFyEnQLBxB2PAhAZ8KvmuR6ELXws1Qr13Nd1 i4nsp189jqvaNzt+0nEnIaniuP1+/UOZdyfoZh57ku8sYHKdvfW/jYSUks+0rK+qtte+p y8jWL9cOJ0fV8rrH/t+85/p1z2N67p/ZsZ3JmdyliL7lrNxZUlx0MVIl6PxXOUuGOeArW 3vuEvJ2beoh7SGyZKHKbR2bBWO1d49JDIcVM6lQtu9UO8ec8pOnXmkcponBPLNM2CwZ9k NC/4ct6rQkPkQHMcV/8XckU4UJCy+VeTA== ; } echo “$base64” | base64 -d | tar xj mv good.pdf “$good” mv bad.pdf “$bad” touch “$out” ; cacheVal = let urlHash = builtins.hashString sha256 url; timeSlice = builtins.currentTime / 600; in ${urlHash}${toString timeSlice}; in { success = import (runCommand check-success { result = stdenv.mkDerivation { name = tryfetch-${cacheVal}; inherit url; outputHash = d00bbe65d80f6d53d5c15da7c6b4f0a655c5a86a; outputHashMode = flat; outputHashAlgo = sha1; nativeBuildInputs = [ curl ]; preferLocalBuild = true; inherit (collisions) good bad; buildCommand = if SSL_CERT_FILE=”${cacert}/etc/ssl/certs/ca-bundle.crt” curl -s -L -f -I “$url” > /dev/null; then cp “$good” “$out” else cp “$bad” “$out” fi ; impureEnvVars = lib.fetchers.proxyImpureEnvVars; }; inherit (collisions) good; } if cmp -s “$result” “$good”; then echo true > “$out” else echo false > “$out” fi ); value = builtins.fetchurl url; }; fetchLatest = channel: let result = tryFetch (mkVerURL channel.version); in if result.success then result.value else fetchLatest (channel // { version = if channel.history != [] then (lib.head channel.history).version else throw Unfortunately there’s no older version than + ${channel.version} available for channel + ${channel.channel} on ${channel.os}.; history = lib.tail channel.history; }); getHash = path: import (runCommand gethash.nix { inherit path; nativeBuildInputs = [ nix ]; } sha256=”$(nix-hash –flat –base32 –type sha256 “$path”)” echo “”$sha256″” > “$out” ); isLatest = channel: version: let ourVersion = sources.${channel}.version or null; in if ourVersion == null then false else lib.versionOlder version sources.${channel}.version || version == sources.${channel}.version; # We only support GNU/Linux right now. linuxChannels = let genLatest = channelName: channel: let newUpstream = { inherit (channel) version; sha256 = getHash (fetchLatest channel); }; keepOld = let oldChannel = sources.${channelName}; in { inherit (oldChannel) version sha256; } // lib.optionalAttrs (oldChannel ? sha256bin32) { inherit (oldChannel) sha256bin32; } // lib.optionalAttrs (oldChannel ? sha256bin64) { inherit (oldChannel) sha256bin64; }; in if isLatest channelName channel.version then keepOld else newUpstream; in lib.mapAttrs genLatest channels.linux; getLinuxFlash = channelName: channel: let inherit (channel) version; fetchArch = arch: tryFetch (getDebURL channelName version arch debURL); packages = lib.genAttrs [i386 amd64] fetchArch; isNew = arch: attr: !(builtins.hasAttr attr channel) && packages.${arch}.success; in channel // lib.optionalAttrs (isNew i386 sha256bin32) { sha256bin32 = getHash (packages.i386.value); } // lib.optionalAttrs (isNew amd64 sha256bin64) { sha256bin64 = getHash (packages.amd64.value); }; newChannels = lib.mapAttrs getLinuxFlash linuxChannels; dumpAttrs = indent: attrs: let mkVal = val: if lib.isAttrs val then dumpAttrs (indent + 1) val else ${lib.escape [$ \ ] (toString val)}; mkIndent = level: lib.concatStrings (builtins.genList (_: ) level); mkAttr = key: val: ${mkIndent (indent + 1)}${key} = ${mkVal val};n; attrLines = lib.mapAttrsToList mkAttr attrs; in {n + (lib.concatStrings attrLines) + (mkIndent indent) + }; in writeText chromium-new-upstream-info.nix # This file is autogenerated from update.sh in the same directory. ${dumpAttrs 0 newChannels}

Read More

Hexbyte  News  Computers The mysterious crystal that melts at two different temperatures

Hexbyte News Computers The mysterious crystal that melts at two different temperatures

Hexbyte News Computers

Hexbyte  News  Computers Crystals of acetaldehyde phenylhydrazone, or APH.
Crystals of acetaldehyde phenylhydrazone appear colorful when exposed to polarized light under a microscope. Credit: Terry Threlfall

In a little-known paper published in 1896, Emil Fischer—the German chemist who would go on to win the 1902 Nobel Prize in Chemistry for synthesizing sugars and caffeine—said his laboratory had produced a crystal that seemed to break the laws of thermodynamics. To his puzzlement, the solid form of acetaldehyde phenylhydrazone (APH) kept melting at two very different temperatures. A batch he produced on Monday might melt at 65 °C, while a batch on Thursday would melt at 100 °C.

Colleagues and rivals at the time told him he must have made a mistake. Fischer didn’t think so. As far as he could tell, the crystals that melted at such different points were identical. A few groups in Britain and France repeated his work and got the same baffling results. But as those scientists died off, the mystery was forgotten, stranded in obscure academic journals published in German and French more than a century ago.

There it would probably have remained but for Terry Threlfall, an 84-year-old chemist at the University of Southampton, UK. Stumbling across Fischer’s 1896 paper in a library about a decade ago, Threlfall was intrigued enough to kick-start an international investigation of the mysterious crystal. Earlier this year in the journal Crystal Growth and Design, Threlfall and his colleagues published the solution: APH is the first recorded example of a solid that, when it melts, forms two structurally distinct liquids. Which liquid emerges comes down to contamination so subtle that it’s virtually undetectable.

A forgotten mystery

The quest began in 2008 when Threlfall, a fluent speaker of German and a keen student of the history of science, was searching the pages of the 140-year-old Berichte der deutschen chemischen Gesellschaft for interesting solid-state work relevant to his research on second-order phase transitions. After learning of the long-lost puzzle from Fischer’s paper, Threlfall followed the reported recipe and found that his own samples of APH melted according to the same peculiar pattern. One batch melted at around 60 °C, the other at 90–95 °C.

Hexbyte  News  Computers Emil Fischer
Nobel laureate Emil Fischer works in his lab in 1904, eight years after describing a mysterious solid with multiple melting points. Credit: Nicola Perscheid

As Fischer knew 125 years ago, the laws of thermodynamics do not allow such a molecule. If a pair of solids have different melting points, then they must be structurally distinct. Yet all the modern structural analysis techniques that Threlfall and some colleagues tried on Fischer’s compound confirmed the 19th-century claim. X-ray diffraction, nuclear magnetic resonance, IR spectroscopy: All showed the crystals that behaved so differently were identical.

“For two years we wondered whether to believe the evidence of our own eyes and think that we needed to rewrite the laws of the universe, or to believe thermodynamics and think that we were simply incompetent experimentalists,” Threlfall says.

Piecing together the puzzle

The first clue for solving the mystery came from the way APH crystals are prepared. The molecule (C8H10N2) is made up of a benzene ring attached to a pair of nitrogen atoms, one of which is attached to a hydrogen atom and a methyl group that can point either up or down. Chemists make APH by dissolving solid acetaldehyde (a precursor for many useful chemical reactions and a compound found naturally in fruit) into aqueous ethanol and adding drops of liquid phenylhydrazine (also first made and characterized by Fischer, who used it in his seminal studies of sugars). If the mixture is chilled and stirred, jagged flakes and then thicker chunks of APH crystals start to appear.

According to reports from Fischer’s time, there were hints that impurities could play a role in the puzzling behavior of APH. Adding drops of an acid could steer the crystallization process toward the low-melting-point version of the molecule; with added alkali, the high-melting-point crystal would emerge. Threlfall confirmed that claim and found that he could convert between the two forms. The low-melting version could be made to melt at the higher temperature by exposing it to ammonia vapor. And the high-melting crystal just needed a whiff of acid to bring its melting point down.

That behavior seemed to suggest that the acid worked like rock salt does in lowering the melting point of water ice. But for salt to make a difference, a significant amount must be added—certainly enough to show up in a close examination of the ice’s structure. At as little as a thousandth of a molar equivalent, the quantities of acid or alkali needed to make the switch in APH were vanishingly small. Whatever contamination occurred did so with no detectable physical change to the crystal structure.

Hexbyte  News  Computers Melting points of APH crystals.
Terry Threlfall and his colleagues confirmed that there are low-melting-point and high-melting-point forms of APH. The y axis represents the heat absorbed in melting; the measured absorption is the area under the curve. Credit: Terry Threlfall

Threlfall got some important help from Hugo Meekes, a solid-state physicist at Radboud University in Nijmegen, the Netherlands. After hearing of a 2012 lecture that Threlfall had given about the conundrum, Meekes wondered if the solution might relate to a different, but equally curious, phenomenon called the disappearing polymorph problem. A scourge of drug companies, the problem manifests as the production of a solid that’s slightly but consequentially different from the desired product. The polymorphs are identical except for varying crystalline structures, which can give them different properties. In the late 1990s, for example, Abbott Laboratories learned that it had produced a less-soluble polymorph of its antiviral crystalline compound ritonavir.

The cause of disappearing polymorphs is disputed, but Meekes says it seems to come down to imperceptible contamination—perhaps a single molecule in the air can disrupt the process by seeding crystallization of the problematic form. “It sounds rather unbelievable, but it’s the only explanation,” he says. “We thought the situation with the APH must be something like this.”

But the APH case didn’t fit the pattern. The crystals of APH that melted at different temperatures weren’t polymorphs; they were identical. The researchers failed to find any other structural discrepancies either. For example, some molecules show different physical properties when their same atoms are arranged in different patterns, which is called isomerization. But both solid forms of APH contained the Z isomer, in which the methyl group points down.

Meekes too was stumped.

Enter Manuel Minas da Piedade, a solid-state physicist and thermodynamics researcher at the University of Lisbon, whom Threlfall met at a conference in 2011. After initially offering a hunch that led to another dead end, the Portuguese physicist did what many scientists do when faced with something that doesn’t add up: He went back to first principles. Because it is impossible for the same material to melt at different temperatures if the initial and final states are the same, he says, “either we don’t have the same crystal state, or the final state cannot be the same.”

Hexbyte  News  Computers Simon Coles (left) and Terry Threlfall (right).
Study coauthors Simon Coles (left) and Terry Threlfall performed some of their APH detective work at the UK National Crystallography Service at the University of Southampton. Credit: Simon Coles

Until then, all the tests performed by Threlfall and a growing number of interested colleagues had focused on solid APH, since differences in melting point typically stem from differences in the solid form. But, out of options on the solid front, in 2015 the researchers took a look at the liquids that emerged.

Back in the Netherlands, Meekes spun tiny tubes of the hot, molten APH in a solid-state NMR machine, once with the low-melting-point sample and once with the high-melting-point one. Occasional forays to temperatures higher than the delicate equipment’s 100 °C limit led to “frowning technicians,” Meekes says, but the risk was worth it. He discovered that the spectra of the two liquids were different. The same solid crystal was melting to form two liquids with distinct compositions—an unprecedented finding. “We think we have a clue as to what’s going on,” Meekes recalls telling Threlfall at a conference.

Tricky liquid

The difference, Meekes, Threlfall, and colleagues soon found as they probed further, comes down to isomerization, but only in the liquid phase. Although solid APH consists of solely the Z isomer, liquid APH also contains E isomer, in which the methyl group points up. In the liquid state, with the molecules spaced farther apart and therefore with more room to maneuver, APH can flit between the two forms, and it does so until it finds the most stable mix. That turns out to be a blend of about one-third of the Z isomer and two-thirds of the E form.

The relative amounts of each isomer at equilibrium are determined by the molecules’ Gibbs free energies, a measure of their thermodynamic potential. As the difference in Gibbs energy increases, so does the ratio of one isomer to the other. What makes APH so unusual, Threlfall says, is that the optimal isomer combination for liquid APH doesn’t match that of the solid form. “That the [solid] crystal is composed entirely of Z molecules shows that these must have a more favorable packing,” he says.

Hexbyte  News  Computers NMR analysis of liquid APH.
An NMR analysis of liquid APH revealed structural differences between the low-melting-point (black line) and high-melting-point (red) forms. Credit: Terry Threlfall

Tests showed that the high-melting solid crystal melted to a liquid that was also all Z. Then the Z-type molecules started to flip to E-type and continued until they hit that stable mix. But when the low-melting solid APH melted, it did so almost immediately to the stable mix of two-thirds E. The two liquids are different—and so the melting points are different—only because one represents an intermediate stage.

It was a melting-point suppression effect, just like salt and ice, but it was much larger than anyone on the team had thought possible. So what was behind it? Like the salt, they thought it must be an impurity. And like the disappearing polymorphs that plague the pharmaceutical industry, that impurity is too small to see or measure. Threlfall says hydrogen ions must be clinging to the surface of the solid crystal and catalyzing the shift from the Z form to the E form. To do so, those protons shift the electron density of the nitrogen atoms, which loosens the connection between nitrogen and carbon atoms in the APH molecules from a strong double bond to a weaker single one. The bond is therefore free to rotate, allowing a much more rapid switch between the Z and E forms.

With no acid present, the Z-form solid melts to Z-form liquid, and then this Z-form liquid starts the transition to E-form liquid until it reaches the stable 1:2 ratio. But when acid is there, the catalysis effect speeds the switch from Z form to E form, so much so that it happens as the solid melts.

Hexbyte  News  Computers Z and E isomers of APH.
Two isomers of APH. As a solid, molecules of APH take the Z form (left), in which the methyl group points down. But liquid APH also contains the E isomer, in which the methyl group points up. Credit: Leyla-Cann Söğütoğlu and Hugo Meekes

Overall, the starting solid is the same, the finishing liquid is the same, and the amount of energy used is the same. The laws of the universe are safe. Gérard Coquerel, who works on thermodynamics and solid-state physics at the University of Rouen, France, and was not involved in the project, says it’s an important discovery that organic chemists and others who rely on melting points to help characterize compounds should take into account. “It shows that sometimes there is a need to be careful about what we consider as the melting point,” he says.

Fischer would have been delighted to see the answer, Threlfall says, and the 19th-century chemist would probably have understood it. Although the team’s work breaks genuinely new ground, Meekes cheerfully admits that the circumstances under which the melting-point suppression occurs are so specific that the research is unlikely to have useful applications. The team hasn’t even coined a name for the physical process by which identical solids can melt into distinct liquids. “If someone else wants to name it, then they can,” Threlfall says. “But if you ask me, the scientific literature is already cluttered with too many needless terms.”

Read More

Hexbyte  News  Computers CSS Grid Level 2 – subgrid is coming to Firefox – Mozilla Hacks – the Web developer blog

Hexbyte News Computers CSS Grid Level 2 – subgrid is coming to Firefox – Mozilla Hacks – the Web developer blog

Hexbyte News Computers

The subgrid feature which is part of Level 2 of the CSS Grid Specification is not yet shipping in any browser, but is now available for testing in Firefox Nightly. This is a feature that, if you have used CSS Grid for a layout of any complexity, you are likely to be pretty excited about. In this article I’m going to introduce the feature and some of the use cases it solves.

So what is subgrid exactly? In terms of syntax, it is a new keyword value for the grid-template-columns and grid-template-rows properties. These properties normally accept a track listing, a listing of sizes of the tracks you want in your grid. For example, the following CSS would create a three column track grid with a 200px column, a column sized as max-content, and a final 1fr column.

grid-template-columns: 200px max-content 1fr;

You can find out more about track sizing in general, and the basics of grid layout via the MDN Guide Basic concepts of Grid Layout.

If we define a track as a subgrid, however, we replace the track listing with the keyword subgrid.

grid-template-columns: subgrid;

This instructs the grid-template-columns property to use the tracks defined on the parent, as the track sizing and number used by this nested grid.

In the example below I have an element which is a grid container. It contains three child elements – two div elements and a ul.

A
B
  • List item 1
  • List item 2
  • List item 3

I create a grid on .wrapper, and the direct children lay out on the grid I have created, but the list items go back to displaying as list items.

.wrapper {
  display: grid;
  grid-template-columns: 2.5fr 1fr 0.5fr;
  gap: 20px;
}

.box1 {
  grid-column: 1;
  grid-row: 1;
}

.box2 {
  grid-column: 2 / 4;
  grid-row: 1;
}

.box3 {
  grid-column: 1 / -1;
  grid-row: 2;
}

Hexbyte  News  Computers A layout of boxes, with list items displayed one below the other

The list items do not participate in grid layout.

If we make the ul with a class of box3 a grid, and set grid-template-columns to subgrid, the ul is now a three column track grid. The list items laying out using the tracks of the parent.

.box3 {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: subgrid;
}

Hexbyte  News  Computers A layout of boxes with aligned elements.

The list items use the grid of the parent of the list.

 

CodePen (needs Firefox Nightly)

There are some additional nice features which make subgrid useful for patterns you might need to build. The gap properties are inherited by default into subgrids – however you can override that with a gap, row-gap, or column-gap property on the subgrid itself.

The lines in your subgrid will inherit the line names set on the parent grid. This means that you can position items in the subgrid with the line names on your main grid. You can however add line names just for the subgrid and these will be added to any inherited names.

Take a look at the guide to subgrid on MDN to read about all of these features and see example code.

Hexbyte News Computers What will subgrid be useful for?

In terms of new syntax, and new things to learn, this is a very small change for web developers who have learned grid layout. A grid defined as a subgrid is pretty much the same as a regular nested grid with its own track listings. However it makes a number of previous difficult patterns possible.

For example, if you have a card layout, and the cards have headers and footers with uneven amounts of content, you might want the card headers and footers to align across the rows. However, with a standard nested grid this isn’t possible. The grid on each card is independent, therefore the track sizing in card A can’t respond to change of height inside card B.

Hexbyte  News  Computers A grid of cards with headers and footers which do not align

The card internal elements do not line up

If we cause each card to span across three rows however, we can then change the value of grid-template-rows to subgrid.

.card {
  grid-row: auto / span 3;
  display: grid;
  grid-template-rows: subgrid;
}

The card still spans three row tracks, but those rows are defined on the parent and therefore each footer is in the same row. If one footer gets taller, it makes the whole row taller.

CodePen example.

Hexbyte  News  Computers A grid of cards with aligned headers and footers.

The card internal elements now line up.

You might want to work to a standard 12-column layout. Without subgrid, components which are not direct children of the grid container can’t be laid out on that parent grid. Instead, you need to be careful with track sizing in the nested components in order to get the layout to work. With subgrid we can opt nested grids into that parent grid as far into the structure as is required.

This means that in the below wireframe example, all elements are using the tracks defined on the main element, even things that are nested inside two grids – such as the links inside a list inside a nav element. The screenshot below has the lines of that parent grid displayed using the Firefox Grid Inspector.

Hexbyte  News  Computers A layout with grid lines overlaid

The twelve column grid highlighted by the Grid Inspector

CodePen example.

A less obvious use case for subgrid is to help in the situation where you have an unknown amount of repeated content in your layout, and want to be able to place an item from the start to the end of the grid.

We can target the end of an explicit grid with -1, so an item which is placed with grid-row: 1 / -1 will stretch from the first to the last row line. The below grid has two row tracks defined. The block on the left stretches over both as it is spanning from column line 1 to column line -1.

Hexbyte  News  Computers A grid of boxes with the Firefox Grid Inspector showing the lines

The explicit grid highlighted with the Grid Inspector

CodePen example.

However, if you are creating implicit row tracks, because you don’t know how many items there will be you can’t target the end of the implicit grid with -1. As we do not have explicit tracks after the first track (a grid always has one explicit track in each dimension) the blue item can’t span to the end line after all of the auto-placed items have been laid out.

Hexbyte  News  Computers A arrangement of boxes, one blue box is top left.

Without an explicit grid the item cannot stretch to the end line

CodePen example.

If you make the repeating section a subgrid for columns, with implicit rows, all of those rows fit into the same grid area of the parent, rather than creating more rows on the parent. This means that you can have a fully explicit parent grid and know exactly where the end line is no matter how many items are added in the subgridded part.

The only compromise would be the addition of an extra wrapper if your markup didn’t have a container for these repeating elements. However a single wrapping div is not going to cause any problems and enables this pattern.

Hexbyte  News  Computers An arrangement of boxes with a full height box on the left

The sidebar stretches to the height of the content

CodePen example.

Hexbyte News Computers Firefox DevTools and subgrid

The DevTools team have been working on adding features to DevTools that will make it easier to work with multiple grids, including subgrid.

You can now highlight multiple grids with DevTools. This can be helpful to see how the grid lines up with each other. You can see this in action by highlighting multiple grids in the cards example above, letting you see how the lines of the rows on our cards align with the parent rows.

Hexbyte  News  Computers A grid of cards with two grids of lines displayed overlaid

Two grids are highlighted here, one on the parent and one on a child

In the Grid Inspector subgrids have a little subgrid badge, and appear nested inside their parent. These things should help you to identify them better when working with complex arrangements of grids.

Hexbyte  News  Computers The Firefox DevTools open to show the different ways that subgrids are highlighted.

DevTools makes it easy to see your subgrids.

The team are still working on features, including the ability to highlight a parent when a subgrid is selected.

Hexbyte News Computers Status of the subgrid feature

Subgrid is now available in Firefox Nightly, so you can test it out, and we would love for you to do so. Firefox will have the first implementation of the specification, so feedback from web developers is vital both for the Firefox implementation, the DevTools, and for the CSS specification itself.

Some more resources can be found in the MDN guide, also I have started to build some more examples at Grid by Example – my website of CSS Grid examples. In addition see an article I wrote about the specification, before we had any implementation – CSS Grid Level 2: Here Comes Subgrid.

Rachel Andrew is a front and back-end web developer, one half of the company behind Perch CMS, and Editor in Chief of Smashing Magazine. She is a Google Developer Expert for web technologies and a member of the CSS Working Group representing Fronteers, where she is co-editor of the Multi-column Layout spec. Author of 22 books, and a frequent public speaker at conferences worldwide, you can find out what she is up to at https://rachelandrew.co.uk.

More articles by Rachel Andrew…

Read More