What is Hackers' Pub?

Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed.

0
1
0
15
0
0
0
0
0
1
1

Optimizing IRQ latency on the STM32H743 @ 480 MHz, perhaps for NES ROM emulation... Best result so far: 100 nanoseconds input-to-output latency when the vector table and the IRQ handler are relocated to Tightly-Coupled Memory without making HAL calls. Not bad, but the GPIO controller (several buses away) looks like the real performance killer here.

STM32 development board with a STM32H743VI microcontroller.Oscilloscope trace of a rising edge trigger and the STM32's GPIO pulse (25 ns), the latency is 97.60 ns./* Define output sections */
SECTIONS
{
  /* The startup code goes into ITCM (relocated from FLASH)  */
  .isr_vector :
  {
    . = ALIGN(4);
    __isr_vector_start = .;
    KEEP(*(.isr_vector)) /* Startup code */
    . = ALIGN(4);
    __isr_vector_end = .;
  } >ITCMRAM AT> FLASH

  .itcm_text :
  {
    . = ALIGN(4);
    __itcm_text_start = .;
    *(.itcm_text)
    *(.itcm_text*)
    . = ALIGN(4);
    __itcm_text_end = .;
  } > ITCMRAM AT> FLASH

  /* used by the startup to initialize data */
  _si_isr_vector = LOADADDR(.isr_vector);
  _si_itcm_text = LOADADDR(".itcm_text");# Basic compiler flags
CFLAGS  = -O2 -flto -Wall -Wextra -std=c99 -pedantic
CFLAGS += -DSTM32H743xx -DUSE_HAL_DRIVER

# debug symbols?
#CFLAGS += -g -ggdb

# If this macro is set, system_stm32h7xx.c overwrites the interrupt
# vector table address (VTOR register) to a custom address.
CFLAGS += -DUSER_VECT_TAB_ADDRESS=0x00000000void relocate_to_itcm(void)
{
        extern volatile char _si_isr_vector;
        extern volatile char __isr_vector_start, __isr_vector_end;

        volatile char *flash_isr_vector_start = &_si_isr_vector;
        volatile char *ram_isr_vector_start = &__isr_vector_start;
        volatile char *ram_isr_vector_end = &__isr_vector_end;
        size_t len = ram_isr_vector_end - ram_isr_vector_start;

        for (size_t i = 0; i < len; i++) {
                ram_isr_vector_start[i] = flash_isr_vector_start[i];
        }

#ifdef SEMIHOSTING
        printf("relocate %p-%p to %p, %d bytes\n", flash_isr_vector_start, flash_isr_vector_start + len, ram_isr_vector_start, len);
#endif

        extern volatile char _si_itcm_text;
        extern volatile char __itcm_text_start, __itcm_text_end;

        volatile char *flash_itcm_text_start = &_si_itcm_text;
        volatile char *ram_itcm_text_start = &__itcm_text_start;
        volatile char *ram_itcm_text_end = &__itcm_text_end;
        len = ram_itcm_text_end - ram_itcm_text_start;

        for (size_t i = 0; i < len; i++) {
                ram_itcm_text_start[i] = flash_itcm_text_start[i];
        }

#ifdef SEMIHOSTING
        printf("relocate %p-%p to %p, %d bytes\n", flash_itcm_text_start, flash_itcm_text_start + len, ram_itcm_text_start, len);
#endif
}__attribute__((section (".itcm_text")))
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
	if (GPIO_Pin != GPIO_PIN_0)
		return;

	GPIOA->BSRR = (uint32_t) GPIO_PIN_2;
	GPIOA->BSRR = (uint32_t) GPIO_PIN_2 << 16U;
}__attribute__((section (".itcm_text")))
void SysTick_Handler(void)
{
	HAL_IncTick();
}

/******************************************************************************/
/*                 STM32H7xx Peripherals Interrupt Handlers                   */
/*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
/*  available peripheral interrupt handler's name please refer to the startup */
/*  file (startup_stm32h7xx.s).                                               */
/******************************************************************************/
__attribute__((section (".itcm_text")))
void EXTI0_IRQHandler(void)
{
	HAL_GPIO_EXTI_Callback(GPIO_PIN_0);

	// Still make a dummy HAL call to ACK the IRQ
	// TODO: ACK it manually
	HAL_GPIO_EXTI_IRQHandler(0xFFFF);
}
0
1
0
0

收到 Kodak Charmera 相機的 GR 造型保護殼了!

設計的挺不錯的,一開始沒看說明影片,裝相機時差點直接弄壞......😂

裝了之後,感覺有比較好拿,只是快門釋放時間感覺有點微妙啊~~~

這兩天都沒出門,照片效果還是只能過兩天再試了。 :0540:

0

주말에 Pijul을 연습해봤다. Pijul은 패치 이론 기반의 VCS로, Pijul 패치는 Git의 커밋과 달리 순서가 (완전히는 아니지만) 상관없다. 그래서 Git의 merge, rebase, cherry-pick이 Pijul에서는 그냥 apply이다. 커밋은 나열해야하는 반면 패치는 마치 숫자처럼 '더할' 수 있다. 그래서 그런지 튜토리얼은 오히려 훨씬 쉬웠다. 배울게 적어서 너무 빨리 끝났다고 느꼈을 정도.

물론 실무에 투입하려면 여러가지 애로사항이 있을텐데 차차 공유해보겠다.

5
0
1
0
0
0
0
1
1

今天跟德國朋友一起去吃台式剉冰然後那個老闆問我朋友要不要加湯圓,他免費請他,然後我朋友「我不喜歡湯圓」,然後那個老闆就「哎呀我看外國人都喜歡QQ的東西」就還是把湯圓加進去了。
這讓我想起以前總是被教育不能說自己喜歡不喜歡什麼的事情,還有以前明明覺得就算別人好心請我但不要還是應該要說不要結果被朋友罵的一些過去。
我覺得去德國的時候我沒意識到自己的想法有什麼轉變,但回台灣我有很多時刻都意識到了。
包括我的家人就是老闆這種會覺得是對你好所以硬塞東西給你的性格。我覺得我也有過明確反抗的時候,但仍然被強迫了。
看見德國人理直氣壯會說自己喜歡討厭什麼但依然跟我同一個結局的時候,一邊覺得我果然也是努力過了、不應該責備自己太不主動表達自我,一邊又覺得真的好無語,我不喜歡這種事情的發生。

0

RE: social.lansky.name/@hn50/11623

摘要:Bezos 如何顛覆《華盛頓郵報》

原文出處: The New York Times, 2026/3/14
作者: Benjamin Mullin, Erik Wemple, Katie Robertson

---

亞馬遜創辦人 Jeff Bezos 自 2013 年以 2.5 億美元買下《華盛頓郵報》後,初期大舉投資,新聞編輯室規模一度倍增。然而近年報社讀者持續流失、年虧損逾一億美元,Bezos 的態度從放手經營轉為強勢介入,要求報社導入亞馬遜式的數據驅動與效率至上思維。
在高層人事上,Bezos 先後撤換了長期執行長 Fred Ryan,由親信 Patty Stonesifer 暫代,再聘請前《華爾街日報》發行人 Will Lewis 接任。Lewis 任內推動「第三新聞室」等實驗計畫,卻因繞過時任總編 Sally Buzbee 進行人事佈局,導致 Buzbee 離職,由前《華爾街日報》總編 Matt Murray 接替。Lewis 與編輯室之間的緊張關係持續升高。

2024 年底,Lewis 向 Bezos 提出裁員約 200 人的止血方案,但 Bezos 認為計畫缺乏數據基礎而退回。Murray 一度萌生辭意,Bezos 親自致電挽留,並賦予他主導裁員規劃的角色,提出更激進的目標:將編輯室預算砍半,同時要求留任者產出加倍。2025 年 2 月,報社裁撤約 350 名記者(約佔編輯室近半),體育、書評部門遭併裁,地方新聞大幅縮編,多數駐外記者也被解聘。超過六萬名讀者在該週取消數位訂閱。

在社論路線方面,Bezos 同樣大力改造。2024 年總統大選前,他取消了報社行之有年的總統候選人背書傳統,壓下一篇支持民主黨候選人 Kamala Harris 的社論草稿,引發大量退訂。隨後他進一步宣布社論版只刊登符合「個人自由與自由市場」立場的觀點,長期意見編輯 David Shipley 因此辭職。

裁員後數日,Lewis 被拍到出席超級盃活動,引發內外不滿,隨即辭職,由財務長 Jeff D'Onofrio 接任執行長。在裁員後的員工大會上,管理層以「每篇報導成本」等數據指標解釋決策,並預告將推出「受眾價值評分」系統來衡量報導效益。

2026 年 3 月,Bezos 在華盛頓宅邸宴請郵報高層,以類似亞馬遜的備忘錄會議形式討論未來方向。他坦承過去數年監督不力,但重申不會出售報社,並表示已回絕七次收購提議。郵報的命運,取決於這套以數據和效率為核心的轉型策略,究竟能扭轉頹勢,還是加速衰退。

0
0
0
1
0
1

LLM과 에이전트가 똑똑하고 유능해지면서 만족도가 크게 올라간 점 중 하나는 얘가

  • shell
  • git
  • docker/docker-compose

를 매우 잘 안다는 점이다. 이 도구를 잘 아는 동료가 팀에 있으면 참 든든한데, AI가 그 역할을 해서 이것 저것 의도를 설명하면 미처 몰랐던 기능과 옵션을 써서 해결해줌.

0

Debian is more stable than everyone I met.
發現我可能沉迷計算機技術和 開源相關是因為0和1是可以預測的,比起外部紛擾的世界,混沌的政治,一團糟的人生,混亂的自我,還有上下不定的情緒,這種掌控自我系統的感覺十分良好。同理也可以套用在打遊戲逃避現實的人身上,但是自由開源的運動從更底層——不單單只是廉價的多巴胺快感——給我一種擁有掌控全局的感覺。縱然FOSS世界也有很多drama,可是原始碼握在手上就可以確保自己的獨立性啊。

0

Hey people, and everyone else who has joined us recently!

You might be just learning about the thing that makes fediverse special, that it's made up of many communities spread across many servers running different platforms.

Now, I won't bore anyone with how all that works, but here are two cool ways to visualize this.

- data.stefanbohacek.com/project lets you see which servers you are connected to (I made this one!)
- moderation-explorer.online helps you understand the shared responsibility of fediverse moderators

Hope you'll enjoy!

A chart showing the breakdown of fediverse servers I am connected to. Each server is represented by a rectangle with its size corresponding to how many users I am connected to on that server.

The top 10 servers with most connections are highlighted in pinkish color, the rest are varying shades of gray.

The top 10 servers are listed alongside of the data breakdown:

mastodon.social: 882 connections (19.7%)
mstdn.social: 135 connections (3.0%)
hachyderm.io: 132 connections (3.0%)
mastodon.online: 98 connections (2.2%)
fosstodon.org: 88 connections (2.0%)
infosec.exchange: 84 connections (1.9%)
stefanbohacek.online: 70 connections (1.6%)
indieweb.social: 59 connections (1.3%)
mastodon.world: 57 connections (1.3%)
techhub.social: 44 connections (1.0%)
0
6
1
4
1

Following up on my adventures from a couple of weeks ago to replace DOMPurify with the new Sanitizer API for the HTML inline content in ActivityPub objects, I had to disable it, as I wasn't able to create a configuration setup that would allow as many things as the existing configuration.

Granted I am very lax with what DOMPurify is accepting (including inline styles for example) but I wasn't able to allow even inline tags and classes on that HTML.

So I'll wait a bit more, until the API percolates to other implementations outside of Mozilla, and have another try at a later date. :goose_hacker:

0

【BUILT-IN PRO 電器專門店特約】社交平台X用戶Samuel McCrae近日分享一段惡作劇經歷,引起網民熱議。他稱因一直懷疑妹妹養金魚只是一時興起,於是趁對方不留意時,悄悄將魚缸內兩條金魚撈走,再放入兩條顏色及外形相近的紅蘿蔔條,測試妹妹是否真的有用心照顧寵物。

Samuel表示,紅蘿蔔放進魚缸後雖然顏色與金魚相似,但畢竟不會游動,只能一直沉在缸底。他原以為妹妹很快便會發現異樣,沒想到過了3天,對方仍毫無察覺,照常生活。

事件曝光後,不少網民要求Samuel交代後續。他其後再更新近況,指到第4天時,妹妹依然未發現魚缸內的「金魚」其實只是兩條沉底紅蘿蔔,表現自然得令人意外。

帖文隨即引來大批網民討論。有人認為兄妹互動荒謬又好笑,但亦有不少人批評妹妹對寵物過於疏忽,質疑她根本無心照顧金魚。有網民直言,連續數天都未察覺魚隻毫無動靜,反映她並不適合養寵物;亦有人關注原有兩條金魚的情況,擔心牠們被當成惡作劇工具。

面對外界批評,Samuel其後上載照片回應,表示兩條金魚目前安全無恙,並已為牠們換上更大的魚缸,提供較以往更寬敞的生活環境,希望平息外界質疑。

May be an image of ‎centipede, worm, isopod, reptile, guppy and ‎text that says '‎KN 哥哥偷走金魚換紅蘿蔔 妹妹4日未黎覺 望 網民轟無心養寵物 03.01 03.01-03.3 03.31 九龍灣 MegaBox 6樓3號舗 SAMSUNG BUILT-IN SAMSUNGBUILT-INPRO PRO 智能 智能「視・ 智能「視·活」體驗館 「視 活」 體驗館 ר Neo QLED NeoQLED8K 8K 低至 6折 折‎'‎‎
0
1
0
0
1
0
1
0
0
1
0
0
1
0