HN user

bazzargh

2,328 karma
Posts32
Comments649
View on HN
www.cornant.uk 4y ago

Swing Cranks for Disabled Cyclists

bazzargh
4pts1
probablydance.com 6y ago

Measuring mutexes, spinlocks and how bad the Linux scheduler is

bazzargh
331pts93
github.com 8y ago

Mezzo is a Haskell library and embedded DSL for music description

bazzargh
7pts0
www.joachim-breitner.de 9y ago

Veggies: Haskell code generation from scratch

bazzargh
3pts0
web.stanford.edu 10y ago

How to Build Static Checking Systems Using Orders of Magnitude Less Code [pdf]

bazzargh
6pts0
googletesting.blogspot.com 10y ago

Flaky Tests at Google and How We Mitigate Them

bazzargh
1pts0
www.cartoonbrew.com 10y ago

Toonz Software Used by Studio Ghibli Being Made Free and Open Source

bazzargh
18pts5
github.com 10y ago

Collection of tests and tools to help diagnose WebRTC systems

bazzargh
3pts1
techblog.livingsocial.com 11y ago

After the Hero Comes

bazzargh
12pts0
news.ycombinator.com 11y ago

Ask HN: Having Trouble with Google Public DNS?

bazzargh
1pts3
www.acwa.com 11y ago

Status of Response to 2014 California Drought

bazzargh
1pts0
theodi.org 12y ago

Open Addresses: Discovery Phase

bazzargh
1pts0
devopsbox.es 12y ago

How to test tricky nginx rewrite rules

bazzargh
1pts0
codegolf.stackexchange.com 12y ago

Draw a sun map – on faces of a cube

bazzargh
1pts0
theodi.org 12y ago

2014: The Year of CSV

bazzargh
2pts0
devcomo.2013.nodeknockout.com 12y ago

FFmpeg, compiled into JavaScript and running in your browser

bazzargh
5pts0
blogs.oracle.com 12y ago

Finding nuggets in ARC discussions

bazzargh
2pts0
open.bekk.no 12y ago

Retire.js - identify JS libraries with known vulnerabilities in your application

bazzargh
9pts1
udel.edu 12y ago

Myths of Human Genetics

bazzargh
6pts0
kmoddl.library.cornell.edu 12y ago

Kinematic Models for Design Digital Library

bazzargh
1pts0
turtle-roy.herokuapp.com 12y ago

Fun programming in Roy with Turtle Graphics

bazzargh
1pts1
www.cyclestreets.net 13y ago

CycleStreets looking for routing engine developer

bazzargh
10pts9
blog.brownplt.org 13y ago

Teaching the Essentials of Garbage Collection

bazzargh
89pts10
allievi.sssup.it 13y ago

Duetto: A faster and smarter alternative to Emscripten.

bazzargh
10pts1
www.go4awalk.com 13y ago

SARLOC: Mountain Rescue app to help locate hill walkers in trouble (2012)

bazzargh
1pts1
www.blackpawn.com 13y ago

How to test if a point is in a triangle

bazzargh
1pts0
abandonedwig.info 13y ago

Edge-distance anti-aliasing

bazzargh
1pts0
www.thepaypalblog.com 13y ago

Paypal announces FIDO Alliance for passwordless authentication

bazzargh
1pts0
we-make-money-not-art.com 13y ago

OpenPositioningSystem - GPS alternative with seismic sensors

bazzargh
1pts1
www.ipo.gov.uk 13y ago

Plans for UK Copyright reform announced [pdf]

bazzargh
1pts0

Our experience has been the direct opposite. The way to get the most out of cursor was to leave it on auto - we saw it average around 3.9 cents per request under the old contract (per-seat pricing) and more like 39 cents per request under the new (single pooled cost for everyone). Composer came in a little higher, more like 50c/r, while the claude models were up into the dollars. Meanwhile, if you use Claude-the-app, there is _no_ cheap model and the default switched to Opus in April, resulting in increased costs across the board.

We have both Claude and Cursor here, as well as agents running GPT, things in AWS Bedrock, etc and its my team handle the bills...when people use Cursor on auto, costs are under control, but there's always a dozen or so whale users who'll switch models manually and blow through the budget like it's not there.

Another thing: "better cost controls". There was for example no way for us to disable Fable in Claude, but we could in Cursor. Again, the opposite experience.

I quite enjoyed their Omega Mart in Vegas. Was there for work and gambling, shows, and gun ranges are really not my thing, glad there was something different. (I did wander round the strip but enjoyed the hike in Red Rock Canyon more)

When we went we got the priority tickets (can't remember the exact name of the deal) because there were no normal slots left that day; that does get you discounts on stuff but awkwardly the discount is at the gift shop _outside_ and it wasn't clear whether there were things at the fake supermarket checkout _inside_ that you couldn't get outside. It also gets you the card you boop for the scavenger hunt which makes you more involved in the whole thing. So yeah, they got us for some extra cash but it wasn't so bad as a one-off.

I think maybe https://oeis.org/A263499

You can shorten the candidates list quite a bit: https://oeis.org/search?q=author%3A%22Chai+Wah+Wu%22+2015+Pr...

The article says "Spring 2015" but in fact the magazine was published December 29, 2015. In the text it mentions https://oeis.org/history?seq=A250001 so the interview could not have been earlier than October 2015; Wu's sequence is "recent".

There's a few sequences that jump out, this one, and the prime palindromes of 0's and 1s whose squares are palindromes; but that was August and seems too early.

I was doing something related for genuary recently, but with different constraints - I wanted to make a photgraph look painted in a fauvist style, with visible brushstrokes (and a vivid, unrealistic colour scheme). When you're overlaying many, many strokes like that you end up hiding the errors but also hiding the digital brushtrokes; with very few strokes, placement becomes important.

Instead of just stroking with the average colour, I chose to only connect points that were similar in colour (because of the fauvist thing, I was mainly interested in hue; the paints are all intense). By doing this, I was trying to be edge preserving, without explicitly calculation, eg of the Sobel operator.

It kinda worked in that the edges came out clearly; the resulting painting was messy tho; the thick brushstrokes and the colours are intentional, but the brushstrokes going in random directions is not https://media.hachyderm.io/media_attachments/files/115/894/8... compare to an actual fauvist work, https://en.wikipedia.org/wiki/Robert_Delaunay#/media/File:Ro... which still has the 'dithered' look to the face but the strokes are deliberately aligned, I'd fix that if I try again. (Delaunay also uses small strokes for detail, a thing I wasn't going to try in a throwaway program)

An earlier attempt at generating pencil sketches from photos - again, keeping the number of strokes small, and using parallel strokes for hatching - worked much better https://media.hachyderm.io/media_attachments/files/112/767/4... (it's just sobel to find edges and a bit of sampling with a filter to decide where to shade)

You would find things in there that were already close to QM and relativity. The Michelson-Morley experiment was 1887 and Lorentz transformations came along in 1889. The photoelectric effect (which Einstein explained in terms of photons in 1905) was also discovered in 1887. William Clifford (who _died_ in 1889) had notions that foreshadowed general relativity: "Riemann, and more specifically Clifford, conjectured that forces and matter might be local irregularities in the curvature of space, and in this they were strikingly prophetic, though for their pains they were dismissed at the time as visionaries." - Banesh Hoffmann (1973)

Things don't happen all of a sudden, and being able to see all the scientific papers of the era its possible those could have fallen out of the synthesis.

it works for any number of integers. The first proof above (before tl;dr) is showing that every positive integer has a unique representation as a sum of distinct powers of 2, ie binary, and that no two integers have the same representation. You can watch a lecture about the representation of sets in binary here https://www.youtube.com/watch?v=Iw21xgyN9To (google representing sets with bits for way more like this)

But again it's not useful in practice for very sparse sets: if you have say a million players, with at most 10 at the same poker table, setting 10 bits of a million-bit binary number is super wasteful. Even representing the players as fixed size 20-bit numbers (1 million in binary is 20 bits long), and appending the 10 sorted numbers, means you don't need more than 200 bits to represent this set.

And you can go much smaller if all you want is to label a _bucket_ that includes this particular set; just hash the 10 numbers to get a short id. Then to query faster for a specific combination of players you construct the hash of that group, query to get everything in that bucket (which may include false positives), then filter this much smaller set of answers.

I'm saying it's a tautology because it's just a binary representation of the set. Suppose we have 8 players, with x and y being 2 and 4: set the 2nd and 4th bits (ie 2^2 & 2^4) and you have 00001010.

But to lay it out: every positive integer is a sum of powers of 2. (this is obvious, since every number is a sum of 1s, ie 2^0). But also every number is a sum of _distinct_ powers of 2: if there are 2 identical powers 2^a+2^a in the sum, then they are replaced by 2^(a+1), this happens recursively until there are no more duplicated powers of 2.

It remains to show that each number has a unique binary representation, ie that there are no two numbers x=2^x1+2^x2+... and y=2^y1+2^y2+... that have the same sum, x=y, but from different powers. Suppose we have a smallest such number, and x1 y1 are the largest powers in each set. Then x1 != y1 because then we can subtract it from both numbers and get an _even smaller_ number that has distinct representations, a contradiction. Then either x1 < y1 or y1 < x1. Suppose without loss of generality that it's the first (we can just swap labels). then x<=2^(x1+1)-1 (just summing all powers of 2 from 1..x1) but y>=2^y1>=2^(x1+1)>x, a contradiction.

or, tl;dr just dealing with the case of 2 powers: we want to disprove that there exists a,b,c,d such that

2^a + 2^b = 2^c + 2^d, a>b, c>d, and (a,b) != (c,d).

Suppose a = c, then subtract 2^a from both sides and we have 2^b = 2^d, so b=d, a contradiction.

Suppose a>c; then a >= c+1.

2^c + 2^d < 2^c + 2^c = 2^(c+1).

so

2^c + 2^d <= 2^(c+1) - 1 < 2^(c+1) + 2^b <= 2^a + 2^b

a contradiction.

The typo is most likely the extra /, in (x/y)/(x^2+y^2) instead of (xy)/(x^2+y^2).

`2^x & 2^y ...is the & a bitwise operator...???? That would produce a unique ID? That would be very interesting, is that provable?`

Yes, & is bitwise and. It's just treating your players as a bit vector. It's not so much provable as a tautology, it is exactly the property that players x and y are present. It's not _useful_ tho because the field size you'd need to hold the bit vector is enormous.

As for the problem...it sounds bloom-filter adjacent (a bloom filter of players in a hand would give a single id with a low probability of collision for a set of players; you'd use this to accelerate exact checks), but also like an indexed many-to-many table might have done the job, but all depends on what the actual queries you needed to run were, I'm just idly speculating.

It looks like you have typos? (x^2+y^2)+(sin(atan(x/y))*cos(atan(x/y))) reduces to x^2+y^2+( (x/y) / (x^2/y^2 + 1) ) - not the equation given? Tho it's easier to see that this would be symmetrical if you rearrange it to: x^2+y^2+( (xy) / (x^2+y^2) )

Also, if f(x,y) = x^2+y^2+( (x/y) / (x^2+y^2) ) then f(2,1) is 5.2 and f(1,2) is 5.1? - this is how I noticed the mistake. (the other reduction gives the same answer, 5.4, for both, by symmetry, as you suggest)

There's a simpler solution which produces integer ids (though they are large): 2^x & 2^y. Another solution is to multiply the xth and yth primes.

I only looked because I was curious how you proved it unique!

The boids in this demo form smaller flocks (both tighter, and fewer individuals) than other implementations I've seen. I had a look at the code and I'm not sure it's "right"? (I know the whole thing is subjective, I mean it doesn't follow the original)

In no particular order:

- the original boids code didn't cap the magnitude of acceleration after adding all the contributions; it added the contributions _by priority_, starting with separation, and if the max acceleration was exceeded it didn't add the others

- the max acceleration was decided by adding the _magnitudes_ not vectors of components, so the cohesion vector and the separation vector wouldn't cancel out - separation would win. I think this is why both this and the p5js one form very tight clumps which later "explode". That's this bit of the code (from https://www.red3d.com/cwr/code/boids.lisp):

    ;;
    ;; Available-acceleration should probably be 1.0, but I've set it a little higher to
    ;; avoid have to readjust the weighting factors for all of the acceleration requests.
    ;;
    (vlet* ((composite-acceleration (prioritized-acceleration-allocation 1.3 ;; 1.0
          avoid-obstacles
          avoid-flockmates
          velocity-matching
          centering-urge
          migratory-urge
          course-leveling
          course-damping))
- this implementation, unlike the p5js version it's based on, caps the acceleration _twice_ - before adding the contributions and after https://github.com/LauJensen/practical-quadtree/blob/7f5bdea... (this is the 'after' bit)

- the original had different radii for different components (the separation threshold was 4, the cohesion, alignment thresholds were 5)

- both the clojure and p5js versions use the same strength for cohesion, separation, and alignment. In the original, separation is much stronger (1, vs 0.3 for cohesion and 0.23 for alignment). Again this might explain the tight clumps.

I've not yet mucked with the rules to see if the behaviour recovers, but the p5js version makes it easy to hack on https://editor.p5js.org/pattvira/sketches/v_tmN-BC5 - as a first change, in draw() in sketch.js change the print statement to this:

    print(frameRate(), boids.length);
    if (frameRate()>50) {
      boids.push(new Boid(random(width), random(height)));    
    } else if (frameRate() < 40) {
      boids.pop()
    }
... and the two loops below it to use 'boids.length' not 'num'. Then the thing will dynamically adjust the number of boids to give you an acceptable framerate.

Aside: both the p5 and clojure versions do preserve the typo of 'seperation' from the Craig Reynold's code tho ;) ... I have to wonder if that's like 'referer' and now we have to spell it that way in a boids context.

On the subject of whisper being great... A few weeks ago a co-worker commented about the difficulty he'd had editing a work demo, I pointed at various jump-cutting tools that had automated what he did in the past (editing out silences). But I'd also wanted to play with whisper for a while...

So a couple of hours later I'd written a script that does transcription based editing: on the first pass it grabs a timestamped transcript and a plain text transcript for editing; you edit the words into any order you like and a second pass reassembles the video (it's just a couple of hundred lines of python wrapping whisper and ffmpeg). It also speeds up 4x any silences detected that sit within retained sequences in the video.

Matching up transcripts turns out to be not that hard; I normalise the text, split it, and then compare to the sequence of normalised words from the timestamped transcript. I find the longest common sequence, keep that, then recurse on the before/after sections (there's a little more detail, but not much). I also sent the transcription to ffmpeg to burn in as captions, because sometimes it makes the audio choppy and the captions make it easier to follow.

I know, tools have been doing this for years now. I just didn't have one to hand, and now I do, and I couldn't have done this without whisper.

That's an odd take. Teams doesn't have the leading market share in videoconferencing, Zoom does. I can't judge what it's like because I've never yet had to use Teams - not a single company that we deal with uses it, it's all Zoom and Chime - but I do hear friends who have to use it complain about it all the time. (Zoom is better than it used to be, but for all that is holy please get rid of the floating menu when we're sharing screens)

Marble Fountain 8 months ago

One of the results for hilbert curve marble tracks, mentioned elsewhere in the thread, was a video showing how to make one in blender, which has a physics engine so it can simulate it pretty well.

https://www.youtube.com/watch?v=8YeXyUNCnhM

I'd imagine that the 3d-printable models could be imported into blender, so it's 'just' adding balls and motion to the lift.

You can also get reasonable results from using quasirandom sequences https://extremelearning.com.au/unreasonable-effectiveness-of... - which are trivial to generate.

That's the kind of thing I use dithering on BBC Micro because it's such a cheap technique, here in a thread directly comparing to Bayer-like dithering https://hachyderm.io/@bbcmicrobot@mastodon.me.uk/11200546490... or here faking the Windows XP desktop https://hachyderm.io/@bbcmicrobot@mastodon.me.uk/11288651013...

In the code I saw, at least twice in its history people had introduced a "pure lua" solution for speed, and were clearly unaware of the shotgun they'd just pointed at their feet. (as in, somebody saw the issue and fixed it, and then someone else _fixed it back_ before I came along).

But in case _I'm_ messing up here, I'll bow to your expertise: libuuid uses /dev/random, which uses a CSPRNG (ChaCha20) with entropy ingested via Blake2 from whatever sources the system can get, right?

We did actually do a bunch of before/after testing showing the collision rates (zero after), and I believe the cookie in question has been replaced with a third party identity system in the intervening years - but if we did it wrong, I'd like to know.

A word of caution. A few years ago we had a production impact event where customers were getting identical cookies (and so started seeing each others sessions). When I took a look at the code, what I found was that they were doing something very like your code - using a time() based seed and an PRNG.

Whenever we deployed new nginx configs, those servers would roll out and restart, getting _similar_ time() results in the seed. But the individual nginx workers? Their seeds were nearly identical. Not every call to the PRNG was meant for UUIDs, but enough were that disaster was inevitable.

The solution is to use a library that leverages libuuid (via ffi or otherwise). A "native lua" implementation is always going to miss the entropy sources available in your server and generate clashes if it's seeded with time(). (eg https://github.com/Kong/lua-uuid, https://github.com/bungle/lua-resty-uuid)

Absolutely you can. The places in France and Spain I've flown to just suggest you bring your own pedals, so they match your shoe cleats; they'll fit them before your hire. You can usually bring your own saddle too. It's far more convenient than bringing the bike.

I've also done it the other way, my main bike has S&S coupling so I could bring it aboard the Eurostar. For touring I prefer my own bike, because I have the racks set up for my panniers, but when I do that, I prefer travelling by ferry/train.

to me it doesn't look great that Perplexity use BrowserBase at all. I asked BB's doc bot if you can customise the user agent; it says you can't because it sets the user agent automatically _in order to bypass bot checks_.

This seems to be the only secret sauce they offer; other than that it's just a headless browser farm. So perplexity saying "companies like Cloudflare mischaracterize user-driven AI assistants as malicious bots" is disingenuous at best; they chose to use a tool designed to mask their traffic and it blew up in their face?

I managed to get some decent results using this algorithm (not at my own computer so can't post code, yet):

- create a smaller greyscale copy of the image, and use sobel to calculate gradients (smaller to speed this up)

- set a gradient magnitude threshold, and add those points to a queue, largest first.

- for these points, add 2 squares, one either side of the queued point, in the direction of the gradient (ie you expect one to be light and one dark)

- add the squares to a location hash as they are placed. (I'm using a grid size slightly larger than my square tiles). The location hash is to speed up comparisons.

- skip placing a square if it would fall within a small radius of a previous square's centre (I used 0.5 of a square size). When looking up a point in the location hash, remember to look not for the point itself, but for the hash values for the corners of an axis-aligned square with your point at the centre; this is to catch overlaps when the point falls need grid lines.

- once all points in this queue have been processed or skipped, we start on a new queue, containing all squares placed so far.

- for each square in the queue, try to place a new square to its north, south, east and west along its alignment; as before skip these if they overlap too much

- any squares we place - jitter their position and angle slightly (otherwise it looks horribly unnatural)

- any squares we do place, add them to the phase 2 queue.

The first phase is quite slow, set the threshold high. Second phase placement is very fast. My squares all use a grey stroke the same grey as the background for the grout effect, and the squares are drawn using the colour of the point picked as the square's centre (I don't bother averaging). I have it rendering this interactively, using requestAnimationFrame, so it doesn't clog up the browser - I add about 50 tiles per frame

I'm looking at one it did of the mona lisa; it places the phase 1 tiles along her hairline and hand in a nice "vermiculatum" way, the phase 2 placement is less satisfying but with jitter it seems ok. Originally I'd thought about calculating where squares overlap and cutting tiles nicely but it was quicker just to _allow_ the overlap and so most of what you see are the whole tiles placed on top of partials. The overall effect isn't _quite_ like hand placed tiles but I like it better than a grid.

You can see a couple of output images here. https://hachyderm.io/deck/@bazzargh/114938616011157584

While this is nice enough, it bothers me that these don't look much like "art". If you look at real roman mosaics, they do not place points in a grid - they use a technique called "opus vermiculatum" https://en.wikipedia.org/wiki/Opus_vermiculatum ... snaking the tiles around so that there is a flow to it; the overall effect is much better.

I think that'd be possible to automate too. I was doing something related over here: https://hachyderm.io/@bazzargh/112767548339559102 - in that I was trying to generate sketch-like renderings from photographs. What I did was to pick random points, look at the brightness gradient (taken from the Sobel operator, there are other ways to do this), move up the gradient a bit and sketch some parallel lines (and then various experiments with hatching for shading the flatter areas)

In a similar way you could start with a grid of tiles _with some separation_, and allow them to move and align better with the gradient of the underlying picture, and not lie _on_ edges, if possible. If they overlap, allow the tessera to be cut, and only then choose images to colour-match the average on the tile, leaving some "grout" in the image (I'd probably speckle that a bit so it didn't look too uniform). Then the result might look more like real mosaics.

I might give this a go...

This is frustratingly difficult to understand from the site because they never include a human in the photos for scale (though the text says it's 3m in diameter). This video is a bit better https://www.youtube.com/watch?v=BvL0T5xyG5E ... it shows a cutaway in a scale model that makes it clearer where people stand, pictures of people painting the exterior and video of the globe in motion. I can't find any of what it looks like inside while in motion, which would have been nice. I guess I'll just have to go visit!