<?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_15</id>
	<title>Mobile Apps 2023W Lecture 15 - 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_15"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_Apps_2023W_Lecture_15&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_15&amp;diff=24385&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Notes==  &lt;pre&gt; March 8 -------  Last time, we were talking about how to store web browser history so we can view it in interesting ways.  class HostPart {    value: String,    expanded: bool,    higher: HostPart?,   /* can be undefined */    lower: HostPart? }                           .ca      .carleton                       .google    www  brightspace                www   mail   sheets  class HNTree {    hostComponent: String, /*  &lt;-- &quot;carleton&quot; in &quot;www.carleton.ca&quot;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Mobile_Apps_2023W_Lecture_15&amp;diff=24385&amp;oldid=prev"/>
		<updated>2023-03-09T04:43:19Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Notes==  &amp;lt;pre&amp;gt; March 8 -------  Last time, we were talking about how to store web browser history so we can view it in interesting ways.  class HostPart {    value: String,    expanded: bool,    higher: HostPart?,   &lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;can be undefined: &lt;/span&gt;    lower: HostPart? }                           .ca      .carleton                       .google    www  brightspace                www   mail   sheets  class HNTree {    hostComponent: String, /*  &amp;lt;-- &amp;quot;carleton&amp;quot; in &amp;quot;www.carleton.ca&amp;quot;...&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
March 8&lt;br /&gt;
-------&lt;br /&gt;
&lt;br /&gt;
Last time, we were talking about how to store web browser history so we can view it in interesting ways.&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;
&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;
class HNTree {&lt;br /&gt;
   hostComponent: String, /*  &amp;lt;-- &amp;quot;carleton&amp;quot; in &amp;quot;www.carleton.ca&amp;quot; */&lt;br /&gt;
   hostSuffix: String,    /*  &amp;lt;-- &amp;quot;carleton.ca&amp;quot; in &amp;quot;www.carleton.ca&amp;quot; */&lt;br /&gt;
   HostName: bool,  /* is this part of a hostname, or the whole thing */&lt;br /&gt;
   hostHistory: hostHistory? /* reference to history associated with this host,&lt;br /&gt;
     only valid if HostName is true */&lt;br /&gt;
   expanded: bool, &lt;br /&gt;
   children: List&amp;lt;&amp;lt;HNTree&amp;gt;&amp;gt;,&lt;br /&gt;
   parent: HNTree,&lt;br /&gt;
   peerIndex: int  /* to allow fast location of next child */&lt;br /&gt;
   historyLevel: int  /* to determine how to display this relative to other history elements */&lt;br /&gt;
&lt;br /&gt;
   fun getValue(): String {&lt;br /&gt;
       return this.value;&lt;br /&gt;
   }  &lt;br /&gt;
&lt;br /&gt;
   fun expanded?() {}&lt;br /&gt;
&lt;br /&gt;
   /* want to get a list of host entries that are pruned to the current expanded level*/&lt;br /&gt;
   &lt;br /&gt;
   fun nextVisibleNode() {&lt;br /&gt;
   &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   fun nextChildNode(child): HNTree? {&lt;br /&gt;
     /* takes a child node in of this node */&lt;br /&gt;
     /* get&amp;#039;s child&amp;#039;s peerIndex and returns peerIndex + 1 entry in children */&lt;br /&gt;
     /* if child is not a child of this nodee, then return NULL */&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   fun addChild(node);&lt;br /&gt;
    /* always add at sorted position amongst children */&lt;br /&gt;
&lt;br /&gt;
   fun delChild(index);&lt;br /&gt;
     /* have to update peerIndex of all children with index greater than this */&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
So we could just call listVisibleChildren on the root and we&amp;#039;d get exactly what we want to show.  But actually we only want to generate a list of what is visible on the screen, want to use LazyColumn&lt;br /&gt;
 - also want to be able to handle *lots* of history, that&amp;#039;s what would be useful to visualize&lt;br /&gt;
&lt;br /&gt;
Start:&lt;br /&gt;
.&lt;br /&gt;
 .com&lt;br /&gt;
 .ca&lt;br /&gt;
 .net&lt;br /&gt;
 .org&lt;br /&gt;
&lt;br /&gt;
Tap on .ca&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
 .com&lt;br /&gt;
 .ca&lt;br /&gt;
   .carleton.ca&lt;br /&gt;
 .net&lt;br /&gt;
 .org&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We need a list of items to be displayed, and we need to be able to say the first item in the list to be displayed.  So we&amp;#039;d say VisibleHistoryItems(n, c), and it would return a list of items.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is always an HNTree.  We can just keep calling nextVisibleNode on this element to see what should next be shown.  Internally this will use nextChildNode and check whether it is expanded or not, and based on that it will return the next node to be displayed.&lt;br /&gt;
&lt;br /&gt;
How to test?&lt;br /&gt;
&lt;br /&gt;
Start off with constant data, an array of hostnames.  Get it from a website or from my own browser history&lt;br /&gt;
&lt;br /&gt;
Then we want to parse it into our data structure, and then build a LazyColumn that displays the data structure&lt;br /&gt;
&lt;br /&gt;
So first&lt;br /&gt;
 - show you can just make a scrollable list of the hardcoded hostnames using LazyColumn&lt;br /&gt;
 - make a trivial version of this class that just outputs stuff from the hostnames list, but uses desired API&lt;br /&gt;
 - make the API do the right thing&lt;br /&gt;
&lt;br /&gt;
You want to get API right before semantics&lt;br /&gt;
 - because semantics may have to change based on needed API&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>