首页
编程语言
数据库
网络开发
Algorithm算法
移动开发
系统相关
金融统计
人工智能
其他
首页
>
> 详细
COMP30023讲解、Image Tagger辅导、讲解C/C++语言、C/C++编程设计辅导 辅导Web开发|讲解R语言编程
COMP30023 Computer Systems 2019
Project 1: Image Tagger
Due date: 11:59pm on 29 April (Monday), 2019
Prepared by Junhao Gan and Lachlan Andrew
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
热点文章
更多
讲解 dts206tc applied linear...
2024-04-17
辅导 apstat.ge.2110 ap plied...
2024-04-17
辅导 econ 1103 002 & 013...
2024-04-17
辅导 busness 114 – accounti...
2024-04-17
讲解 rest0004: property inve...
2024-04-17
讲解 swen30006 software mode...
2024-04-17
讲解 interconnected worlds: ...
2024-04-17
讲解 problem set #1 – econ ...
2024-04-17
讲解 ad 685 term project辅导...
2024-04-17
辅导 math 194: problem set #...
2024-04-17
辅导 ceg 5301 assignment 5 a...
2024-04-17
辅导 chin0085 final exam que...
2024-04-17
辅导 mth 214 life insurance ...
2024-04-17
辅导 comm1110 evidence-based...
2024-04-17
讲解 cen103 – solids and st...
2024-04-17
辅导 stats 320 – applied st...
2024-04-17
辅导 ac1103 – accounting i ...
2024-04-17
讲解 fit3175 usability - s1 ...
2024-04-17
辅导 bx2031 sp51 2024 invest...
2024-04-17
讲解 cs 20a: data structures...
2024-04-17
热点标签
cs 61b
cs360
fin 3080
ierg 4080
cs6238
cit 594
finm7406
hw6
elec9713
asb-2522
lit301
mcd4540
geog0030
125.330
biol0006
125.320
cs3334
fit2093
acct1101
110.309
masy1-gc
cs314
elec0048
gds104
mg5637
mso3610
math5905
fit2096
comp3411
07
eel4837
sehs4515
cpt s 321
asb2522 investment
ma214
co2104
mgmt2015
32516
math32051
econ1012
mark2052
dsci 525
comp3310
econ0019
comp30023
abmf3184
aps106
antc27
finm7401
itp122
tech2300
math3026
comp9024
cs 2550
is2022
fit1047
36318
cao107
cs 211
ics4u
2xc3
en.540.635
4qqmn506
finn3081
phys10362
sta601
ec481e
math5165
csi 2120
el1205
comp7250
ecos3013
beam065
swen90004
info1113
sehh2042
comp2051
csc325
mne 6130
ai6126
inu1111
fit3152
finm7409
qbus2820
fins5516
cpt106
info6001
ecs150
is61x6
cse115
seng6110
bus265
cpts260
mphy0009
csc306
eco2011
ee3004
st332
idepg001
isom3028
eece 6083
ceg5304
mcd4700
eecs 493
eg25h4
38173
elc5216
infs6071
lubs5996m
7ssmm803
glbh0031
phys1120
comp52715
eeb240
soci3403
comp3334
psyc3241
fin570
218.323
lng310
rim3352
bio206
bu.450.760
math3836
cmns3490
iy5610/4610
cpt304
ac6105
ac.f633
asb-3525
lng206
acfi302
cs 1501
cpt408
bust10134
soc100
infr11199
csci 2122
comp9334
csc1002
etf5650
eco202y1y
acct608
apm236
gbsh0007
efim20005
actl5105
elec 292
sdsc4026
ds2500
dts205tc
cs 455
swen20003
cs202
158.739-2024
eco2101
benv0149
ifb001
mth6142
phy344
infs3202/7202
fc308
st332/st409
eeng20004
cmt313
chc4008
6g6z0041
1cwk100
ec204
eng2008
stat512
comp20007
comp3331/9331
comp2111
sehh2239
envm3115/7205
fin3020
finn1037
mat187-written-homework
comp9311
csc3150
comp809
chc5223
bem2031
159.341
math3001
csme10003
pa3
ent204tc
finm1416
ib2680
phl349
culs30004
psych204-24a
csc 330
mecm30016
eap115
comp 330
aic2100
comp s380f
联系我们
- QQ: 99515681 微信:codinghelp
© 2024
www.7daixie.com
站长地图
程序辅导网!