HNHacker News
TopNewBestAskShowJobs

mg

7,565 karma · joined August 19, 2011

I like to build web projects and to meet like-minded people.

www.gibney.org

submissionscomments
mg··on Cash: A small jQuery alternative for modern browsers
Browsers have become so nice to work with, that these days, I get away with just the following two lines of code to simplify DOM manipulation:

    dqs  = document.querySelector.bind(document);
    dqsA = document.querySelectorAll.bind(document);
So instead of

    country = document.querySelector('#country');
    cities  = document.querySelectorAll('.city');
I can write

    country = dqs('#country');
    cities  = dqsA('.city');
For everything else, I am fine with just using the native browser functions.

I usually import the two functions from a module like this:

import { dqs, dqsA } from '/lib/js/dqs.js';

This is the module:

https://github.com/no-gravity/dqs.js

mg··on Pushing the frontiers of audio generation
Is there a free (ad supported?) online tool without login that reads text that you paste into it?

I often would like to listen to a blog post instead of reading it, but haven't found an easy, quick solution yet.

I tried piping text through OpenAI's tts-1-hd, model and it is the first one I ever found that is human like enough for me to like listening to it. So I could write a tool for my own usecase that pipes the text to tts-1-hd and plays the audio. But maybe there is already something with a public web interface out there?

mg··on Family medicine is in decline
I wonder what percentage of medical issues we could tackle by better analyzing and categorizing the existing medical studies that are out there.

And then attaching a user interface to the data that guides the user through a step-by-step self-diagnose process.

mg··on Subvert – Collectively owned music marketplace
I run a self-learning music discovery engine called Gnoosic:

https://www.gnoosic.com

I can confirm that when you suggest a random band to a random user, they will dislike it with over 90% probability.

I'd be interested to hear how well Gnoosic works for your musical taste.

mg··on Ask HN: Founders, what was the major sourcing channel for your first 100 users?
Hacker News :)

It was this Show HN:

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

That was before showing something on HN was called "Show HN" though.

mg··on Show HN: A VSCode Extension to edit HTML visually in real-time
I like to use standalone tools with no dependencies, so I made this open source html editor with instant preview as a single html page:

https://github.com/no-gravity/html_editor

It has a few convenience functions already. Open for pull requests.

mg··on Google is preparing to let you run Linux apps on Android, just like Chrome OS
It sounds like this would make Android devices more useful for developers, which is a good thing. Although I am pretty happy with building what I need via web apps these days.

The one thing I am missing on Android is that Chrome on Android does not yet support the File System Access API. So you can't make web applications which let the user store their data locally:

https://caniuse.com/mdn-api_window_showopenfilepicker

It looks like they are working on it:

https://issues.chromium.org/issues/40101963

The last commit related to this feature seems to be from from 2 days ago.

I have my fingers crossed that it will be available soon.

mg··on Nearly all of the Google images results for "baby peacock" are AI generated
Well, nearly all of the Google Images results for "Woman" show a woman with makeup and additionally the photos were altered via Photoshop.

We have been creating our own reality even before AI.

mg··on Python 3.13.0 Is Released
Hmm.. I think this is a misunderstanding.

What I meant is: While I am already inside a container running Debian, can I ...

    1: ./myscript.py
    2: some_magic_command
    3: ./myscript.py
So 1 runs it under 3.11 (which came with Debian) and 2 runs it under 3.13.

I don't need to preserve 3.11. some_magic_command can wrack havoc in the container as much as it wants. As soon as I exit it, it will be gone anyhow.

The in a sense, the question is not related to Docker at all. I just mentioned that I would do it inside a container to emphasize that I don't need to preserve anything.

mg··on Python 3.13.0 Is Released
When I'm in a docker container using the Python 3 version that comes with Debian - is there an easy way to swap it out for this version so I can test how my software behaves under 3.13?
mg··on Show HN: Instant HTML Preview Bookmarklet
Nice one!

Some observations:

This fork throws errors in my console. It seems you added a Cloudflare statistics script that does not work in my browser.

This is also a fork of an old version. Where for example "let x=7" in a script block will error out on the second run.

If you find the time to make a pull request for the vert switcher, we can join forces!

mg··on Show HN: Instant HTML Preview Bookmarklet
I have various problems with these. That's why I made my own.

Some of the problems are:

You can't edit the raw HTML because the site injects additional stuff into the HTML you write.

Editing is sluggish because of the heavy processing the site does on every keystroke.

The console gets flooded with stuff not related to the code you write.

mg··on Show HN: Instant HTML Preview Bookmarklet
Another approach is to paste it into an online HTML editor with preview. Here is one that I made:

https://no-gravity.github.io/html_editor/

This has the benefit that you can also edit the html afterwards.

It also has the function to render the HTML into an image (Via the "Render" button). I wonder if one could feed that image back to ChatGPT to provide visual feedback on what it coded? Maybe it would reply with "Oh, now that I see it, let's make the margins on the header a bit smaller and the background a bit more colorful" :)

mg··on Popular gut probiotic craps out in randomized controlled trial
Yes, that might be helpful.

First attempt:

    Insignificant does not mean ineffective
Not as good as "correlation isn't causation" though. I wonder if there is a better quip. Or if the concept is too complex to wrap in a catchy statement.
mg··on Popular gut probiotic craps out in randomized controlled trial
There is a lot of confusion on how to interpret studies.

The reasoning of this article seems to be "The study did not produce a significant result, therefore the treatment is ineffective".

But that is not how to think about significance.

Otherwise, you could show for any treatment that it is ineffective. By simply doing a study small enough to produce an insignificant result.

mg··on Liquid Foundation Models: Our First Series of Generative AI Models
I tried my standard testprompt:

    Two cars have a 100 mile race. Car A drives 10
    miles per hour. Car B drives 5 miles per hour,
    but gets a 10 hour headstart. Who wins?
And the Liquid-40B model failed with a long explanation why car B wins the race.

Amusingly, the explanation is quite convincing and very similar to how Zeno explains in one of his paradoxes that a fast runner can never overtake a slower runner with a headstart. Because every time the fast runner gets to the point where he saw the slow runner, the slow runner is already a bit further along the track.

mg··on Chain of Thought empowers transformers to solve inherently serial problems
Has it been publicly benchmarked yet, if this approach:

    Hello LLM, please solve this task: <task>
Can be improved by performing this afterwards?

    for iteration in range(10):
        Hello LLM, please solve this task: <task>
        Here is a possible solution: <last_reply>
        Please look at it and see if you can improve it.
        Then tell me your improved solution.
mg··on The HTTP Query Method
The first example shows a GET request and states that it is "common and interoperable query". But that "if the query parameters extend to several kilobytes or more of data it may not be, because many implementations place limits on their size".

So how about simply removing those limits on GET requests?

mg··on Why Haskell?
TL/DR: Haskell makes you add more meta information to the code, so that compilers can reason about it.

One of the examples in the article:

Python:

    def do_something():
        result = get_result()
        if result != "a result":
            raise InvalidResultError(result)
        return 42
Haskell:

    doSomething :: Either InvalidResultError Int
    doSomething = 
        let result = getResult
            in if result /= "a result"
                then Left (InvalidResultError result)
                else Right 42
Personally, I prefer the Python version. In my experience, the benefits of adding meta information like types and possible return values are very small. Because the vast majority of time fixing problems in software development is spent on systematic bugs and issues, not on dealing with type errors.
mg··on Radicle 1.0 – A local-first, P2P alternative to GitHub
Yes. Say Joe just finished the 1000-add_logout_button.txt task and committed it with the following content:

    owner: mg

    info:

        2024-09-03 17:02
        I added the logout button. Settled on rounded
        corners which we haven't used before but I think
        they look good here.
        /Joe
I might change the file like this and commit it, so it goes back to Joe and he sees my comment:

    owner: Joe

    info:

        2024-09-03 17:02
        I added the logout button. Settled on rounded
        corners which we haven't used before but I think
        they look good here.
        /Joe

        2024-09-04 09:10
        Fine with the rounded corners. The styles should
        go into styles.css instead of the html though.
        /mg
mg··on Radicle 1.0 – A local-first, P2P alternative to GitHub
Everybody works on a fork on their own machine.

Since everybody pulls the changes of the others and sees if something collides with their own changes, its pretty much possible to do it manually. Thats how I started this approach.

It's really just a 0815 git based workflow. Just not for code but for a tasklist.

Meanwhile I wrote a bit of tooling around it. But using it is not at all a must.

mg··on Radicle 1.0 – A local-first, P2P alternative to GitHub
These days when I collaborate with other developers, we do it all in a git repo that is simply hosted on a VM everyone has ssh access to.

Project management is done in a plan/ directory which has task entries like

    1000-add_logout_button.txt
Where 1000 is the priority.

There is also a directory plan/done/ where tasks go that have been completed. In the plan/done/ directory, the priority gets replaced by the completion date, so it looks like this:

    2024-09-04-add_logout_button.txt
This has a bunch of nice consequences. Some of them are:

Task management does not need any software or logins.

Task management can be done directly in Vim by simply looking into and editing the plan/ directory.

Task history is nicely versioned by git automatically.

All the tooling that comes with bash and git can be used on the plan/ dir. Like finding all tasks that contain the term "rounded corners" in the description is just

    grep -r 'rounded corners' plan/
mg··on I use Nim instead of Python for data processing (2021)
The optimizations the compiler can do because of the "var" the author added in the nim version of the first example should be also possible without it. Because Python defines variables as local or global at compile time.

The code looks like they avoided that by putting the code into the global scope?

If the code of the first example is what the author really ran, than he got a speed penalty for running the loop in the global scope.

One might consider it a bit of a quirk that Python code runs slower in the global scope. But in practice, it rarely matters. As a script with just a loop and no functions (not even a main function) is so rare.

mg··on LibreOffice Timeline
Every now and then I stumble over the problem that in LibreOffice, you cannot date-format the x-axis of a chart. So no x/y chart with lines at the 1st of every month for example.

https://x.com/marekgibney/status/1454757289043406849

It's a mistery to me how that is still not fixed.

mg··on 1M Users
He uses "vanilla PHP/HTML/MySQL":

https://x.com/AnTheMaker/status/1530851239310802947

mg··on Show HN: Typeform alternative, turns Markdown to forms
Well, you can define the syntax however you like in a new DSL, right?

I like the syntax notpushkin proposed and would extend it a bit like this:

    fruits* = MultiChoiceInput
        # Pick two out of three fruits
        Fruits are healthy, so let's pick two fruits
        you will eat every morning for the coming week
        - [ ] Apple
        - [ ] Orange
        - [ ] Banana
mg··on Show HN: Typeform alternative, turns Markdown to forms
It looks like it could be made leaner.

This:

    name* = TextInput(
        | question = What is your name?
        | description = 
          Let's get started with the survey. First, please tell
          us your full legal name according to your passport.
    )
Could be just this:

    name* = TextInput
        # What is your name?
        Let's get started with the survey. First, please tell
        us your full legal name according to your passport.
mg··on The semantic web is now widely adopted
We research all product data manually and then have AI cross-check the data and see how well it can replicate what the human has researched and whether it can find errors.

Actually, building the AI agent for data research takes up most of my time these days.

mg··on The semantic web is now widely adopted
The author gives two reasons why AI won't replace the need for metadata:

1: LLMs "routinely get stuff wrong"

2: "pricy GPU time"

1: I make a lot of tests on how well LLMs get categorization and data extraction right or wrong for my Product Chart (https://www.productchart.com) project. And they get pretty hard stuff right 99% of the time already. This will only improve.

2: Loading the frontpage of Reddit takes hundreds of http requests, parses megabytes of text, image and JavaScript code. In the past, this would have been seen as an impossible task to just show some links to articles. In the near future, nobody will see passing a text through an LLM as a noteworthy amount of compute anymore.

mg··on 6th-generation Waymo Driver
As far as I know, Alphabet has spent over $10B on Waymo so far.

That surely makes it one of the most expensive (in terms of development before reaching profitability) products of all time that were financed by the private sector?

I would love to see a list of the most expensive products the private sector developed in human history.

← PreviousPage 11 of 34Next →