Hacker News new | past | comments | ask | show | jobs | submit | balnaphone's comments login

This exists, just use https://github.com/sigoden/aichat with local ollama and a model like qwen2.5-coder:7b or better (e.g. gemma3:12b).

Add this to ~/.bashrc :

    # bind Alt-e on the command line to replace text with command
    _aichat_bash() {
        if [[ -n "$READLINE_LINE" ]]; then
            READLINE_LINE=$(aichat -e "$READLINE_LINE")
            READLINE_POINT=${#READLINE_LINE}
        fi
    }
    bind -x '"\ee": _aichat_bash'
In the example you gave i get:

    find . -type f -name "*.mp4" -exec ffmpeg -i {} -c:v libaom-av1 -crf 30 -b:v 0 -c:a copy ~/Videos/{}.mkv \;
But if you don't like that you can press Ctrl-Shift-_ (bash has emacs keybindings) to undo and try something else. You can also put a # mark in front and hit enter, then up arrow then Alt-e so you know what created the command.




Perhaps that is inexcusable. GNU gcc version 13.2.0 (with -O2, as documented) does report a problem.

    $ cat tst.c
    int main () {
      int x[10];
      return *(x+20);
    }
    $ gcc -Wall -O2 tst.c
    tst.c: In function ‘main’:
    tst.c:3:10: warning: array subscript 20 is outside array bounds of ‘int[10]’ [-Warray-bounds=]
        3 |   return *(x+20);
          |          ^~~~~~~
    tst.c:2:7: note: at offset 80 into object ‘x’ of size 40
        2 |   int x[10];
          |       ^


These are easy mode arrays, with size and offset known at compile time. Receiving x as an int* parameter to a function, with no way to know its length automatically, would be more realistic.


I would save my data in CSV format, then use this. Save the code below as chunk.pl (remove leading spaces) and call it as "perl chunk.pl" :

    #!/usr/bin/perl -CSD -w -Mstrict -Mwarnings -MText::CSV
    
    # chunk.pl -- split csv files into chunks
    
    # Usage message and exit if needed
    if (!@ARGV || $ARGV[0] eq '-h') {
        print "Usage: $0 input_csv [chunk_size] [output_filename_format] [separator]\n";
        print "Example: $0 input.csv 500 'input-%08d.csv' ','\n";
        exit;
    }
    
    # Set command-line arguments
    my ($INFILE, $CHUNKSIZE, $FMT, $SEP) = @ARGV;
    $CHUNKSIZE //= 500;
    $FMT //= "data-%08d.csv";
    $SEP //= ",";
    
    # Initialize CSV, file handles, and counters
    my $csv = Text::CSV->new({ binary => 1, auto_diag => 1, sep_char => $SEP, eol => "\n" });
    my ($i, $f, $out) = (0, 1, undef);
    open my $in, "<:encoding(UTF-8)", $INFILE or die "Cannot open $INFILE: $!";
    
    # Main loop
    while (my $row = $csv->getline($in)) {
        if ($i % $CHUNKSIZE == 0) {
            close $out if defined $out;
            open $out, ">:encoding(UTF-8)", sprintf($FMT, $f++) or die "Cannot open output file: $!";
        }
        $csv->print($out, $row) or die "Failed to write row: $!";
        $i++;
    }
    
    # Clean up: close file handles
    close $out if defined $out;
    close $in;


I suppose R might be a better choice...

    library(readr)
    library(dplyr)
    library(purrr)
    data <- read_csv("input.csv")
    chunk_size <- 500
    chunks <- split(data, ceiling(seq_along(1:nrow(data))/chunk_size))
    iwalk(chunks, ~write_csv(.x, sprintf("data-%04d.csv", .y)))


Can you post your tmux config that mocks GNU Screen?

Here is mine : https://pastebin.com/ZVWYcpyU , but a lot of GNU Screen muscle memory fails for various reasons.

The main reasons I'm trying to switch are: better scrollback support, and better mouse support (both for tmux itself and for pass-through to terminal applications). Having used GNU Screen for 32 years, it's difficult for me to even think about what keys I'm hitting, it's below the level of conscious recognition at this point.


Here is mine - it's pretty short. I think it reflects what I use and don't use, so I'm not sure it's useful to you!

    # remap prefix from 'C-b' to 'C-a'
    unbind C-b
    set-option -g prefix C-a
    bind-key a send-prefix
    bind-key C-n next-window
    bind-key C-p previous-window
    
    unbind C-a
    bind C-a last-window
    
    unbind A
    # Default C-a ,
    bind A command-prompt -I "#W" "rename-window '%%'"
    unbind k
    bind k confirm-before "kill-window"
    
    bind Escape copy-mode
    
    # start counting from 1
    set -g base-index 1
    setw -g pane-base-index 1
    
    # vi keys scrollback
    setw -g mode-keys vi
    
    # Style
    set -g status-bg black
    set -g status-fg white
    
    # Make current tab visible
    setw -g window-status-current-format "#[reverse]*#I:#W*"


The site doesn't scroll at all on Firefox(X11) with ublock and umatrix, even when the non-tracking sites are enabled. In Brave browser it somewhat works in a janky way, but given that the site apparently brings a 24-core threadripper with 128GB RAM to it's knees, it certainly doesn't inspire confidence in the product, which otherwise looks pretty good.


Steve Mann resolved this notational dilemma by using the term "crown", as in binary = crown 1, octal = crown 7, decimal = crown 9, hex = crown F, and so on.


Dr Brad Stanfield suggests this doesn't work in humans.

https://www.youtube.com/watch?v=dVvqGAjg_J8


Stanfield's logic is simply wrong.

1. Spermidine found to increase lifespan and fertility in mice.

2. Spermidine levels not found to increase in blood or certain tissues when fed to mice.

3. Therefore, 1 is wrong.

Finding 2 in no way disproves 1. Facts which could be consistent with both 1 and 2 being true:

- spermidine metabolites are responsible for benefits

- while spermidine levels are maintained, excess spermidine is used beneficially

- experimenters in 2 simply haven't looked in the right tissues

And so on. TFA says there were observed phenotypic improvements (follicular health, oocyte number and quality), which categorically trump 2's failure to observe increase in spermidine levels. And none of this says anything directly about spermidine's effects in humans


I’ve watched a lot of Stanfield’s videos. Over time I came to realize that his whole image is built on being “the critic” and tempering optimism around these treatments. Except for his own personal research, which he’d like you to help fund :)

At the end of the day, “the critic” is a valuable job. Someone has to do it. Not sure it is really helping progress the industry though. I think it would be better for him to leave this to the lawyers tho.


On-screen keyboards all seem to fail, with "onboard" crashing when you try to type, most others not showing up at all.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: