Example project: https://github.com/quantrpeter/antlr-maven-project-setup
在pom.xml加上<developer>, <email>為你的hkprog登入電郵
然後登入hkprog.org,上載你的頭像
第一階段:動員十名編程資優生參與開源小工具開發。圍繞住Microsoft世界開發一些補完功能型的工具,再投放給香港各NGO使用
第二階段:動員一百名編程資優生,參與完整Full Stack開發,務求建立香港編程文化
第三階段:動員一千名編程資優生,向軟件界核心領域例如OS/Compiler等推進
" ["post_title"]=> string(8) "We serve" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(8) "we-serve" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2024-08-12 16:16:04" ["post_modified_gmt"]=> string(19) "2024-08-12 16:16:04" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(30) "https://www.hkprog.org/?p=1154" ["menu_order"]=> int(0) ["post_type"]=> string(4) "post" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" }口號 : 唔好講嘢,實際開發
香港編程學會為社會提供義務教育,吸引到一大批對編程有濃厚興趣之年青人,編程學會透過一系列課程,真接拉高他們之技術,令他們從小就擁有實際的軟件開發能力。現在是時候貢獻香港了,我們將會發起號召及組織,團結業界學界及年青人,貢獻一己的力量,開發一系列的開源工具,提升香港生產力及香港Programmer之榮譽感。
香港IT界一直以來給人的印象就是說話多,實際輸出少。 香港人過去二十年在軟件開發上連一個回憶都沒有。計劃作出三方面大膽嘗試
第一階段:動員十名編程資優生參與開源小工具開發。圍繞住Microsoft世界開發一些補完功能型的工具,再投放給香港各NGO使用
第二階段:動員一百名編程資優生,參與完整Full Stack開發,務求建立香港編程文化
第三階段:動員一千名編程資優生,向軟件界核心領域例如OS/Compiler等推進
七月份,香港編程學會舉辦了一場別開生面的聚會及生日會,展示了學會成員之間的團結和友誼。這次活動在一個溫馨的BBQ場地舉行,吸引了眾多成員參加。
活動開始時,學會主席致辭,回顧了過去一年的成就,並展望未來的計劃。隨後,成員們分享了各自的編程經驗和心得,討論了最新的技術趨勢和項目進展。這些交流不僅增進了彼此的了解,也激發了新的創意和合作機會。
在生日會環節,學會特別為七月份生日的成員準備了精美的蛋糕。大家一起唱生日歌,分享甜點,氣氛溫馨而愉快。這一刻,不僅讓壽星們感受到來自學會的關愛,也讓所有成員感受到集體的溫暖。
整個活動充滿了歡聲笑語,成員們在輕鬆愉快的氛圍中加深了彼此的友誼。這次聚會不僅展示了香港編程學會的團結一面,也為未來的合作奠定了堅實的基礎。
希望未來的每一次聚會,都能像這次一樣,充滿歡樂和溫暖,讓學會成員們在共同學習和成長的道路上,攜手並進。
注意,在bochsrcSDL.bxrc不需要這兩句,否則就會做成video framebuffer 0xb8000不能使用
範例代碼
bits 16 %define ONE 1 org 0x7c00 mov ax, 0xb800 mov es, ax mov byte [es:0], 'P' mov byte [es:1], 4 mov byte [es:2], 'e' mov byte [es:3], 3 loop1: jmp loop1 times 512-($-$$)-2 db 0 signature dw 0xaa55
############################################################### # bochsrc.txt file for DLX Linux disk image. ############################################################### # how much memory the emulated machine will have megs: 16 # hard disk ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 ata0-master: type=disk, path="hd.img", mode=flat, cylinders=40, heads=16, spt=63 # choose the boot disk. boot: c #display_library: term # other choices: win32 sdl wx carbon amigaos beos macintosh nogui rfb term svga display_library: sdl2 # where do we send log messages? log: bochsout.txt # disable the mouse, since DLX is text only mouse: enabled=0 magic_break: enabled=1 #debug: action=report info: action=report error: action=report panic: action=report
#!/bin/bash if [ $# != 4 ]; then echo "Usage : insertData.sh source dest <source skip position> <dest seek position>" exit; fi source_size=$(ls -l $1 | awk {'print $5'}) #dest_size=$(ls -l $2 | awk {'print $5'}) total_seek_size=$((source_size + $4)) #dd if=$2 of=insertData_temp skip=$total_seek_size ibs=1 obs=1MB > /dev/null if [ $4 = 0 ]; then rm -fr first touch first else echo "dd if=$2 of=first bs=$4 count=1"; dd if=$2 of=first bs=$4 count=1 fi #### back ##### echo "dd if=$2 of=back skip=1 bs=$total_seek_size"; dd if=$2 of=back skip=1 bs=$total_seek_size cat first $1 back > $2 rm -fr first back
編譯指令
nasm a.asm -l a.lst ./insertData.sh a hd.img 0 0 bochs -f bochsrcSDL.bxrc
下載nasm https://www.nasm.us/
下載bochs https://bochs.sourceforge.io/ , 如果在linux或mac,可以試下自己build
./configure --enable-debugger --enable-debugger-gui --with-sdl2 --with-nogui --with-term make -j make install
a.asm:
org 0x7c00 mov ax,1 mov bx,2 add ax, bx ; ax = ax + bx inc ax sub ax, bx ; ax = ax - bx mov ah, byte [ds:bx] xor ch,ch ; set zero mov byte [ds:bx], ch loop1: jmp loop1 times 512-($-$$)-2 db 0 signature dw 0xaa55
bochsrcSDL.bxrc:
############################################################### # bochsrc.txt file for DLX Linux disk image. ############################################################### # how much memory the emulated machine will have megs: 16 # filename of ROM images romimage: file=$BXSHARE/BIOS-bochs-latest vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest # what disk images will be used #floppya: 1_44=../bootimage, status=inserted #floppyb: 1_44=floppyb.img, status=inserted # hard disk #ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 #ata0-master: type=disk, path="hd10meg.img", cylinders=306, heads=4, spt=17 ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 #ata0-master: type=disk, path="10mb.img", mode=flat, cylinders=20, heads=16, spt=63 ata0-master: type=disk, path="hd.img", mode=flat, cylinders=40, heads=16, spt=63 #ata0-master: type=disk, path="../hd.img", mode=flat, cylinders=203, heads=16, spt=63 # 100MB #ata0-master: type=disk, path="../harddisk", mode=flat, cylinders=2080, heads=16, spt=63 # 1GB # choose the boot disk. boot: c #display_library: term # other choices: win32 sdl wx carbon amigaos beos macintosh nogui rfb term svga display_library: sdl2 # where do we send log messages? log: bochsout.txt # disable the mouse, since DLX is text only mouse: enabled=0 # enable key mapping, using US layout as default. # # NOTE: In Bochs 1.4, keyboard mapping is only 100% implemented on X windows. # However, the key mapping tables are used in the paste function, so # in the DLX Linux example I'm enabling keyboard_mapping so that paste # will work. Cut&Paste is currently implemented on win32 and X windows only. #keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-us.map #keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-fr.map #keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-de.map #keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-es.map magic_break: enabled=1 #debug: action=report info: action=report error: action=report panic: action=report
insertData.sh:
#!/bin/bash if [ $# != 4 ]; then echo "Usage : insertData.sh source dest <source skip position> <dest seek position>" exit; fi source_size=$(ls -l $1 | awk {'print $5'}) #dest_size=$(ls -l $2 | awk {'print $5'}) total_seek_size=$((source_size + $4)) #dd if=$2 of=insertData_temp skip=$total_seek_size ibs=1 obs=1MB > /dev/null if [ $4 = 0 ]; then rm -fr first touch first else echo "dd if=$2 of=first bs=$4 count=1"; dd if=$2 of=first bs=$4 count=1 fi #### back ##### echo "dd if=$2 of=back skip=1 bs=$total_seek_size"; dd if=$2 of=back skip=1 bs=$total_seek_size cat first $1 back > $2 rm -fr first back
Compile指令:
nasm a.asm -l a.lst dd if=/dev/zero of=hd.img count=3072 bs=10240 ./insertData.sh a hd.img 0 0 bochs -q -f bochsrcSDL.bxrc
Thank you HKOSCON, their Chairman Mr Sammy, and all members for the chance to present there
Stack例子:
import java.util.Stack; public class Example6 { public static void main(String args[]) { Stack<String> s = new Stack(); s.add("A"); s.add("B"); s.add("C"); s.remove(1); System.out.println(s.size()); System.out.println(s.pop()); if (!s.empty()) { System.out.println(s.pop()); } System.out.println(s.pop()); if (!s.empty()) { System.out.println(s.pop()); } } }
LinkedList例子:
import java.util.LinkedList; public class Example6 { public static void main(String args[]) { LinkedList<String> list = new LinkedList(); list.add("Peter 1"); list.add("Peter 2"); list.add("Peter 3"); for (int x = 0; x < list.size(); x++) { System.out.println(list.get(x)); } } }
注意 : 如果用VSCode打Code,淺灰式e:只是提示不是真正代碼,不用打去你段Code到
public class Example1{ public static void main(String args[]){ int score=55; if (score >= 80){ System.out.println("A"); }else if (score >= 60){ System.out.println("B"); }else if (score >= 40){ System.out.println("C"); }else{ System.out.println("F"); } System.out.println("End"); } }
class Example1{ public static void main(String args[]){ System.out.println("Hello World"); } }
Compile指令
javac Example1.java
java Example1
首先打錯字唔洗驚, 睇下個Error Message, 佢會有個箭咀指住大約錯邊個位, 同埋有個行數, 跟住就可以揾到錯邊
錯誤張文件名Save做.java.txt, 所有Java文件必需要用.java做尾. 你地係notebook到要簡下面嘅撰項
Get in HKPS website, you see "Hour Of Code" menu on top
If you are not registered yet, you jump in above page. Two options: register for teen or adult
This is the main screen, since we don't have many courses yet, so no search bar. "On going" means the course still has lessons, you may ask teacher questions. "Done" means the course is ended, no question to teacher.
View course info and video play back
McCode is a weekly event for coding enthusiasts who want to share their passion, learn new skills, and enjoy some delicious food. Every week, we meet at a local McDonald’s restaurant and work on different coding projects, challenges, and tutorials. Whether you are a beginner or an expert, you are welcome to join us and have fun with coding. McCode is a great opportunity to network with other coders, get feedback on your work, and discover new tools and resources. Plus, you get to enjoy some tasty burgers, fries, and drinks while you code. What’s not to love? If you are interested in joining McCode, please visit our website and sign up for our newsletter. We hope to see you soon at McCode, the coding event that satisfies your hunger for learning and eating.