Author Archives: admin
ubuntu , allow root to login mysql without sudo

公關力

fix TS1005 in spfx project

"extends": "./node_modules/@microsoft/rush-stack-compiler-3.9/includes/tsconfig-web.json",
Linear Regression in java

Road map to learn AI

The way to extend qemu TCG plugin functionality

Hi, if want to to provide other function-calls to TCG plugin, such as reading guest memory, follow these steps: https://peter.quantr.hk/2024/01/qemu-risc-v-log-all-memory-operations/ 5. Run in qemu 6. Edit xv6-riscv Makefile: References:
QEMU risc-v , log all memory operations

Step 1: Step 2: modify ./tests/tcg/plugins/mem.c , add this code in vcpu_mem() Step 3: in xv6-riscv change this to Then you see this References
Qemu's trace_memory_region_ops_write

I was trying to find the body of trace_memory_region_ops_write function in qemu source code, can't find it. It is generated by python script (log.py)
X11 is good but slow in starbucks

I am sitting in Starbucks with network speed 15Mbps and try to use X11 forward for Netbeans coding. XMing is very low screen resolution so I changed to x410. The text is super clear now but the bandwidth not enought, so a little bit lagging. You can see xming font is not clear in my […]
Corsair MP600 needs to upgrade SSD firmware otherwise speed is very slow

Latest SPFx, web parts not appear

Using latest SPFx with node v18, pack and deploy the app no error, but web parts not appear, because you missed this. When you upgrade your SharePoint project, beware of this
Netbeans programmatically add watch expression to the "watch window"

use this code pom.xml
RISC-V qemu doesn't log "PRIV" in every instruction

RISC-V qemu seems wrong because it doesn't log "PRIV:" in every instruction in qemu.log. Even mret is execute and the mode is changed, it doesn't log "PRIV". To fix this:
Create a breadboard FPGA

We tried to ask GOWIN to let us generate the bitstream but seems they are not willing to open their standard, xilinx and altera has no hope too. So for education purpose we now go for build a simple one. We found the way to break logic into LUTs, so we want to build a […]
NOR vs NAND flash

i finally found the differences between NOR and NAND flash, but just dont know what is it
WordPress Theme to support post-views-counter

To make the plugin works, need to call wp_footer() in footer.php
ENC28J60 + Arduino

CS人如何同EE人溝通

首先,你要承認幾點先 千萬唔可以俾佢地知你知呢幾樣野,否則死得好慘 要不停贊美呢幾樣野
Arduino Function Generator

I am using Nano and AD9833 to build a simple function generator. Code in here https://gitlab.com/quantr/hardware/arduino-function-generator
Arduino + AD9833 using library by Rob Tillaart

Buy the board here : https://item.taobao.com/item.htm?spm=a1z09.2.0.0.6caf2e8dU9c4dS&id=590166217396&_u=6buhab0a8d9 Install the library, see below Make sure connect these pins to the board, total 5 pins, follow below Refer to https://github.com/RobTillaart/AD9833 , more examples in https://github.com/RobTillaart/AD9833/tree/master/examples
Arduino + AD9833

Buy from here. I am using the example from here but ignore the switch buttons. You need to add this zip into the library and make sure don't install the other library call "AD9833", very important
Program與輪廻之對比

我想探討一下用電腦program與佛教輪廻之對比,唯先你必需要明白佛教講的核心理論就是無我,無常 Program之空性體驗 當你寫一段program去令電腦運行時,你所寫的每一行代碼你都會解釋到它的用途,所以你會有一種非常實在的感覺,但當你越鑽越深的時候,你會發現一個有趣現象就是你認為一個好實在的個體,例如 int x,去到深處你會發現它消失不見,又或者它可以同時出現在不同的空間之中。這正正體驗到佛教所講的無我,無我的意思是一件物件必定是由多個因緣所組成,它要在特定時刻和經由特定情況先至可以顯露在你面前,program都是一樣,你看不到只是你編程功力不夠
TheDB發展戰略圖

Rotate button by Arduino

Refer to https://zhuanlan.zhihu.com/p/349824627 , buy from here
MCP4725 I2C DAC Breakout board

Bought from here Testing maximum frequency, around 800us
GY-4725 board

Bought from here. This code test maximum frequency, around 1ms period is peak Documents
計準NPN了

Main point: calculate Ib, we can do it by Ib=Ic / Beta min OR Ib=(Vb - 0.7) / Rb
syscall.c for STM32 + XCubeAI

Redis uses its own protocol to communicate between redis-server and redis-client

I thought db client sending plain text command (in SQL) to server and server parse the command. But I found Redis and Mysql client communicate to server via a custom protocol, that prove the client parse the command, not the server socat -v tcp-listen:8001,reuseaddr,fork tcp:localhost:6379
FPGA Research

This is a synthesis of a simple verilog program in vivado
"大中華程序員"及"大香港程序員"之定義

"紅色程序員"又或者"大中華程序員"之定義: "大香港程序員"之定義
Funny Toy : Oscilloscope

I got this electronic toy from Taobao, i want to have more experience on soldering and putting different components on the PCB and making them work. After 3 hours in soldering and 1 hour in debugging, i finally make it works https://v.youku.com/v_show/id_XNjAyNDAwNDY2OA==.html?spm=a2hje.13141534.1_3.d_1&scm=20140719.manual.240103.video_XNjAyNDAwNDY2OA== All documents here
Nucleo-L476RG DAC

砌機 : FPGA

Lattice FPGA比STM32簡單, 我應該可以搞得掂 用户手册:           https://github.com/wuxx/icesugar-nano/blob/main/README.mdwin7串口驱动:   https://github.com/wuxx/icesugar-nano/blob/main/doc/usbser.inf原理图及源码:   https://github.com/wuxx/icesugar-nano 主要component其實得兩個: FGPA同粒Flash
CIO現象之觀察

已經同大部份嘅公營機構做過生意, 公營機構嘅IT部技術同hands-on氣氛同以下元素嘅關係 同以下元素有關係, 我解釋唔到點解, 但觀察得之係有一定關係
同香港啲阿叔嘅交流指引

香港有好多阿叔,業界學界商界全部都係由阿叔為主,同佢地只要係有少少聯絡,你都要好小心,以下是指引 香港唔存在"前輩"呢一層,我唔係話香港無人夠資格稱做前輩,而係真正稱得上係前輩嘅人太少,唔足以叫做一代人。所以要摒棄幻想,唔好諗住搞到啲阿叔去指導你,唔點你都算係咁。香港啲中小學生同年青人未知呢個事實,所以寫呢篇文。
同香港嘅IT人溝通之正確方法

香港啲技術人好小氣, 所以同佢地交流要好小心, 以下列出必需要注意嘅重點
Multimeter book, teach you how to build one

教學理念

其實香港啲IT教育大家心裏邊都覺得唔係太work, 至於點解唔work你問啲學生就知. 所以我打算宣揚呢個教學理念, 但係呢個理念太難(右圖), 所以先執行一個簡化版理念(左圖). 首先我地盡可能用自己開發嘅tool去教學生, 呢一點難度好大, 因為要求位老師真係實際咁開發到舊野出黎, 完整程度要足以教學, 咁樣可以收兩個好處, 老師保證足夠handson, 學生保證學到最handson嘅skill. 做到呢樣野相信教學會煥燃一新. 香港太多課程啲老師照稿讀, 根本自己就對自己所教嘅野無足夠深度嘅認識. 舉個例子, MIT嘅Operating system課程不單止老師可以創造一個OS, 佢地亦都可以帶領學生去創造一個OS, 而香港嘅OS課程只係吹下powerpoint, 抽少少concept寫少少C++就算數, 無論完整性都沒法同外國比. 又例如香港教compiler嗰班老師又有幾多個可以寫到一個完整compiler出黎, 咁樣仲走去教人唔知會教到啲咩知識出黎. 當老師真係攞得起自己舊野去教, 啲學生又學得識, 最後一步就係要啲學生投入返去開發個project, 咁老師同學生就會有一個可以共同進步嘅圈. 收到嘅好處就係啲學生唔會覺得老師無料, 老師唔會覺得學生廢. 係香港提出一啲會帶來改變嘅意見好危險, 我而家提出呢個理念肯定都好多人跳出黎插我, 佢地嘅原因不外乎就係話用人地嘅tool去教一樣收到好效果, 呢一點我都懶得去反駁.
Build a programmer for ATF22V10C using Arduino

https://www.ecstaticlyrics.com/electronics/ATF22V10C/ https://github.com/ole00/afterburner https://github.com/hansake/PLD_programmer