HNHacker News
TopNewBestAskShowJobs

jstrieb

3,509 karma · joined October 21, 2016

Programmer • Hacker • Public Interest Technologist

https://jstrieb.github.io

https://github.com/jstrieb

submissionscomments
jstrieb··on Purely Functional Data Structures (1996) [pdf]
I've recently used a number of structures that I learned from this book. Though I don't know if the text represents the state of the art in purely functional data structures, it's a pretty seminal work in the area.
jstrieb··on Programming in Standard ML (2011) [pdf]
I've used it for a handful of personal CLI applications. Not sure if that counts as "production," though.
jstrieb··on Programming in Standard ML (2011) [pdf]
This is both a comprehensive guide, and an excellent reference! I use it often when writing SML for side projects.

For those interested in parallel, functional programming, I recommend taking a look at Futhark, which leverages data parallelism to make very fast parallel programs. It is based on SML, and has similar syntax, but can automatically build programs that (among other targets) run on the GPU using CUDA or OpenCL. It is also worth checking out MPL, which extends the (already awesome) whole-program optimizing compiler MLton to add support for nested, fork-join parallelism.

https://github.com/diku-dk/futhark

https://github.com/MPLLang/mpl

jstrieb··on Programming in Standard ML (2011) [pdf]
Though I know far more about SML than OCaml, I would approximate that the former is to C as the latter is to C++.

Which one you learn should depend on what you plan to use it for! I'm partial to SML. Then again, I've only written a handful of real-world programs with it.

jstrieb··on A Mathematician's Lament (2002) [pdf]
Hadn't seen The Cauchy-Schwartz Masterclass, but after a quick glance around, it seems to be very different from 99 Variations on a Proof.

The book I'm recommending is pretty far from a textbook. Rather it is an Exercises in Style type book that explores many different ways to express a mathematical proof of the same simple fact. Some of the proofs are whimsical, and others offer genuine insight. Many cover the ways that such mathematical discussions would have taken place in earlier historical periods.

In other words, 99 Variations is more like a jaunt through mathematics culture rather than a book that focuses on actual mathematical content.

I'll take a look at this book, though, because it looks quite good!

jstrieb··on A Mathematician's Lament (2002) [pdf]
As someone who majored in math in college, this essay did an excellent job of communicating ideas that I've struggled to explain to family and friends who practically flinch when I tell them I studied math.

If you connected with this essay (or, perhaps, if you did not), I highly recommend checking out a book called 99 Variations on a Proof, by Philip Ording. It is an enjoyable, easy to understand journey through the art of making a mathematical argument by way of showing the many forms such an argument can take.

https://www.amazon.com/99-Variations-Proof-Philip-Ording/dp/...

jstrieb··on Deep learning library written in Futhark
I've only used Futhark a handful of times, but found it to be really easy, and intuitive (coming from extensively using SML).

For anyone looking to get started with it, writing a Monte Carlo simulation is a good first exercise to get familiar. Monte Carlo simulations also happen to perfectly showcase its power to exploit parallelism for massive speedups.

jstrieb··on Universal Summarizer
Here is a quick bookmarklet that uses this to open the summary for the current page in a new tab.

Highlight the following and drag it to your bookmarks bar.

    javascript:Object.assign(document.createElement("a"), {href: `https://labs.kagi.com/ai/sum?url=${encodeURIComponent(window.location)}`, target: "_blank"}).click();
jstrieb··on Minimal Cross-Platform Graphics
Yup! Besides being hard to search, others have commented that the name might be bad for accessibility:

https://news.ycombinator.com/item?id=24257503

jstrieb··on Minimal Cross-Platform Graphics
I think they're referring to this:

https://justine.lol/ape.html

One of many HN discussions about the topic here:

https://news.ycombinator.com/item?id=26273960

jstrieb··on Show HN: Unblob – extraction suite for 30+ file formats
Unblob looks cool!

If you're interested in something similar that can put things back together after you've modified them, check out OFRAK:

https://github.com/redballoonsecurity/ofrak

It's designed with embedded systems in mind, but has support for all kinds of other stuff, too. It also has some very advanced binary patching capabilities.

I work on it as part of my day job.

jstrieb··on Liu Cixin's Technologies of the Future
I felt like you do until about two thirds of the way through the second book, which is where things really pick up. These books have since become some of my favorites.

I understand where you're coming from, but I encourage you to try and power through to the end of the second book. The things you complain about are long gone by then, and you might change your mind like I did!

jstrieb··on Show HN: URL Snake
If you want to make clickable links with this code, you can use URL Pages.

https://github.com/jstrieb/urlpages

It's a small JavaScript application to store entire web pages in URLs. I made it after learning that links with data URLs are no longer clickable.

jstrieb··on The beauty of CGI and simple design
> Zero external configuration, other than telling your webserver to enable CGI on your file

This is only true if you've done it before, and know what you're doing. In reality, it looks like a mess of `mod_cgi` configuration, trying different combinations of file permissions, finding the magic `cgi_bin` directory, finding the right obscure log files when there are inevitably errors, wrestling with CORS and other subtleties of HTTP headers, and other complexities that are only easy to navigate if you're already an experienced CGI user.

That being said, I love the philosophy of using CGI for scripts. Instead of using CGI itself, though, I wrote a (single-file, statically-linked) web server called "QuickServ" to bring this philosophy into the twenty-first century. It has all of the upside of CGI, but is much easier to set up and run, especially for beginners.

One of its benefits is that it automatically parses submitted HTTP forms, and converts the form fields to command line arguments. That means it's extremely easy to put existing CLIs on the web with minimal changes other than writing an HTML form front-end.

If you like CGI, I will (shamelessly) ask that you check it out!

https://github.com/jstrieb/quickserv

https://news.ycombinator.com/item?id=29002694

jstrieb··on How do I draw a pair of buttocks? (2014)
I second this recommendation, Inigo Quilez is amazing!

If you're interested in learning the fundamentals of some of the math he uses, I can highly recommend the CMU computer graphics course. It's free on YouTube.

https://youtube.com/playlist?list=PL9_jI1bdZmz2emSh0UQ5iOdT2...

The professor, Keenan Crane, puts out a ton of super interesting, high-quality research as well. His website is awesome.

https://www.cs.cmu.edu/~kmcrane/

jstrieb··on How Regexes Work
The haystack idea reminds me of this wonderful post from the creator of both the Rust regex crate and the ripgrep command line utility (among other awesome things).

https://blog.burntsushi.net/transducers/

jstrieb··on Ask HN: Working in a VR Headset?
Can't comment on what it's like with a modern headset, but I have used an old Oculus Go with great success, despite its low resolution. It's definitely uncomfortable and hard on the eyes for long periods of time, but the focus it affords makes it worthwhile for short bursts.

I set everything up to interface with my computer using a web browser on the headset, which might not match your use case.

https://jstrieb.github.io/posts/vr-programming/

jstrieb··on Mcmaster.com is the best e-commerce site I've ever used
If you're not familiar with McMaster-Carr, this Hackaday article is a good introduction: https://hackaday.com/2017/09/13/noobs-guide-to-mcmaster-carr...

Besides the handy website, their many-thousand page phsyical catalog is great. We have a copy at work and it's easy to spend a long time flipping through, learning about all of the different things they have, and why they are useful.

Here is Adam Savage talking about why their catalog is awesome: https://youtu.be/8kbu34dk92s

jstrieb··on Columbia whistleblower on exposing college rankings
When I was picking colleges a few years ago, I made my own rankings. At the time, I knew more about what I didn't want than what I did want, and none of the tools I found supported searching that way.

The US department of education collects extremely comprehensive data on colleges every year, and makes the data public. I loaded these CSVs into SQLite and made a bunch of queries to filter schools out, then dumped the rest to a spreadsheet. In the spreadsheet I weighted each column and sorted the rows. The weights were tunable so I could emphasize different factors in the sorting. The process was successful in that it turned up some surprising results I wouldn't have otherwise considered!

I've wanted to write a post on my website about this process for a while, but haven't gotten around to it. In the meantime, for anyone looking to do something similar, the data is here:

https://collegescorecard.ed.gov/data

jstrieb··on The Follower: Using open cameras and AI to find how an Instagram photo is taken
If you're looking for more info, there is a whole book that goes beyond the content of this episode. I found it to be an informative, and eye-opening (albeit disconcerting) read.

https://www.amazon.com/Eyes-Sky-Secret-Gorgon-Stare-ebook/dp...

jstrieb··on Show HN: Compass and Ruler construction problems as puzzle game
This looks very fun! It reminds me of a game called Euclidea that I played and enjoyed a while back, though the interface for this looks pretty different.

https://www.euclidea.xyz/

Congrats on the release!

jstrieb··on AI-designed camera only records objects of interest while being blind to others
Reminds me of this really cool video about using Fourier Optics for optical pattern recognition.[1] The video happens to have one of the best explanations of Fourier transforms I've yet encountered.

1: https://www.youtube.com/watch?v=Y9FZ4igNxNA

jstrieb··on Fleur – A bloom filter implementation in C
I appreciate the Go-style docstring comments in the code!

For anyone trying to understand Bloom filters who may be interested in checking out an alternative C implementation (designed to be compiled to WebAssembly), I'll link mine below.

I used it to build a Bloom filter of every Hacker News submission ever for a privacy-preserving browser extension that tells you if the page you're currently on has been submitted before.

https://github.com/jstrieb/hackernews-button/blob/master/blo...

jstrieb··on Ask HN: How to learn mathematical proofs from scratch?
I did math in undergrad and struggled with proofs at first.

I learned a lot from working through An Infinite Descent into Pure Mathematics by Clive Newstead. It's designed to get someone with minimal math background started with the basics of pure math. Becoming comfortable with proofs happens along the way.

https://infinitedescent.xyz/

Lately, I have also really enjoyed 99 Variations on a Proof by Philip Ording, which is not a textbook. Rather it is an Exercises in Style type book that explores many different ways to express a mathematical proof of the same simple fact. Some of the proofs are whimsical, and others offer genuine insight. If you're looking for something lighter than a textbook that is still interesting and somewhat useful, this book is more approachable.

https://www.amazon.com/99-Variations-Proof-Philip-Ording/dp/...

jstrieb··on Ask HN: Share your personal site
Kept mine simple. Made by hand!

https://jstrieb.github.io

I get a ton of action on my contact form, but mostly from people using Link Lock (one of my projects), or people who use my Cookie Clicker auto clicker bookmarklet.

jstrieb··on On being a PhD student of Robert Harper
Can't speak to graduate student experiences, but I did take Dr. Harper's principles of programming languages class as an undergrad.

The course was ambitious and moved at a breakneck pace, and Dr. Harper could be a whirlwind in lecture. As some of the anecdotes mention, he's pretty opinionated. He'd often go on intense (albeit well-informed), tangential rants, particularly about Python.

Personally, I would have preferred a less comprehensive course with more time to let some of the abstract ideas settle, but I can imagine his attitude and approach being well-suited to energetic graduate advising.

For those curious about the material, we covered a significant portion of his Practical Foundations of Programming Languages book: https://www.cs.cmu.edu/~rwh/pfpl/2nded.pdf

jstrieb··on Introducing the new star-history.com – the missing GitHub star history graph
This is very cool! I like that multiple repos can be added to the graph at once. Previously, I have used https://starchart.cc/, which is similar, but lacks this feature.
jstrieb··on Websocketd – It's like CGI, twenty years later, for WebSockets
This is awesome! Websocketd occupies a similar niche to—and might pair well with—my user friendly, single-binary webserver with CGI-like capabilities called QuickServ. When I released that here, one of the comments was that it would be nice to have WebSocket support. Now, I can just point people to Websocketd!

https://github.com/jstrieb/quickserv

jstrieb··on Apache Guacamole
I have used Apache Guacamole to access running GitHub Actions workflows as remote desktops. It worked super well for testing GUI apps on other operating systems that I didn't want to deal with setting up.

It's also nice if you want to run a GUI application in someone else's sandbox.

https://github.com/jstrieb/ctf-collab/blob/9300c57364f71fe29...

jstrieb··on YAML: It's Time to Move On
One interesting demonstration of YAML's complexity relative to JSON is that YAML is almost a complete superset of JSON. This is acknowledged by the authors of the YAML spec.[0]

For example, the following code translates JSON to YAML using only the Python yaml library:

    import yaml
    
    data = yaml.load("""
    {
      "firstName": "John",
      "lastName": "Smith",
      "isAlive": true,
      "age": 27,
      "address": {
        "streetAddress": "21 2nd Street",
        "city": "New York",
        "state": "NY",
        "postalCode": "10021-3100"
      },
      "phoneNumbers": [
        {
          "type": "home",
          "number": "212 555-1234"
        },
        {
          "type": "office",
          "number": "646 555-4567"
        },
        {
          "type": "mobile",
          "number": "123 456-7890"
        }
      ],
      "children": [],
      "spouse": null
    }
    """)
    
    print(yaml.dump(data))
    
Prints:

    address:
      city: New York
      postalCode: 10021-3100
      state: NY
      streetAddress: 21 2nd Street
    age: 27
    children: []
    firstName: John
    isAlive: true
    lastName: Smith
    phoneNumbers:
    - number: 212 555-1234
      type: home
    - number: 646 555-4567
      type: office
    - number: 123 456-7890
      type: mobile
    spouse: null
0: https://yaml.org/spec/1.2.2/#12-yaml-history
← PreviousPage 4 of 8Next →