home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 42,436 of 42,547   
   Marion to All   
   I just asked CoPilot AI to write a grams   
   19 Jul 25 09:50:38   
   
   XPost: alt.comp.os.windows-10, alt.comp.os.windows-11   
   From: marion@facts.com   
      
   This is an example, for the record, of the current state of AI on Windows.   
      
   I was doing a review for Amazon Vine  who   
   had sent me a hose fitting to review (where I do about 8 reviews a day for   
   free products Amazon Vine sends to my home) so I had to ask a bunch of   
   questions of CoPilot to get to know the product details better, and at some   
   point I needed to convert grams to ounces, so I asked CoPilot to write the   
   Windows batch script for me.   
      
   Having programmed since the days of Fortran IV (before Fortran 77) and   
   COBOL & PL/1 and IBM Assembly Language, and learning to hate programming, I   
   prefer to let the AI write the programs for me.   
      
   Below is the verbatim interaction with CoPilot, for others to benefit,   
   where it's interesting how SIMILAR AI is in making the same mistakes we all   
   made when we were LEARNING how to program - but - and this is key - but AI   
   recovers from those many sophormorish mistakes thousands of times FASTER   
   than we would recover from them. Which is why it works so well as a team.   
      
   10 The AI puts out garbage   
   20 The human tests that garbage & tells AI to fix what didn't work   
   30 AI fixes it (goto 10)   
      
   See below for details...   
      
   User: ght is how many tpi   
   Copilot: GHT (Garden Hose Thread) has 11.5 threads per inch (TPI). It's the   
   standard thread used for garden hoses in North America.   
      
   User: there are only about 1/4 inch of threads in the female hose fitting   
   though, which at 11.5TPI is only about (how many threads)?   
   Copilot: ...2.875 threads, which rounds up to about 3 threads total. The   
   threads hold the fitting together; it's the washer that prevents leaks.   
      
   User: by way of contrast, the male ends measured at a full half inch, which at   
   11.5 TPI is about (how many threads)?   
   Copilot: That equals 5.75 threads, or about 5 to 6 full threads.   
      
   User: the female garden hose thing (is it a nut?) has 8 sides. Why not 6?   
   Copilot: Yes, it's a nut-specifically a swivel nut. The 8 sides give better   
   grip angles, reduce rounding off, and increase tool compatibility.   
      
   User: the hose fitting is very heavy. Over 500 grams. Can you write a batch   
   file for window that asks for input of the number of grams and then it   
   converts that to cooking ounces in fractions no smaller than 1/8, and where it   
   loops to ask for the next    
   conversion but if you type q it will quit.   
   Copilot: [Provides initial batch script to convert grams to ounces with loop   
   and fraction rounding.]   
      
   User: Enter number of grams (or type 'q' to quit): 1395   
   Copilot: Error messages occur due to non-integer math and letters in input   
   like "1395g".   
      
   User: Can you fix it?   
   Copilot: [Provides updated script using integer math and input validation.]   
      
   User: Enter number of grams (or type 'q' to quit): 23   
   Copilot: Incorrectly flagged as invalid. Validation needs tweaking.   
      
   User: Can you fix the funky characters?   
   Copilot: Save the batch file as ANSI instead of UTF-8 to eliminate stray   
   symbols like ÿ.   
      
   User: Can you give me the script in ascii so I can copy it using GVIM to   
   g2oz.bat?   
   Copilot: [Provides script using plain ASCII characters, tilde replaced with ~.]   
      
   User: Can you fix the output to omit "0" when less than one ounce and format   
   14-1/4 ounces style?   
   Copilot: [Updates script formatting accordingly.]   
      
   User: Can you make the output read like: "23 grams (or about 7/8 ounces)"?   
   Copilot: [Adds formatted output with optional pounds & suggests plurals.]   
      
   User: Oh, yes, I didn't think of plurals. Yes please.   
   Copilot: [Updates script with correct pluralization: ounce/ounces,   
   pound/pounds.]   
      
   User: how long did this conversation take?   
   Copilot: From your first message to this one, the conversation has been going   
   for about 1 hour and 40 minutes. And we've covered quite a bit - garden hose   
   threads, wrench geometry, rounding fractions in cooking conversions,   
   ASCII-safe scripting,    
   pluralization, and even how to copy your chat. Productive and charming, I'd   
   say. Want me to compile the final batch script one more time for easy pasting?   
   Or do you feel like cooking up something totally different now?   
      
   User: yes. Please do. Also, how do I copy this whole conversation?   
   Copilot: Instructions for selecting and copying manually, or using GVIM.   
      
   User: Yuck. Too much formatting. Can you convert this whole conversation into   
   pure ascii text so I can paste it into GVim?   
   Copilot: [You're reading the result!]   
      
    @echo off   
    REM 20250719 g2oz.bat convert grams to ounces, kitchen rounding   
    setlocal enabledelayedexpansion   
      
    :Start   
    set /p grams=Enter number of grams (numeric only, or type 'q' to quit):   
    if /i "%grams%"=="q" exit /b   
      
    REM Validate input   
    echo.%grams%| findstr /R "^[0-9][0-9]*$" >nul   
    if errorlevel 1 (   
        echo Please enter a valid number with no letters or symbols.   
        goto Start   
    )   
      
    REM Convert grams to total eighths of an ounce   
    set /a total_eighths=(%grams% * 8 + 14) / 28   
    set /a total_ounces=!total_eighths! / 8   
    set /a eighths=!total_eighths! %% 8   
      
    REM Build fraction string   
    set fraction=   
    if !eighths!==1 set fraction=1/8   
    if !eighths!==2 set fraction=1/4   
    if !eighths!==3 set fraction=3/8   
    if !eighths!==4 set fraction=1/2   
    if !eighths!==5 set fraction=5/8   
    if !eighths!==6 set fraction=3/4   
    if !eighths!==7 set fraction=7/8   
      
    REM Calculate pounds   
    set /a pounds=!total_ounces! / 16   
    set /a ounces=!total_ounces! %% 16   
      
    REM Determine pluralization   
    set oz_label=ounce   
    if !ounces! GTR 1 set oz_label=ounces   
    if !eighths! GTR 0 set oz_label=ounces   
      
    set lb_label=pound   
    if !pounds! GTR 1 set lb_label=pounds   
      
    REM Build final output   
    set about=   
    if !total_ounces! LSS 1 (   
        if defined fraction (   
            set about=%fraction% !oz_label!   
        ) else (   
            set about=less than 1 ounce   
        )   
    ) else (   
        if !pounds! GEQ 1 (   
            if defined fraction (   
                set about=!pounds! !lb_label! !ounces!-!fraction! !oz_label!   
            ) else (   
                if !ounces!==0 (   
                    set about=!pounds! !lb_label!   
                ) else (   
                    set about=!pounds! !lb_label! !ounces! !oz_label!   
                )   
            )   
        ) else (   
            if defined fraction (   
                set about=!ounces!-!fraction! !oz_label!   
            ) else (   
                set about=!ounces! !oz_label!   
            )   
        )   
    )   
      
    echo %grams% grams (or about !about!)   
    goto Start   
   --   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca