mg

Joined 15 years ago

Karma
7,565
Submissions
1,633
Member since
Aug 19
I like to build web projects and to meet like-minded people.

www.gibney.org

View on Hacker News

Recent submissions

Comment · 28 days ago
The great thing with software is you can write your own functions. It would look something like this:

    function html(strings, ...values) {
      let result = strings[0];
      for (let i = 0; i < values.length; i++) {
        result += escapeHtml(values[i]);
        result += strings[i + 1];
      }
      return result;
    }
Comment · 28 days ago
> If you interpolate it, you have to escape manually

Well, for some definition of "manually".

If you have untrusted variables to interpolate, you can do

    this.innerHTML = html`Hello ${name}!`
Where html is a function that escapes the variables.

The arguments brought forward against web components all seem to fall under "But it does not contain every functionality you want to use out of the box". Personally, I don't think browsers should provide more and more functionality, but rather a good base to build upon.

Comment · 28 days ago
Comment · 1 month ago

    give it a normal text prompt, and it
    continues that prompt by searching
    for the byte sequences that compress
    best.
One moment, how are we supposed to know how well that search was done? There is no way to search a meaningful part of the search space.

So the result only gives us some lower bound of how well gzip works as a "plausibility tester" of a continuation of a text. The space of possible sequences is many orders of magnitude larger than what was searched. So there might be sequences in there that compress much better.

The text mentions beamsearch, but I don't see a discussion about how well beamsearch performs in finding the global optima when it comes to gzip compressibility of a text?

Comment · 1 month ago

    For business profits to rise, people need
    to to have disposable income
Does it matter, if the business pays employees who then use their salary to buy goods from the business or if the government collects taxes and uses that to pay for the goods? The government could also give the taxes to the people, so they have disposable income.

Imagine an island with two people on it and there is one tree that grows apples. And every other day, one of the two people climbs the tree and picks apples so they both have something to eat. Then the next day, the other person owes to climb on the tree because they are in debt to the first person.

Now, let's say one day, one of them discovers, hey, we can just give the tree a kick and the apples fall down on their own!

With the perspective you are proposing, the other one would have to say: Oh my God, don't do it! We will be out of work and starve!

Comment · 1 month ago
Taking that logic of protecting users from themselves to the extreme, a website should not be able to display text either. Because it can use text to ask the user to open their explorer and delete the files manually.

I think the flow of Chrome where the user has to select a file from disk and then acknowledge a prompt that the site will have access to that file until they close the window is fine. But if Mozilla wanted to protect users from themselves even more, they could make it as strong as they like. For example, by requiring to turn the functionality on in about:config.

Not giving the user the choice at all, if they want a cloud only browser or a browser that lets them work with local files is the wrong way.

Comment · 1 month ago
As AI becomes more and more capable and integrated into our lives, we will see this across many industries.

In theory, as things get cheaper to produce, business profits should rise and governments should be able to raise more taxes. So the government then has more means to provide goods and services for free to people who need them.

Comment · 1 month ago
Firefox unfortunately does not support the File System Access API. You can try by calling the most fundamental function, the one that asks the user to select a file:

    window.showOpenFilePicker()
What Firefox supports is a "File System API" which creates something similar to the other old ways of storing data in a browser, like cookies and indexeddb. You cannot use it to edit normal files on your disk.

This is my main gripe with Firefox. They force their users to either store everything in the cloud or go through the arcane "download" workflow where you have to manually save files.

Comment · 1 month ago
Comment · 1 month ago
For me, the appeal of HN is the DIY attitude.

In that regard AI fits the bill well. Because many of the AI related posts are about tools one can immediately tinker with.

While a new type of laptop cooling might become interesting once the laptops come out, the news is not as interesting to me as a new LLM or agent that I can experiment with right away.

Comment · 2 months ago
> Here’s a book_table tool. It takes a date, a time, and a party size. Call it.

Why not offer a simple form that humans and AI can use alike?

    <form action=book_table>
      <input type=date name=date>
      <input type=time name=time>
      <input type=number name=party_size>
      <input type=submit value="Book table">
    </form>
Comment · 2 months ago
I use the bookmarklet below.

It jumps to the newest story on the frontpage. And when I click the bookmarklet again (or press "n") it jumps to the next. So I just click it until I land on a story I have already seen and know I have seen them all.

If you want to use it, you can convert the code into a bookmarklet with my bookmarklet editor:

https://www.gibney.org/bookmarklet_editor

The bookmarklet:

    if (!location.href.match('ycom'))
        location.href='https://news.ycombinator.com';

    doTheMagic = function() {
        if (typeof e!=='undefined')
            e.style.background='#c0c0c0';
        e=Array.from(
            document.querySelectorAll(
                '.age a:not(.seen)')
        ).sort().at(-1);
        e.style.background='#ff0';
        e.classList.add('seen');
        e.scrollIntoView({
            behavior:"smooth",
            block:"center",
            inline:"nearest"
        });
    }

    function addShortcuts() {
        document.addEventListener("keydown", function(evnt) {
            if (evnt.key === "n") doTheMagic();
        });
    }

    function addStyle() {
       let style = document.createElement('style');
        style.type = 'text/css';
        style.textContent = `
            .noshow {
                display: initial;
            }
        `;
        document.head.appendChild(style);
    }

    if (typeof theMagicIsActive=='undefined') {
        addShortcuts();
        addStyle();
        theMagicIsActive = true;
    }

    doTheMagic();
Comment · 2 months ago
Comment · 2 months ago
Comment · 2 months ago
Cars that are idle 95% of the time are replaced less than once in a decade.

Cabs are replaced something like 3x more often than privately owned cars. And when they run 24/7 because of self-driving, that factor will even increase.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton