Readit News logoReadit News
pjungwir commented on Progressive JSON   overreacted.io/progressiv... · Posted by u/kacesensitive
pjungwir · 9 months ago
Does this scheme give a way to progressively load slices of an array? What I want is something like this:

    ["foo", "bar", "$1"]
And then we can consume this by resolving the Promise for $1 and splatting it into the array (sort of). The Promise might resolve to this:

    ["baz", "gar", "$2"]
And so on.

And then a higher level is just iterating the array, and doesn't have to think about the promise. Like a Python generator or Ruby enumerator. I see that Javascript does have async generators, so I guess you'd be using that.

The "sort of" is that you can stream the array contents without literally splatting. The caller doesn't have to reify the whole array, but they could.

EDIT: To this not-really-a-proposal I propose adding a new spread syntax, ["foo", "bar", "...$1"]. Then your progressive JSON layer can just deal with it. That would be awesome.

pjungwir commented on Dear sir, you have built a compiler (2022)   rachit.pl/post/you-have-b... · Posted by u/azhenley
pjungwir · a year ago
I've seen this a lot when someone wants to add "workflow automation" or "scripting" to their app. The most success I'd had is embedding either Lua or Javascript (preferably Lua) with objects/functions from the business domain available to the user's script. This is what games do too. I think it's a great way to dodge most of the work. For free you can support flow control, arbitrary boolean expressions, math, etc.
pjungwir commented on Show HN: Mermaid ASCII Diagrams   mermaid-ascii.art/... · Posted by u/AlexanderGrooff
danpalmer · a year ago
Out of interest have you managed to get Mermaid graphs rendering outside of a browser?

I was trying to do this a while back so I could do server side rendering of graphs, but it seemed to depend strongly on the presence of a DOM. Couldn’t quite get it working with JS-DOM either.

pjungwir · a year ago
I've used [mmdc](https://github.com/mermaid-js/mermaid-cli) to generate mermaid images from a Makefile. It looks like it is implemented with puppeteer, so perhaps it doesn't quite fit your request. But if you just want something you can use at the cli, it is great.
pjungwir commented on Ask HN: Freelancer? Seeking freelancer? (August 2024)    · Posted by u/whoishiring
pjungwir · 2 years ago
SEEKING WORK - Portland, OR or Remote

I'm a full-stack developer with 20+ years experience. My specialties are deep Postgres consulting, web development in Rails/Django, and devops with Kubernetes, AWS, Azure, Terraform, Ansible, etc. From time to time I've done projects in Javascript/Typescript (React, Vue, Angular, Node), Java, C#, C, Go, Rust, Elixir, Perl, etc.

I am reliable, easy to work with, quick to turn things around, and a good communicator. I can work solo or on a team, either as lead or a team member. I value client satisfaction as highly as technical excellence.

You can see some of my recent work here:

https://illuminatedcomputing.com/portfolio

https://commitfest.postgresql.org/49/4308/ (Adding SQL:2011 application-time to Postgres)

https://commitfest.postgresql.org/31/2112/ (Adding multiranges to Postgres)

https://github.com/pjungwir/aggs_for_arrays

https://github.com/pjungwir/aggs_for_vecs

https://github.com/pjungwir/active_model_serializers_pg

If you'd like to work together, I'd be happy to discuss your project!: pj@illuminatedcomputing.com

pjungwir commented on Divers discover Roman mosaic   smithsonianmag.com/smart-... · Posted by u/Brajeshwar
whoknowsidont · 2 years ago
Augustus IS Julius Caesar, he quite literally inherited the name (and all of his great uncle's property).

The full quote is this:

>During the late Roman Empire, rulers like Julius Caesar and Nero owned homes in the town, which was known as a destination that aristocrats flocked to for drinking, parties and general hedonism.

Gaius Julius Caesar Augustus (aka Octavian) not only gained his great uncle's original property, but he invested quite heavily into property and other public works in Baiae with other emperors doing the same. Baiae was very much an "imperial city" and it definitely kicked off with Octavian.

The city gained much of its notoriety (or negative connotation for extravagance) as time went on.

And the sentence says "like", as in "hey reader, here are these two pretty familiar names who are not only relevant to the city itself, but also can give you an idea of the type of elite class we're talking about." It's a pretty succinct way of putting it and while reinforcing multiple points at once.

So it's not wrong. If you're going to be pedantic, at least be correct.

pjungwir · 2 years ago
Nero isn't from the the late Roman Empire either.
pjungwir commented on Ruby methods are colorless   jpcamara.com/2024/07/15/r... · Posted by u/pmontra
pjungwir · 2 years ago
Great article! I'm looking forward to reading the rest of the series.

I noticed a couple details that seem wrong:

- You are passing `context` to `log_then_get` and `get`, but you never use it. Perhaps that is left over from a previous version of the post?

- In the fiber example you do this inside each fiber:

    responses << log_then_get(URI(url), Fiber.current)
and this outside each fiber:

    responses << get_http_fiber(...)
Something is not right there. It raised a few questions for me:

- Doesn't this leave `responses` with 8 elements instead of 4?

- What does `Fiber.schedule` return anyway? At best it can only be something like a promise, right? It can't be the result of the block. I don't see the answer in the docs: https://ruby-doc.org/3.3.4/Fiber.html#method-c-schedule

- When each fiber internally appends to `responses`, it is asynchronous, so are there concurrency problems? Array is not thread-safe I believe. So with fibers is this safe? If so, how/why? (I assume the answer is "because we are using a single-threaded scheduler", but that would be interesting to put in the post.)

pjungwir commented on Leaked admin access token to Python, PyPI, and PSF GitHub repos   jfrog.com/blog/leaked-pyp... · Posted by u/elchief
pjungwir · 2 years ago
How did JFrog know this github token was so powerful, compared to all the other ones I'm sure their scanner detects? What caused a human to get involved?

u/pjungwir

KarmaCake day4142March 18, 2011
About
https://illuminatedcomputing.com/

pj@illuminatedcomputing.com

[ my public key: https://keybase.io/pjungwir; my proof: https://keybase.io/pjungwir/sigs/18RLNIH6b2Dlda44UTBZU_M50U7MmWCTjBKoF813ZOA ]

View Original