JavaScript
fromPythonSpeed
2 days agoTimesliced reservoir sampling: a new(?) algorithm for profilers
Random sampling from an unknown-length event stream can effectively identify relevant information without storing all data.
I've built a number of demos already using Bluesky's APIs, and for the most part, they're easy to use and "just work" - which is all you want from an API. That was my expectation going into this little demo, but what I was really surprised by was the fact that everything I needed to do could be done without any authentication at all. I didn't need oAuth, I didn't need an API key, I just hit public endpoints and everything just worked.
Logo is a programming language designed in the 60s. Its most famous feature is turtle graphics: the programmer controls the "turtle" (cursor) with instructions like forward, left, right, repeat and the turtle leaves a 'trace' on the screen. Today we'll build a compact, single-file logo interpreter in about 100 lines of pure JavaScript. To keep the code short, we'll only implement the four instructions above, plus color_cycle (not part of the standard Logo) that cycles through 36 HSV hues.
Annotate Image is a JavaScript image annotation library that creates Flickr-style comment annotations on images. You can draw rectangular regions on any image and attach interactive hotspots and notes to those regions. Version 2.0 is a complete TypeScript rewrite that works standalone with vanilla JavaScript or integrates with jQuery, React, and Vue. It's ideal for building photo galleries, design review tools, or any application requiring collaborative image markup.
Company CEO David Mytton said the release of v1.0 of its Arcjet JavaScript SDK makes it possible for developers to address many of the issues as applications are being developed that DevOps teams would otherwise need to address later in the software development lifecycle (SDLC). Additionally, Arcjet is beta testing a similar SDK for Python developers, who often have even less application security expertise, added Mytton.
For today, I'm going to demonstrate something that's been on my mind in a while - doing summarizing of PDFs completely in the browser, with Chrome's on-device AI. Unlike the Prompt API, summarization has been released since Chrome 138, so most likely those of you on Chrome can run these demos without problem. (You can see more about the AI API statuses if you're curious.)