more-projects.html 28.9 KB
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/picnicss/6.2.3/picnic.min.css" type="text/css" />

<style type="text/css">
body {font: arial;}
body {margin: 15px;}
body.constrained {margin: auto; max-width: 1000px;}
h1 {background: #fdb863; border: 1px solid black; text-align: center; padding: 5px; font-size: 1.15em;}
h2 {color: #e66101; font-size: 1.05em; margin-left: 0.5em;}
h3 {color: #5e3c99;font-size: 0.95em; margin-left: 1em;}
h3, p {margin-left: 1em;}
.en {float:left; clear:left; width: 45%; margin-left: 2%;}
.fr {float:right; clear:right; width: 45%; margin-right: 2%;}
.clear {clear:both;}
pre {margin-left: 30px; border: 1px solid #333; padding: 10px; background: #EEF;}
pre>code {background: none !important; border: none !important;}
em {color: darkgreen;}
code:not(.sourceCode) {background: #EEE; margin: -2px; padding: 2px; border: 1px solid #DDD}
.lineNumbers {width: 40px;}

.WARN {background: red;}
.WARN code {background: black; color: white;}
blockquote {border: 1px solid grey; border-left: 3px solid black; padding: 0;}
blockquote p {padding: 0;}
</style>
<script>
window.onload = function() {
if (window.location.hash != "") {
window.document.body.classList.remove("constrained");
setTimeout(function() {history.go(0)}, 2000);
}
}
</script>

</head>
<body class="constrained">
<h2 id="updates">Updates</h2>
<!--
- Updated deliverable and defense dates.

- Details on the protocol.md file: explain what is meant by
-->
<h3 id="section">2017-01-24</h3>
<ul>
<li>First version, with general instructions and deliverables</li>
</ul>
<h1 id="expectations-for-the-project">Expectations for the Project</h1>
<p>The project will be evaluated based on your ability to show you acquired knowledge and skills about peer to peer (P2P), network programming, concurrent programming and software engineering. You'll be working in groups (of 3/4 students) and you'll probably share the work load. While only some of you might fight with each particular line of code and detail, it is expected that each group member have an understanding of the project as a whole (and can explain any of its parts).</p>
<p>A good project, deliverables and defense should show that you understood and know how to:</p>
<ul>
<li>organize yourselves,</li>
<li>design a protocol,</li>
<li>structure a P2P system,</li>
<li>use TCP sockets,</li>
<li>handle mixed text/binary data,</li>
<li>test your software properly,</li>
<li>learn from your experience by conducting a proper retrospective,</li>
<li>present your work,</li>
<li>use the git version control system to collaborate cleanly.</li>
</ul>
<h2 id="instructions-for-good-development-practices">Instructions for Good Development Practices</h2>
<p>About documents:</p>
<ul>
<li>write your documentation in markdown (.md) so that it is automatically nicely display in github (check that it is displayed well)</li>
</ul>
<p>About git:</p>
<ul>
<li>do not commit generated files (and use a <code>.gitignore</code> so that <code>git status</code> shows up clean),</li>
<li>do not use git just to store a zip of your project,</li>
<li>if your repository starts to reach several MB in size, there is probably an issue,</li>
<li>commit/push often, so you don't fear making changes,</li>
<li>provide good commit messages (e.g., see a <a href="http://chris.beams.io/posts/git-commit/">post about commit messages</a>) that describe the changes and the reason for these changes,</li>
<li>use English for all commit messages,</li>
<li>if you pair-program in front of single machine, mention in the message who contributed to the commit (you'd be surprised how fast you can forget who did what on a project),</li>
</ul>
<p>About your code:</p>
<ul>
<li>write your code in English,</li>
<li>indent/format your code properly, learn how to use your tools to do it,</li>
<li>avoid mixing spaces and tabs (ideally, don't use tabulations),</li>
<li>keep your code clean: do not use global/static variables, choose your names carefully (packages, classes, functions, etc), follow some/the conventions (e.g., <a href="http://www.oracle.com/technetwork/java/codeconventions-135099.html">java convention</a>), use constants for constant values, ...</li>
</ul>
<p>You're writing software, and especially networking and concurrent software, so:</p>
<ul>
<li>test a lot and often,</li>
<li>have automated tests,</li>
<li>have stress tests,</li>
<li>have tests for &quot;bad&quot; behaviors from other peers (e.g., a peer connecting but not sending anything),</li>
<li>document how to use, compile, test and start your project,</li>
<li>document how to understand and continue your project.</li>
</ul>
<h2 id="reuse-and-attribution">Reuse and Attribution</h2>
<p>Whenever re-used code/text/definitions/... coming from external sources, <strong>you must properly cite your sources</strong>. In particular, your must specify in your README.md (in your git repository) the source of external code you used, who are the authors, what is the license, and what effort you had to make to understand and integrate, ... Not doing this properly may be against the law (license terms) and against the university policies (in french, <a href="http://www.universite-lyon.fr/plagiat" class="uri">http://www.universite-lyon.fr/plagiat</a>).</p>
<h2 id="project-deliverables-via-github">Project deliverables (via github)</h2>
<p>For all deliverables, I will clone the project from your github repository (no handing-in by email or other means). This can happen at any the moment after the date is passed.</p>
<p>All textual documents should preferably be in a text-based format, such as <code>.md</code> (markdown <a href="https://help.github.com/articles/github-flavored-markdown/" class="uri">https://help.github.com/articles/github-flavored-markdown/</a>) that displays nicely on github.</p>
<h3 id="protocol-specification-february-6-13h00">Protocol Specification (February 6, 13h00)</h3>
<p>Your repository <strong>must</strong> contain, at least, the following element. A file named <code>protocol.md</code>, that describes your protocol in sufficient details, such that someone else could read it and implement a peer that is compatible with yours. This work has to be done in metagroups (see the group composition email). Each group <strong>must</strong> commit a protocol description but it should be the same for all groups in a meta-group.</p>
<p>Describing a protocol involves different aspects, for which you can find examples in the courses:</p>
<ul>
<li>what programs sends what messages to what other program,</li>
<li>when each message is sent (and in which order their are sent),</li>
<li>what is the content of each exchanged message,</li>
<li>what is the semantic/meaning of each message,</li>
<li>what is the data format of the messages (how it is actually encoded/serialized on the network),</li>
<li>etc.</li>
</ul>
<h3 id="final-deliverable-march-16-23h59">Final Deliverable (March 16, 23h59)</h3>
<p>Your repository <strong>must</strong> contain, at least, the following elements:</p>
<ul>
<li><code>protocol.md</code>
<ul>
<li>your protocol description, in its updated version, if you changed the protocol since the first deliverable</li>
</ul></li>
<li><code>README.md</code>
<ul>
<li>a paragraph at least about your subject</li>
<li>instructions on how to obtain, build, run, test, ..., your project</li>
<li>a description of the architecture (what parts interacts how with what other parts)</li>
</ul></li>
<li><code>retrospective.md</code>, about organization of the work, technology, etc
<ul>
<li>compared to your objectives: what works, what does not work yet</li>
<li>the difficulties you faced</li>
<li>the lessons you learned</li>
<li>what you would keep for next time</li>
<li>what you would do differently</li>
</ul></li>
<li><code>auto-evaluation.md</code>, which should contain:
<ul>
<li>the time spent (in hours) by each member of the project</li>
<li>the parts on which each member worked</li>
<li>for each item in the “Good Development Practices” section, an evaluation of how much you followed the practice</li>
</ul></li>
</ul>
<h3 id="project-defense-march-20">Project Defense (March 20)</h3>
<p>NB: the organization of the defense might change, more on that later.</p>
<p>The first part of your defense should be a product presentation, as if you were presenting/selling your project to a semi-technical client, not detailing too much the low level details. The “retrospective” part should be an honest evaluation of your work. Ideally, your slides should also be committed in your git repository.</p>
<h3 id="typical-defense-indicative-timings-for-a-4-person-group">Typical Defense (indicative timings for a 4-person group)</h3>
<ul>
<li>2 minutes: setup in the room</li>
<li>5 minutes with slides: presentation of the project, what have been done, your choices, ...</li>
<li>5 minutes: project demo, ideally with multiple machines (the wifi router will be available)</li>
<li>5 minutes with slides: retrospective, how you worked in your group, auto-evaluation, what worked well, what was difficult, what you learned, strong/weak points of the projects (on the methodology and results)</li>
<li>5 minutes: questions</li>
</ul>
<h1 id="project-description-and-links">Project Description and Links</h1>
<p>Let's start with some reminders from the lessons. NB: you can navigate the slides using the left/right arrow keys or 'a'/'z' (you might need to click on the slide to give the focus first).</p>
<ul>
<li>Some slides about the project: <a href="./lesson-02.html#slide-27">lesson-02.html#slide-27</a></li>
<li>Some slides about bittorent: <a href="./lesson-04.html#slide-10">lesson-04.html#slide-10</a></li>
</ul>
<h2 id="peer-to-peer-file-sharing-terms-and-conditions">Peer to peer file sharing (terms and conditions)</h2>
<p>The goal of the project is to implement a peer-to-peer system inspired by BitTorrent, but different. Our system will not be compatible with BitTorrent. To avoid misunderstanding (on compatibility), we will use the following terms:</p>
<ul>
<li><em>Composition</em> (the actual data to share)
<ul>
<li>this can be any kind of file (video, music, ...)</li>
<li>as an extension, this could also be a set of files</li>
<li>each <em>composition</em> will be split into <em>parts</em></li>
</ul></li>
<li><em>Orchestra</em> (“torrent file” in BitTorrent)
<ul>
<li>this is a description of the <em>composition</em> to exchange</li>
<li>it can be stored as a text file that will be shared to all <em>members</em> (in a real case, this file could be stored on a webserver named “l411.me” that lists <em>orchestra</em> files)</li>
<li>the file extension <code>.orch</code> will be used</li>
<li>it contains the following informations
<ul>
<li>the address of the <em>conductor</em> (e.g., <code>192.168.6.66:42000</code>)</li>
<li>the name of the <em>composition</em></li>
<li>the size of the <em>composition</em></li>
<li>the size used for <em>parts</em></li>
<li>the number of <em>parts</em> (not mandatory, this is redundant)</li>
<li>for each <em>part</em>, its <em>SHA1</em></li>
</ul></li>
</ul></li>
<li><em>Part</em> (“piece” in BitTorrent)
<ul>
<li>this represents a part of a <em>composition</em> to download</li>
<li>this is the unit of exchange: <em>members</em> exchange <em>parts</em></li>
<li><em>parts</em> are all of the same size, except the last one (if the <em>composition</em> size is not a multiple of the <em>part</em> size)</li>
<li>the size of the <em>parts</em> is decided when creating the <em>orchestra</em> (e.g., 2kB)</li>
<li><em>SHA1</em>
<ul>
<li>this is a type of checksum that we will use to check the integrity of a <em>part</em></li>
<li>it is stored in the <em>orchestra</em> file</li>
<li>it is checked by the <em>member</em> when receiving a <em>part</em> (or when restarting with from a partially downloaded <em>composition</em>)</li>
</ul></li>
</ul></li>
<li><em>Member</em> (“peer” in BitTorrent)
<ul>
<li>this is a program exchanging <em>parts</em> with others <em>members</em></li>
<li>it first loads a <em>orchestra</em> file</li>
<li>it finds others <em>members</em> by querying the <em>conductor</em></li>
<li>it remembers (in memory) the <em>SHA1</em> of each <em>part</em></li>
<li>it remembers what <em>part</em> it has, and shares this information with others <em>members</em></li>
<li>it can ask <em>parts</em> to other <em>members</em></li>
<li>it can provide <em>parts</em> to other <em>members</em></li>
</ul></li>
<li><em>Conductor</em> (“tracker” in BitTorrent)
<ul>
<li>this is a program that maintains an updated list of all <em>members</em> exchanging the <em>composition</em></li>
<li>it provides, on demand by a <em>member</em>, a list of other <em>members</em> to connect to</li>
<li>it does nothing else: it does not download or upload any <em>part</em>, does not know what <em>member</em> has what <em>parts</em>, etc.</li>
</ul></li>
</ul>
<p>To have a functional peer-to-peer system, you will thus need to write 3 programs:</p>
<ul>
<li>A plain program named composer (used before starting to share some <em>composition</em>) that generates the <code>.orch</code> file corresponding to some <em>composition</em>.</li>
<li>A networked program named <em>conductor</em> (that will be started only once for any <em>orchestra</em>) which role is described above.</li>
<li>A networked program named <em>member</em> (that will be started by each user that want to download or share the <em>composition</em>) that .</li>
</ul>
<h2 id="help-with-the-composer">Help with the composer</h2>
<p>The composer, in its simple form, takes a file (e.g. a video file) and generates a <code>.orch</code> <em>orchestra</em> file. From a programming point of view, your program should receive the (input) filename of the <em>composition</em> and the (output) filename of the <em>orchestra</em> file.</p>
<p>It is recommended to write and use a utility function to convert any binary data (<code>byte[]</code> in Java) to a <em>SHA1</em> (String), so that this function can be reused also in the <em>member</em>. To make the project easier, here is a possible hashing function, using Java's <code>MessageDigest</code> class:</p>
<div class="sourceCode"><pre class="sourceCode java"><code class="sourceCode java"> <span class="co">// inspired by: http://www.mkyong.com/java/how-to-generate-a-file-checksum-value-in-java/</span>
<span class="kw">public</span> <span class="dt">static</span> String <span class="fu">bytesToSHA1</span>(<span class="dt">byte</span>[] bytes) {
<span class="kw">try</span> {
MessageDigest messageDigest = MessageDigest.<span class="fu">getInstance</span>(<span class="st">&quot;SHA1&quot;</span>);
<span class="dt">byte</span>[] digestedBytes = messageDigest.<span class="fu">digest</span>(bytes);
<span class="co">// convert the digestedBytes to hexadecimal format to reduce the size of the ouput</span>
String result = <span class="st">&quot;&quot;</span>;
<span class="kw">for</span> (<span class="dt">int</span> i = <span class="dv">0</span>; i &lt; digestedBytes.<span class="fu">length</span>; i++) {
result += Integer.<span class="fu">toString</span>((digestedBytes[i] &amp; <span class="bn">0xff</span>) + <span class="bn">0x100</span>, <span class="dv">16</span>).<span class="fu">substring</span>(<span class="dv">1</span>);
}
<span class="kw">return</span> result;
} <span class="kw">catch</span> (NoSuchAlgorithmException e) {
e.<span class="fu">printStackTrace</span>();
<span class="kw">return</span> <span class="kw">null</span>;
}
}</code></pre></div>
<p>The composer should read the file, <em>part</em> by <em>part</em>, and compute the <em>SHA1</em> of each <em>part</em>, writing the meaningful information in the <em>orchestra</em> file. You can use, in Java, the <code>FileInputStream</code> and <code>FileOutputStream</code> classes. You can use the <code>read(byte[] b, int off, int len)</code> method in <code>InputStream</code>, but be careful to read the documentation properly. Be also careful to handle the last <em>part</em> properly (it is most of time smaller than the other ones).</p>
<h2 id="help-with-the-conductor-options-only-if-you-base-system-works">Help with the <em>conductor</em> (+options, only if you base system works)</h2>
<p>The <em>conductor</em> is a TCP server that accepts connections from the <em>members</em> and answer their requests. As a summary:</p>
<ul>
<li>the <em>conductor</em> accepts <em>members</em> as clients</li>
<li>the <em>conductor</em> maintains a list of existing <em>members</em> (for its <em>composition</em>)</li>
<li>when a <em>member</em> asks the <em>conductor</em> for a list of other <em>members</em>, the <em>conductor</em> randomly selects and send a sub-part of the complete list of <em>members</em> (e.g., sends a list of at most 10 <em>members</em>)</li>
<li>periodically, the <em>conductor</em> checks that each <em>member</em> is still alive and responding, in order to maintain the list of peers clean,</li>
<li>the <em>conductor</em> doesn't need to have the <em>orchestra</em> file</li>
</ul>
<p><strong>(option)</strong> A <em>conductor</em> can also handle multiple <em>orchestra</em> at the same time (acting as a <em>conductor</em> for multiple <em>composition</em>). This option requires to update the <em>member</em> too.</p>
<p><strong>(option)</strong> A <em>conductor</em> can also periodically ask the <em>members</em> what <em>parts</em> they have and try to be smart when a new <em>member</em> asks for a list of <em>members</em>. Warning: it is sometimes difficult to be smarter than random (without creating critical corner cases).</p>
<h2 id="help-with-the-member-options-only-if-you-base-system-works">Help with the <em>member</em> (+options, only if you base system works)</h2>
<p>A <em>member</em> is a TCP server that accepts connections from others <em>members</em>, but it also connects to <em>conductor</em> (to get the addresses of other <em>members</em>) and to other <em>members</em> (to exchange <em>parts</em>).</p>
<ul>
<li>the <em>member</em> load a <em>orchestra</em> file from the hard drive</li>
<li>the <em>member</em> loads the corresponding <em>composition</em> from the hard drive, if it has it</li>
<li>if the <em>member</em> had the file, it must check which <em>parts</em> are valid, using the <em>SHA1</em></li>
<li>the <em>member</em> connects to the <em>conductor</em> to ask a list of other <em>members</em></li>
<li>the <em>member</em> connects to each such other <em>member</em>, and they exchange the list of <em>parts</em> they have</li>
<li>the <em>member</em> asks a missing <em>part</em> to another <em>member</em>, following its own strategy (random can be ok)</li>
<li>the <em>member</em> sends a <em>part</em> to another <em>member</em> asks it</li>
<li>the exchanges between <em>members</em> must happen in parallel (a <em>member</em> asks multiple <em>parts</em> to multiple <em>members</em> but also answers to the requests from other <em>members</em>),</li>
<li>the <em>members</em> periodically exchange the list of <em>parts</em> they have</li>
<li>from time to time (depending on its strategy), the <em>member</em> asks a new list to the <em>conductor</em> and to these <em>members</em></li>
<li>when the <em>composition</em> is complete or the application is closed, the <em>member</em> saves it to disk</li>
</ul>
<p>This can be easier to implement or seen as an option. The <em>member</em> can create, from the beginning, a file with the proper size (the size of the <em>composition</em>), with a random content, and save each <em>part</em> as soon as it is validly received (using for instance Random Access files). This lowers the memory requirements for the peers, but might use the hard drive more.</p>
<p><strong>(option)</strong> When a <em>member</em> receives a list of other <em>members</em> and tries to connect to them, if a connection problem happens, it can “complain” to the <em>conductor</em>. The <em>conductor</em> can then trigger the “liveliness” test on this peer, leading to a faster cleanup of its <em>members</em> list.</p>
<p><strong>(option)</strong> Implement and compare different strategies on the choice of <em>members</em>/that the <em>member</em> decide to ask.</p>
<p><strong>(option)</strong> Make the <em>composition</em> being possibly composed of multiple files (or even folders and subfolders). This option probably requires the adaptation of the composer.</p>
<h2 id="general-help">General help</h2>
<p>To test on different machines, you won't be able to use the university wifi. You can use a smartphone to setup a dedicated wifi, by using the “wifi tethering” option (even if you have no data connection (Edge, 3G, etc) on your phone).</p>
<p>In Java, the <code>Map</code> hols a key→value association and is very very useful. If “keys” are simple integers, starting from <span class="math inline">0</span> to <span class="math inline"><em>N</em> − 1</span> (with <span class="math inline"><em>N</em></span> known), then an array might as well work.</p>
<p>You'll have to mix textual and binary data in your network exchanges, you can use the <code>readLine</code> reimplementation done in the course. You should also use the principle of message queues (<code>BlockingQueue</code>) seen in the course.</p>
<p>An interesting tip, when using a queue: not all messages have to come from the network and a thread can even send itself some message. Following this reasoning, another trick to help implementing a timeout, is to use a Java <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Timer.html">Timer</a> that sends adds a message to a queue after some delay:</p>
<div class="sourceCode"><pre class="sourceCode java"><code class="sourceCode java"> <span class="dt">long</span> dur = <span class="dv">5000</span>;
Timer t = <span class="kw">new</span> Timer(<span class="kw">true</span>);
t.<span class="fu">schedule</span>(<span class="kw">new</span> TimerTask() {
<span class="fu">@Override</span> <span class="kw">public</span> <span class="dt">void</span> <span class="fu">run</span>() { <span class="kw">try</span> {
blockingQueue.<span class="fu">put</span>(<span class="kw">new</span> <span class="fu">Message</span>(<span class="kw">null</span>, <span class="st">&quot;COOL COOCOOCOOL&quot;</span>));
} <span class="kw">catch</span> (InterruptedException ex) {
Logger.<span class="fu">getLogger</span>(<span class="kw">this</span>.<span class="fu">getClass</span>().<span class="fu">getName</span>()).<span class="fu">log</span>(Level.<span class="fu">SEVERE</span>, <span class="kw">null</span>, ex);
}}
}, dur);</code></pre></div>
<h2 id="teams-groups-etc">Teams, Groups, etc</h2>
<h3 id="group-a-java-abc">Group A − Java − ABC</h3>
<ul>
<li>Sana HOUCH − SanaHOUCH</li>
<li>Anas BENAMOU − anbanasmou</li>
<li>Feras AL-KASSAR − enferas</li>
</ul>
<h3 id="group-b-java-abc">Group B − Java − ABC</h3>
<ul>
<li>Amine IDIR − idiramine</li>
<li>Youssef DRIDI − DrYous</li>
<li>Youssef MCHICH − youssefmchich</li>
</ul>
<h3 id="group-c-java-abc">Group C − Java − ABC</h3>
<ul>
<li>Oussama BOULDJEDRI − Oussamab21</li>
<li>Usama JAVAID − Usama113</li>
<li>Joe RENNER − joerenner</li>
<li>Austin SCHWINN − amschwinn</li>
</ul>
<h3 id="group-d-python-def-torrentnchill">Group D − Python − DEF − torrentNchill</h3>
<ul>
<li>Sejal JAISWAL − druaGa</li>
<li>Jorge CHANG − fortachong</li>
<li>Edward BEECHING − edbeeching</li>
<li>Arlsen REMACI − Arslen</li>
</ul>
<h3 id="group-e-java-def">Group E − Java − DEF</h3>
<ul>
<li>Valentin BENOZILLO − koolok</li>
<li>Mathieu VIOLA − mathieu-viola</li>
<li>Rémi VIOLA − RemiViola</li>
</ul>
<h3 id="group-f-java-def">Group F − Java − DEF</h3>
<ul>
<li>Dimitris TSALOKIDIS − EucliTs0</li>
<li>Maedeh AFSHARI − sanazafshari</li>
<li>Ishwar PURUSHOTHAM − ishwar</li>
<li>Kahina OUZIA − Kahi-Na</li>
</ul>
<h3 id="group-g-python-ghi-workbees">Group G − Python − GHI − Work Bees</h3>
<ul>
<li>Renuka CHITTIMALA − renukachittimalla</li>
<li>Marouane GAZOUZI − Kimeur</li>
<li>Arunava MAULIK − Arunavameister</li>
</ul>
<h3 id="group-h-java-ghi">Group H − Java − GHI</h3>
<ul>
<li>Clement SCHMIT − Mastique</li>
<li>Jérémie BLANCHARD − thezeken</li>
<li>Josselin MARNAT − jmarnat</li>
<li>Anthony DEVEAUX − Drydge</li>
</ul>
<h3 id="group-i-java-ghi">Group I − Java − GHI</h3>
<ul>
<li>Aka Pierre Marie COBBOLD − cedriccob</li>
<li>Edhatt RAGEL − Edhatt</li>
<li>Romaissa KIRECHE − KMaissa</li>
</ul>
<h3 id="group-j-python-jklm-voyager">Group J − Python − JKLM − Voyager</h3>
<ul>
<li>Prem PRAKASH − prem2017</li>
<li>Navdeep KUMAR − navdeepkaushish</li>
<li>Rahul CHANDNANI − rahulchandnani</li>
</ul>
<h3 id="group-k-java-jklm">Group K − Java − JKLM</h3>
<ul>
<li>Clement CHAMBON − traglom</li>
<li>Alexis BARTHELEMY − Sangfer</li>
<li>Julien BRAT − jbrat</li>
<li>Kevin ABRIAL − kabrial</li>
</ul>
<h3 id="group-l-java-jklm">Group L − Java − JKLM</h3>
<ul>
<li>Assandi BACO − Bassandi</li>
<li>Slimane MAKHLOUF − slimaneMakh</li>
<li>Youcef MESSAOUD − ekehe</li>
<li>Néssim SLIMANI − Zesskiller</li>
</ul>
<h3 id="group-m-java-jklm">Group M − Java − JKLM</h3>
<ul>
<li>Zubair Hussain − ZubairHussain</li>
<li>Rashid Saleem − coolxid</li>
<li>Syed Bilal Ahsan − SBAEdu</li>
</ul>
<!-- clicky Cla -->
<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push(100779706);
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//static.getclicky.com/js';
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/100779706ns.gif" /></p></noscript>


<!-- Histats.com START (aync)-->
<script type="text/javascript">var _Hasync= _Hasync|| [];
_Hasync.push(['Histats.start', '1,2767123,4,0,0,0,00010000']);
_Hasync.push(['Histats.fasi', '1']);
_Hasync.push(['Histats.track_hits', '']);
(function() {
var hs = document.createElement('script'); hs.type = 'text/javascript'; hs.async = true;
hs.src = ('http://s10.histats.com/js15_as.js');
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs);
})();</script>
<noscript><a href="http://www.histats.com" target="_blank"><img src="http://sstatic1.histats.com/0.gif?2767123&101" alt="javascript hit counter" border="0"></a></noscript>
<!-- Histats.com END -->
</body>
</html>