Browse Source

show java src snippets

Taco 1 year ago
parent
commit
55cbb381bc
2 changed files with 352 additions and 167 deletions
  1. 198 114
      entitlements.html
  2. 154 53
      entitlements.org

+ 198 - 114
entitlements.html

@@ -3,7 +3,7 @@
3 3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5 5
 <head>
6
-<!-- 2018-03-30 Fri 13:29 -->
6
+<!-- 2018-03-30 Fri 14:09 -->
7 7
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8 8
 <meta name="viewport" content="width=device-width, initial-scale=1" />
9 9
 <title>&lrm;</title>
@@ -233,45 +233,45 @@ for the JavaScript code in this tag.
233 233
 <h2>Table of Contents</h2>
234 234
 <div id="text-table-of-contents">
235 235
 <ul>
236
-<li><a href="#org6ad08da">1. Introduction</a></li>
237
-<li><a href="#org072de29">2. Data Model</a>
236
+<li><a href="#org8ae0a17">1. Introduction</a></li>
237
+<li><a href="#orge727dd4">2. Data Model</a>
238 238
 <ul>
239
-<li><a href="#org8d79393">2.1. Example wallet profile</a>
239
+<li><a href="#org6f71f81">2.1. Example wallet profile</a>
240 240
 <ul>
241
-<li><a href="#org095376e">2.1.1. Things to further investigate</a></li>
241
+<li><a href="#org347d6ce">2.1.1. Things to further investigate</a></li>
242 242
 </ul>
243 243
 </li>
244
-<li><a href="#org233a174">2.2. Example request</a>
244
+<li><a href="#orgf62bac9">2.2. Example request</a>
245 245
 <ul>
246
-<li><a href="#org9d58885">2.2.1. Things to further investigate</a></li>
246
+<li><a href="#org2ed1810">2.2.1. Things to further investigate</a></li>
247 247
 </ul>
248 248
 </li>
249 249
 </ul>
250 250
 </li>
251
-<li><a href="#orge5efe62">3. Data Comparison</a>
251
+<li><a href="#org543b48a">3. Data Comparison</a>
252 252
 <ul>
253 253
 <li>
254 254
 <ul>
255
-<li><a href="#orgfad2f2c">3.0.1. Things to further investigate</a></li>
255
+<li><a href="#org7b37c3c">3.0.1. Things to further investigate</a></li>
256 256
 </ul>
257 257
 </li>
258 258
 </ul>
259 259
 </li>
260
-<li><a href="#orged26f2d">4. Visualization</a>
260
+<li><a href="#orgb4b9266">4. Visualization</a>
261 261
 <ul>
262
-<li><a href="#orgee13539">4.1. Request</a></li>
263
-<li><a href="#org49e5f33">4.2. Contexts</a>
262
+<li><a href="#orgf5193c6">4.1. Request</a></li>
263
+<li><a href="#orgfc1d0ba">4.2. Contexts</a>
264 264
 <ul>
265
-<li><a href="#org345b713">4.2.1. Things to further investigate</a></li>
265
+<li><a href="#orge1a149d">4.2.1. Things to further investigate</a></li>
266 266
 </ul>
267 267
 </li>
268 268
 </ul>
269 269
 </li>
270
-<li><a href="#org8278ef8">5. Interaction</a>
270
+<li><a href="#orge118bca">5. Interaction</a>
271 271
 <ul>
272 272
 <li>
273 273
 <ul>
274
-<li><a href="#orga48e52e">5.0.1. Things to further investigate</a></li>
274
+<li><a href="#org3e72422">5.0.1. Things to further investigate</a></li>
275 275
 </ul>
276 276
 </li>
277 277
 </ul>
@@ -279,8 +279,8 @@ for the JavaScript code in this tag.
279 279
 </ul>
280 280
 </div>
281 281
 </div>
282
-<div id="outline-container-org6ad08da" class="outline-2">
283
-<h2 id="org6ad08da"><span class="section-number-2">1</span> Introduction</h2>
282
+<div id="outline-container-org8ae0a17" class="outline-2">
283
+<h2 id="org8ae0a17"><span class="section-number-2">1</span> Introduction</h2>
284 284
 <div class="outline-text-2" id="text-1">
285 285
 <p>
286 286
 The purpose of this document is to investigate possible User Interaction designs for Decode task 4.4.
@@ -289,12 +289,12 @@ More specifically the focus is on investigating how the user of a decode wallet
289 289
 </div>
290 290
 </div>
291 291
 
292
-<div id="outline-container-org072de29" class="outline-2">
293
-<h2 id="org072de29"><span class="section-number-2">2</span> Data Model</h2>
292
+<div id="outline-container-orge727dd4" class="outline-2">
293
+<h2 id="orge727dd4"><span class="section-number-2">2</span> Data Model</h2>
294 294
 <div class="outline-text-2" id="text-2">
295 295
 </div>
296
-<div id="outline-container-org8d79393" class="outline-3">
297
-<h3 id="org8d79393"><span class="section-number-3">2.1</span> Example wallet profile</h3>
296
+<div id="outline-container-org6f71f81" class="outline-3">
297
+<h3 id="org6f71f81"><span class="section-number-3">2.1</span> Example wallet profile</h3>
298 298
 <div class="outline-text-3" id="text-2-1">
299 299
 <p>
300 300
 This sample wallet profile datastructure consists of multiple contexts.
@@ -307,7 +307,7 @@ Each context has a name and groups on or more properties that consist of a well
307 307
 A type can be part of more than one context. 
308 308
 </p>
309 309
 <div class="org-src-container">
310
-<pre class="src src-js" id="org831875d"><span style="color: #4f97d7; font-weight: bold;">var</span> <span style="color: #7590db;">profile</span> = <span style="color: #4f97d7;">{</span>
310
+<pre class="src src-js" id="orgda542ab"><span style="color: #4f97d7; font-weight: bold;">var</span> <span style="color: #7590db;">profile</span> = <span style="color: #4f97d7;">{</span>
311 311
     contexts : 
312 312
     <span style="color: #bc6ec5;">[</span>
313 313
         <span style="color: #2d9574;">{</span>
@@ -357,8 +357,8 @@ process.stdout.write<span style="color: #4f97d7;">(</span>JSON.stringify<span st
357 357
 </div>
358 358
 </div>
359 359
 
360
-<div id="outline-container-org095376e" class="outline-4">
361
-<h4 id="org095376e"><span class="section-number-4">2.1.1</span> Things to further investigate</h4>
360
+<div id="outline-container-org347d6ce" class="outline-4">
361
+<h4 id="org347d6ce"><span class="section-number-4">2.1.1</span> Things to further investigate</h4>
362 362
 <div class="outline-text-4" id="text-2-1-1">
363 363
 <ul class="org-ul">
364 364
 <li>Make a big list of possible property types (at least properties that are used in Gebied Online)</li>
@@ -373,15 +373,15 @@ process.stdout.write<span style="color: #4f97d7;">(</span>JSON.stringify<span st
373 373
 </div>
374 374
 </div>
375 375
 
376
-<div id="outline-container-org233a174" class="outline-3">
377
-<h3 id="org233a174"><span class="section-number-3">2.2</span> Example request</h3>
376
+<div id="outline-container-orgf62bac9" class="outline-3">
377
+<h3 id="orgf62bac9"><span class="section-number-3">2.2</span> Example request</h3>
378 378
 <div class="outline-text-3" id="text-2-2">
379 379
 <p>
380 380
 This sample application request consists of an application name, a set of required property types and a set of optional property types.
381 381
 </p>
382 382
 
383 383
 <div class="org-src-container">
384
-<pre class="src src-js" id="orgfbf0d34"><span style="color: #4f97d7; font-weight: bold;">var</span> <span style="color: #7590db;">request</span> = <span style="color: #4f97d7;">{</span>
384
+<pre class="src src-js" id="org3a0460b"><span style="color: #4f97d7; font-weight: bold;">var</span> <span style="color: #7590db;">request</span> = <span style="color: #4f97d7;">{</span>
385 385
     application : <span style="color: #2d9574;">"decodeapp:facebook"</span>,
386 386
     required : <span style="color: #bc6ec5;">[</span><span style="color: #2d9574;">"decode:name"</span>, <span style="color: #2d9574;">"decode:email"</span>, <span style="color: #2d9574;">"decode:address"</span><span style="color: #bc6ec5;">]</span>,
387 387
     optional : <span style="color: #bc6ec5;">[</span><span style="color: #2d9574;">"decode:phone"</span><span style="color: #bc6ec5;">]</span>
@@ -392,8 +392,8 @@ process.stdout.write<span style="color: #4f97d7;">(</span>data<span style="color
392 392
 </div>
393 393
 </div>
394 394
 
395
-<div id="outline-container-org9d58885" class="outline-4">
396
-<h4 id="org9d58885"><span class="section-number-4">2.2.1</span> Things to further investigate</h4>
395
+<div id="outline-container-org2ed1810" class="outline-4">
396
+<h4 id="org2ed1810"><span class="section-number-4">2.2.1</span> Things to further investigate</h4>
397 397
 <div class="outline-text-4" id="text-2-2-1">
398 398
 <ul class="org-ul">
399 399
 <li>Create a generator that seeds a request with random required and optional property types</li>
@@ -404,8 +404,8 @@ process.stdout.write<span style="color: #4f97d7;">(</span>data<span style="color
404 404
 </div>
405 405
 </div>
406 406
 
407
-<div id="outline-container-orge5efe62" class="outline-2">
408
-<h2 id="orge5efe62"><span class="section-number-2">3</span> Data Comparison</h2>
407
+<div id="outline-container-org543b48a" class="outline-2">
408
+<h2 id="org543b48a"><span class="section-number-2">3</span> Data Comparison</h2>
409 409
 <div class="outline-text-2" id="text-3">
410 410
 <p>
411 411
 During the interaction we want to give the user insight into a couple of things;
@@ -421,60 +421,29 @@ In below ruby code a comparison is made by on creating the intersection and its
421 421
 </p>
422 422
 
423 423
 <div class="org-src-container">
424
-<pre class="src src-ruby" id="org3ba9759"><span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'json'</span>
425
-<span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'nokogiri'</span> <span style="color: #2aa1ae; background-color: #292e34;">#</span><span style="color: #2aa1ae; background-color: #292e34;">for creating xml</span>
426
-
427
-request = <span style="color: #ce537a; font-weight: bold;">JSON</span>.parse<span style="color: #4f97d7;">(</span>request_data<span style="color: #4f97d7;">)</span>
428
-profile = <span style="color: #ce537a; font-weight: bold;">JSON</span>.parse<span style="color: #4f97d7;">(</span>profile_data<span style="color: #4f97d7;">)</span>
429
-
430
-context_diffs = <span style="color: #4f97d7;">[]</span>
431
-profile<span style="color: #4f97d7;">[</span><span style="color: #2d9574;">"contexts"</span><span style="color: #4f97d7;">]</span>.each <span style="color: #4f97d7; font-weight: bold;">do</span> | context |
432
-  requested = request<span style="color: #4f97d7;">[</span><span style="color: #2d9574;">"required"</span><span style="color: #4f97d7;">]</span> + request<span style="color: #4f97d7;">[</span><span style="color: #2d9574;">"optional"</span><span style="color: #4f97d7;">]</span>
433
-  available = context<span style="color: #4f97d7;">[</span><span style="color: #2d9574;">"properties"</span><span style="color: #4f97d7;">]</span>.map <span style="color: #4f97d7;">{</span>|p| <span style="color: #4f97d7;">p</span><span style="color: #bc6ec5;">[</span><span style="color: #2d9574;">"type"</span><span style="color: #bc6ec5;">]</span><span style="color: #4f97d7;">}</span>
434
-
435
-  intersect = available &amp; requested
436
-  except = requested - available
437
-  diff = <span style="color: #4f97d7;">{</span><span style="color: #a45bad;">:context</span> =&gt; context<span style="color: #bc6ec5;">[</span><span style="color: #2d9574;">"title"</span><span style="color: #bc6ec5;">]</span>, <span style="color: #a45bad;">:intersect</span> =&gt; intersect, <span style="color: #a45bad;">:except</span> =&gt; except<span style="color: #4f97d7;">}</span>
438
-
439
-  context_diffs &lt;&lt; diff
440
-<span style="color: #4f97d7; font-weight: bold;">end</span>
441
-
442
-<span style="color: #2aa1ae; background-color: #292e34;"># </span><span style="color: #2aa1ae; background-color: #292e34;">unfortunately processing.js doesn't support json yet, so we have to use xml</span>
443
-doc = <span style="color: #ce537a; font-weight: bold;">Nokogiri</span>::<span style="color: #ce537a; font-weight: bold;">XML</span>::<span style="color: #ce537a; font-weight: bold;">Builder</span>.new <span style="color: #4f97d7; font-weight: bold;">do</span> |xml|
444
-xml.result <span style="color: #4f97d7;">{</span>
445
-  xml.request <span style="color: #bc6ec5;">{</span> 
446
-    xml.application request<span style="color: #2d9574;">[</span><span style="color: #2d9574;">"application"</span><span style="color: #2d9574;">]</span> 
447
-    xml.required <span style="color: #2d9574;">{</span>
448
-      request<span style="color: #67b11d;">[</span><span style="color: #2d9574;">"required"</span><span style="color: #67b11d;">]</span>.each <span style="color: #4f97d7; font-weight: bold;">do</span> |p| xml.property <span style="color: #4f97d7;">p</span> <span style="color: #4f97d7; font-weight: bold;">end</span>
449
-    <span style="color: #2d9574;">}</span> 
450
-    xml.optional <span style="color: #2d9574;">{</span>
451
-      request<span style="color: #67b11d;">[</span><span style="color: #2d9574;">"optional"</span><span style="color: #67b11d;">]</span>.each <span style="color: #4f97d7; font-weight: bold;">do</span> |p| xml.property <span style="color: #4f97d7;">p</span> <span style="color: #4f97d7; font-weight: bold;">end</span>
452
-    <span style="color: #2d9574;">}</span>
453
-  <span style="color: #bc6ec5;">}</span>
454
-  xml.diffs <span style="color: #bc6ec5;">{</span>
455
-    context_diffs.each <span style="color: #4f97d7; font-weight: bold;">do</span> |diff|
456
-     xml.diff <span style="color: #2d9574;">{</span>
457
-      xml.contextName diff<span style="color: #67b11d;">[</span><span style="color: #a45bad;">:context</span><span style="color: #67b11d;">]</span>
458
-      xml.intersect <span style="color: #67b11d;">{</span>
459
-        diff<span style="color: #b1951d;">[</span><span style="color: #a45bad;">:intersect</span><span style="color: #b1951d;">]</span>.each <span style="color: #4f97d7; font-weight: bold;">do</span> |p| xml.property <span style="color: #4f97d7;">p</span> <span style="color: #4f97d7; font-weight: bold;">end</span>
460
-      <span style="color: #67b11d;">}</span>
461
-      xml.except <span style="color: #67b11d;">{</span>
462
-        diff<span style="color: #b1951d;">[</span><span style="color: #a45bad;">:except</span><span style="color: #b1951d;">]</span>.each <span style="color: #4f97d7; font-weight: bold;">do</span> |p| xml.property <span style="color: #4f97d7;">p</span> <span style="color: #4f97d7; font-weight: bold;">end</span>
463
-      <span style="color: #67b11d;">}</span>
464
-     <span style="color: #2d9574;">}</span>
465
-    <span style="color: #4f97d7; font-weight: bold;">end</span>
466
-  <span style="color: #bc6ec5;">}</span>
467
-<span style="color: #4f97d7;">}</span>
468
-<span style="color: #4f97d7; font-weight: bold;">end</span>
469
-path = <span style="color: #2d9574;">"diff.xml"</span>
470
-<span style="color: #ce537a; font-weight: bold;">File</span>.write<span style="color: #4f97d7;">(</span>path, doc.to_xml<span style="color: #4f97d7;">)</span> 
471
-path
424
+<pre class="src src-ruby" id="org7f43fac"><span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'json'</span>
425
+  <span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'nokogiri'</span> <span style="color: #2aa1ae; background-color: #292e34;">#</span><span style="color: #2aa1ae; background-color: #292e34;">for creating xml</span>
426
+
427
+  request = <span style="color: #ce537a; font-weight: bold;">JSON</span>.parse<span style="color: #4f97d7;">(</span>request_data<span style="color: #4f97d7;">)</span>
428
+  profile = <span style="color: #ce537a; font-weight: bold;">JSON</span>.parse<span style="color: #4f97d7;">(</span>profile_data<span style="color: #4f97d7;">)</span>
429
+
430
+  context_diffs = <span style="color: #4f97d7;">[]</span>
431
+  profile<span style="color: #4f97d7;">[</span><span style="color: #2d9574;">"contexts"</span><span style="color: #4f97d7;">]</span>.each <span style="color: #4f97d7; font-weight: bold;">do</span> | context |
432
+    requested = request<span style="color: #4f97d7;">[</span><span style="color: #2d9574;">"required"</span><span style="color: #4f97d7;">]</span> + request<span style="color: #4f97d7;">[</span><span style="color: #2d9574;">"optional"</span><span style="color: #4f97d7;">]</span>
433
+    available = context<span style="color: #4f97d7;">[</span><span style="color: #2d9574;">"properties"</span><span style="color: #4f97d7;">]</span>.map <span style="color: #4f97d7;">{</span>|p| <span style="color: #4f97d7;">p</span><span style="color: #bc6ec5;">[</span><span style="color: #2d9574;">"type"</span><span style="color: #bc6ec5;">]</span><span style="color: #4f97d7;">}</span>
434
+
435
+    intersect = available &amp; requested
436
+    except = requested - available
437
+    diff = <span style="color: #4f97d7;">{</span><span style="color: #a45bad;">:context</span> =&gt; context<span style="color: #bc6ec5;">[</span><span style="color: #2d9574;">"title"</span><span style="color: #bc6ec5;">]</span>, <span style="color: #a45bad;">:intersect</span> =&gt; intersect, <span style="color: #a45bad;">:except</span> =&gt; except<span style="color: #4f97d7;">}</span>
438
+
439
+    context_diffs &lt;&lt; diff
440
+  <span style="color: #4f97d7; font-weight: bold;">end</span>
472 441
 </pre>
473 442
 </div>
474 443
 </div>
475 444
 
476
-<div id="outline-container-orgfad2f2c" class="outline-4">
477
-<h4 id="orgfad2f2c"><span class="section-number-4">3.0.1</span> Things to further investigate</h4>
445
+<div id="outline-container-org7b37c3c" class="outline-4">
446
+<h4 id="org7b37c3c"><span class="section-number-4">3.0.1</span> Things to further investigate</h4>
478 447
 <div class="outline-text-4" id="text-3-0-1">
479 448
 <ul class="org-ul">
480 449
 <li>Calculate the weight of each context before and after giving permission</li>
@@ -493,8 +462,8 @@ request is size 3
493 462
 </div>
494 463
 </div>
495 464
 
496
-<div id="outline-container-orged26f2d" class="outline-2">
497
-<h2 id="orged26f2d"><span class="section-number-2">4</span> Visualization</h2>
465
+<div id="outline-container-orgb4b9266" class="outline-2">
466
+<h2 id="orgb4b9266"><span class="section-number-2">4</span> Visualization</h2>
498 467
 <div class="outline-text-2" id="text-4">
499 468
 <p>
500 469
 We want to visualize the following things;
@@ -525,7 +494,7 @@ A prelimary definition of six privacy levels (ordered from most private to least
525 494
 </ul>
526 495
 
527 496
 <p>
528
-A preliminary definition of 6 context types (ordered from the self outwards, but much less strict)
497
+A preliminary definition of 6 context types (ordered from the self outwards, but order is much less important here)
529 498
 </p>
530 499
 <ul class="org-ul">
531 500
 <li>SELF: stuff about your identity</li>
@@ -533,11 +502,110 @@ A preliminary definition of 6 context types (ordered from the self outwards, but
533 502
 <li>FRIENDS: stuff you share with friends</li>
534 503
 <li>WORK: stuff you share in a professional context</li>
535 504
 <li>HOBBY: stuff you share in the context of a pastime</li>
536
-<li>WORLD: stuff that is intended for the public good / commons</li>
505
+<li>OTHER: for contexts that do not fit in one of the above</li>
537 506
 </ul>
538 507
 
508
+<div class="org-src-container">
509
+<pre class="src src-java" id="org55b35dd"><span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">color definitions</span>
510
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">a3</span> = #<span style="color: #a45bad;">3A3B58</span>;
511
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">b3</span> = #<span style="color: #a45bad;">734246</span>;
512
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">d3</span> = #B4561F;
513
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">c3</span> = #<span style="color: #a45bad;">336F60</span>;
514
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">f3</span> = #<span style="color: #a45bad;">7A3E2A</span>;
515
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">g3</span> = #A48137;
516
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">e2</span> = #<span style="color: #a45bad;">97BBCB</span>;
517
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">a4</span> = #<span style="color: #a45bad;">3B4257</span>;
518
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">b4</span> = #<span style="color: #a45bad;">6A4345</span>;
519
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">d4</span> = #<span style="color: #a45bad;">86451F</span>;
520
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">c4</span> = #<span style="color: #a45bad;">345A48</span>;
521
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">f4</span> = #A92F21;
522
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">g4</span> = #BC983B;
523
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">a5</span> = #<span style="color: #a45bad;">3D4358</span>;
524
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">b5</span> = #<span style="color: #a45bad;">402623</span>;
525
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">d5</span> = #<span style="color: #a45bad;">85442D</span>;
526
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">c5</span> = #<span style="color: #a45bad;">3B403A</span>;
527
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">f5</span> = #<span style="color: #a45bad;">7A150B</span>;
528
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">g5</span> = #<span style="color: #a45bad;">252F2B</span>;
529
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">a1</span> = #<span style="color: #a45bad;">597099</span>;
530
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">e4</span> = #<span style="color: #a45bad;">0A3878</span>;
531
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">b1</span> = #D16365;
532
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">d1</span> = #FFD43B;
533
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">c1</span> = #B7BF98;
534
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">e1</span> = #CAD2C8;
535
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">e0</span> = #F5EDE5;
536
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">f1</span> = #D17978;
537
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">g1</span> = #FDD23E;
538
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">a0</span> = #C5C3CC;
539
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">e3</span> = #<span style="color: #a45bad;">0485B1</span>;
540
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">b0</span> = #FFDCD6;
541
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">d0</span> = #FFE9BE;
542
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">c0</span> = #F0E9D5;
543
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">f0</span> = #E4C8BF;
544
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">g0</span> = #FBE6BA;
545
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">a2</span> = #<span style="color: #a45bad;">3D4B79</span>;
546
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">e5</span> = #<span style="color: #a45bad;">084064</span>;
547
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">b2</span> = #<span style="color: #a45bad;">974244</span>;
548
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">d2</span> = #F8AA08;
549
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">c2</span> = #<span style="color: #a45bad;">4E937F</span>;
550
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">f2</span> = #<span style="color: #a45bad;">8F4330</span>;
551
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">g2</span> = #FFDB03;
552
+
553
+<span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">colors</span><span style="color: #4f97d7;">[][]</span> = <span style="color: #4f97d7;">{</span>
554
+  <span style="color: #bc6ec5;">{</span>a0,a1,a2,a3,a4,a5<span style="color: #bc6ec5;">}</span>,
555
+  <span style="color: #bc6ec5;">{</span>b0,b1,b2,b3,b4,b5<span style="color: #bc6ec5;">}</span>,
556
+  <span style="color: #bc6ec5;">{</span>c0,c1,c2,c3,c4,c5<span style="color: #bc6ec5;">}</span>,
557
+  <span style="color: #bc6ec5;">{</span>d0,d1,d2,d3,d4,d5<span style="color: #bc6ec5;">}</span>,
558
+  <span style="color: #bc6ec5;">{</span>e0,e1,e2,e3,e4,e5<span style="color: #bc6ec5;">}</span>,
559
+  <span style="color: #bc6ec5;">{</span>f0,f1,f2,f3,f4,f5<span style="color: #bc6ec5;">}</span>,
560
+  <span style="color: #bc6ec5;">{</span>g0,g1,g2,g3,g4,g5<span style="color: #bc6ec5;">}</span>
561
+<span style="color: #4f97d7;">}</span>;
562
+
563
+<span style="color: #4f97d7; font-weight: bold;">class</span> <span style="color: #ce537a; font-weight: bold;">PrivacyLevel</span> <span style="color: #4f97d7;">{</span>
564
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">SECRET</span> = <span style="color: #a45bad;">5</span>; <span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">passwords, keys etc. </span>
565
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">PRIVATE</span> = <span style="color: #a45bad;">4</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">ssn etc, strict need to know basis stuff </span>
566
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">INTIMATE</span> = <span style="color: #a45bad;">3</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">e.g. stuff you share with family </span>
567
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">AFFILIATE</span> = <span style="color: #a45bad;">2</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">e.g. stuff you share with work, project etc </span>
568
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">PUBLIC</span> = <span style="color: #a45bad;">1</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">e.g. stuff that everybody may know, your e.g. twitter handle </span>
569
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">COMMONS</span> = <span style="color: #a45bad;">0</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">stuff that is intended for the public good / commons, anonimized IoT stuff </span>
570
+<span style="color: #4f97d7;">}</span>
571
+
572
+<span style="color: #4f97d7; font-weight: bold;">class</span> <span style="color: #ce537a; font-weight: bold;">ContextType</span> <span style="color: #4f97d7;">{</span>
573
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">SELF</span> = <span style="color: #a45bad;">5</span>; <span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">stuff that applies strictly to yourself </span>
574
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">FAMILY</span> = <span style="color: #a45bad;">4</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">stuff that applies to you and your family (hopefully not facebook pics)</span>
575
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">FRIENDS</span> = <span style="color: #a45bad;">3</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">stuff you share with friends </span>
576
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">WORK</span> = <span style="color: #a45bad;">2</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">stuff you share in a professional context</span>
577
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">HOBBY</span> = <span style="color: #a45bad;">1</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">stuff you share in the context of a pastime</span>
578
+  <span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #4f97d7; font-weight: bold;">static</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">OTHER</span> = <span style="color: #a45bad;">0</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">stuff that doesn't fit in any of the other types </span>
579
+<span style="color: #4f97d7;">}</span>
580
+
581
+<span style="color: #4f97d7; font-weight: bold;">public</span> <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #bc6ec5; font-weight: bold;">getColor</span><span style="color: #4f97d7;">(</span><span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">privacy_level</span>, <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">context_type</span><span style="color: #4f97d7;">)</span>
582
+<span style="color: #4f97d7;">{</span>
583
+  <span style="color: #4f97d7; font-weight: bold;">return</span> colors<span style="color: #bc6ec5;">[</span>context_type<span style="color: #bc6ec5;">][</span>privacy_level<span style="color: #bc6ec5;">]</span>;
584
+<span style="color: #4f97d7;">}</span>
585
+</pre>
586
+</div>
587
+
588
+<p>
589
+Below snippet is an exemplifies the color getColor(PrivacyLevel.SECRET, ContextType.SELF);
590
+And should be a dark red color.
591
+</p>
592
+
593
+<div class="org-src-container">
594
+<pre class="src src-java" id="org34985cd"><span style="color: #ce537a; font-weight: bold;">void</span> <span style="color: #bc6ec5; font-weight: bold;">draw</span><span style="color: #4f97d7;">(){</span>
595
+  size<span style="color: #bc6ec5;">(</span><span style="color: #a45bad;">100</span>,<span style="color: #a45bad;">100</span><span style="color: #bc6ec5;">)</span>;
596
+  background<span style="color: #bc6ec5;">(</span><span style="color: #a45bad;">0</span><span style="color: #bc6ec5;">)</span>;
597
+  noStroke<span style="color: #bc6ec5;">()</span>;
598
+  <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">level</span> = <span style="color: #a45bad;">PrivacyLevel</span>.SECRET;
599
+  <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">contextType</span> = <span style="color: #a45bad;">ContextType</span>.SELF;
600
+  <span style="color: #ce537a; font-weight: bold;">color</span> <span style="color: #7590db;">private_self</span> = getColor<span style="color: #bc6ec5;">(</span>level, contextType<span style="color: #bc6ec5;">)</span>;<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">should be dark red</span>
601
+  fill<span style="color: #bc6ec5;">(</span>private_self<span style="color: #bc6ec5;">)</span>;
602
+  ellipse<span style="color: #bc6ec5;">(</span><span style="color: #a45bad;">50</span>,<span style="color: #a45bad;">50</span>,<span style="color: #a45bad;">50</span>,<span style="color: #a45bad;">50</span><span style="color: #bc6ec5;">)</span>;
603
+<span style="color: #4f97d7;">}</span>
604
+</pre>
605
+</div>
606
+
539 607
 <script src="processing.js"></script>
540
- <script type="text/processing" data-processing-target="ob-a8ca6153dc3f4dcea5960a1d135a98b56cb78842">
608
+ <script type="text/processing" data-processing-target="ob-aac1cb0de10f17f2bf5848bf4547f6a869db9766">
541 609
 //color definitions
542 610
 color a3 = #3A3B58;
543 611
 color b3 = #734246;
@@ -607,14 +675,13 @@ class ContextType {
607 675
   public static int FRIENDS = 3;//stuff you share with friends 
608 676
   public static int WORK = 2;//stuff you share in a professional context
609 677
   public static int HOBBY = 1;//stuff you share in the context of a pastime
610
-  public static int WORLD = 0;//stuff that is intended for the public good / commons 
678
+  public static int OTHER = 0;//stuff that doesn't fit in any of the other types 
611 679
 }
612 680
 
613 681
 public int getColor(int privacy_level, int context_type)
614 682
 {
615 683
   return colors[context_type][privacy_level];
616 684
 }
617
-
618 685
 void draw(){
619 686
   size(100,100);
620 687
   background(0);
@@ -625,14 +692,27 @@ void draw(){
625 692
   fill(private_self);
626 693
   ellipse(50,50,50,50);
627 694
 }
628
-</script> <canvas id="ob-a8ca6153dc3f4dcea5960a1d135a98b56cb78842"></canvas>
695
+</script> <canvas id="ob-aac1cb0de10f17f2bf5848bf4547f6a869db9766"></canvas>
629 696
 </div>
630 697
 
631
-<div id="outline-container-orgee13539" class="outline-3">
632
-<h3 id="orgee13539"><span class="section-number-3">4.1</span> Request</h3>
698
+<div id="outline-container-orgf5193c6" class="outline-3">
699
+<h3 id="orgf5193c6"><span class="section-number-3">4.1</span> Request</h3>
633 700
 <div class="outline-text-3" id="text-4-1">
701
+<div class="org-src-container">
702
+<pre class="src src-java" id="orgfd33c65"><span style="color: #ce537a; font-weight: bold;">Request</span> <span style="color: #7590db;">r</span> = parseRequest<span style="color: #4f97d7;">(</span>doc<span style="color: #4f97d7;">)</span>;
703
+<span style="color: #ce537a; font-weight: bold;">Diff</span><span style="color: #4f97d7;">[]</span> <span style="color: #7590db;">d</span> = parseDiffs<span style="color: #4f97d7;">(</span>doc<span style="color: #4f97d7;">)</span>;
704
+
705
+size<span style="color: #4f97d7;">(</span><span style="color: #a45bad;">200</span>,<span style="color: #a45bad;">200</span><span style="color: #4f97d7;">)</span>;
706
+background<span style="color: #4f97d7;">(</span><span style="color: #a45bad;">0</span><span style="color: #4f97d7;">)</span>;
707
+noFill<span style="color: #4f97d7;">()</span>;
708
+stroke<span style="color: #4f97d7;">(</span><span style="color: #a45bad;">255</span><span style="color: #4f97d7;">)</span>;
709
+ellipse<span style="color: #4f97d7;">(</span><span style="color: #a45bad;">56</span>, <span style="color: #a45bad;">46</span>, <span style="color: #a45bad;">55</span>, <span style="color: #a45bad;">55</span><span style="color: #4f97d7;">)</span>;
710
+text<span style="color: #4f97d7;">(</span>r.application, <span style="color: #a45bad;">10</span>, <span style="color: #a45bad;">10</span><span style="color: #4f97d7;">)</span>;
711
+</pre>
712
+</div>
713
+
634 714
 <script src="processing.js"></script>
635
- <script type="text/processing" data-processing-target="ob-358673b6aca53ef65765ed4baecf23b8c3889682">
715
+ <script type="text/processing" data-processing-target="ob-c42de876a926aece02f5fc38d4531fc842438852">
636 716
 class Request
637 717
 {
638 718
   public String application;
@@ -710,30 +790,39 @@ void parseDiffs(xml)
710 790
 }
711 791
 Request r = parseRequest(doc);
712 792
 Diff[] d = parseDiffs(doc);
713
-//set up font for labels
714
-//PFont label_font = createFont("Arial",16,true);
715
-//textFont(label_font,12);
716 793
 
717
-//draw the difference for each context with the request
718 794
 size(200,200);
719 795
 background(0);
720 796
 noFill();
721 797
 stroke(255);
722 798
 ellipse(56, 46, 55, 55);
723
-//fill(255);
724 799
 text(r.application, 10, 10);
725
-</script> <canvas id="ob-358673b6aca53ef65765ed4baecf23b8c3889682"></canvas>
800
+</script> <canvas id="ob-c42de876a926aece02f5fc38d4531fc842438852"></canvas>
726 801
 </div>
727 802
 </div>
728 803
 
729
-<div id="outline-container-org49e5f33" class="outline-3">
730
-<h3 id="org49e5f33"><span class="section-number-3">4.2</span> Contexts</h3>
804
+<div id="outline-container-orgfc1d0ba" class="outline-3">
805
+<h3 id="orgfc1d0ba"><span class="section-number-3">4.2</span> Contexts</h3>
731 806
 <div class="outline-text-3" id="text-4-2">
732 807
 <p>
733 808
 How do we visulize each context? Intend to do this in processing too.
734 809
 </p>
810
+
811
+<div class="org-src-container">
812
+<pre class="src src-java" id="org1b1953e"><span style="color: #ce537a; font-weight: bold;">Request</span> <span style="color: #7590db;">r</span> = parseRequest<span style="color: #4f97d7;">(</span>doc<span style="color: #4f97d7;">)</span>;
813
+<span style="color: #ce537a; font-weight: bold;">Diff</span><span style="color: #4f97d7;">[]</span> <span style="color: #7590db;">d</span> = parseDiffs<span style="color: #4f97d7;">(</span>doc<span style="color: #4f97d7;">)</span>;
814
+<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">draw the difference for each context with the request</span>
815
+size<span style="color: #4f97d7;">(</span><span style="color: #a45bad;">200</span>,<span style="color: #a45bad;">200</span><span style="color: #4f97d7;">)</span>;
816
+background<span style="color: #4f97d7;">(</span><span style="color: #a45bad;">0</span><span style="color: #4f97d7;">)</span>;
817
+noFill<span style="color: #4f97d7;">()</span>;
818
+stroke<span style="color: #4f97d7;">(</span><span style="color: #a45bad;">255</span><span style="color: #4f97d7;">)</span>;
819
+ellipse<span style="color: #4f97d7;">(</span><span style="color: #a45bad;">56</span>, <span style="color: #a45bad;">46</span>, <span style="color: #a45bad;">55</span>, <span style="color: #a45bad;">55</span><span style="color: #4f97d7;">)</span>;
820
+text<span style="color: #4f97d7;">(</span>d<span style="color: #bc6ec5;">[</span><span style="color: #a45bad;">0</span><span style="color: #bc6ec5;">]</span>.context, <span style="color: #a45bad;">10</span>, <span style="color: #a45bad;">10</span><span style="color: #4f97d7;">)</span>;
821
+</pre>
822
+</div>
823
+
735 824
 <script src="processing.js"></script>
736
- <script type="text/processing" data-processing-target="ob-efa176753d914243c7a44088a4a08201dd1f5913">
825
+ <script type="text/processing" data-processing-target="ob-1233b6269f6ad9dae9260cd0fea081e8622a0cf4">
737 826
 class Request
738 827
 {
739 828
   public String application;
@@ -811,23 +900,18 @@ void parseDiffs(xml)
811 900
 }
812 901
 Request r = parseRequest(doc);
813 902
 Diff[] d = parseDiffs(doc);
814
-//set up font for labels
815
-//PFont label_font = createFont("Arial",16,true);
816
-//textFont(label_font,12);
817
-
818 903
 //draw the difference for each context with the request
819 904
 size(200,200);
820 905
 background(0);
821 906
 noFill();
822 907
 stroke(255);
823 908
 ellipse(56, 46, 55, 55);
824
-//fill(255);
825 909
 text(d[0].context, 10, 10);
826
-</script> <canvas id="ob-efa176753d914243c7a44088a4a08201dd1f5913"></canvas>
910
+</script> <canvas id="ob-1233b6269f6ad9dae9260cd0fea081e8622a0cf4"></canvas>
827 911
 </div>
828 912
 
829
-<div id="outline-container-org345b713" class="outline-4">
830
-<h4 id="org345b713"><span class="section-number-4">4.2.1</span> Things to further investigate</h4>
913
+<div id="outline-container-orge1a149d" class="outline-4">
914
+<h4 id="orge1a149d"><span class="section-number-4">4.2.1</span> Things to further investigate</h4>
831 915
 <div class="outline-text-4" id="text-4-2-1">
832 916
 <ul class="org-ul">
833 917
 <li>How do we show relation between request and each context with color?</li>
@@ -839,16 +923,16 @@ text(d[0].context, 10, 10);
839 923
 </div>
840 924
 </div>
841 925
 
842
-<div id="outline-container-org8278ef8" class="outline-2">
843
-<h2 id="org8278ef8"><span class="section-number-2">5</span> Interaction</h2>
926
+<div id="outline-container-orge118bca" class="outline-2">
927
+<h2 id="orge118bca"><span class="section-number-2">5</span> Interaction</h2>
844 928
 <div class="outline-text-2" id="text-5">
845 929
 <p>
846 930
 We intend to investigate this in Processing as well.
847 931
 </p>
848 932
 </div>
849 933
 
850
-<div id="outline-container-orga48e52e" class="outline-4">
851
-<h4 id="orga48e52e"><span class="section-number-4">5.0.1</span> Things to further investigate</h4>
934
+<div id="outline-container-org3e72422" class="outline-4">
935
+<h4 id="org3e72422"><span class="section-number-4">5.0.1</span> Things to further investigate</h4>
852 936
 <div class="outline-text-4" id="text-5-0-1">
853 937
 <ul class="org-ul">
854 938
 <li>How does the end user actually accept the request? Is it by dragging the request onto the context?</li>
@@ -860,7 +944,7 @@ We intend to investigate this in Processing as well.
860 944
 </div>
861 945
 <div id="postamble" class="status">
862 946
 <p class="author">Author: Taco</p>
863
-<p class="date">Created: 2018-03-30 Fri 13:29</p>
947
+<p class="date">Created: 2018-03-30 Fri 14:09</p>
864 948
 <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
865 949
 </div>
866 950
 </body>

+ 154 - 53
entitlements.org

@@ -103,9 +103,9 @@ During the interaction we want to give the user insight into a couple of things;
103 103
 
104 104
 In below ruby code a comparison is made by on creating the intersection and its inverse between the request and each context.
105 105
 
106
-#+name: diff
107
-#+BEGIN_SRC ruby :noweb yes :var profile_data=profile :var request_data=request :results value file 
108
-  require 'json'
106
+#+name: diff_src
107
+#+BEGIN_SRC ruby
108
+require 'json'
109 109
   require 'nokogiri' #for creating xml
110 110
 
111 111
   request = JSON.parse(request_data)
@@ -122,18 +122,8 @@ In below ruby code a comparison is made by on creating the intersection and its
122 122
 
123 123
     context_diffs << diff
124 124
   end
125
-
126
-  <<xml>>
127 125
 #+END_SRC
128 126
 
129
-#+RESULTS: diff
130
-[[file:diff.xml]]
131
-
132
-*** Things to further investigate
133
-    - Calculate the weight of each context before and after giving permission
134
-
135
-NOTE: We export to file diff.xml here for easy parsing in processing.js below.
136
-
137 127
 #+name: xml 
138 128
 #+BEGIN_SRC ruby :exports none
139 129
   # unfortunately processing.js doesn't support json yet, so we have to use xml
@@ -168,6 +158,20 @@ NOTE: We export to file diff.xml here for easy parsing in processing.js below.
168 158
   path
169 159
   #+END_SRC
170 160
 
161
+#+name: diff
162
+#+BEGIN_SRC ruby :exports none :noweb yes :var profile_data=profile :var request_data=request :results value file 
163
+<<diff_src>>    
164
+<<xml>>
165
+#+END_SRC
166
+
167
+#+RESULTS: diff
168
+[[file:diff.xml]]
169
+
170
+*** Things to further investigate
171
+    - Calculate the weight of each context before and after giving permission
172
+
173
+NOTE: We export to file diff.xml here for easy parsing in processing.js below.
174
+
171 175
 /de relatieve grootte van de cirkel kan zijn op basis van hoeveel data je erin hebt. 
172 176
 personal is size 4, professional size 3
173 177
 request is size 3
@@ -201,7 +205,7 @@ A preliminary definition of 6 context types (ordered from the self outwards, but
201 205
 - OTHER: for contexts that do not fit in one of the above
202 206
 
203 207
 #+name: colors
204
-#+BEGIN_SRC processing
208
+#+BEGIN_SRC java
205 209
 //color definitions
206 210
 color a3 = #3A3B58;
207 211
 color b3 = #734246;
@@ -278,7 +282,13 @@ public int getColor(int privacy_level, int context_type)
278 282
 {
279 283
   return colors[context_type][privacy_level];
280 284
 }
285
+#+END_SRC
286
+
287
+Below snippet is an exemplifies the color getColor(PrivacyLevel.SECRET, ContextType.SELF);
288
+And should be a dark red color.
281 289
 
290
+#+name: color_example_src
291
+#+BEGIN_SRC java
282 292
 void draw(){
283 293
   size(100,100);
284 294
   background(0);
@@ -289,8 +299,107 @@ void draw(){
289 299
   fill(private_self);
290 300
   ellipse(50,50,50,50);
291 301
 }
302
+#+END_SRC
303
+
304
+#+name: color_example
305
+#+BEGIN_SRC processing :noweb yes
306
+<<colors>>
307
+<<color_example_src>>
292 308
 #+END_SRC 
293 309
 
310
+#+RESULTS: color_example
311
+#+BEGIN_EXPORT html
312
+<script src="processing.js"></script>
313
+ <script type="text/processing" data-processing-target="ob-aac1cb0de10f17f2bf5848bf4547f6a869db9766">
314
+//color definitions
315
+color a3 = #3A3B58;
316
+color b3 = #734246;
317
+color d3 = #B4561F;
318
+color c3 = #336F60;
319
+color f3 = #7A3E2A;
320
+color g3 = #A48137;
321
+color e2 = #97BBCB;
322
+color a4 = #3B4257;
323
+color b4 = #6A4345;
324
+color d4 = #86451F;
325
+color c4 = #345A48;
326
+color f4 = #A92F21;
327
+color g4 = #BC983B;
328
+color a5 = #3D4358;
329
+color b5 = #402623;
330
+color d5 = #85442D;
331
+color c5 = #3B403A;
332
+color f5 = #7A150B;
333
+color g5 = #252F2B;
334
+color a1 = #597099;
335
+color e4 = #0A3878;
336
+color b1 = #D16365;
337
+color d1 = #FFD43B;
338
+color c1 = #B7BF98;
339
+color e1 = #CAD2C8;
340
+color e0 = #F5EDE5;
341
+color f1 = #D17978;
342
+color g1 = #FDD23E;
343
+color a0 = #C5C3CC;
344
+color e3 = #0485B1;
345
+color b0 = #FFDCD6;
346
+color d0 = #FFE9BE;
347
+color c0 = #F0E9D5;
348
+color f0 = #E4C8BF;
349
+color g0 = #FBE6BA;
350
+color a2 = #3D4B79;
351
+color e5 = #084064;
352
+color b2 = #974244;
353
+color d2 = #F8AA08;
354
+color c2 = #4E937F;
355
+color f2 = #8F4330;
356
+color g2 = #FFDB03;
357
+
358
+color colors[][] = {
359
+  {a0,a1,a2,a3,a4,a5},
360
+  {b0,b1,b2,b3,b4,b5},
361
+  {c0,c1,c2,c3,c4,c5},
362
+  {d0,d1,d2,d3,d4,d5},
363
+  {e0,e1,e2,e3,e4,e5},
364
+  {f0,f1,f2,f3,f4,f5},
365
+  {g0,g1,g2,g3,g4,g5}
366
+};
367
+
368
+class PrivacyLevel {
369
+  public static int SECRET = 5; //passwords, keys etc. 
370
+  public static int PRIVATE = 4;//ssn etc, strict need to know basis stuff 
371
+  public static int INTIMATE = 3;//e.g. stuff you share with family 
372
+  public static int AFFILIATE = 2;//e.g. stuff you share with work, project etc 
373
+  public static int PUBLIC = 1;//e.g. stuff that everybody may know, your e.g. twitter handle 
374
+  public static int COMMONS = 0;//stuff that is intended for the public good / commons, anonimized IoT stuff 
375
+}
376
+
377
+class ContextType {
378
+  public static int SELF = 5; //stuff that applies strictly to yourself 
379
+  public static int FAMILY = 4;//stuff that applies to you and your family (hopefully not facebook pics)
380
+  public static int FRIENDS = 3;//stuff you share with friends 
381
+  public static int WORK = 2;//stuff you share in a professional context
382
+  public static int HOBBY = 1;//stuff you share in the context of a pastime
383
+  public static int OTHER = 0;//stuff that doesn't fit in any of the other types 
384
+}
385
+
386
+public int getColor(int privacy_level, int context_type)
387
+{
388
+  return colors[context_type][privacy_level];
389
+}
390
+void draw(){
391
+  size(100,100);
392
+  background(0);
393
+  noStroke();
394
+  int level = PrivacyLevel.SECRET;
395
+  int contextType = ContextType.SELF;
396
+  color private_self = getColor(level, contextType);//should be dark red
397
+  fill(private_self);
398
+  ellipse(50,50,50,50);
399
+}
400
+</script> <canvas id="ob-aac1cb0de10f17f2bf5848bf4547f6a869db9766"></canvas>
401
+#+END_EXPORT
402
+
294 403
 #+RESULTS: colors
295 404
 #+BEGIN_EXPORT html
296 405
 <script src="processing.js"></script>
@@ -465,29 +574,29 @@ void parseDiffs(xml)
465 574
 #+END_SRC
466 575
 
467 576
 ** Request
468
-#+name: draw_request
469
-#+BEGIN_SRC processing :noweb yes
470
-<<glue>>
577
+#+name: draw_request_src
578
+#+BEGIN_SRC java
471 579
 Request r = parseRequest(doc);
472 580
 Diff[] d = parseDiffs(doc);
473
-//set up font for labels
474
-//PFont label_font = createFont("Arial",16,true);
475
-//textFont(label_font,12);
476 581
 
477
-//draw the difference for each context with the request
478 582
 size(200,200);
479 583
 background(0);
480 584
 noFill();
481 585
 stroke(255);
482 586
 ellipse(56, 46, 55, 55);
483
-//fill(255);
484 587
 text(r.application, 10, 10);
485 588
 #+END_SRC
486 589
 
590
+#+name: draw_request
591
+#+BEGIN_SRC processing :noweb yes
592
+<<glue>>
593
+<<draw_request_src>>
594
+#+END_SRC
595
+
487 596
 #+RESULTS: draw_request
488 597
 #+BEGIN_EXPORT html
489 598
 <script src="processing.js"></script>
490
- <script type="text/processing" data-processing-target="ob-358673b6aca53ef65765ed4baecf23b8c3889682">
599
+ <script type="text/processing" data-processing-target="ob-c42de876a926aece02f5fc38d4531fc842438852">
491 600
 class Request
492 601
 {
493 602
   public String application;
@@ -565,46 +674,52 @@ void parseDiffs(xml)
565 674
 }
566 675
 Request r = parseRequest(doc);
567 676
 Diff[] d = parseDiffs(doc);
568
-//set up font for labels
569
-//PFont label_font = createFont("Arial",16,true);
570
-//textFont(label_font,12);
571 677
 
572
-//draw the difference for each context with the request
573 678
 size(200,200);
574 679
 background(0);
575 680
 noFill();
576 681
 stroke(255);
577 682
 ellipse(56, 46, 55, 55);
578
-//fill(255);
579 683
 text(r.application, 10, 10);
580
-</script> <canvas id="ob-358673b6aca53ef65765ed4baecf23b8c3889682"></canvas>
684
+</script> <canvas id="ob-c42de876a926aece02f5fc38d4531fc842438852"></canvas>
581 685
 #+END_EXPORT
582 686
 
583 687
 ** Contexts
584 688
    How do we visulize each context? Intend to do this in processing too.
585
-#+name: draw_context
586
-#+BEGIN_SRC processing :noweb yes
587
-<<glue>>
689
+
690
+#+name: draw_context_src
691
+#+BEGIN_SRC java
588 692
 Request r = parseRequest(doc);
589 693
 Diff[] d = parseDiffs(doc);
590
-//set up font for labels
591
-//PFont label_font = createFont("Arial",16,true);
592
-//textFont(label_font,12);
593
-
594 694
 //draw the difference for each context with the request
595 695
 size(200,200);
596 696
 background(0);
597 697
 noFill();
598 698
 stroke(255);
599 699
 ellipse(56, 46, 55, 55);
600
-//fill(255);
601 700
 text(d[0].context, 10, 10);
602 701
 #+END_SRC
603 702
 
703
+#+name: draw_context
704
+#+BEGIN_SRC processing :noweb yes
705
+<<glue>>
706
+<<draw_context_src>>
707
+#+END_SRC
708
+
604 709
 #+RESULTS: draw_context
605 710
 #+BEGIN_EXPORT html
606 711
 <script src="processing.js"></script>
607
- <script type="text/processing" data-processing-target="ob-efa176753d914243c7a44088a4a08201dd1f5913">
712
+ <script type="text/processing" data-processing-target="ob-8ee17c5173a5af5448f13532fc4f51ceb0390970">
713
+Request r = parseRequest(doc);
714
+Diff[] d = parseDiffs(doc);
715
+//draw the difference for each context with the request
716
+size(200,200);
717
+background(0);
718
+noFill();
719
+stroke(255);
720
+ellipse(56, 46, 55, 55);
721
+text(d[0].context, 10, 10);
722
+
608 723
 class Request
609 724
 {
610 725
   public String application;
@@ -680,21 +795,7 @@ void parseDiffs(xml)
680 795
   }
681 796
   return diffs;
682 797
 }
683
-Request r = parseRequest(doc);
684
-Diff[] d = parseDiffs(doc);
685
-//set up font for labels
686
-//PFont label_font = createFont("Arial",16,true);
687
-//textFont(label_font,12);
688
-
689
-//draw the difference for each context with the request
690
-size(200,200);
691
-background(0);
692
-noFill();
693
-stroke(255);
694
-ellipse(56, 46, 55, 55);
695
-//fill(255);
696
-text(d[0].context, 10, 10);
697
-</script> <canvas id="ob-efa176753d914243c7a44088a4a08201dd1f5913"></canvas>
798
+</script> <canvas id="ob-8ee17c5173a5af5448f13532fc4f51ceb0390970"></canvas>
698 799
 #+END_EXPORT
699 800
 
700 801
 *** Things to further investigate