Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Gemini is much better than the free version of GPT 3.5 though. At least in my experience.

Microsoft’s enterprise co-pilot is also fairly decent. It’s really good at providing help to Microsoft related issues or helping you find the right parts of their ridiculously massive documentation site. Which probably isn’t too weird considering.



I tried

"zsh rename index.html.1 to image_1.png for many images"

Gemini

    Here's a zsh script that will rename multiple files named index.html.1 to
    image_1.png in your current directory and its subdirectories:

    Bash

    #!/bin/zsh

    # Loop through all files in the current directory and subdirectories
    for file in **/index.html.1; do
      # Extract the base filename and extension
      base_name="${file%.*}"
      extension="${file##*.}"

      # Rename the file with the new name and extension
      mv "$file" "${base_name}_1.png"

      # Print a message for each renamed file
      echo "Renamed $file to ${base_name}_1.png"
    done
ChatGPT3.5

    To rename multiple files in zsh, you can use the zmv function. Assuming you
    want to rename files from index.html.1 to image_1.png for many images, you
    can create a pattern to match the filenames and then define the new names
    using capturing groups. Here's an example:

    zsh

    autoload -U zmv

    zmv -n '(*).html.(*)' 'image_$1_$2.png'

Not a great first impression of Gemini. ChatGPTs answer isn't perfect but its a lot closer to correct, only needing me to remove the extra 'index' capture of $1.

Curious if someone could commit some light copyright infringement and post what GPT4 says to the same prompt.

Edit: Also Phind-34B probably gives the best answer, with the correct capture.

    To rename multiple files in zsh from index.html.1 to image_1.png for many
    images, you can use the zmv command, which is a powerful batch renaming tool
    available in zsh. If you encounter the error zsh: command not found: zmv, you
    can load it using autoload -U zmv 1.

    First, ensure zmv is available by adding autoload -U zmv to your ~/.zshrc file
    or run it directly in your shell session 2.

    Here's how you can use zmv to rename your files:

    zmv -n 'index.html.(*)' 'image_$1.png'


Here's what gpt4-turbo-preview outputs (with max output of 256 tokens, so the result was truncated).

P.S. have you tried testing what happens when you clearly describe what you want? The prompt you're using is really low quality - more like a google search. If you asked me a question like that I'd tell you to clearly explain what it is you want.

    If you have multiple files with names like `index.html.1`, `index.html.2`, etc., and you want to rename them to `image_1.png`, `image_2.png`, and so on, using Zsh, you can accomplish this with a simple loop and the `mv` command.
    
    Here is how you could do it in a Zsh terminal:
    
    ```zsh
    autoload -U zmv
    zmv -W 'index.html.*' 'image_*.png'
    ```
    
    The `autoload -U zmv` command loads the `zmv` function, which is a powerful utility in Zsh for batch renaming files. The `-W` option tells `zmv` to use wildcard patterns for matching and renaming files.
    
    In the `zmv` command:
    
    - `'index.html.*'` is the pattern to match. It matches any file that starts with `index.html.` followed by any characters.
    - `'image_*.png'` is the replacement pattern. The asterisk `*` in the replacement pattern corresponds to the `*` in the match pattern, so each matched number after `index.html.` gets placed where the `*` is in `image_*.png`.
    
    **Important:** Always make sure


In stable diffusion we build x/y plots to evaluate the results due to seed variance. I find it interesting that LLM guys (seemingly) never do that, since their answers shouldn't be deterministic too.




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

Search: