首页
编程语言
数据库
网络开发
Algorithm算法
移动开发
系统相关
金融统计
人工智能
其他
首页
>
> 详细
讲解COMP30023、辅导C++程序设计、讲解Image Tagger、C++辅导 辅导Python编程|讲解R语言编程
COMP30023 Computer Systems 2019
Project 1: Image Tagger
Due date: 11:59pm on 29 April (Monday), 2019
Background. Nowadays, search engines have been an essential part of our lives, e.g., Google and
Bing, which have significantly improved our productiveness. There are various types of searching
services, among which keyword search is the dominant one, namely searching by keywords. While
keyword search works well for documents, pages and websites, it faces a big challenge when searching
for images. This is because linking images with keywords is typically difficult for computers as it
requires understanding on the semantic of images. For this purpose, tagging images with keywords
is one of the most effective ways to help computers understand images’ semantic, and this is
also the first step to help machines learn (by telling them which is correct and which is wrong).
Unfortunately, tagging a large number of images is boring and requires a substantial amount of
human power. In this project, you will make the boring tagging process more funny by implementing
a network game server that tags images as people play. (The idea was invented by the inventor
of re-Captcha and Duo-lingo; Google bought the company and shut down the game.)
The Rules of the Game. The game consists of two players and one server, where each of the
players can only communicate with the server (but the other player). At the beginning, when the
two players log on to the server, the server sends both of them a same image. The game then
starts; the players submit words or phrases to the server, one at a time, without being told what
the other player has inputed. The goal for both the players is to enter a word or a phrase that has
been submitted by the other as soon as possible. Obviously, in order to maximise the chance of
getting a match, the two players would better to enter words that describe the image well, since it
is the only information shared by both of the two. (The image is, therefore, tagged.) Once the goal
is achieved, the game ends; the server sends a web page indicating that the game is completed and
prompting the players to play again. If both the players agree to play again, the process repeats
with a new image.
Project Basic Functionalities. In this project, you are asked to write a program to implement
(by socket programming in C) the aforementioned game server supporting two players from
two different browsers over HTTP. The program should allow users to configure both the server IP
address and the port number. Specifically, you need to implement the following basic functionalities
of the server, where the html source files of all the pages will be provided.
The Welcome Page. The server should be able to accept persistent TCP connections from the
players and return a Welcome Page (as shown in Figure 1) upon the establishment of the
connection. Specifically, the page consists of:
– a title, i.e., Image Tagger Game,
– a welcome image,
– a welcome phrase,
– a textbox for players to enter their name, and
– a button with text “submit”, by pressing which the name entered in the textbox will be
sent to the server by the http POST method;
1When a player name is submitted, the server should be able to record the name and return the
Main Menu Page (see Figure 2).
Figure 1: welcome.html
Figure 2: start.html
The Main Menu Page. The Main Menu Page (as shown in Figure 2) has two buttons right below
2the image: (i) the “Start” button, and (ii) the “Quit” button.
– When the “Start” button is clicked, an HTTP GET request is sent to the server. Upon
receiving the request, the server returns the Game Playing Page (see Figure 3).
– When the “Quit” button is clicked, the current player quits the game and a POST request
is sent to the server. Upon receiving this POST request, the server returns the Game
Over Page (i.e., Figure 7) to the current player, and to the other player when he/she
submits their next keyword.
The Game Playing Page. The Game Playing Page (as shown in Figure 3) contains a keyword
textbox which is for players to type keywords as their attempts. When the button “Guess” is
clicked, the keyword in the textbox is sent to the server (by a POST request). The server should
then perform the following actions:
Step 1. Check whether the other player is ready to play. If so, go to Step 2; otherwise, return the
Keyword Discarded Page (i.e., Figure 4) to the current player indicating that the other
player is not ready yet and the keyword just inputed is discarded.
Step 2. Check whether or not the submitted keyword has ever been submitted by the other player.
If so, the server returns the Game Completed Page to the current player and to the other
player when he/she submits the next guess. Otherwise, the server returns the Keyword
Accepted Page (i.e., Figure 5) to the current player and the game continues.
Figure 3: first_turn.html
The Keyword Discarded Page. In the Keyword Discarded Page (as shown in Figure 4), when
the “Guess” button is clicked, the server performs exactly the same actions as what it does in
the Game Playing Page.
3 The Keyword Accepted Page. In the Keyword Accepted Page (as shown in Figure 5), when
the “Guess” button is clicked, the server performs the same actions as what it does in the Game
Playing Page, except that the server does not need to check whether the other player is ready
or not.
The Game Completed Page. For the Game Completed Page, the server performs the same
actions as what it does in the Main Menu Page.
The Game Over Page. This page shows “Game Over!”. The server closes the TCP connection.
Advanced Functionalities. In order to implement the following advanced functionalities, you
will need to “generate” the html files dynamically rather than simply using the static html files
provided. More specifically, you will need to insert or change some contents in the html files such
that it can show information dynamically according to what information the server has received.
Advanced Functionality 1: Showing the Inputed Keyword List. In the Keyword Accepted Page,
the page should show the list of keywords that have been successfully submitted by the player
so far.
Advanced Functionality 2: Identifying Players by Cookie. When a player connects to the server
for the first time, the server should be able to create a cookie for the player. Afterward, when a
player tries to connect to the server for the second time with a cookie, the server should be able
to identify the player by cookie and return directly the Main Menu Page showing the player’s
name (therefore, you will need an html file that can change dynamically) without asking the
player to submit his/her name in the Welcome Page.
Specific Requirements. Below are some specific requirements for the project:
The game server must be implemented by socket programming in C. Programs in other
languages will not be accepted and will result in zero mark.
The server must use HTTP protocol to communicate with the client browsers.
A makefile must be provided along with your code for compilation, and the compiled executable
binary must be named as image_tagger.
The image_tagger program must accept two parameters: (i) a specified server IP address,
and (ii) a specified port number.
When the program is started, it must print out the information of the IP address and the
port number of the server, as shown in Figure 8.
Hints. In this project, you can assume that everything in the test environment is friendly, namely,
there are no adversaries aiming to break down your program, neither unexpected connection drops.
In addition, below are some key knowledge that you may need to know to complete the project:
communicating with a client over a persistent TCP connection by socket programming in C;
sending an html file to the client browser;
4Figure 4: discarded.html
Figure 5: accepted.html
5Figure 6: endgame.html
Figure 7: gameover.html
$ image_tagger
image_tagger server is now running at IP:
on port
Figure 8: Example execution instance. Note: $ is the CLI prompt;
and
are input parameters.
parsing an http message received from a client browser such that the server can extract the
http method (whether it is a GET or a POST) and the contents in the message;
supporting two connections with two client browsers simultaneously, namely, multiplexing &
demultiplexing (some useful materials and good examples can be found here1
).
An important note: You will have a try on some of the above techniques in the labs in Week 5 and
Week 6. You may not want to miss them.
Marking Scheme. This project worths 15% of the subject. The marking scheme is as follows:
1http://www.beej.us/guide/bgnet/html/multi/advanced.html
6Marks Task
1 Configurable IP addresses and port numbers
1 HTTP over Persistent TCP Connections
1 Response to the player’s name submission
2 Response to the clicking the “Start” button
1 Response to the clicking the “Quit” button
3 Response to the clicking the “Guess” button
2 Displaying the keyword list
1 Identifying player by cookie
1 The use of Gitlab for version control
1 Code Quality
1 Build Quality (e.g., providing a makefile)
Questions. Any questions or doubts should be raised in the LMS Discussion Forum — Project 1.
Do not share implementation-specific source code on the discussion forum.
Submitting Your Source Code. The due date is at 11:59pm on 29 April (Monday) 2019.
You must submit, to both GitLab and LMS, your source code (with a makefile) in a .zip file
with a filename in the the format of
_comp30023_2019_project-1, e.g., junhaog_comp30023_2019_project-1.
Any failure to follow the filename format will result in a
2-mark deduction. Any missing submission from either Gitlab or LMS or both will be considered
a submission failure.
Late Submissions. There will be heavy penalties on late submissions. Any late submission will
be deduced 20% from the total marks in the first day, and an extra 1-mark deduction applies
to each day passing the deadline.
Zero Tolerance for Cheating. While you are allowed to discuss the project with your classmates
and search online to learn some related techniques to complete the project , you are required to
implement the program by your own. This means that every single line of the code must be written
by yourself. All submissions will be checked for plagiarism. Any confirmed case will receive
a 0 mark for the project outright, and be reported to the school for disciplinary actions.
7
联系我们
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-21:00
微信:codinghelp
热点文章
更多
辅导 comm2000 creating socia...
2026-01-08
讲解 isen1000 – introductio...
2026-01-08
讲解 cme213 radix sort讲解 c...
2026-01-08
辅导 csc370 database讲解 迭代
2026-01-08
讲解 ca2401 a list of colleg...
2026-01-08
讲解 nfe2140 midi scale play...
2026-01-08
讲解 ca2401 the universal li...
2026-01-08
辅导 engg7302 advanced compu...
2026-01-08
辅导 comp331/557 – class te...
2026-01-08
讲解 soft2412 comp9412 exam辅...
2026-01-08
讲解 scenario # 1 honesty讲解...
2026-01-08
讲解 002499 accounting infor...
2026-01-08
讲解 comp9313 2021t3 project...
2026-01-08
讲解 stat1201 analysis of sc...
2026-01-08
辅导 stat5611: statistical m...
2026-01-08
辅导 mth2010-mth2015 - multi...
2026-01-08
辅导 eeet2387 switched mode ...
2026-01-08
讲解 an online payment servi...
2026-01-08
讲解 textfilter辅导 r语言
2026-01-08
讲解 rutgers ece 434 linux o...
2026-01-08
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 99515681 微信:codinghelp
© 2024
www.7daixie.com
站长地图
程序辅导网!