Browse Source

added theme and logo

Taco 1 year ago
parent
commit
f81462e365
2 changed files with 72 additions and 1227 deletions
  1. 56 604
      entitlements.html
  2. 16 623
      entitlements.org

+ 56 - 604
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-04-20 Fri 15:21 -->
6
+<!-- 2018-04-20 Fri 16:37 -->
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>
@@ -180,6 +180,12 @@
180 180
   .org-svg { width: 90%; }
181 181
   /*]]>*/-->
182 182
 </style>
183
+<link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css"/>
184
+<link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>
185
+<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
186
+<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
187
+<script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script>
188
+<script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
183 189
 <script type="text/javascript">
184 190
 /*
185 191
 @licstart  The following is the entire license notice for the
@@ -233,35 +239,28 @@ for the JavaScript code in this tag.
233 239
 <h2>Table of Contents</h2>
234 240
 <div id="text-table-of-contents">
235 241
 <ul>
236
-<li><a href="#org5eeb021">1. Introduction</a>
242
+<li><a href="#org163d841">1. Introduction</a></li>
243
+<li><a href="#orgac9ac37">2. Data Model</a>
237 244
 <ul>
238
-<li>
239
-<ul>
240
-<li><a href="#orgbe1d123">1.0.1. <span class="todo TODO">TODO</span> Increase list of property types (at least properties that are used in Gebied Online)</a></li>
241
-<li><a href="#orge636498">1.0.2. <span class="todo TODO">TODO</span> think about replacing go namespace with random appspecific namespace in generator</a></li>
242
-</ul>
243
-</li>
244
-</ul>
245
-</li>
246
-<li><a href="#org638ac9d">2. Data Model</a>
247
-<ul>
248
-<li><a href="#org1d5533f">2.1. Example wallet profile</a></li>
249
-<li><a href="#org48b7919">2.2. Example request</a></li>
250
-</ul>
251
-</li>
252
-<li><a href="#org5fad6c9">3. Data Comparison</a></li>
253
-<li><a href="#org4b8024a">4. Visualization</a>
254
-<ul>
255
-<li><a href="#org9a3d266">4.1. Request</a></li>
256
-<li><a href="#orga67a54c">4.2. Contexts</a></li>
245
+<li><a href="#org4d48ab1">2.1. Example wallet profile</a></li>
246
+<li><a href="#org6aae10a">2.2. profile generator</a></li>
247
+<li><a href="#org987796d">2.3. Example request</a></li>
248
+<li><a href="#orga33413a">2.4. request generator</a></li>
257 249
 </ul>
258 250
 </li>
259
-<li><a href="#org089873d">5. Interaction</a></li>
251
+<li><a href="#org48e4d3e">3. Data Comparison</a></li>
252
+<li><a href="#org3e7c43a">4. Visualization</a></li>
253
+<li><a href="#orgc8c07de">5. Interaction</a></li>
260 254
 </ul>
261 255
 </div>
262 256
 </div>
263
-<div id="outline-container-org5eeb021" class="outline-2">
264
-<h2 id="org5eeb021"><span class="section-number-2">1</span> Introduction</h2>
257
+
258
+<div class="figure">
259
+<p><img src="./Logo.png" alt="Logo.png" />
260
+</p>
261
+</div>
262
+<div id="outline-container-org163d841" class="outline-2">
263
+<h2 id="org163d841"><span class="section-number-2">1</span> Introduction</h2>
265 264
 <div class="outline-text-2" id="text-1">
266 265
 <p>
267 266
 The purpose of this document is to investigate possible User Interaction designs for Decode task 4.4.
@@ -271,7 +270,7 @@ More specifically the focus is on investigating how the user of a decode wallet
271 270
 <p>
272 271
 A prelimary definition of six privacy levels (ordered from most private to least private):
273 272
 </p>
274
-<table id="org2ecdf90" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
273
+<table id="org5df6e16" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
275 274
 
276 275
 
277 276
 <colgroup>
@@ -330,7 +329,7 @@ A prelimary definition of six privacy levels (ordered from most private to least
330 329
 <p>
331 330
 A preliminary definition of context types
332 331
 </p>
333
-<table id="org92f7a03" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
332
+<table id="orga995acc" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
334 333
 
335 334
 
336 335
 <colgroup>
@@ -412,7 +411,7 @@ Properties that are very application specific have the 'go' (and not the 'decode
412 411
 This is pretty speculative, but serves as a discussion starter. 
413 412
 </p>
414 413
 
415
-<table id="org94a24e9" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
414
+<table id="org2528c08" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
416 415
 
417 416
 
418 417
 <colgroup>
@@ -686,22 +685,14 @@ This is pretty speculative, but serves as a discussion starter.
686 685
 </tbody>
687 686
 </table>
688 687
 </div>
689
-
690
-
691
-<div id="outline-container-orgbe1d123" class="outline-4">
692
-<h4 id="orgbe1d123"><span class="section-number-4">1.0.1</span> <span class="todo TODO">TODO</span> Increase list of property types (at least properties that are used in Gebied Online)</h4>
693
-</div>
694
-<div id="outline-container-orge636498" class="outline-4">
695
-<h4 id="orge636498"><span class="section-number-4">1.0.2</span> <span class="todo TODO">TODO</span> think about replacing go namespace with random appspecific namespace in generator</h4>
696
-</div>
697 688
 </div>
698 689
 
699
-<div id="outline-container-org638ac9d" class="outline-2">
700
-<h2 id="org638ac9d"><span class="section-number-2">2</span> Data Model</h2>
690
+<div id="outline-container-orgac9ac37" class="outline-2">
691
+<h2 id="orgac9ac37"><span class="section-number-2">2</span> Data Model</h2>
701 692
 <div class="outline-text-2" id="text-2">
702 693
 </div>
703
-<div id="outline-container-org1d5533f" class="outline-3">
704
-<h3 id="org1d5533f"><span class="section-number-3">2.1</span> Example wallet profile</h3>
694
+<div id="outline-container-org4d48ab1" class="outline-3">
695
+<h3 id="org4d48ab1"><span class="section-number-3">2.1</span> Example wallet profile</h3>
705 696
 <div class="outline-text-3" id="text-2-1">
706 697
 <p>
707 698
 This sample wallet profile datastructure consists of multiple contexts.
@@ -720,7 +711,7 @@ It overrides the default privacy level specified by the property type.
720 711
 </p>
721 712
 
722 713
 <div class="org-src-container">
723
-<pre class="src src-js" id="orgbcfd415"><span style="color: #4f97d7; font-weight: bold;">var</span> <span style="color: #7590db;">profile</span> = <span style="color: #4f97d7;">{</span>
714
+<pre class="src src-js" id="org661e07f"><span style="color: #4f97d7; font-weight: bold;">var</span> <span style="color: #7590db;">profile</span> = <span style="color: #4f97d7;">{</span>
724 715
     contexts : 
725 716
     <span style="color: #bc6ec5;">[</span>
726 717
         <span style="color: #2d9574;">{</span>
@@ -795,9 +786,14 @@ It overrides the default privacy level specified by the property type.
795 786
 process.stdout.write<span style="color: #4f97d7;">(</span>JSON.stringify<span style="color: #bc6ec5;">(</span>profile<span style="color: #bc6ec5;">)</span><span style="color: #4f97d7;">)</span>;
796 787
 </pre>
797 788
 </div>
789
+</div>
790
+</div>
798 791
 
792
+<div id="outline-container-org6aae10a" class="outline-3">
793
+<h3 id="org6aae10a"><span class="section-number-3">2.2</span> profile generator</h3>
794
+<div class="outline-text-3" id="text-2-2">
799 795
 <div class="org-src-container">
800
-<pre class="src src-ruby" id="org5162ea0"> <span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'faker'</span>
796
+<pre class="src src-ruby" id="org9423814"> <span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'faker'</span>
801 797
  <span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'json'</span>
802 798
  <span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'securerandom'</span>
803 799
 
@@ -840,9 +836,9 @@ profile<span style="color: #4f97d7;">[</span><span style="color: #a45bad;">:cont
840 836
 </div>
841 837
 </div>
842 838
 
843
-<div id="outline-container-org48b7919" class="outline-3">
844
-<h3 id="org48b7919"><span class="section-number-3">2.2</span> Example request</h3>
845
-<div class="outline-text-3" id="text-2-2">
839
+<div id="outline-container-org987796d" class="outline-3">
840
+<h3 id="org987796d"><span class="section-number-3">2.3</span> Example request</h3>
841
+<div class="outline-text-3" id="text-2-3">
846 842
 <p>
847 843
 This sample application request consists of an application name, a set of required property types and a set of optional property types.
848 844
 Each application has a default context type attached to it, (so we can assign it a hue).
@@ -851,7 +847,7 @@ and the cumulative privacy weight by adding the privacy levels of each property
851 847
 </p>
852 848
 
853 849
 <div class="org-src-container">
854
-<pre class="src src-js" id="org2b3e825"><span style="color: #4f97d7; font-weight: bold;">var</span> <span style="color: #7590db;">request</span> = <span style="color: #4f97d7;">{</span>
850
+<pre class="src src-js" id="org2f0a16f"><span style="color: #4f97d7; font-weight: bold;">var</span> <span style="color: #7590db;">request</span> = <span style="color: #4f97d7;">{</span>
855 851
     application : <span style="color: #2d9574;">"decodeapp:facebook"</span>,
856 852
     context_type : <span style="color: #a45bad;">5</span>,<span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">personal</span>
857 853
     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>,
@@ -861,9 +857,14 @@ and the cumulative privacy weight by adding the privacy levels of each property
861 857
 process.stdout.write<span style="color: #4f97d7;">(</span>data<span style="color: #4f97d7;">)</span>;
862 858
 </pre>
863 859
 </div>
860
+</div>
861
+</div>
864 862
 
863
+<div id="outline-container-orga33413a" class="outline-3">
864
+<h3 id="orga33413a"><span class="section-number-3">2.4</span> request generator</h3>
865
+<div class="outline-text-3" id="text-2-4">
865 866
 <div class="org-src-container">
866
-<pre class="src src-ruby" id="org4e775f5"><span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'faker'</span>
867
+<pre class="src src-ruby" id="orge7a52bc"><span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'faker'</span>
867 868
 <span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'json'</span>
868 869
 <span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'securerandom'</span>
869 870
 
@@ -888,8 +889,8 @@ request<span style="color: #4f97d7;">[</span><span style="color: #a45bad;">:pl_m
888 889
 </div>
889 890
 </div>
890 891
 
891
-<div id="outline-container-org5fad6c9" class="outline-2">
892
-<h2 id="org5fad6c9"><span class="section-number-2">3</span> Data Comparison</h2>
892
+<div id="outline-container-org48e4d3e" class="outline-2">
893
+<h2 id="org48e4d3e"><span class="section-number-2">3</span> Data Comparison</h2>
893 894
 <div class="outline-text-2" id="text-3">
894 895
 <p>
895 896
 During the interaction we want to give the user insight into a couple of things;
@@ -905,7 +906,7 @@ In below ruby code a comparison is made by on creating the intersection and its
905 906
 </p>
906 907
 
907 908
 <div class="org-src-container">
908
-<pre class="src src-ruby" id="orgb086980"><span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'json'</span>
909
+<pre class="src src-ruby" id="orgcf4a6e9"><span style="color: #4f97d7;">require</span> <span style="color: #2d9574;">'json'</span>
909 910
   <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>
910 911
 
911 912
   request = <span style="color: #ce537a; font-weight: bold;">JSON</span>.parse<span style="color: #4f97d7;">(</span>request_data<span style="color: #4f97d7;">)</span>
@@ -931,8 +932,8 @@ NOTE: We export to file diff.xml here for easy parsing in processing.js below.
931 932
 </div>
932 933
 </div>
933 934
 
934
-<div id="outline-container-org4b8024a" class="outline-2">
935
-<h2 id="org4b8024a"><span class="section-number-2">4</span> Visualization</h2>
935
+<div id="outline-container-org3e7c43a" class="outline-2">
936
+<h2 id="org3e7c43a"><span class="section-number-2">4</span> Visualization</h2>
936 937
 <div class="outline-text-2" id="text-4">
937 938
 <p>
938 939
 We want to visualize the following things;
@@ -1123,559 +1124,10 @@ void draw()
1123 1124
 }
1124 1125
 </script> <canvas id="ob-44f6f21ab5755a24cd02bc9679d06787f37dfeb6"></canvas>
1125 1126
 </div>
1126
-
1127
-<div id="outline-container-org9a3d266" class="outline-3">
1128
-<h3 id="org9a3d266"><span class="section-number-3">4.1</span> Request</h3>
1129
-<div class="outline-text-3" id="text-4-1">
1130
-<script src="processing.js"></script>
1131
- <script type="text/processing" data-processing-target="ob-d1a83be2c44d00455adace357b093d445e4966ea">
1132
-String[] levels = {"commons", "public", "affiliate", "intimate", "private", "secret"};
1133
-String[] contextTypes = {"personal", "health", "education", "work", "hobby", "financial", "other"};
1134
-
1135
-static class PrivacyLevel {
1136
-  public static int SECRET = 5;
1137
-  public static int PRIVATE = 4;
1138
-  public static int INTIMATE = 3;
1139
-  public static int AFFILIATE = 2;
1140
-  public static int PUBLIC = 1;
1141
-  public static int COMMONS = 0;
1142
-}
1143
-
1144
-static class ContextType {
1145
-  public static int PERSONAL = 0; 
1146
-  public static int HEALTH = 1;
1147
-  public static int EDUCATION = 2;
1148
-  public static int WORK = 3;
1149
-  public static int HOBBY = 4;
1150
-  public static int FINANCIAL = 5;
1151
-  public static int OTHER = 6;
1152
-}
1153
-
1154
-int[][] colors = generateColors();
1155
-
1156
-//generate colors to maximize contrast
1157
-int[][] generateColors()
1158
-{
1159
-  int[][] pcolors = new int[contextTypes.length][levels.length];
1160
-  
1161
-//we start with d0 as a seed color
1162
-  color seed = #FFE9BE;//seed color
1163
-  
1164
-  colorMode(HSB);
1165
-  
1166
-  float h_seed = hue(seed);
1167
-  float s_seed = saturation(seed);
1168
-  float v_seed = brightness(seed);
1169
-
1170
-  float levelshift = 255/levels.length;
1171
-  float contextshift = 255/contextTypes.length + 1;
1172
-  
1173
-  //cycle hue for each level
1174
-  for (int i = 0; i < contextTypes.length; i++){
1175
-    float h = h_seed + i * contextshift;
1176
-    if(h > 255){h = h - 255;}
1177
-    
1178
-    //cycle brightness for each context
1179
-    for(int j = 0; j < levels.length; j++)
1180
-    {
1181
-      float v = v_seed - (j * levelshift);
1182
-      float s = s_seed + (j * levelshift); 
1183
-      
1184
-      color c = color(h,s,v);
1185
-      pcolors[i][j] = c;
1186
-    }
1187
-  }
1188
-  colorMode(RGB);
1189
-
1190
-  return pcolors;
1191
-}
1192
-
1193
-public int getColor(int privacy_level, int context_type)
1194
-{
1195
-    return colors[context_type][privacy_level];
1196
-}
1197
-class Request
1198
-{
1199
-  public String application;
1200
-  public int contextType;
1201
-  public String[] required_properties;
1202
-  public String[] optional_properties;
1203
-  public int plSum;
1204
-  public int plMean;
1205
-
1206
-  public Request(String app, int contextType, String[] req, String[] opt, int sum, int mean)
1207
-  {
1208
-    this.application = app;
1209
-    this.contextType = contextType;
1210
-    this.required_properties = req;
1211
-    this.optional_properties = opt;
1212
-    this.plSum = sum;
1213
-    this.plMean = mean;
1214
-  }
1215
-}
1216
-
1217
-class Diff
1218
-{
1219
-  public String context;
1220
-  public String[] intersect;
1221
-  public String[] except;
1222
-
1223
-  public Diff(String ctx, String[] intersect, String[] except)
1224
-  {
1225
-    this.context = ctx;
1226
-    this.intersect = intersect;
1227
-    this.except = except;
1228
-  } 
1229
-}
1230
-
1231
-class Property
1232
-{
1233
-  public String type;
1234
-  public String value;
1235
-  public int pl;//privacy level
1236
-
1237
-  public Property(String type, String value, int pl)
1238
-  {
1239
-    this.type = type;
1240
-    this.value = value;
1241
-    this.pl = pl;
1242
-  }
1243
-}
1244
-
1245
-class Context
1246
-{
1247
-  public String title;
1248
-  public int plSum;
1249
-  public int plMean;
1250
-  public int contextType;
1251
-  public Property[] properties;
1252
-
1253
-  public Context(String title, int plSum, int plMean, int contextType, Property[] properties)
1254
-  {
1255
-    this.title = title;
1256
-    this.plSum = plSum;
1257
-    this.plMean = plMean;
1258
-    this.properties = properties;
1259
-    this.contextType = contextType;
1260
-  }
1261
-}
1262
-
1263
-XMLElement doc = new XMLElement(this, 'diff.xml');
1264
-
1265
-//create typed versions because this is java :-(
1266
-Request parseRequest(XMLElement xml)
1267
-{
1268
-  XMLElement req = xml.getChild(0);
1269
-  String name = req.getChild(0).getContent();
1270
-  int contextType = req.getChild(1).getContent();
1271
-  String[] required = new String[req.getChild(2).getChildCount()];
1272
-  String[] optional = new String[req.getChild(3).getChildCount()];
1273
-  int plSum = parseInt(req.getChild(4).getContent());
1274
-  int plMean = parseInt(req.getChild(5).getContent());
1275
-
1276
-  for (int i = 0; i < required.length; i++) {
1277
-    required[i] = req.getChild(2).getChild(i).getContent();
1278
-  }
1279
-
1280
-  for (int i = 0; i < optional.length; i++) {
1281
-    optional[i] = req.getChild(3).getChild(i).getContent();
1282
-  }
1283
-
1284
-  Request r = new Request(name,contextType,required,optional, plSum, plMean);
1285
-  return r;
1286
-}
1287
-
1288
-Context[] parseProfile(XMLElement xml)
1289
-{
1290
-  XMLElement profile = xml.getChild(2);
1291
-  Context[] contexts = new Context[profile.getChildCount()];
1292
-
1293
-  for(int i = 0; i < contexts.length; i++)
1294
-  {
1295
-    String contextName = profile.getChild(i).getChild(0).getContent();
1296
-    int contextType = parseInt(profile.getChild(i).getChild(1).getContent());
1297
-    int plSum = parseInt(profile.getChild(i).getChild(2).getContent());
1298
-    int plMean = parseInt(profile.getChild(i).getChild(3).getContent());
1299
-    XMLElement propertiesEl = profile.getChild(i).getChild(4);
1300
-    Property[] properties = new Property[propertiesEl.getChildCount()];
1301
-    for(int j = 0; j < properties.length; j++)
1302
-    {
1303
-      Property prop = parseProperty(propertiesEl.getChild(j));
1304
-      properties[j] = prop;
1305
-    }
1306
-
1307
-    Context context = new Context(contextName, plSum, plMean, contextType, properties);
1308
-    contexts[i] = context;
1309
-  }
1310
-  return contexts;
1311
-}
1312
-
1313
-Property parseProperty(XMLElement propertyEl)
1314
-{
1315
-  String propertyType = propertyEl.getChild(0).getContent();
1316
-  String value = propertyEl.getChild(1).getContent();
1317
-  int pl = parseInt(propertyEl.getChild(2).getContent());
1318
-  return new Property(propertyType, value, pl);
1319
-}
1320
-
1321
-//create typed versions because this is java :-(
1322
-Diff[] parseDiffs(xml)
1323
-{
1324
-  XMLElement diffsEl = xml.getChild(1);
1325
-  Diff[] diffs = new Diff[diffsEl.getChildCount()];
1326
-  for(int i = 0; i < diffs.length; i++)
1327
-  {
1328
-    String contextName = diffsEl.getChild(i).getChild(0).getContent();
1329
-    String[] intersects = new String[diffsEl.getChild(i).getChild(1).getChildCount()];
1330
-    String[] except = new String[diffsEl.getChild(i).getChild(2).getChildCount()];
1331
-    
1332
-    for(int j = 0; j < intersects.length; j++)
1333
-    {
1334
-      intersects[j] = diffsEl.getChild(i).getChild(1).getChild(j).getContent();
1335
-    }
1336
-
1337
-    for(int j = 0; j < except.length; j++)
1338
-    {
1339
-      except[j] = diffsEl.getChild(i).getChild(2).getChild(j).getContent();
1340
-    }
1341
-
1342
-    Diff diff = new Diff(contextName,intersects,except);
1343
-    diffs[i] = diff;
1344
-  }
1345
-  return diffs;
1346
-}
1347
-
1348
-Request request = parseRequest(doc);
1349
-Diff[] diffs = parseDiffs(doc);
1350
-Context[] contexts = parseProfile(doc);
1351
-size(200,200);
1352
-//background(0);
1353
-noFill();
1354
-
1355
-//the size of request is fixed for now
1356
-float centerX = width/2;
1357
-float centerY = height/2;
1358
-float rsize = 55;
1359
-
1360
-//color of request is mapped to the privacy type of the request, each request has one.
1361
-color reqColor = getColor(PrivacyLevel.PUBLIC, request.contextType);
1362
-fill(reqColor); 
1363
-ellipse(centerX, centerY, rsize, rsize);
1364
-
1365
-//show the name of the application that makes the request, centered below the circle
1366
-fill(0);
1367
-textAlign(CENTER,CENTER);
1368
-text(request.application, centerX, centerY + rsize/1.5);
1369
-</script> <canvas id="ob-d1a83be2c44d00455adace357b093d445e4966ea"></canvas>
1370
-</div>
1371
-</div>
1372
-
1373
-<div id="outline-container-orga67a54c" class="outline-3">
1374
-<h3 id="orga67a54c"><span class="section-number-3">4.2</span> Contexts</h3>
1375
-<div class="outline-text-3" id="text-4-2">
1376
-<p>
1377
-We want to draw each context in relation to the request, 
1378
-so we place each context equidistant from the request in the center.
1379
-Click on the picture to toggle preview of different (random) sizes and distances for the contexts.
1380
-</p>
1381
-
1382
-<script src="processing.js"></script>
1383
- <script type="text/processing" data-processing-target="ob-a0d330ffcf77c1bd4b7462f8512e5cd9310ecf3f">
1384
-String[] levels = {"commons", "public", "affiliate", "intimate", "private", "secret"};
1385
-String[] contextTypes = {"personal", "health", "education", "work", "hobby", "financial", "other"};
1386
-
1387
-static class PrivacyLevel {
1388
-  public static int SECRET = 5;
1389
-  public static int PRIVATE = 4;
1390
-  public static int INTIMATE = 3;
1391
-  public static int AFFILIATE = 2;
1392
-  public static int PUBLIC = 1;
1393
-  public static int COMMONS = 0;
1394
-}
1395
-
1396
-static class ContextType {
1397
-  public static int PERSONAL = 0; 
1398
-  public static int HEALTH = 1;
1399
-  public static int EDUCATION = 2;
1400
-  public static int WORK = 3;
1401
-  public static int HOBBY = 4;
1402
-  public static int FINANCIAL = 5;
1403
-  public static int OTHER = 6;
1404
-}
1405
-
1406
-int[][] colors = generateColors();
1407
-
1408
-//generate colors to maximize contrast
1409
-int[][] generateColors()
1410
-{
1411
-  int[][] pcolors = new int[contextTypes.length][levels.length];
1412
-  
1413
-//we start with d0 as a seed color
1414
-  color seed = #FFE9BE;//seed color
1415
-  
1416
-  colorMode(HSB);
1417
-  
1418
-  float h_seed = hue(seed);
1419
-  float s_seed = saturation(seed);
1420
-  float v_seed = brightness(seed);
1421
-
1422
-  float levelshift = 255/levels.length;
1423
-  float contextshift = 255/contextTypes.length + 1;
1424
-  
1425
-  //cycle hue for each level
1426
-  for (int i = 0; i < contextTypes.length; i++){
1427
-    float h = h_seed + i * contextshift;
1428
-    if(h > 255){h = h - 255;}
1429
-    
1430
-    //cycle brightness for each context
1431
-    for(int j = 0; j < levels.length; j++)
1432
-    {
1433
-      float v = v_seed - (j * levelshift);
1434
-      float s = s_seed + (j * levelshift); 
1435
-      
1436
-      color c = color(h,s,v);
1437
-      pcolors[i][j] = c;
1438
-    }
1439
-  }
1440
-  colorMode(RGB);
1441
-
1442
-  return pcolors;
1443
-}
1444
-
1445
-public int getColor(int privacy_level, int context_type)
1446
-{
1447
-    return colors[context_type][privacy_level];
1448
-}
1449
-class Request
1450
-{
1451
-  public String application;
1452
-  public int contextType;
1453
-  public String[] required_properties;
1454
-  public String[] optional_properties;
1455
-  public int plSum;
1456
-  public int plMean;
1457
-
1458
-  public Request(String app, int contextType, String[] req, String[] opt, int sum, int mean)
1459
-  {
1460
-    this.application = app;
1461
-    this.contextType = contextType;
1462
-    this.required_properties = req;
1463
-    this.optional_properties = opt;
1464
-    this.plSum = sum;
1465
-    this.plMean = mean;
1466
-  }
1467
-}
1468
-
1469
-class Diff
1470
-{
1471
-  public String context;
1472
-  public String[] intersect;
1473
-  public String[] except;
1474
-
1475
-  public Diff(String ctx, String[] intersect, String[] except)
1476
-  {
1477
-    this.context = ctx;
1478
-    this.intersect = intersect;
1479
-    this.except = except;
1480
-  } 
1481
-}
1482
-
1483
-class Property
1484
-{
1485
-  public String type;
1486
-  public String value;
1487
-  public int pl;//privacy level
1488
-
1489
-  public Property(String type, String value, int pl)
1490
-  {
1491
-    this.type = type;
1492
-    this.value = value;
1493
-    this.pl = pl;
1494
-  }
1495
-}
1496
-
1497
-class Context
1498
-{
1499
-  public String title;
1500
-  public int plSum;
1501
-  public int plMean;
1502
-  public int contextType;
1503
-  public Property[] properties;
1504
-
1505
-  public Context(String title, int plSum, int plMean, int contextType, Property[] properties)
1506
-  {
1507
-    this.title = title;
1508
-    this.plSum = plSum;
1509
-    this.plMean = plMean;
1510
-    this.properties = properties;
1511
-    this.contextType = contextType;
1512
-  }
1513
-}
1514
-
1515
-XMLElement doc = new XMLElement(this, 'diff.xml');
1516
-
1517
-//create typed versions because this is java :-(
1518
-Request parseRequest(XMLElement xml)
1519
-{
1520
-  XMLElement req = xml.getChild(0);
1521
-  String name = req.getChild(0).getContent();
1522
-  int contextType = req.getChild(1).getContent();
1523
-  String[] required = new String[req.getChild(2).getChildCount()];
1524
-  String[] optional = new String[req.getChild(3).getChildCount()];
1525
-  int plSum = parseInt(req.getChild(4).getContent());
1526
-  int plMean = parseInt(req.getChild(5).getContent());
1527
-
1528
-  for (int i = 0; i < required.length; i++) {
1529
-    required[i] = req.getChild(2).getChild(i).getContent();
1530
-  }
1531
-
1532
-  for (int i = 0; i < optional.length; i++) {
1533
-    optional[i] = req.getChild(3).getChild(i).getContent();
1534
-  }
1535
-
1536
-  Request r = new Request(name,contextType,required,optional, plSum, plMean);
1537
-  return r;
1538
-}
1539
-
1540
-Context[] parseProfile(XMLElement xml)
1541
-{
1542
-  XMLElement profile = xml.getChild(2);
1543
-  Context[] contexts = new Context[profile.getChildCount()];
1544
-
1545
-  for(int i = 0; i < contexts.length; i++)
1546
-  {
1547
-    String contextName = profile.getChild(i).getChild(0).getContent();
1548
-    int contextType = parseInt(profile.getChild(i).getChild(1).getContent());
1549
-    int plSum = parseInt(profile.getChild(i).getChild(2).getContent());
1550
-    int plMean = parseInt(profile.getChild(i).getChild(3).getContent());
1551
-    XMLElement propertiesEl = profile.getChild(i).getChild(4);
1552
-    Property[] properties = new Property[propertiesEl.getChildCount()];
1553
-    for(int j = 0; j < properties.length; j++)
1554
-    {
1555
-      Property prop = parseProperty(propertiesEl.getChild(j));
1556
-      properties[j] = prop;
1557
-    }
1558
-
1559
-    Context context = new Context(contextName, plSum, plMean, contextType, properties);
1560
-    contexts[i] = context;
1561
-  }
1562
-  return contexts;
1563
-}
1564
-
1565
-Property parseProperty(XMLElement propertyEl)
1566
-{
1567
-  String propertyType = propertyEl.getChild(0).getContent();
1568
-  String value = propertyEl.getChild(1).getContent();
1569
-  int pl = parseInt(propertyEl.getChild(2).getContent());
1570
-  return new Property(propertyType, value, pl);
1571
-}
1572
-
1573
-//create typed versions because this is java :-(
1574
-Diff[] parseDiffs(xml)
1575
-{
1576
-  XMLElement diffsEl = xml.getChild(1);
1577
-  Diff[] diffs = new Diff[diffsEl.getChildCount()];
1578
-  for(int i = 0; i < diffs.length; i++)
1579
-  {
1580
-    String contextName = diffsEl.getChild(i).getChild(0).getContent();
1581
-    String[] intersects = new String[diffsEl.getChild(i).getChild(1).getChildCount()];
1582
-    String[] except = new String[diffsEl.getChild(i).getChild(2).getChildCount()];
1583
-    
1584
-    for(int j = 0; j < intersects.length; j++)
1585
-    {
1586
-      intersects[j] = diffsEl.getChild(i).getChild(1).getChild(j).getContent();
1587
-    }
1588
-
1589
-    for(int j = 0; j < except.length; j++)
1590
-    {
1591
-      except[j] = diffsEl.getChild(i).getChild(2).getChild(j).getContent();
1592
-    }
1593
-
1594
-    Diff diff = new Diff(contextName,intersects,except);
1595
-    diffs[i] = diff;
1596
-  }
1597
-  return diffs;
1598
-}
1599
-
1600
-Request request = parseRequest(doc);
1601
-Diff[] diffs = parseDiffs(doc);
1602
-Context[] contexts = parseProfile(doc);
1603
-void setup(){
1604
-  size(800,800);
1605
-  smooth();
1606
-  noLoop();
1607
-}
1608
-
1609
-//divide the circle by the amount of contexts 
1610
-//to get the angle between the lines that indicate the center of each context
1611
-float eqd_angle = TWO_PI / contexts.length;
1612
-int varyDistance = 0;
1613
-
1614
-//press any key to use random size and distance
1615
-void mousePressed()
1616
-{
1617
-  if(varyDistance ==  0){
1618
-    varyDistance = 1;
1619
-  }
1620
-  else{
1621
-    varyDistance = 0;
1622
-  }
1623
-  draw();
1624
-}
1625
-
1626
-void draw()
1627
-{
1628
-  background(200);
1629
-
1630
-  //the size of request is fixed for now
1631
-  float centerX = width/2;
1632
-  float centerY = height/2;
1633
-  float rsize = 55;
1634
-
1635
-  //color of request is mapped to the privacy type of the request, each request has one.
1636
-  color reqColor = getColor(PrivacyLevel.PUBLIC, request.contextType);
1637
-  fill(reqColor); 
1638
-  ellipse(centerX, centerY, rsize, rsize);
1639
-
1640
-  //show the name of the application that makes the request, centered below the circle
1641
-  fill(0);
1642
-  textAlign(CENTER,CENTER);
1643
-  text(request.application, centerX, centerY + rsize/1.5);
1644
-
1645
-  int count = 0;
1646
-  for(Context context : contexts)
1647
-  {
1648
-    float angle = (count * eqd_angle) - (PI/2);//start drawing at the top
1649
-
1650
-    float distance = 200;
1651
-    float csize = 100;
1652
-    if(varyDistance == 1)
1653
-    {
1654
-      distance = random(100,300);
1655
-      csize = random(50,100);
1656
-    }
1657
-    float x = centerX + distance * cos(angle); //calculate xPos
1658
-    float y = centerY + distance * sin(angle); //calculate yPos
1659
-
1660
-    //each context should have a contextType too, in order to base the color on it.
1661
-    color contextColor = getColor(PrivacyLevel.PUBLIC, context.contextType);
1662
-    fill(contextColor);
1663
-    ellipse(x, y, csize, csize);//fixed sizes and distances for now.
1664
-
1665
-    //show context label
1666
-    fill(0);
1667
-    textAlign(CENTER,CENTER);
1668
-    text(context.title, x, y + csize/1.5);
1669
-    count++;
1670
-  }
1671
-}
1672
-</script> <canvas id="ob-a0d330ffcf77c1bd4b7462f8512e5cd9310ecf3f"></canvas>
1673
-</div>
1674
-</div>
1675 1127
 </div>
1676 1128
 
1677
-<div id="outline-container-org089873d" class="outline-2">
1678
-<h2 id="org089873d"><span class="section-number-2">5</span> Interaction</h2>
1129
+<div id="outline-container-orgc8c07de" class="outline-2">
1130
+<h2 id="orgc8c07de"><span class="section-number-2">5</span> Interaction</h2>
1679 1131
 <div class="outline-text-2" id="text-5">
1680 1132
 <p>
1681 1133
 We have come up with an interaction for entitlements that is based around a 'context switcher'.
@@ -1695,7 +1147,7 @@ close by the sector of the calculated best fitted context. Based on the category
1695 1147
 </p>
1696 1148
 
1697 1149
 <div class="org-src-container">
1698
-<pre class="src src-java" id="org84d5687"><span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">calculate the fitness score for the given context and diff for the current request </span>
1150
+<pre class="src src-java" id="org0d553f3"><span style="color: #2aa1ae; background-color: #292e34;">//</span><span style="color: #2aa1ae; background-color: #292e34;">calculate the fitness score for the given context and diff for the current request </span>
1699 1151
 <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #bc6ec5; font-weight: bold;">fitnessScore</span><span style="color: #4f97d7;">(</span><span style="color: #ce537a; font-weight: bold;">c</span>,<span style="color: #ce537a; font-weight: bold;">d</span><span style="color: #4f97d7;">)</span>
1700 1152
 <span style="color: #4f97d7;">{</span>
1701 1153
   <span style="color: #ce537a; font-weight: bold;">int</span> <span style="color: #7590db;">score</span> = <span style="color: #a45bad;">0</span>;
@@ -2370,7 +1822,7 @@ String getPropertyValue(Context c, String key)
2370 1822
 </div>
2371 1823
 <div id="postamble" class="status">
2372 1824
 <p class="author">Author: Taco</p>
2373
-<p class="date">Created: 2018-04-20 Fri 15:21</p>
1825
+<p class="date">Created: 2018-04-20 Fri 16:37</p>
2374 1826
 <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
2375 1827
 </div>
2376 1828
 </body>

File diff suppressed because it is too large
+ 16 - 623
entitlements.org