HNHacker News
TopNewBestAskShowJobs

okennedy

393 karma · joined May 7, 2018

Hate notebooks... so do we. That's why we built one that doesn't suck. Check out Vizier, our spreadsheet-enabled, polyglot, notebook-flavored workflow system https://vizierdb.info
submissionscomments
okennedy··on Codebase as Database: Turning the IDE Inside Out with Datalog (2020)
The idea of code as data is something that's been churning around in the heads of my colleagues and me for a while now. Compiler optimization in particular is something that can really benefit from this view: The typical fixpoint-style approach of writing optimizers usually requires a ton of fine-tuning in the rules (e.g., manually triggering one rule after a second one fires), and you're still limited to how big a query you can run. On the other hand, start thinking of the optimizer like an IVM system... not could we automate a lot of the hand-tuning, but we can start thinking of scalable cross-module optimizations.
okennedy··on Paving the on-ramp to Java
It's worth keeping in mind that the primary audience that the article discusses is not folks at your skill level.

By far one of the most common errors I see as a CS instructor is aggressive over-reliance on global state. Not global methods, but state. However, usually what causes the student to reach for global state is the fact that it can be accessed from a static method like main; In lieu of figuring out how to structure a class, they reach for the easier "just make the variable static" approach. Allowing the initialization sequence to call main on an instance via the class's zero-arg constructor seems like it would address the point.

okennedy··on SQLite: Past, Present, and Future
We are... Spark's DataFrame is essentially a relational algebra AST-builder. Microsoft's LINQ interprets SQL directly in at compile-time. All of these, however, run queries more or less directly in the system in which they're specified.

It helps to think of SQL strings as an untrusted wire format. Yes, parsing is a pain, but it comes with two main benefits: (i) The wire format is human writable/interpretable, with all the accompanying benefits, and (ii) The wire format is easily extensible in a predictable way.

That latter one is particularly useful in keeping SQL's ecosystem open. Take a front-end library like SQLAlchemy or ScalikeJDBC for example. It's not practical for any one such library to support every extension provided by every database engine. SQL provides a fall-back for when you need a back-end feature that hasn't been implemented in any given front-end.

okennedy··on AppleScript: Graphic User Interface (GUI) Scripting
AppleScript's syntax was a mess of pseudo-english that was a pain to write (although considerably easier for newbies to read). The editor helped here quite a bit.

That said, the infrastructure backing Applescript was amazing (especially for the time). The MacOS scripting interface was just as powerful as /proc, but far more structured. Every application and system service defined its own object-relational schema, and Applescript provided a SQL/Sparql-like language for querying that schema ("set foo to all of the Documents"). The schema and associated documentation were self-contained within the applications themselves via the resource fork, and Apple's HIGs set fairly high expectations for the quality of this documentation.

And of course, as the GP notes, other languages could tie into the scripting framework (I have fond memories of using both Frontier and Hyperscript in this way).

okennedy··on Guidance to make federally funded research freely available without delay
For the NSF at least, most grants are awarded for 3-5 years. When the last policy shift happened (all grant-supported publications need to be publicly released into the NSF's publication archive), it applied to newly awarded grants. 4 years should give most existing grants a chance to cycle out.
okennedy··on Reference count, don't garbage collect
This. Exactly this.

Garbage collection has a huge, and generally entirely unappreciated win when it comes to threaded code. As with most things, there are tradeoffs, but every reference counting implementation that I've used has turned any concurrent access to shared memory into a huge bottleneck.

okennedy··on Framework Laptop (2022) review: the repairability dream
Timing! (To my credit, I had checked the upgrade kits page and they were still on "notify me" status when I posted)

Obviously I'm being a bit greedy here, but much of Framework's value proposition is built around upgradability. Servicing the crowd that actually buys into that proposition first seems like it would be more valuable from a customer loyalty standpoint, even relative to new customer acquisition. These are repeat customers clearly committed to your company's product.

okennedy··on Ask HN: What are some cool but obscure data structures you know about?
The same thing was a huge issue in Python until somewhere around 3.6, until they canonicalized the sort order.
okennedy··on Ask HN: What are some cool but obscure data structures you know about?
Modulo the snark, you're completely right. Iteration order = insertion order is super valuable for a bunch of reasons (this one included).
okennedy··on Ask HN: What are some cool but obscure data structures you know about?
Hence the "simple but good". It's not really obscure, but also not on the common path. I've lost track of the number of times I've pointed this one out to a colleague or student.
okennedy··on Ask HN: What are some cool but obscure data structures you know about?
Linked Hash/Tree Maps, simple, but elegant. A Map with its nodes connected in a linked list so you can traverse them in insertion order (and O(n) time). Very useful for window queries over sequential data and other cases where you want FIFO access, but also quick access by a field of the data.
okennedy··on Framework Laptop (2022) review: the repairability dream
I frequently carry my laptops by the body one handed, which probably doesn't help. I also (used to) travel a bunch, so the laptops end up getting stuffed into and out of densely packed bags. In most cases though, the hinges are just badly designed. In one extreme case, the hinge's mount points on the case were all in a straight line in line with the hinge's line of rotation. As a peer post pointed out, just the stress of the lid's friction lock + 1-2 years of constant use tore the hinge right off the case.

The Framework has a proper cross-brace on the hinge, the hinge mounting points are metal, and I can inexpensively replace the case or hinge if either breaks after the warranty expires.

okennedy··on Framework Laptop (2022) review: the repairability dream
I completely agree in nearly every respect. Especially notable is the fact that they sell replacement hinges. Considering that every one of my preceding non-Apple laptops has failed at the hinge, this is huge.

Support for suspend in linux is definitely shaky, but a (eventually fixable) firmware issue. On the other hand, I am concerned with the company's commitment to upgradability. Since they announced the 2nd generation motherboard some months back, the only way to get one has been with a brand new laptop around it.

okennedy··on What is PVTM? Or why your Rockchip RK3588 CPU may not reach 2.4 GHz
The same thing happens on a lot of mobile devices as well. It's the reason that mobile devices generally don't get advertised with clock speeds. E.g., see: https://dl.acm.org/doi/abs/10.1145/3032970.3032982

Unlike desktops, where CPUs from different quality bins are sold at different price points (with different clock speeds), mobile CPUs are simply run at different voltages to compensate for quality differences. The resulting differences in power dissipation end up creating different temperature profiles, depending on which bin you happen to get.

okennedy··on Detroit’s new personalized flight information board is straight out of sci-fi
A technology demo can be both incredibly cool, while still having significant negative implications. 16-year old me dreamed about this sort of tech. Current me has seen Minority Report and is not comfortable with faceless corporations unilaterally deciding they want an intimate, personal relationship with me.

Technology is a tool, neither intrinsically good nor evil. Unfortunately the tech industry has, as a whole, shown a stark disrespect for the needs or desires of individuals. Tech culture values monetization over individual autonomy, and that shows little sign of changing. Unfortunately, without a dramatic culture shift, it will continue to be the case that otherwise amazingly incredibly cool tech like this gets subverted to force more "personal" interactions.

okennedy··on Quantum Zeno effect
Don't blink.
okennedy··on Mito – Excel-like interface for Pandas dataframes in Jupyter notebook
You might want to check out a tool Vizier: https://vizierdb.info (I'm one of the devs). Direct interaction with notebooks state (e.g., dataframes as spreadsheets) is one of the central ideas, and it's fully open source.
okennedy··on PiGlass v2: A wearable Pi Zero 2
It is... niche. The display, in spite of butting up against your glasses, is still very small. You're not going to be programming on the command line with one of them (I've tried). It's also not really great as a secondary display either. At least for me, refocusing my eye on the vufine screen and back to the main display isn't faster than switching virtual desktops.

The applications where these do well generally involve large text or video... AR apps like navigation, or watching TV while traveling.

okennedy··on ACM Opens First 50 Years Backfile
To their credit, US and EU funding agencies agree with you! Back at the start of 2016 or so, the NSF started adding clauses to grant contracts requiring that all research supported by new NSF awards be deposited in its open access repository: https://par.nsf.gov/ Results from there don't seem to show up in major search engines, neither academic (Google Scholar, DBLP), nor general (DDG, Google). Nevertheless, many ACM articles from the past 5 years can be found there. Similar repositories exist for other funding agencies.

Also worth noting: Many ACM publications will be cross-posted on ArXiV (https://arxiv.org) or faculty webpages. It's an open secret that many faculty will publish "preprint" versions of their articles there after the paper passes peer review, but before they sign any licensing agreement with a publisher.

okennedy··on Show HN: I Launched a “Fun” Web App for Developers
I can see this being helpful to people who are unfamiliar with a language's syntax/language learners.

For someone who already understands the syntax of a language (or at least the syntax of a related language), there's little to be gained from seeing what the code is doing. Take part of the Python example from the linked page: "The code defines a function called isPerfectSquare. This function takes an input of x, and calculates the square root of x. The function then returns whether or not x * x is equal to x.". This guides me through the code, line-by-line.

A more valuable description is "The function returns true if the input is the square of an integer". In other words, the more useful question is why the code exists. Good comments, explanations of code, function/variable names etc... focus on the overall objective of the code. For example: - What is the abstraction that the code is trying to capture? - What makes the problem that the algorithm is solving difficult/non-obvious? - What are the pre-conditions that a given segment of code assumes? - What post-conditions does the segment of code ensure?

okennedy··on Mastodon now a non-profit organisation
It can and does. e.g., a Mastodon account can subscribe to one on PeerTube.
okennedy··on F# is the best coding language today
Ocaml sold me on the value of functional languages. F# taught me that they could be practical outside of academic projects.

Ocaml's standard library is amazing, and it has a great developer community, but at the end of the day Ocaml is its own thing. F# had virtually identical syntax, but put all of .NET at my fingertips. I was using it for UDFs in SQLServer, UIs with tables and plots, and a lot more. My brief flirtation with windows ended years ago, but F# remains one of the most positive parts of that experience.

okennedy··on British right to repair law excludes smartphones and computers
It's been a while since I looked at the technology, but the basic premise is very simple. The TPM basically keeps around a stack of hashes. The BIOS pushes a hash of the bootloader onto the stack. The bootloader pushes a hash of the kernel onto the stack. Then there's a handful of ring 0 cpu instructions for pushing and popping all but the bottom-most entries of the stack that allow the kernel to do whatever it wants, including pushing hashes of application code, hashes of passwords (as in your example), or opening up a similar ability to push/pop upper levels of the stack to the application.

The only check the TPM does when deciding whether to allow the key in one of its registers to be used is whether the stack is in a particular configuration. The TPM doesn't (and in fact can't) directly require passwords (since it has no direct line of communication to the user). However, the BIOS, bootloader, kernel, etc... can all be configured to mix user-provided information like a password into the hash they push into the TPM.

okennedy··on British right to repair law excludes smartphones and computers
A TPM is a chip on some motherboards that serves two purposes:

1. Using something not too dissimilar from blockchain/git repo hashes to attest to the the execution stack (BIOS, bootloader, kernel, userspace). 2. Providing cryptographic primitives that are only unlocked when the stack exactly matches a particular value.

It's a handy tool for avoiding spyware, as any change in the attestation chain gets immediately flagged. It is also, in principle, useful for tying DRM keys to a particular execution stack that's known to be trusted... although it's very worth noting that the TPM's threat model does not include an attacker having physical access to the hardware.

okennedy··on Ohio GOP ends attempt to ban municipal broadband after protest from residents
For many goods and services, they are actually quite reasonable requirements. Internet access, however, is a form of public infrastructure, regardless of whether it is administered by a for-profit corporation or a government.

> - Municipal broadband expands the role of government. It's an extra program for the municipality to manage.

It requires physical infrastructure, and that physical infrastructure needs to reach people's houses. That, in turn requires the use of public resources (streets) and/or eminent domain. In short, government is already involved.

> - Municipal broadband is a government handout. It artificially lowers prices.

The level of infrastructure investment required makes it hard to justify new for-profit investment, especially if the area is already being served or isn't populated enough for the company to make a profit. As a result, internet access providers naturally tend towards being a monopoly, which in turn artificially increases prices.

> - Expanding government programs is a tax on residents, even if they don't benefit from broadband access.

I can see where this point is coming from, and it's not wrong. At this point, however, even those who don't directly benefit from internet access seem like they benefit indirectly. It's also worth noting that a lot of locales (mine included) already pump money into corporate broadband providers to entice them to build and maintain the infrastructure. In other words, the tax gets applied, regardless of whether it's a for-profit corporation reaping the benefits or not.

> - Municipal broadband is hostile to business. Companies cannot reasonably compete with a service that the government pumps money into.

Companies already can't compete with a service that requires enormous infrastructure investments and the use of government property.

Internet access (and most large-scale infrastructure) is different due to the heavy infrastructure investment required.

- It's hard to convince a for-profit organization to build out that sort of infrastructure in an area that isn't populated enough to allow the organization to make a profit.

- It's hard to convince a for-profit organization to build out a second set of infrastructure in an area that already has it, as increasing competition will lower prices and make it harder to make a profit on the investment.

- Building out multiple redundant infrastructures can also be a hassle for normal citizens. More closures due to maintenance/construction work, more use of eminent domain, more unsightly telephone poles, etc...

In short, Internet access tends towards being a monopoly. With that in mind...

- Artificially lowering prices is a good thing if it counters the natural tendency of a monopoly to push prices up. - Expanding the role of government is a bit of a non-argument, since

okennedy··on The PinePhone could bring the Linux mobile ecosystem to life
GSConnect (which I already use) is written as a GNOME shell extension in order to provide support for clipboard sharing. Unfortunately, none of the mobile-friendly shells/desktop managers support GNOME extensions (yet). There's an effort to port GSConnect to Phosh-based environments (https://source.puri.sm/Librem5/phosh/-/issues/514), but that's still exploratory. It's also possible to install KDEConnect on Mobian, but it doesn't work fully and the UI isn't quite mobile-friendly yet.
okennedy··on The PinePhone could bring the Linux mobile ecosystem to life
KDEConnect is supported in KDE/Plasma-based distros. Work is in progress to add it to Gnome/Phosh. KDEConnect is definitely a killer app!

Can't speak for the other distros, but Mobian/Phosh has reached a point where it's usable as a primary phone. Tons of work from the community has brought battery lifetimes up from ~1 hour to the point where it lasts me the day under normal use. Firefox is usable, and most every piece of software I need has a workable counterpart.

That said, the experience is still quirky (think c.a. 2000 linux on desktops). Most things work, but the final mile still requires a decent amount of poking at config files and trawling wikis. Doable, but not everyone's cup of tea.

(Posted from a pinephone)

okennedy··on Dataflow, a self-hosted Observable notebook editor
It's based on Spark rather than Postgresql directly, but I'm part of an effort to build a workflow system disguised as a notebook callled Vizier [1]. SQL is a first-class primitive in Vizier, and the notebook plays nice with postgres (you can load from and unload to postgres using Spark's native data loader).

[1] https://vizierdb.info

okennedy··on Reactive, reproducible, collaborative: computational notebooks evolve
Hi, one of the creators of Vizier here.

The difficulty with git in this use case is that it relies on the user to manually commit. If you try the analysis, and decide to throw the code away before you commit, too bad! There's no longer a record of it.

Vizier records everything. Every single change to the notebook, just like track changes in your word processor/spreadsheet of choice. Speaking from experience, it's really nice not to have to think about manually check-pointing... the history is just there.

okennedy··on Ask HN: Is there a way to efficiently subscribe to an SQL query for changes?
We haven't updated it in a while, but check out DBToaster [1]. Give it some SQL queries and a set of tables, and it'll compile for you a Scala or C++ class with insert() and delete() functions for every table listed, as well as a functions to get the (incrementally maintained) result of any query. Supports SQL92, with some decent extensibility for UDFs, etc... and has quite a bit of theory backing it.

[1] https://dbtoaster.github.io/

← PreviousPage 2 of 4Next →