2

用 GPT-3 解讀程式碼

 1 year ago
source link: https://blog.gslin.org/archives/2022/07/12/10795/%e7%94%a8-gpt-3-%e8%a7%a3%e8%ae%80%e7%a8%8b%e5%bc%8f%e7%a2%bc/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

用 GPT-3 解讀程式碼

Hacker News 上看到的方法,Simon Willison 試著把程式碼餵進 GPT-3,然後問 GPT-3 程式碼的意思,看起來答的還不錯:「Using GPT-3 to explain how code works」,對應的討論 (包括 Simon Willison 的回應) 則可以在「Using GPT-3 to explain how code works (simonwillison.net)」這邊看到。

第一個範例裡面可以解讀 regular expression,雖然裡面對 (?xm) 的解讀是錯的,但我會說已經很強了...

第二個範例在解釋 Shadow DOM,看起來也解釋的很不錯...

第三個範例回來原來產生程式碼的例子,拿來生 SQL 指令。

後面的 bonus 題目居然是拿來解釋數學公式,他直接丟 TeX 文字進去要 GPT-3 解釋柯西不等式 (Cauchy–Schwarz inequality)。這樣我想到以前高微作業常常會有一堆證明題,好像可以丟進去要 GPT-3 給證明耶...

Related

Cloudflare 的 D1 (SQLite as a service)

在 Hacker News Daily 上看到 Cloudflare 推出了新產品 D1:「Announcing D1: our first SQL database」,在 Hacker News 上對應的討論在「D1: Our SQL database (cloudflare.com)」這邊可以看到。 就如同 Hacker News 上的討論提到的,這篇文章不像一般的 Cloudflare 文章會帶有很多技術上的說明 (尤其是在描述技術產品),這篇算是非常的行銷導向的文章,目前大家只能靠「猜」的去理解: For a Cloudflare article, this one is surprisingly light on technical details. And for the product where it most matters. 翻了一下這兩個屬名的作者,Rita Kozlov 是…

May 12, 2022

In "Cloud"

無名小站的 XSS 安全漏洞

前言 布丁大長輩 在 Year.new(2006) 這篇幹剿無名小站的 XSS 安全漏洞,沒有講的很明白,加上我這陣子沒在實驗室遇到 wkwu (是的,我跟他是同一個指導教授),所以一直沒有跟他說這個在國外已經「開發」好一陣子的安全漏洞。 Javascript 是在使用者端 (Browser) 跑的程式,理論上來說,讓使用者輸入自己的 Javascript 並不會有什麼問題,但實際上自從 XMLHttpRequest() 被大量應用後 (一開始發展 AJAX 所使用的核心技術之一),有些人就發現 XMLHttpRequest() 是可以拿來當作攻擊的工具。 舉例說明 舉個例子說明會比較清楚。以目前最大的 無名小站 為例,「修改個人資料」的頁面是在 http://www.wretch.cc/user/modify.php?admin_user=1 這個位置,會以 POST 的方式送給 http://upload.wretch.cc/user/do_modify.php,那麼我就可以在文章裡面嵌入一段 Javascript:(修改自 Use the XMLHttpRequest Object to Post Data) var objHTTP, strResult; objHTTP = new ActiveXObject('Microsoft.XMLHTTP'); objHTTP.Open('POST', "http://upload.wretch.cc/user/do_modify.php",false); objHTTP.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');…

January 6, 2006

In "Blog"

GitHub Copilot 宣佈 GA

GitHub Copilot 宣佈 GA:「GitHub Copilot is generally available to all developers」,Hacker News 上的討論可以看一下:「GitHub Copilot is generally available (github.blog)」。 價錢也出來了,US$10/mo 或是 US$100/year: We’re making GitHub Copilot, an AI pair programmer that suggests code in your editor, generally available to all developers for $10 USD/month or $100 USD/year. It will also be…

June 23, 2022

In "Computer"

a611ee8db44c8d03a20edf0bf5a71d80?s=49&d=identicon&r=gAuthor Gea-Suan LinPosted on July 12, 2022July 12, 2022Categories Computer, Murmuring, Network, Programming, ServiceTags code, dom, explain, expression, gpt-3, math, mathematics, programming, regular, shadow, source, sql

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)

Post navigation


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK