<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gregory Edward Williams on Medium]]></title>
        <description><![CDATA[Stories by Gregory Edward Williams on Medium]]></description>
        <link>https://medium.com/@gregoryedwardwilliams?source=rss-4b368532f80d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Gregory Edward Williams on Medium</title>
            <link>https://medium.com/@gregoryedwardwilliams?source=rss-4b368532f80d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:17:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gregoryedwardwilliams/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Forrest Gump of Tech: My Journey Through Four Decades of Computing]]></title>
            <link>https://gregoryedwardwilliams.medium.com/the-forrest-gump-of-tech-my-journey-through-four-decades-of-computing-4403880ce23f?source=rss-4b368532f80d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4403880ce23f</guid>
            <category><![CDATA[forrest-gump-style]]></category>
            <category><![CDATA[computer-history]]></category>
            <category><![CDATA[tech-career]]></category>
            <category><![CDATA[personal-journeys]]></category>
            <dc:creator><![CDATA[Gregory Edward Williams]]></dc:creator>
            <pubDate>Thu, 11 Sep 2025 20:35:25 GMT</pubDate>
            <atom:updated>2025-09-15T16:32:59.600Z</atom:updated>
            <content:encoded><![CDATA[<h3>“Mama always said computers are like a box of chocolates” — sweet till they crash at 3 a.m.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IN44CE_Whtkr9nqwXudsFw.png" /></figure><p>Folks someone ask me what all I’ve done in computers. So I figured I’d just sit down and tell it the best I can. This here’s the story of where that blinking cursor’s taken me.</p><p>My daddy once told me in 1979 he saw the two Steves — Steve Jobs and Steve Wozniak — <br>at a computer fair sellin the Apple ][+.<br>He thought it was somethin special, so he bought one.</p><p>We were on vacation in Wichita, Kansas at the time. We took it to my grandparents house.<br>I remember sittin with my grandma playin a game called Lemonade. We competed to see who would make the most profit at the end of it. She beat me at it too.</p><p>Daddy said it was the best investment he ever made. It got my brother and me good jobs.<br>I just liked makin the little green letters dance on the screen.</p><p>The Apple ][+ had 48K of memory, plus a 16K expansion card. It wouldn’t even hold one modern camera photo.</p><p>Forward a few years.<br>In 1984, Daddy bought a Macintosh 128K.<br>He upgraded it to a Macintosh 512K and then to a Macintosh Plus.</p><p>It had a whole megabyte of memory — <br>still less than one modern selfie — <br>and Minitorian, the game I made on it,<br>took only half a meg of space.<br>It still had dozens of pictures,<br>lots of sounds, text,<br>and the programming for a full game.<br>These days they call that efficient.<br>Now they just call it bloatware.</p><p>Back then, openin up a Mac was like defusin a bomb. You had to unplug it, wait a day, and ground yourself. Touch the exposed CRT and you’d get shocked. When he opened it, we saw all the creators signatures inside.</p><p>It showed they really cared about what they were makin.</p><p>In 1987, I used that Macintosh Plus to make Minitorian. I built it in World Builder with MacVision graphics and digitized sound.<br>It was my first real creation. I even put a picture of me as the villain if you lost.<br>If you lost I turned you into a frog.</p><p>It got published in the Educorp catalog, then on their CD-ROM, and later on the MacMania CD-ROM. I even got a letter from Japan.<br>Decades later, just for fun, I typed its name into a browser. There it was on Macintosh Garden. It’s still playable on Macintosh Repository today.<br>I never expected that.<br>I thought it was lost.<br>It was like I got a piece of my childhood back.</p><p>As a teenager I worked in a summer government apprenticeship program<br>for two summers at the Uniformed Services University of the Health Sciences.<br>While other kids were flippin burgers, I was buildin software.</p><p>We even went on two field trips I still remember. One was to the National Institutes of Health. They showed us a short from Pixar called The Adventures of André and Wally B.<br>It was the first time Pixar told a story in a short film — and the first time they made an audience laugh. This was several years before Toy Story.</p><p>Back then they were doin scientific imaging,<br>and the folks at the NIH were tryin out new MRI technology. It could build a 3D picture of the body and let you slice through it to see all the parts inside. I thought that was mighty clever.</p><p>In another demo, the engineer spun a baboon’s head around like a pinwheel.<br>The edges went all blurry, but the middle stayed real sharp — kinda like what folks now call foveated rendering, where the computer only makes the part you’re lookin at real clear.</p><p>Then we went to see the NeXT Computer.<br>It sure was fancy. It had writable CDs, a Finder-like screen, and it drew everything with PostScript. They even had an early program builder called Interface Builder.</p><p>They wanted students to buy them,<br>but they were way too expensive<br>and didn’t even have a floppy drive.<br>But boy, they sure were pretty.</p><p>Apple later used NeXT as the base for the modern Macintosh. At the time, I just thought it looked neat.</p><p>That summer I built a little flat-file program to track nuclear waste. I made it look like a text-based GUI — with menus and prompts, like a real computer program.</p><p>Years later I asked my mentor, Captain Jerry Thomas, what happened to it.<br>He said, “Greg, that thing ran for over ten years.” That’s when I learned the government’ll keep software runnin a long time — even if it was written by a high school kid.</p><p>The next summer I built a program for their radiology department. It showed X-rays with numbers on the parts. Click a number, and up popped an explanation. Students could turn the answers on and off like flashcards.<br>They kept usin it for years after I left.</p><p>After that was Drexel University.<br>I picked it cause it was the first school that made every student have a computer, and cause they had one of the best co-op programs in the whole country.</p><p>It was a five-year school on the quarter system. In your second, third, and fourth years, you’d go to class half the year<br>and work a real job in your major the other half — and they even paid you. I thought that sounded pretty good.</p><p>School was hard at first cause of my dyslexia,<br>but I stuck with it.</p><p>I started out in computer science,<br>but it didn’t quite fit me.<br>So in my second year I switched over to CIS — <br>that’s computers too, just more about buildin real systems for real people.</p><p>I graduated cum laude,<br>and later almost had a 4.0 in my master’s.</p><p>I’ll never forget the Database Theory 2 midterm for my master’s.<br>The professor came in and said,<br>“Many of you failed this test.”</p><p>Then he held up mine and said,<br>“Gregory got 110 percent.”</p><p>I sure blew the curve that day.</p><p>And you know what?<br>Drexel’s master’s in Information Systems is now ranked number one.<br>So I guess I did alright.</p><p>I kept on learnin even after school.<br>Back in the 2010s, I took some exams on a site called Brainbench.<br>I got the top score in the whole world in Relational Database Concepts — <br>and again in SQL Server 2012 Programming.<br>Those scores stayed up there for years<br>till Brainbench shut down.<br>I guess I’ve always liked seein how far I could go.</p><p>My first co-op job was at the General Services Administration.<br>I was buildin things in dBASE.<br>One of the folks there said,<br>“If you can do all this with dBASE,<br>I’d like to see what you do with Oracle.”<br>I never got the chance, but it planted a seed.<br>They even sent me a nice letter askin me to come back<br>and gave me a fancy pen,<br>but I wanted to see what else was out there.</p><p>Then came Cigna.<br>They wanted a bond underwriting system for Windows.</p><p>At first they told me to use a thing called ObjectVision, but it wouldn’t cut it.<br>It didn’t really have a programming language<br>and couldn’t even talk to SQL Server 4.2.</p><p>I read about this brand-new thing called Visual Basic 1.0 and showed it to my boss. After thinkin on it, he said, “Go for it.”</p><p>Before long, that system — we called it Surety Aide — was runnin in the main office and 14 field offices. It was one of Cigna’s first Windows-based client/server systems,<br>and I reckon one of the first real distributed setups there. We even had to design for eventual consistency. Nobody called it that back then.</p><p>I just liked how the modems sang<br>when they synced up every night.</p><p>After that I went to work at a little company called LawManage. They hired me fresh out of college to build their first Windows program.</p><p>Back then, shippin software was hard.<br>If you changed somethin, you had to rebuild the whole thing and send it out to everybody again. I thought there had to be an easier way.</p><p>So I made a system where folks could build screens and forms just by settin things up in the database. No compilin, no shippin disks — just save your changes and it worked.<br>These days they call that low code,<br>but back then we were just tryin to make life easier.</p><p>We kept all the parts in three tables: components, properties, and relations.<br>One day, while showin the president what I built, I said,<br>“Wouldn’t it be nice if this worked kinda like objects — <br>where one could be the parent of another?”<br>He asked how I’d do it.<br>I said, “Just add a parent column to the component table.”<br>The CIO said, “Yeah, what he said.”</p><p>That little idea meant we could make one base version of the system and let each customer change just the bits they needed.<br>If we fixed somethin in the base, it fixed it for everyone — unless someone had their own version of it. That “parent” idea let us inherit defaults and override only what was different.</p><p>We started thinkin about LawManager like it was an engine. If the engine was solid, then all the screens and forms were just riders on top of it. That way, when the world started movin to the web, it made the job a whole lot easier. All we really had to do was write the engine again, and everything else could ride along with it. The rules lived in the database, so the screens could follow without rebuildin everything.</p><p>A new client could be up and running<br>just by changin settings instead of shippin new code.</p><p>I wanted its internal code name to be Remora. They’re little fish that ride along with sharks and keep ’em clean. But the bosses said no — they didn’t want people thinkin we were callin lawyers sharks.</p><p>So out in the world we just called it LawManager. It came out in 1997 — two years before Salesforce. Funny thing is, Salesforce later used a similar approach; by then we’d been doin it for about a decade.</p><p>LawManager kept on runnin for decades, through two company mergers. Only now is it finally bein phased out. I guess that means it was built to last.</p><p>After that came SmithKline Beecham.<br>We were tryin to help folks who had<br>type 2 diabetes, depression, or high blood pressure.</p><p>We built a rules engine that could spot who needed help. Now they call that bioinformatics or clinical decision support,<br>but back then we just called it helpin people.</p><p>When the system found someone,<br>we sent ’em pamphlets and had nurses call ’em. I made a simple scripting language<br>so the nurses’ forms could change while they talked to folks.</p><p>I also made a tool that drew big workflow diagrams straight from the database.<br>We had to print ’em on those giant architect printers just to fit ’em on the paper.</p><p>And I made a rule that checked<br>if people were takin their medicine like they were supposed to.</p><p>I used a Delphi loop and a calendar table.<br>These days they call that “islands and gaps”<br>or “medication compliance.”<br>Back then I just called it makin sure folks got better.</p><p>It was new enough back then that they gave me an award for it.<br>I just thought it was the right thing to do.</p><p>Then came Qwest Interactive.<br>I worked on the SEI Investments portfolio site<br>with a young fella named Chip Childers — <br>he’s a senior director at Broadcom now.</p><p>The site was one of the first real single-page apps. I built the form tech, a “Most Recently Used” section, and made it spit out custom PowerPoint presentations on the fly.</p><p>The system was slow at first.<br>I found the bottleneck — it was gluin strings together the wrong way. Back then there wasn’t even a StringBuilder in VB6,<br>so I built my own.</p><p>When Chip tested the new version he said,<br>“I figured you’d speed it up some — <br>not by a whole order of magnitude.”</p><p>We also helped modernize the IRS site.<br>They used to copy content by hand from static pages.<br>I wrote a program that scraped it<br>and turned it into clean data.<br>Weeks of work, done in minutes.</p><p>I even helped on the Seventh-day Adventist site. Didn’t think much of it then.<br>Lookin back, I reckon I left a mark on the early web.</p><p>Then came ACE INA Reinsurance.<br>They had old VB6 programs and weekend batch jobs. that kept fallin apart.<br>Somebody had to babysit ’em all weekend<br>just to make sure they didn’t crash.</p><p>The heart of the system was a giant spreadsheet in an ActiveX control called Formula One. It had over a thousand formulas and was doin all the reclaim calculations.</p><p>I rewrote the system piece by piece.<br>I built most of the new SSIS packages<br>to replace the old VB6 programs.<br>We turned it from a weekend batch<br>into a daily system that ran on its own<br>and processed millions of dollars a day.</p><p>I wrote a program that turned all those formulas into C# code and lined ’em up in the right order so they wouldn’t break each other.<br>Folks later told me that’s called a transpiler<br>and a topological sort. I just called it gettin the job done.</p><p>I was there when ACE INA bought Chubb.<br>They said it was the biggest property and casualty merger in history. I converted Chubb’s reinsurance premiums<br>into ACE INA’s database, and made the Treaty Control Document system handle multiple currencies.</p><p>One of the leads there, Frank Brennan, said,<br>“If I leave, it’ll be bad. But if Greg leaves, it’ll be worse.”</p><p>Linda Zampini, one of the managers at ACE USA, said they kept givin me some of the hardest things to do — and I always delivered.</p><p>I reckon that meant I was doin alright.</p><p>Those were some of the biggest things I worked on, but I was there 16 years, and I reckon I did more things than I can even count. Seems like every time I turned around<br>there was somethin new that needed fixin.</p><p>While I was still at ACE INA, I started tinkerin on a side project called Feline Finder.<br>My brother was one of the first iOS app developers when the App Store first opened,<br>and I saw how much fun he was havin.</p><p>So I decided to give it a try.<br>Feline Finder let folks pick the kind of cat they wanted and see pictures, sounds, and videos of the breeds. It even showed adoptable cats from local shelters.</p><p>I was part of the Philly CocoaHeads group back then, and I gave my first demo of it there. That was my first real iOS app.</p><p>Later on I left ACE INA and moved to San Francisco. I went to Hack Reactor to learn modern web development. They crammed a computer science degree into four months.<br>I was the oldest student there. l1The skills I learned went straight into my next job.</p><p>One time I worked for Williams-Sonoma.<br>They had half a million employee histories<br>stretchin all the way back to the 1950s<br>that needed to be moved into Oracle HCM.<br>Some said folks got fired before they were even hired. There was a whole lot of bad data.</p><p>I got 80% of it right the first time, which they said was real good for somethin that big and messy. I kept at it till it was 100%.</p><p>After that I worked at a company called Geographic Solutions. They make unemployment software —if you live in one of about 35 states, they’re the ones sendin your unemployment checks when you’re out of work.</p><p>They’re based in Florida, and I worked remote from California. They had stand-up meetings every day at the start of their day — which was five in the mornin for me.</p><p>I liked the work, but gettin up at 5 a.m. every day wore me down. So after a year I left the job, but on good terms.</p><p>Then I got a job at LexisNexis.<br>I thought it would be more interestin than it turned out to be. I was doin the same thing every day, and every day felt like the movie “Groundhog Day.”</p><p>So I called my old boss at Geographic Solutions to ask for a reference.<br>He was so happy to hear from me<br>that he asked me to come back.<br>I asked about the early stand-ups,<br>and he said they could move ’em to after lunch Eastern. So that problem was solved,<br>and I went back.</p><p>That time I worked on the maternity leave feature and a few other things. I liked the work, but it didn’t pay enough to cover the cost of livin in California. So after a year I moved on.</p><p>Now I’m at the San Francisco Public Utilities Commission. They had old ColdFusion holdin the power meters together. I tore it all out and rebuilt it with React, DevExtreme, Django, and Oracle. It’s the power department’s meter data system, so it’s kind of a big deal if it works right.</p><p>While I was buildin it, I made friends with ChatGPT and learned how to talk to it real well. Together we showed that what folks now call “human in the loop” can build software faster and better than doin it alone.</p><p>Some people didn’t believe in usin AI at work.<br>I did it anyway.<br>And it worked — <br>as long as you trust but verify.</p><p>Now some of the rest of the team<br>are startin to use AI too.<br>Guess they saw it works after all.</p><p>Funny thing is, I started out in government…<br>and now I’m endin up there too. I guess I just ran in one big circle — only a whole lot further down the road.</p><p>While I was at ACE INA,<br>I went on a Geek Cruise for fun.<br>One night I had supper with Steve Wozniak — <br>the fella who made the Apple ][+.</p><p>I told him thank you<br>for makin the little machine<br>that started the whole thing for me<br>and for a lot of other folks too.</p><p>That same night he gave a talk<br>about the early Apple days.<br>He said when he was a boy<br>he used to build circuits in his head.</p><p>When he was makin the Apple ][+<br>he wrote a game called Little Brick Out.<br>Took him about an hour.<br>Back then, doin it in hardware<br>would’ve taken a month.</p><p>That’s when he knew computers were gonna change everything.<br>And I reckon they did.</p><p>Because that little computer — <br>and his idea that there ought to be lots of personal computers instead of just a few really big ones like some folks were sayin back then — that’s what I built my whole life on.</p><p>That’s why I call myself the Forrest Gump of IT. I didn’t just watch the changes roll by — I helped build the tracks they ran on. I’ve been workin my way through four decades of personal computers — from green letters to AI — and I’ve found myself standin in the middle of more than a few big shifts along the way.<br>And I’m still here…<br>runnin… coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4403880ce23f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Variable Width Multi Row Segmented Control Using A Collection View with a CustomLayout]]></title>
            <link>https://gregoryedwardwilliams.medium.com/variable-width-multi-row-segmented-control-using-a-collection-view-with-a-customlayout-3045b85ab06b?source=rss-4b368532f80d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3045b85ab06b</guid>
            <category><![CDATA[custom-layout]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[segmentedcontrol]]></category>
            <dc:creator><![CDATA[Gregory Edward Williams]]></dc:creator>
            <pubDate>Sun, 20 Dec 2020 00:25:27 GMT</pubDate>
            <atom:updated>2020-12-20T00:25:27.366Z</atom:updated>
            <content:encoded><![CDATA[<p>For the new version of my app Feline Finder, <a href="http://www.gregsiosapps.com./">www.gregsiosapps.com</a>, I had a need for a multi-row variable width segment control. I have provided a picture below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxxJMoTVGS5OlZtrnBkYEw.jpeg" /></figure><p>Briefly this is done with a custom layout in a collection view. Here is the code for the custom layout. Here is the code for the Segemented Control Collection View.</p><pre>//<br>//  MultiRowSegmentedLayout.swift<br>//  Feline Finder<br>//  Created by Gregory Williams on 10/12/20<br>//  Copyright © 2020 Gregory Williams. All rights reserved.<br>//</pre><pre><strong>import</strong> UIKit</pre><pre><strong>protocol</strong> MultiRowSegmentedLayout: AnyObject {</pre><pre><strong>func</strong> collectionView(<br><strong>_</strong> collectionView: UICollectionView,<br>widthForTextAtIndexPath indexPath: IndexPath) -&gt; CGFloat</pre><pre><strong>func</strong> collectionView(<br><strong>_</strong> collectionView: UICollectionView,<br>maxHeight: CGFloat)</pre><pre>}<br></pre><pre><strong>class</strong> MultiRowSegmentedAttributes: UICollectionViewLayoutAttributes {</pre><pre><strong>    var</strong> textWidth: CGFloat = 0</pre><pre><strong>    override</strong> <strong>func</strong> copy(with zone: NSZone?) -&gt; <strong>Any</strong> {<br> <strong>      let</strong> copy = <strong>super</strong>.copy(with: zone) <strong>as</strong>! MultiRowSegmentedAttributes<br>       copy.textWidth = textWidth<br>       <strong>return</strong> copy<br>    }</pre><pre><strong>    override</strong> <strong>func</strong> isEqual(<strong>_</strong> object: <strong>Any</strong>?) -&gt; Bool {<br>       <strong>if</strong> <strong>let</strong> attributes = object <strong>as</strong>? MultiRowSegmentedAttributes {<br>          <strong>if</strong> attributes.textWidth == textWidth {<br>             <strong>return</strong> <strong>super</strong>.isEqual(object)<br>          }<br>       }</pre><pre><strong>      return</strong> <strong>false<br>    </strong>}<br>}</pre><pre><strong>class</strong> MultiRowSegmentedLayout: UICollectionViewLayout {</pre><pre><strong>    var</strong> delegate: MultiRowSegmentedLayoutDelegate!<br>    <strong>var</strong> numberOfRows = 1<br>    <strong>var</strong> cellPadding: CGFloat = 5<br>    <strong>var</strong> columnHeight: CGFloat = 50</pre><pre><strong>    var</strong> cache = [UICollectionViewLayoutAttributes]()<br>    <strong>fileprivate</strong> <strong>var</strong> contentHeight: CGFloat = 0<br>    <strong>fileprivate</strong> <strong>var</strong> contentWidth: CGFloat {<br>        <strong>guard</strong> <strong>let</strong> collectionView = collectionView <strong>else</strong> {<strong>return</strong> 0}<br>        <strong>let</strong> insets = collectionView.contentInset<br>        <strong>return</strong> collectionView.bounds.width - (insets.left + insets.right)<br>    }</pre><pre>    //Setting the content size<br>    <strong>override</strong> <strong>var</strong> collectionViewContentSize: CGSize {<br>        <strong>return</strong> CGSize(width: contentWidth, height: contentHeight)<br>    }</pre><pre><strong>    override</strong> <strong>func</strong> prepare() {<br>        cache.removeAll()<br>        <strong>if</strong> cache.isEmpty {<br>           <strong>var</strong> yOffsets = [CGFloat]()<br>           <strong>var</strong> xOffsets = [CGFloat]()<br>           <strong>var</strong> row = -1<br>           <strong>var</strong> item2 = -1</pre><pre>           <strong>let</strong> itemCount = (collectionView?.numberOfItems(inSection: 0))! - 1</pre><pre><strong>           while</strong> item2 &lt; itemCount {<br>               row += 1<br>               yOffsets.append(CGFloat(row) * columnHeight)<br>               xOffsets.append(0)</pre><pre><strong>               var</strong> nextWidth = CGFloat(0.0)<br> <br>               <strong>while</strong> (item2 &lt; itemCount) &amp;&amp; (xOffsets[row] + nextWidth &lt; collectionView?.bounds.width ?? 0) {<br>                  item2 += 1<br>                  <strong>let</strong> indexPath = IndexPath(item: item2, section: 0)<br>                  <strong>let</strong> width2 = delegate.collectionView(collectionView!, widthForTextAtIndexPath: indexPath) + 10</pre><pre><strong>                  if</strong> (item2 == itemCount) &amp;&amp; (xOffsets[row] + width2 &gt; collectionView?.bounds.width ?? 0) {<br>                     row += 1<br>                     yOffsets.append(CGFloat(row) * columnHeight) <br>                     xOffsets.append(0)<br>                     nextWidth = CGFloat(0.0)<br>                  }</pre><pre><strong>                  let</strong> frame = CGRect(x: xOffsets[row], y: yOffsets[row], width: width2, height: columnHeight)</pre><pre><strong>                   var</strong> insetFrame = frame</pre><pre><strong>                   if</strong> width2 &gt; cellPadding * 2 {<br>                      insetFrame = frame.insetBy(dx: cellPadding, dy: 5)<br>                   }</pre><pre>                   <strong>let</strong> attributes = UICollectionViewLayoutAttributes(forCellWith: indexPath)          <br>                   attributes.frame = insetFrame</pre><pre>                   cache.append(attributes)</pre><pre>                   xOffsets[row] = xOffsets[row] + width2</pre><pre><strong>                   if</strong> item2 &lt; itemCount - 1 {<br>                      nextWidth = delegate.collectionView(collectionView!, widthForTextAtIndexPath: IndexPath(item: item2 + 1, section: 0)) + 2.0<br>                   } <strong>else</strong> {<br>                     nextWidth = 0<br>                   }<br>               }<br>           }</pre><pre>           delegate.collectionView(collectionView!, maxHeight: (yoffsets.last ?? 0) + columnHeight)<br>           print(&quot;Segment Prepare End&quot;)<br>      }<br>}</pre><pre>//Is called  to determine which items are visible in the given rect</pre><pre><strong>override</strong> <strong>func</strong> layoutAttributesForElements(in rect: CGRect) -&gt; [UICollectionViewLayoutAttributes]? {<br>    <strong>var</strong> visibleLayoutAttributes = [UICollectionViewLayoutAttributes]()<br>    //Loop through the cache and look for items in the rect<br>    <strong>for</strong> attribute <strong>in</strong> cache {<br>        <strong>if</strong> attribute.frame.intersects(rect) {<br>           visibleLayoutAttributes.append(attribute)<br>        }<br>    }<br>    <strong>return</strong> visibleLayoutAttributes<br>}</pre><pre>   //The attributes for the item at the indexPath</pre><pre><strong> override</strong> <strong>func</strong> layoutAttributesForItem(at indexPath: IndexPath) -&gt; UICollectionViewLayoutAttributes? {<br>    <strong>return</strong> cache[indexPath.item]<br>   }<br>}</pre><p>To implement this you need a collection view, assign the layout to of that collection view to this layout, conform to the MultiRowSegmentedLayout protocol.</p><p>This implements two methods: widthForTextAtIndexPath and MaxHeight.</p><p>The first method is used to tell the layout the width of the cell at the passed in indexPath. For my app I figure out the size of the text in the particular font by performing the following statement.</p><pre><strong>func</strong> collectionView(<strong>_</strong> collectionView: UICollectionView, widthForTextAtIndexPath indexPath: IndexPath) -&gt; CGFloat {</pre><pre><strong>return</strong> <strong>self</strong>.answers[indexPath.item].SizeOf(UIFont.systemFont(ofSize: 15)).width + 10</pre><pre>}</pre><p>SizeOf is an extension I added to the String class. It is defined as follows:</p><pre><strong>func</strong> SizeOf(<strong>_</strong> font: UIFont) -&gt; CGSize {</pre><pre><strong>    let</strong> size = <strong>self</strong>.size(withAttributes: [NSAttributedString.Key.font: font])</pre><pre><strong>    let</strong> frame = CGRect(x: 0, y: 0, width: size.width, height: size.height)</pre><pre><strong>    return</strong> frame.scaleLinear(amount: 1.0).size</pre><pre>}</pre><p>MaxHeight protocol is useful when the collection view is inside a view you want to be sized based on the total height of the items in the collection view.</p><p>The custom layout knows the width of the collection view and in the prepare method uses a loop to call its delegate and call the widthForTextAtIndexPath to get the width of each item in the datasource. Once the total width of the items plus the current one is greater than the width of the collection view it increases the yoffset by the height of the items and sets the xoffset to 0 to that it starts laying out the rest on the next line. Once the total layout is prepared the maxium yoffset of the items plus the height of an item is returned by calling its delegate and passing the hieght which can be used to dynamically change the height of the parent view.</p><p>The implementation of the selection of a cell in the collection view is handled in the following way. I keep a global array of integers. One element for each row with in the table view. The integer holds the currently selected cell index. In the didselectrowatindexpath method you call reloaditems on the collection view twice. Once for the item that is to be unselected and second for the cell to be selected. In this way you can avoid a flash which happens if you were to choose reloaddata. Then you update the position of the array to hold the currently selected item.</p><p>As an added bonus of using a collection view with cells is flexibility. You can define the cells however you like.</p><p>Happy Coding,</p><p>Greg</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3045b85ab06b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing Your Own User Notifications Server in Node.js]]></title>
            <link>https://gregoryedwardwilliams.medium.com/writing-your-own-user-notifications-server-in-node-js-89e53d5b16e5?source=rss-4b368532f80d------2</link>
            <guid isPermaLink="false">https://medium.com/p/89e53d5b16e5</guid>
            <dc:creator><![CDATA[Gregory Edward Williams]]></dc:creator>
            <pubDate>Tue, 15 Dec 2020 00:32:10 GMT</pubDate>
            <atom:updated>2020-12-15T00:32:10.905Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction</p><p>For my app Feline Finder I have just finished writing the initial version of my Node.js server. In this article I attempt to explain what it does and what you need to create your own and provide a brief explanation of what code you need to create your own.</p><p>Concept/Reason</p><p>Feline Finder helps people adopt rescue cats. It is my belief that adopting a cat is a serious decision and you need to be prepared for it and adopt a cat that fits you and your families needs for the long term. After all a cat’s lifespan is usually at least 15 years and you don’t want to be sending the cat back to the shelter.</p><p>My app suggests breeds of cats which fit your life style. You find a cat which fits you by answering some questions. A list of cat breeds which most fit you is displayed and you can see cats of that breed for adoption.</p><p>You may ask what happens if there are no cats of the breed which you are interested in available right now. That is where saved queries and user notifications come into play. If you don’t see a cat you are interested in then you can ask Feline Finder to save a query containing your requirements. Every day the system will run your query and report back if it finds a match.</p><p>For programmers I will now briefly explain what is required to build such a system and how I built it.</p><p>Things You Need To Write Your Own Server</p><p>The first thing you need to determine is to find a server which fits your needs. I choose one which was inexpensive and well known and had all the features I needed. The one I choose was DigitalOcean. I needed two services from a server which it calls Droplets and a file store which calls Spaces. For $10 a month I was able to get a basic droplet and a file store.</p><p>Then I needed a simple database to store the data. I choose MongoDb because it has a simple NoSQL database which has a free 500 megabyte tier and works well with JavaScript which is the language you write a Node.js server in. I store on MongoDb all the meta data about the stored query necessary for it to run. To reduce the storage needed I store the query in a file in DigitalOceans file store Spaces.</p><p>Explanation of Code</p><p>When the user does not find the cat that he wants he can choose to save a query. The query is saved locally in a SQLite database and also since it is needed offline is sent to DigitalOcean using a REST API call and the server stores the queries meta data into a MongoDb database and extracts the query from the query object and stores it into a file with a file name of id of the saved meta data.</p><p>Everyday once a day a cron job is run which performs a curl operation to start the Node.js server. The Node.js server does a MongoDB query to find all queries which need to run today and then locates the query file on the Spaces S3 compatible file store using the id of the JSON object and downloads it to the local file store. The Nodejs server then sends the query to RescueGroups using a npm package called axios and RescueGroups returns how many results it has found. RescueGroups is the nonprofit group which works with all the shelters that provide what cats they have available. If RescueGroups reports they have a match then the Nodejs server updates the MongodDb metadata. Then the Node.js server sends a push notification request to Apple to tell the user it found a match. I used “@parse/node-apn” npm package to send the push notification. When the user receives this push notification he taps it and Feline Finder is run and receives this information, performs the query and displays the results. A REST call is sent to the Node.js server saying that the push notification was received and acted upon so that the server updates the metadata does not perform the query again.</p><p>To send the push notification you need a token which Apple sends you when you register the iOS app at the start of the app. This token changes from time to time at random so you should not store this token. I got around this issue by using iCloud. When Feline Finder starts it checks the ubiquitous key store for user’s user id. The user id is UUID and if Feline Finder cannot find one then it creates one and stores it in the ubiquitous cloud store to find for later sessions. There is a MongoDb collection which contains this ID and the push notification token. All the user’s queries are stored with the UUID and then joined with this collection to find the current token. When Apple sends a notification that the token has changed Feline Finder sends a REST call to the Nodejs server and the token is updated.</p><p>Conclusions</p><p>Hope you enjoyed this brief overview about creating a Node.js app to handle push notifications. For around $10 a month and some effort you can create your own server to handle your push notifications if your needs are modest.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89e53d5b16e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Collection View Formatting]]></title>
            <link>https://gregoryedwardwilliams.medium.com/easy-collection-view-formatting-9f3f51c6fc4b?source=rss-4b368532f80d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f3f51c6fc4b</guid>
            <category><![CDATA[collectionview]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[custom-layout]]></category>
            <category><![CDATA[swift-5]]></category>
            <dc:creator><![CDATA[Gregory Edward Williams]]></dc:creator>
            <pubDate>Wed, 09 Dec 2020 01:28:42 GMT</pubDate>
            <atom:updated>2020-12-09T01:28:42.880Z</atom:updated>
            <content:encoded><![CDATA[<p>Easy Collection View Formatting</p><p>Recently I decided to take the Devslopes Academy iOS course. One of the apps they have you build early on is a calculator app. I decided to create one based on the original 128K Macintosh calculator app.</p><p>Here is a short video of mine in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*qCMAJC2ecyphnhqk891cQQ.gif" /></figure><p>Creating the calculator logic is easy in Swift and so wont be discussed. Where I sent most of my time was figuring out a way to make the calculator support all sizes of iOS device and also support landscape on those devices. I found a solution using a collection view and a custom layout. I had created a custom layout which I created for the new version of Feline Finder. In Feline Finder I am using it to handle a variable width segment control which flows from one row to the next depending the width of the collection view and the items you have in it.</p><p>For the calculator buttons I just have a simple one dimensional string array as the data source of the collection view. Then I just have a uiview with a custom draw func to display the buttons.</p><p>In the original design of the 128K Macintosh it has a zero button which is two cells across and an equals sign which is two cells high. The custom layout for the collection view made it really easy to handle this. The code I had already written handled the different widths and I just added logic to make the last cell extend its height in the prepare method.</p><p>I have two arrays of buttons one for portrait and one for landscape. I just switch them when the user switches screen orientation and reload the collection view.</p><p>The collection view handles all screen sizes including iPad. To do this I just calculated the size of the buttons based on the width of the collection view and divided by how many buttons I wanted for each row. The edge cases of the zero and equals sign were handled by checking their position in the array. A future enhancement could be to have a button structure and have in it a property for layouts.</p><p>Also I used PaintCode for the code of the buttons and the calculator frame. I still use this useful even they stopped supporting it and I have to correct the autogenerated draw code to support Swift 5.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f3f51c6fc4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Made A Video That Will Hopefully Help Me Get Hired]]></title>
            <link>https://gregoryedwardwilliams.medium.com/how-i-made-a-video-that-will-hopefully-help-me-get-hired-b0ada1052970?source=rss-4b368532f80d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0ada1052970</guid>
            <category><![CDATA[unemployment]]></category>
            <category><![CDATA[youtube]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[presentations]]></category>
            <category><![CDATA[covid19]]></category>
            <dc:creator><![CDATA[Gregory Edward Williams]]></dc:creator>
            <pubDate>Mon, 30 Nov 2020 08:24:14 GMT</pubDate>
            <atom:updated>2020-11-30T16:51:14.357Z</atom:updated>
            <content:encoded><![CDATA[<p>How To Make A Video That Can Make You Standout</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*z0qRu9-pFw4g6bn3y-81sA.png" /></figure><p>Hi I am Greg. I have worked with computers my whole life and in many domains and tech stacks. Most recently in Human Resources with Williams Sonoma.</p><p>That ended in June. Been trying very hard to get a new job ever since. As you undoubtedly know, the pandemic has caused a tremendous number of problems including laying off so many people who are trying to get hired, me among them.</p><p>So with so many people out of work you need a way to distinguish yourself. One way to do that is to make a video of your qualifications. In my case, that includes making a video of an app I wrote called Feline Finder which I use as my calling card so to speak to showcase my skills as an iOS developer. Here it is.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FTeSH_P6-JSA%3Fstart%3D3%26feature%3Doembed%26start%3D3&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTeSH_P6-JSA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTeSH_P6-JSA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6befacfc4845a7f8d28d1aec1c2b089/href">https://medium.com/media/e6befacfc4845a7f8d28d1aec1c2b089/href</a></iframe><p>I have this on my website <a href="http://www.gregsiosapps.com/">www.gregsiosapps.com</a> and my LinkedIn.</p><p>Anyways, here is how I created.</p><ol><li>I thought about what I was going to say and the intended audience and made an outline</li><li>I turned the outline into a script and filled it in. Adding the exact words and directions on what would be displayed.</li><li>Iterated and reworked it until I was satisfied.</li><li>Used Apple’s Keynote and added a slide for each of the key points.</li><li>Recorded the use of the app using QuickTime Player. I attached my iPhone to my laptop and choose “New Movie” from the File Menu. Then when the screen opened up choose iPhone as my video source and started recording.</li><li>Recorded one movie for each applicable slide in the Keynote presentation.</li><li>Added each video to the appropriate slide in Keynote. I did this by selecting choose from the media drop down on the toolbar.</li><li>Placed the appropriate part of my script as speaker notes to the presentation.</li><li>I clicked the mouse once to see the next slide and twice to start the video.</li><li>I tried recording the presentation using my voice but did not like the sound of my voice.</li><li>So, I looked at Fiverr to see if a professional narrator was within my shoe string budget but they were not.</li><li>So I looked at other sources.</li><li>The source I found I think is really amazing. At WellSaidLabs website I found a cool service where you can create a text to speech recording for fairly cheap just around $50 a month including commercial rights. I tried out the trial version which does not include commercial rights and it sounded extremely close to a human voice. For me, it even crossed the uncanny valley of voice.</li><li>They only give you like 250 recordings a month in the basic plan so I added as much of the script as I could in the 1000 character limit at a time, produced the files and downloaded them.</li><li>I used a sound editing program to divide the mp3s into segments which matched with what I wanted said on each slide and selected choose from Keynote’s media menu. Don’t worry about the buttons added to the slides with the speaker on them. They don’t show up in the presentation.</li><li>I then turned the microphone to zero volume in system preferences so that the narration would not echo during the presentation.</li><li>I recorded the presentation from Keynote. When recording you have to click once to go to the next slide then click again for the video to start and once more for the narration to start. After the video and narration stopped for each slide I clicked again to go the next slide. Adding the script I created in the speaker notes help me keep track of when the narration would end.</li><li>I recorded the presentation and then iterated on it until I was happy with the results.</li><li>Then I exported the presentation to a mp4 file and uploaded it to YouTube.</li><li>It was then ready to be placed on my website and LinkedIn profile.</li></ol><p>It took around a day from start of the script to finished video but much of that was trying to figure out the process which you have read in the 20 steps. I hope this helps someone. I uploaded my video last Friday from the time I wrote this video. So, it is hard to tell if it will be successful as of yet. I will write a follow up article and tell you what happened once I know. So, stay tuned.</p><p>PS I would be interested to know if you can tell the narrator of the video is not human.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0ada1052970" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>