Programming板 - WEB批踢踢(PTT)http://webptt.com/rss.ashx?n=Programming2023-04-06T11:53:12+08:00[問題]請問大家有用chatgpt除錯python嗎 https://webptt.com/m.aspx?n=/bbs/Programming/M.1724574641.A.523.html2024-08-25T16:30:41+08:002024-09-11T13:39:41+08:00Adamcolton<pre>請問大家用過chatgpt pythong coding debug嗎 剛自學看很久
但用chatgpt試除錯 跑起來也怪怪的 想問大家的經驗
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.194.159.126 (臺灣)
※ 文章網址: https://webptt.com/m.aspx?n=/bbs/Programming/M.1724574641.A.523.html
</pre>[情報] 冼鏡光教授分享的課程影片https://webptt.com/m.aspx?n=/bbs/Programming/M.1716325066.A.434.html2024-05-22T04:57:46+08:002024-09-12T11:48:44+08:00art1<pre> https://www.youtube.com/@ckshene7212 這是中文版的頻道,目前出到第三集
https://www.csl.mtu.edu/cs3331.ck/www/3331-slides.html 英文版頁面
https://pages.mtu.edu/~shene/VIDEOS/CONCURRENT/index-TW.html 中文版介紹頁面
中文版是英文版的精簡版,教授的期望是先看懂中文版,再去讀英文版就不會遇到困難
除了影片,在網頁上還有投影片跟程式可下載
</pre>[問題] RS232通訊問題https://webptt.com/m.aspx?n=/bbs/Programming/M.1714542172.A.41B.html2024-05-01T13:42:52+08:002024-08-24T20:30:50+08:00Federer5566<pre> 大家好
最近拿到一台設備
會透過RS232丟資料出來
丟出來的資料都是簡單的數字帶一個「:」
所以寫了一支程式去接收數據
</pre>Re: [問題] 從n中取k可重複的組合想不全部展開https://webptt.com/m.aspx?n=/bbs/Programming/M.1714534223.A.73D.html2024-05-01T11:30:23+08:002024-05-01T16:09:25+08:00LPH66<pre>於是你的需求是將重覆組合以某個順序排序後直接求出該組合是排序中第幾位 (及反之)
這種組合和序數轉換題型有一個通用的想法是:
將這個排序順序做成有某種分組的樣子
(例如第一權重相同的全部排在一起)
然後依照這個分組順序數過去
</pre>[問題] 從n中取k可重複的組合想不全部展開https://webptt.com/m.aspx?n=/bbs/Programming/M.1714522756.A.8FE.html2024-05-01T08:19:16+08:002024-05-02T08:54:44+08:00dinohsu1019<pre>投資組合為1將權重k等分分配到n個股票,每個股票可分配權重0(零),1/k,2/k,...1
(全部)將k等分分配到n個股票。
即「從n中取k可重複的組合」,組合數為 C(n+k-1,n-1)。
故權重編號範圍為1~C(n+k-1,n-1)
權重串列(整數版)為(n,0,...0,0),(n-1,1,...,0,0),...(0,0,...,0,n)。
</pre>[問題] 關於觀察linux程序與2>&1的程序https://webptt.com/m.aspx?n=/bbs/Programming/M.1713326284.A.3DF.html2024-04-17T11:58:04+08:002024-04-19T10:06:19+08:00yuiweq1999<pre>各位好,因為覺得自己爬文理解的不是很正確,加上參考前輩撰寫的內容後修改但
還是覺得怪怪的想請教:
我撰寫了一個方法
#/bin/bash
single_instance() {
</pre>[請益] NodeMCU ESP8266與EMQX Docker連線https://webptt.com/m.aspx?n=/bbs/Programming/M.1710052718.A.D5F.html2024-03-10T14:38:38+08:002024-04-07T23:57:37+08:00lavender19<pre>各位先進們大家好~
NodeMCU ESP8266 透過Http協定,連線到本機Docker 上面的EMQX,確認Http溝通是否正
常,目前wifi可以正常連線,但HTPP連線失敗?
皆在本機執行,請問那種情況下可能會造成這些錯誤?
https://imgur.com/a/MoFdCC6
</pre>[問題] 分割陣列問題請教https://webptt.com/m.aspx?n=/bbs/Programming/M.1709270459.A.7DA.html2024-03-01T13:20:59+08:002024-03-01T17:42:56+08:00thumbg75446<pre>請教一個問題,給定一個整型數組,值有正有負,需要把整個arr分割成若干個subarr,
但必須滿足每個subarr都至少包含一個負數,請問有幾種分割數?
例如[1,-2,3,4,-5]只有以下分割方式
[1,-2 | 3,4,-5]
[1,-2,3 | 4,-5]
</pre>[問題] Leetcode 19 removeNthFromEndhttps://webptt.com/m.aspx?n=/bbs/Programming/M.1708680307.A.B79.html2024-02-23T17:25:07+08:002024-02-23T21:25:38+08:00buyfood<pre>各位高手大家好,今天練習這題時有些疑惑想請教
題目:https://leetcode.com/problems/remove-nth-node-from-end-of-list/descripti
on/
一開始寫出的做法如下:
```
</pre>[閒聊] 這個toggleMode切換dark modehttps://webptt.com/m.aspx?n=/bbs/Programming/M.1705471740.A.C7D.html2024-01-17T14:09:00+08:002024-01-19T08:59:58+08:00firesnake<pre>這個toggle mode 切換dark mode/light mode
不知道哪裡出了問題
code是bard生成的
css:
body {
</pre>[請益] simd 方法請教https://webptt.com/m.aspx?n=/bbs/Programming/M.1704713384.A.592.html2024-01-08T19:29:44+08:002024-01-08T19:31:37+08:00joshddd<pre>如題
我是社科院的學生
目前正在學習數值運算
最近發現 simd
可以進一步加速
</pre>[討論] 單元測試的方法https://webptt.com/m.aspx?n=/bbs/Programming/M.1702995766.A.A6D.html2023-12-19T22:22:46+08:002024-01-08T21:58:21+08:00Lordaeron<pre>也聽過幾次,講出口的都是年青人。
大概的內容是。
甲說:某某某寫java 的code 都很奇妙,每支程式都掛著一個main 在哪。
負責單元測試。
乙說:對對對,好笑,這麼老派。要人怎麼看?
</pre>[討論] LeetCode 1649. Create Sorted Array thrhttps://webptt.com/m.aspx?n=/bbs/Programming/M.1702080327.A.6F9.html2023-12-09T08:05:27+08:002023-12-09T23:22:20+08:00osnq<pre>1649. Create Sorted Array through Instructions
請教各位關於這一題,
研究過 solution 與 editorial, 大概就是需要 O(nlog n) 才會過.
因為 input 的關係, 所以要搜尋到正確的位置 insert 就得用 binary search
只是... 還是發生了TLE...
</pre>[請益] 左值右值與物件傳回https://webptt.com/m.aspx?n=/bbs/Programming/M.1700779007.A.500.html2023-11-24T06:36:47+08:002023-11-24T20:42:43+08:00amamoimi<pre>#include <iostream>
using namespace std;
class A{};
A f (A x){
return x;
</pre>Re: [問題] C++陣列宣告4維,但用2維存取時會怎樣?https://webptt.com/m.aspx?n=/bbs/Programming/M.1699883810.A.3C6.html2023-11-13T21:56:50+08:002023-12-09T13:20:52+08:00amamoimi<pre>https://onlinegdb.com/c8o-kmc9-
我把他拿去美化了一下
我想問一下...
就cout出的結果來看
a[5][5]跟&a[5][5]是一樣的
</pre>[問題] Native Wlan Api 關於密碼有誤的偵測https://webptt.com/m.aspx?n=/bbs/Programming/M.1696575993.A.A0A.html2023-10-06T15:06:33+08:002023-10-06T15:06:32+08:00osnq<pre>又是我...
再麻煩一次各位前輩, 給小的一盞明燈.
一樣是使用 MFC, 在刻跟 Wi-Fi 有關的程式 (wlan Native Api).
目前可以正常使用 scan / set profile / connect / disconnect.
不過, 在還沒set profile 之前我可以知道, 並讓 user 可以輸入 Wi-Fi password.
</pre>[問題][MFC] 怎麼知道程式回到最上層呢?https://webptt.com/m.aspx?n=/bbs/Programming/M.1688001749.A.357.html2023-06-29T09:22:29+08:002023-08-31T15:42:48+08:00osnq<pre>桌面軟體之間切換
請問該怎麼知道使用者切回來軟體了呢? 是否有 WM MESSAGE 是用來 handle 這個事件
?
Google 過,不過…
實在不知道該下什麼 keyword …
</pre>[討論] -Wl,--as-needed 該如何使用https://webptt.com/m.aspx?n=/bbs/Programming/M.1684595315.A.6B7.html2023-05-20T23:08:35+08:002023-05-30T14:12:35+08:00feelthat<pre>gcc 在編譯時提供了 -Wl,--as-needed 和 -Wl,--no-as-needed 兩個選項,
這兩個選項前者是開啟特性,後者是取消特性。
在生成可執行文件的時候,通過 -lxxx 選項指定需要鏈接的庫文件。以動態庫為例,如
果我們指定了一個需要鏈接的庫,則連接器會在可執行文件的文件頭中會記錄下該庫的
信息。而後,在可執行文件運行的時候,動態加載器會讀取文件頭信息,並加載所有的
</pre>[討論] configure build host target 什麼意思https://webptt.com/m.aspx?n=/bbs/Programming/M.1684528169.A.FBE.html2023-05-20T04:29:29+08:002023-05-20T22:40:14+08:00feelthat<pre>ubuntu x86_64 or linux
若要編譯一包 open source 通常會使用到
./configure --build=xxx-linux-gnu --host=xxx-linux-gnu --target=xxx-linux-gnu
這裡給出幾個解釋 讓大家真正了解定義
https://sensperiodit.files.wordpress.com/2011/04/hagen-the-definitive-guide-to-gcc-2e-apress-2006.pdf
</pre>[情報] 2023金匠獎程式暨設計競賽https://webptt.com/m.aspx?n=/bbs/Programming/M.1680753192.A.B47.html2023-04-06T11:53:12+08:002023-04-06T18:36:11+08:00jk12312377<pre>去年的金匠獎好像是第一屆
本來打算要報名就有稍微留意一下,沒想到好像很多人參賽
而且賽後的評價似乎還不錯,今年也辦了第二屆
除了程式組之外,也有設計組的比賽,總獎金超過35萬
有興趣的人可以參考一下,有分個人和團體組喔~~
</pre>