Frankly, not sure where to begin with this one. Some here have already pointed out how it can easily be trained to produce racist/biased data which is a big red flag to begin with. But am I the only one thinking about how this deep-learning, AI algorithm is going to render millions obsolete at the behest of capital? As has been the case with almost everything developed under capitalism , what a marvelous discovery that will in all likelihood be used for nothing but exploitation. And do I even have to mention how our leaders are geriatric and couldn’t regulate this shit to save their lives?

Unless this is somehow made open-source (and soon), we’re fucked.

  • Hohsia [he/him]
    hexagon
    ·
    2 years ago

    Write me an excel macro that formats files in a directory to .csv

    Sub ConvertToCSV() ' Declare variables Dim sourceFolder As String Dim targetFolder As String Dim sourceFile As String Dim targetFile As String

    ' Set the source and target folders
    sourceFolder = "C:\MyFiles\"
    targetFolder = "C:\MyFiles\Converted\"
    
    ' Loop through all the files in the source folder
    For Each sourceFile In Dir(sourceFolder & "*.xlsx")
        ' Set the target file name
        targetFile = targetFolder & Replace(sourceFile, ".xlsx", ".csv")
    
        ' Open the source file
        Workbooks.Open sourceFile
    
        ' Save the file as CSV
        ActiveWorkbook.SaveAs targetFile, xlCSV
    
        ' Close the source file
        ActiveWorkbook.Close
    Next sourceFile
    

    End Sub

    A python program that copies content from a web page and pastes it to notepad

    Import the required modules

    import webbrowser import pyperclip import time

    Set the URL of the web page to be copied

    url = "https://en.wikipedia.org/wiki/Main_Page"

    Open the web page in a new browser tab

    webbrowser.open(url, new=2)

    Wait for the page to load

    time.sleep(5)

    Copy the page contents to the clipboard

    pyperclip.copy(document.body.innerText)

    Open Notepad

    webbrowser.open("notepad.exe")

    Wait for Notepad to load

    time.sleep(3)

    Paste the copied text into Notepad

    pyperclip.paste()

    • companero [he/him]
      ·
      2 years ago

      The Python one is completely incorrect and would crash if you tried to run it. webbrowser is for displaying web pages to users. It doesn't support accessing data programmatically.

      document.body.innerText

      It magically switches to browser JS when it can't figure out how to get the content.

      I mean, it still is impressive, but you can't really trust anything it outputs and I don't expect that to change for quite a while.

      • Hohsia [he/him]
        hexagon
        ·
        2 years ago

        Of course it’s not always going to be correct, but it’s learning and evolving

        That’s the scary part