News for hackers. Stuff that matters.

mgdlbp

Brings to mind the OK GO music video with all the exploded guitars that they stated were already junk. Spilled paint is reminiscent of their videos too.

They also smashed pianos in the Rube Goldberg video, and a TV with a sledge. Now I wonder if that was a 1984 reference.

https://www.youtube.com/watch?v=0BTnGgzO-tU https://www.youtube.com/watch?v=qybUFnY7Y8w

For the bridge only, Marti also made a more sufferable cut in German, that is on the OP channel (https://www.youtube.com/watch?v=VJLX3C0eg3g)

The segue from CG is much more sensible

Re:My favourite Git commit (2019) on Thursday February 01, 2024 @01:42PM (#39219554)
"quote unification'':

  most typefaces: “Hello” „Hallo“
Verdana: “Hello” „Hallo“
Re:NASA unlocks $1B canister of asteroid dust on Monday January 22, 2024 @03:54AM (#39087621)
That's a lot of hot pixels for base ISO! Could be the focus stacking intensified them.

That camera can actually get a bit more resolution out of sensor movements, though the lens might be at its limit already, or focus was still a little off. edit: it's probably the glovebox glass.

Re:Which command did you run 1731 days ago? on Sunday January 21, 2024 @07:45AM (#39077957)
a weaker method is to set a non-default HISTFILE after HISTSIZE etc
(re: dead comment 39066268) I'm now very interested in what Reiser would think of the present state of the (semantic) web. (edit: i.e, the thought experiment, realized: transplant someone just a few years in time --- what gradual changes would they uniquely observe?)
‹‹‹ "What a camera actually shows is its processor's reconstruction of objects based on input provided by the sensor — not the actual light received by its sensor."
Re:Elisp in Replacement String on Friday January 12, 2024 @04:12PM (#38974154)

  :%s/\([0-9]\+\))/\=submatch(1)-1.')'    " vim

  perl -pe 's/([0-9]+)\)/$1-1 .")"/e'

  ruby -pe 'sub(/([0-9]+)\)/){"#{$1.to_i-1})"}'
Re:CLI user experience case study on Friday January 12, 2024 @10:12AM (#38968953)
btw xterm has a hack for editors without mouse support – turn clicks into the right number of movement key presses,

  uxterm -xrm '*VT100.translations: #override !<Btn1Down>: vi-button() readline-button()'
(I don't think that's what most mean when they say 'chance', but I get what you mean ;) It's similar to realizing how seating choice radically alters your (very small) chance of death by train crash.

I was going to say 'chance of death on that day' but apparently rail transport is remarkably safe and in micromorts, you're as likely to die in one day at 20 years of age as in 10000 km by rail, or (only!) 1600 km by air.

Now, it appears that 1600 km is also nearly the distance of the average passenger flight (a disappointly difficult datum to discover on the internet in 2024). Is this a counterpart to the reassuring quips comparing the chances of death by lightning: that boarding a plane doubles your chances of dying that day?

https://en.wikipedia.org/wiki/Micromort#Travel

Re:There is an oom kill count in Linux on Sunday December 31, 2023 @12:33PM (#38825764)
Tangentially, an issue with the desktop use case is that the main process of a long-running browser is often the first to be killed, instead of one of its content processes, which it can survive losing. This is the case since 2019 as the kernel no longer prefers killing children.[0]

As far as I know, unless a browser manages its oom_score_adj, which none do, a wrapper is insufficient as a workaround and a daemon would have to do so on its behalf, because the value is inherited when forking.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

Re:Compare Google, Bing, Marginalia, Kagi, Mwmbl, and ChatGPT on Sunday December 31, 2023 @09:56AM (#38824459)
Internet Archive remembers. https://web.archive.org/web/*/google.com/search/%2A

Find a query of interest, see for yourself (and take a snapshot of the present state for posterity).

The api enables more powerful queries, https://web.archive.org/cdx/search/cdx?url=google.co.jp*&pag...

Also try other search engines and languages.

Re:There is an oom kill count in Linux on Sunday December 31, 2023 @09:19AM (#38824200)
Enable Alt+SysRq+F and do it manually. Works in seconds every time; the kernel can take days because it's not eager enough when thrashing.

Can have security implications, but the target is chosen in the typical way and screen locks should be setting a score_adj to avoid being picked.

Re:Gentoo Linux Goes Binary on Friday December 29, 2023 @12:34PM (#38807706)
a garden path sentence, but it parses.

[only on HN] could [any state [that Gentoo was ever in]] be [reflected upon [as "just worked like a breeze"] unironically]_,_ and [I] mean [that] [in a fond, loving way]

M-x eshell

  Welcome to the Emacs shell
  
  /tmp $ set-variable `x 6; echo $x
  6
  /tmp $ 
M-: (term "pwsh")

  PowerShell 7.4.0
  PS /tmp> set-variable `x 6; echo $x
  6
  PS /tmp> 
Disturbing.
Engines 3 and 4 are visible in a 2010 photo of the plane.¹ By 2015 the engine ducts had all been covered.² № 3 (the sold one) haphazardly so in the rear,³ though the inner nozzle that it should be attached to isn't part of the removed portion.

¹ https://commons.wikimedia.org/wiki/File:Concorde_(British_AW...

² https://commons.wikimedia.org/wiki/File:Concorde_2015-06_673...

³ https://commons.wikimedia.org/wiki/File:Concorde_2015-06_692...

Re:Why are we being DDoSed by Cloudflare? on Saturday December 02, 2023 @09:47AM (#38498944)
Wait, is that[0] MS Sans Serif? MS PGothic? What version of Windows would fall back to that in 2013?

[0] https://web.archive.org/web/20210826103144/http://www.crimef...

Re:Fish – Update on the Rust Port on Sunday November 26, 2023 @03:26PM (#38424688)
Additionally,

    $ f=-x
    $ cat "$f"
    cat: invalid option -- 'x'

    $ cat -- "$f"
    cat: -x: No such file or directory
    # ^-- correct

    $ f=-
    $ cat -- "$f"
    reading stdin...
    reading stdin...
    ^C

    $ cat ./-
    cat: ./-: No such file or directory
...better to glob with ./* than *
Re:Fish – Update on the Rust Port on Sunday November 26, 2023 @03:07PM (#38424517)
zsh, short loop:

    for i in {1..10}; <<<$i
powershell:

    foreach ($i in 1..10) { $i }

    1..10|%{$_}
Re:The bash book to rule them all on Saturday November 25, 2023 @05:24PM (#38417316)
The first answer is wrong, so is the second's explanation... twice it conflates unset with null/empty. Very illustrative!

The substance of the first answer:

    #!/bin/bash
    
    # Check if the first parameter is not provided
    if [ -z "$1" ]; then
        echo "Error: Parameter not provided."
        exit 1
    fi
The snippet precedes the true statement:

> This checks if the first parameter (`$1`) is empty.

But what happened to the supplied task? It was stated and echoed as:

> Anonymous: ...if it's not passed?

> ChatGPT: ...if a specific parameter is not passed...

> ChatGPT: ...if the parameter is set.

The second answer:

    #!/bin/bash
    : ${1?"Error: Parameter not provided"}
This is correct. But the explanation is not:

> ...and the `${1?...}` part checks if the first positional parameter (`$1`) is unset or null.

--

(the most succinct possible idiom is `#!/bin/bash -u`)

Re:The bash book to rule them all on Saturday November 25, 2023 @11:30AM (#38414502)
Some (topical) amusements:

    $ echo 25 | pwsh -c '$input-replace"\d",{2*"$_"}'
    410
    $ echo 25 | perl -pe 's/\d/2*$&/eg'
    410
```

    PS> $temp:pwsh_out = 10000
    PS> /bin/cat /tmp/pwsh_out
    10000
```

    $ echo ''''

    PS> echo ''''
    '
```

    PS> $Y = { param($f) . { param($x) . $x $x } { param($y) . $f { param($x) . (. $y $y) $x }.GetNewClosure() }.GetNewClosure() }
    PS> $fac = & $Y { param($f) { param($n) $n -lt 2 ? 1 : $n * (. $f ($n - 1)) }.GetNewClosure() }
    PS> & $fac 5
    120
```

    PS> gv -v|% m*d|% t*
    gv -v|% m*d|% t*

    PS> &($x={"&(`$x={$x})"})
    &($x={"&(`$x={$x})"})

    $ bash
    $ eval ${x='echo eval \${${x@A}}'}
    eval ${x='echo eval \${${x@A}}'}
```

bilingual pun,

    .ps1            .pl
     1               1
     {1}             {1}
     end {1}         sub {1}
     {end {1}}       {sub {1}}
     &{end {1}}      &{sub {1}}
```

    awk  -e 'BEGIN { printf "3\n" }'
    perl -e 'BEGIN { printf "3\n" }'
    ruby -e 'BEGIN { printf "3\n" }'
    pwsh -c 'BEGIN { printf "3\n" }'
```

    $ time ...; time ...; ....
    real 0.00 ...
    real 0.00 ...
    real 0.03 ...
    real 0.22 ...
Re:Shellcheck finds bugs in your shell scripts on Thursday November 23, 2023 @07:22PM (#38399387)
Opportunistic interjection that unnecessary ${} is the most bothersome style choice in any language I know of:

- It obscures actual uses of modifiers, particularly ${foo-} when set -u is in effect,

- It's obvious when a name runs into subsequent text, even if one has somehow avoided syntax highlighting,

- And expansions followed by identifier chars don't actually occur in practice. Cases where the quotes cannot be moved to surround the variable are often interpolation of an argument to echo, whose behaviour is such a mess not even portable between bash and dash that shellcheck ought to be demanding printf at all times instead!

Older »