<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Mobile_Apps_2023W_Lecture_14</id>
	<title>Mobile Apps 2023W Lecture 14 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Mobile_Apps_2023W_Lecture_14"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_Apps_2023W_Lecture_14&amp;action=history"/>
	<updated>2026-04-08T03:33:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_Apps_2023W_Lecture_14&amp;diff=24383&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Notes== &lt;pre&gt; March 3 -------  I want to build a browser history viewer.  It will allow surfing history to be viewed in a few ways:  - list of pages visited (easy, dump stored history)  - list &quot;sessions&quot;     - group by what is first entered in the URL bar, whether it be a       search or a direct entry of a URL     - show as a grouped list (with each session collapsable)     - show time of start of session, time of each subsequent request       (potentially hide times)...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_Apps_2023W_Lecture_14&amp;diff=24383&amp;oldid=prev"/>
		<updated>2023-03-08T19:02:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Notes== &amp;lt;pre&amp;gt; March 3 -------  I want to build a browser history viewer.  It will allow surfing history to be viewed in a few ways:  - list of pages visited (easy, dump stored history)  - list &amp;quot;sessions&amp;quot;     - group by what is first entered in the URL bar, whether it be a       search or a direct entry of a URL     - show as a grouped list (with each session collapsable)     - show time of start of session, time of each subsequent request       (potentially hide times)...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Notes==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
March 3&lt;br /&gt;
-------&lt;br /&gt;
&lt;br /&gt;
I want to build a browser history viewer.  It will allow surfing history to be viewed in a few ways:&lt;br /&gt;
 - list of pages visited (easy, dump stored history)&lt;br /&gt;
 - list &amp;quot;sessions&amp;quot;&lt;br /&gt;
    - group by what is first entered in the URL bar, whether it be a&lt;br /&gt;
      search or a direct entry of a URL&lt;br /&gt;
    - show as a grouped list (with each session collapsable)&lt;br /&gt;
    - show time of start of session, time of each subsequent request&lt;br /&gt;
      (potentially hide times)&lt;br /&gt;
 - What &amp;quot;places&amp;quot; I visit&lt;br /&gt;
    - can group by hostname&lt;br /&gt;
    - but sometimes hostname is too specific&lt;br /&gt;
      (subdomains can get added in weird ways)&lt;br /&gt;
    - maybe make it multilevel?&lt;br /&gt;
&lt;br /&gt;
For example, consider the place &amp;quot;carleton.ca&amp;quot;&lt;br /&gt;
 - I visit many other places inside of Carleton&lt;br /&gt;
 - some are in SCS: openstack.scs.carleton.ca, homeostasis.scs.carleton.ca&lt;br /&gt;
 - so maybe make a hierarchical grouping of hostnames?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Collapsed view:&lt;br /&gt;
 - google.com +&lt;br /&gt;
 - carleton.ca +&lt;br /&gt;
&lt;br /&gt;
Expanded view:&lt;br /&gt;
 - google.com&lt;br /&gt;
   - mail.google.com&lt;br /&gt;
   - sheets.google.com&lt;br /&gt;
 - carleton.ca&lt;br /&gt;
   - scs.carleton.ca&lt;br /&gt;
   - brightspace.carleton.ca&lt;br /&gt;
&lt;br /&gt;
So we want a data structure that extracts the tree inherent in hostnames&lt;br /&gt;
&lt;br /&gt;
Do you all know how DNS works?&lt;br /&gt;
&lt;br /&gt;
Remember that DNS is a distributed hierarchical fault-tolerant database for mapping hostnames to IP addresses and other info&lt;br /&gt;
&lt;br /&gt;
While there is lots of caching, basic lookup works like this:&lt;br /&gt;
&lt;br /&gt;
* look up root server (.)&lt;br /&gt;
* ask root server for first component (end of URL)&lt;br /&gt;
   (.com)&lt;br /&gt;
* go to that server, ask for next component&lt;br /&gt;
   (ask .com server for google)&lt;br /&gt;
* continue recursively until you fully resolve host (e.g., www.google.com)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So we need to split up the hostname into its components, and build a tree of those components.&lt;br /&gt;
&lt;br /&gt;
Linear time tree generation&lt;br /&gt;
 - you do this in 2402&lt;br /&gt;
&lt;br /&gt;
But...we want to display this, so we don&amp;#039;t want a data structure that is just for us.  We need to understand what data structure our display widget wants!&lt;br /&gt;
&lt;br /&gt;
We can just make a simple lazy scrollable list that we can interact with to expand as needed&lt;br /&gt;
&lt;br /&gt;
So we have a tree data structure, and for each node we have a property which says whether it is expanded or not&lt;br /&gt;
  - if it is expanded, we display the children.  If not, we don&amp;#039;t.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                        .ca&lt;br /&gt;
&lt;br /&gt;
    .carleton                       .google&lt;br /&gt;
&lt;br /&gt;
  www  brightspace                www   mail   sheets&lt;br /&gt;
&lt;br /&gt;
So our initial view would just show .ca, or it would show carleton.ca and google.ca&lt;br /&gt;
&lt;br /&gt;
If we tap any of these, the node gets marked to expanded.  Then the list will automatically expand to show the nodes under that current one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So how should we make a tree in Kotlin?&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ll have to specify the class of the node elements&lt;br /&gt;
&lt;br /&gt;
class HostPart {&lt;br /&gt;
   value: String,&lt;br /&gt;
   expanded: bool,&lt;br /&gt;
   higher: HostPart?,   /* can be undefined */&lt;br /&gt;
   lower: HostPart?&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Each level of tree is a List&amp;lt;&amp;lt;HostPart&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Need to figure out how to react to tap events so we can expand and shrink our displayed list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>