HNHacker News
TopNewBestAskShowJobs

Calzifer

251 karma · joined May 2, 2021

submissionscomments
Calzifer··on Debian’s “secret” sauce
> And regardless of how you feel about the default the way they went about it broke things for users

For users using Debian unstable and even there it was apparently fixed/improved after a week. Debian stable users had no "wild ride" and for the future became the choice to select between the full featured keepassxc version and a minimal variant without non-essential network and IPC features.

Calzifer··on Mill: A fast JVM build tool for Java and Scala
> [ERROR] No goals have been specified for this build.

> [ERROR] Unknown lifecycle phase "build".

And somehow missed that the error message also lists the valid lifecycle phases. (could have instead complained that it list all lifecycle phases which is a lot)

> // me searching on google how to not run tests

How do I know for other build tools how to skip tests? Skipping tests should not be necessary and is done to regularly. I would not consider a tool which immediately points out how to ignore those stupid tests as good UX.

Calzifer··on Cat without cat on the commandline (2020)
In most cases you could simply use a huge number of lines like

  head filename -n 1000000000
or use the "inverse mode". Head and tail can print all but the first/last n lines (I just have trouble to remember without man page the syntax and which does what). So those are more "cat equivalents":

  head -n-0 filename
  tail -n+0 filename
PS: for your wc example you could actually do just

  head -n $(wc -l filename)
because `wc` will print the number of lines and the filename. (does not work with spaces)
Calzifer··on What was the point of [ "x$var" = "xval" ]? (2021)
Until you realize that some of the expressions in [[ are evaluated as arithmetic expression which has some surprises around array subscript and command substitution.

In short, because the following works despite quoting and will execute the echos

  a=(); x='a[$(echo >&2 what; echo 0)]'; [[ 'x' -eq 0 ]]
I'm back to use the single [ for the arithmetic binary operators.
Calzifer··on Matrix.org Breaks Federation: Users Can't Decrypt Messages from Other Servers
> The developers are silent as spies.

Until just now: https://github.com/matrix-org/matrix.org/issues/2483#issueco...

Calzifer··on Why wordfreq will not be updated
Reminds me of the good old times of first generation Google ReCaptcha where I always only entered the one word Google knows and ignored or intentionally mistyped the other.
Calzifer··on Why is language documentation still so terrible?
Even searching 'float' on docs.python.org brings descent results.

At first the author complains about bad search implementations on the documentation sites and then judges Python by the bad google results.

Calzifer··on Show HN: Haystack – an IDE for exploring and editing code on an infinite canvas
> Based on our qualitative observations, participants’ long navigation times in Eclipse appeared largely due to time spent scrolling through files full of irrelevant code (as opposed to switching tabs), and failing to see the methods they wanted among that code.

> [...]

> Because users of Code Bubbles and Patchworks were able to open code at the granularity of methods, they had the advantage of never having to scroll through code to reach their navigation targets.

Have only read a bit of this paper but from this discussion over Eclipse it seem that the participants could be a lot more efficient if they used it more like an IDE than a multi-tab editor. Finding methods should be much less of an issue having an (alphabetically ordered) outline view.

Calzifer··on What scripting languages come out of the box on Debian 12?
> Have distros gone back to having "/usr/bin/python" available (as opposed to "python3" or something else)?

Debian provides two packages python-is-python3 and python-is-python2 to restore the /usr/bin/python.

Calzifer··on What scripting languages come out of the box on Debian 12?
And will likely remain with that major version for the next 20 years since Perl 6 became Raku.

https://en.wikipedia.org/wiki/Raku_(programming_language)

Calzifer··on Anyone got a contact at OpenAI. They have a spider problem
Those are usually connection and no-data timeouts. A total time limit is in my experience less common.
Calzifer··on Reflections on Distrusting xz
No, because dict_put will update the limit value if the new pos exceed it.
Calzifer··on Regex character "$" doesn't mean "end-of-string"
Isn't JavaScripts regex one of the worst modern regex implementations?

They seem to improve. Negative lookbehind isn't missing anymore [1]. But still lack the handy \Q and \E to escape stuff [2].

[1] https://stackoverflow.com/a/3950684

[2] https://stackoverflow.com/q/6318710

Calzifer··on Show HN: Piping logs, visualizing in a web app – just suffix "| npx logscreen"
It does, but express doesn't tell it directly in the docs.

Instead http://expressjs.com/en/4x/api.html#app.listen sends you to https://nodejs.org/api/http.html#http_server_listen which also won't give the answer but sends you to https://nodejs.org/api/net.html#serverlisten which at some points finally documents that default is 0.0.0.0.

Welcome to the JavaScript ecosystem :/

Calzifer··on In loving memory of square checkbox
The first time my mother encountered a toggle she tried to actually slide it. I also once saw a website which replaced in a redesign checkboxes with toggles where the cursor changes to a "grab hand" but of cause you cannot grab and slide them need to click it. Imo it is not intuitive that you have to click toggles and they magically start sliding but you cannot slide them.
Calzifer··on In loving memory of square checkbox
If I think of square checkboxes I think of sharp corners. Maybe I should write an article "In Loving Memory of sharp corners" because I definitely miss them but they seem to be extinct from the modern Web and GUI in general. If I skim the article only old screenshots contain sharp corners. None of the new once.

I have a browser where I configured "border-radius: 0 !importent" as userContent.css for fun. Was sometimes surprised how much it is used. Especially how many circles are today actually boxes with a large border radius.

Calzifer··on Using Git Offline
But does it matter? Nowadays even my editor wants to run a server in the background to provide syntax highlighting. People generally don't seem to care and see it as progress.
Calzifer··on June 30th, 2024, will bring the End of Life (EOL) of CentOS Linux (2023)
aptitude also auto removes dependent packages and is in Debian stable.

It has also a useful 'aptitude why package' to say why a package is installed and a nice TUI (which is optional; for the most part it works very similar to apt).

Calzifer··on June 30th, 2024, will bring the End of Life (EOL) of CentOS Linux (2023)
You can skip the uninstall if you use purge.

And aptitude (alternative package manager) automatically removes dependent but not required anymore packages when removing/purging a package.

Calzifer··on Modern Java/JVM Build Practices
Depends on how you interpret 'everything' and 'each time'.

The default compiler plugin configuration is quite eager to recompile allot if something changed.

https://maven.apache.org/plugins/maven-compiler-plugin/compi...

"true (default) in this mode the compiler plugin determines whether [...] any source file was added, removed or changed since the last compilation. If this is the case, the compiler plugin recompiles _all_ sources.

Calzifer··on GitMounter: A FUSE filesystem for Git repositories
And in keeping with the topic Seafile has a FUSE extension to access this storage system directly.

https://manual.seafile.com/extension/fuse/

Calzifer··on test, [, and [[ (2020)
No it won't. set -e is implicit disabled for the first command with && and ||. Same for a command after if/while/until and after !. It should only matter if you implicit return immediately after.

  $ bash -ec 'if [ 1 = 2 ]; then echo true; fi; echo $?'
  0
  $ bash -ec '[ 1 = 2 ] && echo true; echo $?'
  1
In both cases it does not quite and execute the last echo.
Calzifer··on Shellcheck finds bugs in your shell scripts
> to put `-u` (nounset) in your shebang

Any particular reason why in the shebang instead of set -u?

> The only exception I typically run across is expansion of arrays using "${arr[@]}" syntax

In Bash? Works for me. Edit: another comment mentions it as well. Seem to behave better in newer versions of Bash and only problematic in <= 4.3 https://news.ycombinator.com/item?id=38397241

  $ bash -uc 'unset x; echo "=> ${x[@]}"'
  =>
  $ bash -uc 'x=(); echo "=> ${x[@]}"'
  =>
  $ bash -uc 'x=(); echo "=> ${x[0]}"'
  bash: x[0]: unbound variable
Zsh does not like the first example but both should support:

  $ bash -uc 'unset x; echo "=> ${x[@]:-null}"'
  => null

> Also handy is `-e` (errexit),

It is unfortunately very confusion with functions. Made me like it less over the years.

Calzifer··on Interactive examples for learning jq
One feature I found very useful when using jq in Bash is the "alternative operator" '//'.

  result=$(echo "$data" | jq -r '.optional // ""')
  if [[ -n "$result" ]] ...
feels more natural in Bash than

  result=$(echo "$data" | jq -r '.optional')
  if [[ "$result" != null ]] ...
Especially if an empty field should be handled the same way.

And when using the raw-output option it helps with the ambiguity between "null" and null.

Calzifer··on The first stable release of a memory safe sudo implementation
That is documented. Since the mercurial web interface isn't very nice to use I picked a random version. sudo 1.8.6 from 2012 writes in the man page "The sudoers file must not be world-writable,".

https://www.sudo.ws/repos/sudo/file/SUDO_1_8_6/doc/sudoers.m...

This is also a very common behaviour for security sensitive applications to check config file permissions. Another example I remember are ssh private keys.

I might be to harsh but it is not so trustworthy they still made this error and still miss the documentation.

Calzifer··on Java JEP 461: Stream Gatherers
The last three are open, open and won't fix. Not so promising for the flatMap method.
Calzifer··on Not knowing the /proc file system

  int s_isdigit(const char* s) {
Name does not fit implementation. Should be "contains_digit".

Also I would say almost any "issomething" method involving a loop has an opportunity for an early return.

Calzifer··on Coding in the Debugger (2007)
You can also run arbitrary code at any breakpoint (at least for Java with Eclipse).

Want to check the content of a buffered image? Just run ImageIO.write(...) while the application is stopped. Want to check the current working directory? Paths.get(".").toAbsolutePath()

Heck you can even add code as breakpoint condition (which does not need to stop at the breakpoint), e.g. for some on the fly print debug. Changing values does not have to be a manual process but can also be injected as breakpoint condition.

Calzifer··on Coding in the Debugger (2007)
I still do this all the time with Java. Especially because the application is rather slow to start or setup whatever I want to debug. It can also influence how you structure the code. In my opinion to the better.

If you mutate state all over a method it is harder to "restart" the method after changing it. Instead I tend to either not mutate state and return the result or work with local variables and just change the object at the very end of the method.

Or might start to more separate a lock/transaction from what is processed within because when "restarting" the method you don't want to relock it.

Calzifer··on Tell HN: Please don't print –-help to stderr in your CLI tools
Java (since version 9) has -version which prints to stderr and --version which prints to stdout (also with slightly different content). Same for -showversion and --show-version and to get back on topic -help -h and -? print to stderr while --help prints to stdout.

https://docs.oracle.com/en/java/javase/17/docs/specs/man/jav...

But since the more standard double-dash variants printing to stdout where added with Java 9 I would actually laud it as good backward compatibility.

← PreviousPage 2 of 4Next →