<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jen Chang</title>
    <description>The latest articles on DEV Community by Jen Chang (@tiptopgs).</description>
    <link>https://dev.to/tiptopgs</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F89954%2F1069a0fe-ec85-46d8-a75e-35133b30a517.jpg</url>
      <title>DEV Community: Jen Chang</title>
      <link>https://dev.to/tiptopgs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tiptopgs"/>
    <language>en</language>
    <item>
      <title>First iOS speaking engagement at 360iDev</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Sun, 11 Nov 2018 16:23:13 +0000</pubDate>
      <link>https://dev.to/tiptopgs/first-ios-speaking-engagement-at-360idev-451l</link>
      <guid>https://dev.to/tiptopgs/first-ios-speaking-engagement-at-360idev-451l</guid>
      <description>

&lt;p&gt;The recording is now available for viewing, my first speaking engagement at an iOS conference! If you want to learn how we do AB testing at Grubhub, check this out.&lt;/p&gt;

&lt;p&gt;Jenny Chang Ho — Building an A/B Testing Framework that works for Developers via @YouTube @360iDev&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/PwUAwUXByAg"&gt; &lt;/iframe&gt;&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://www.howtodoitinswift.com/blog/2018/10/13/best-development-practices-for-ios-development-ive-seen-is-atnbspgrubhub"&gt;How To Do It In Swift&lt;/a&gt;.&lt;/p&gt;


</description>
      <category>ios</category>
      <category>abtest</category>
      <category>speaking</category>
      <category>360idev</category>
    </item>
    <item>
      <title>Best Practices for iOS Development I’ve Seen is at GRUBHUB</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Sat, 13 Oct 2018 15:42:49 +0000</pubDate>
      <link>https://dev.to/tiptopgs/best-development-practices-for-ios-development-ive-seen-is-at-grubhub-3b1k</link>
      <guid>https://dev.to/tiptopgs/best-development-practices-for-ios-development-ive-seen-is-at-grubhub-3b1k</guid>
      <description>

&lt;h3&gt;Best Development Practices for iOS Development I’ve Seen is at GrubHub&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vmpDOfrY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AJrHDbEdqGsVfnBYtxOitcw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vmpDOfrY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AJrHDbEdqGsVfnBYtxOitcw.jpeg" alt=""&gt;&lt;/a&gt;Photo by &lt;a href="https://unsplash.com/photos/a2VqhP3d4Vg?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;rawpixel&lt;/a&gt; on &lt;a href="https://unsplash.com/search/photos/development?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Given that GRUBHUB is the first technology company I’ve worked at, some of the practices that I’m sharing may be limited. Prior to joining GRUBHUB, I worked at corporate companies where there is usually a split between business and technology practices. They didn’t necessarily align with each other. More often than not, businesses have a bigger say because they control the financial aspects of the company. So I enjoy working in a technology-driven company. This is also my first time experiencing true agile development processes. The following sections from my experiences as a developer.&lt;/p&gt;

&lt;h3&gt;Team Structure&lt;/h3&gt;

&lt;p&gt;In order for the process to work, everyone has to be on the same page. Stakeholders in our case include developers, product owners, analytics representatives, and QA engineers. Sometimes, the designers are involved on a need basis. At GRUBHUB, we have a strong emphasis on the quality of the product. Therefore, we choose to implement less number of features with higher quality.&lt;/p&gt;

&lt;h3&gt;Product Management&lt;/h3&gt;

&lt;p&gt;At GRUBHUB, we work closely with the product owners. Product owners manage the priority of their tickets, which we groom together as a team. The grooming process takes place once a week for 30 minutes and with occasional ad-hoc meetings to groom additional tickets that need to be completed urgently. During the meeting, developers identify any gaps in the requirements and add any unit tests and functional tests into the mix because developers are also responsible for implementing the automation tests, both unit tests and functional tests. Our QA team does more of the exploration manual tests to check the health of the entire application. They have a more holistic view. This is a reason the QA team is involved in the grooming process. They help ensure that the tickets include use cases that need to be automated by the developers. Product owners are responsible for providing sufficient details including acceptance criteria, design mockups, API requests, flows, and test data.&lt;/p&gt;

&lt;p&gt;During planning, the leads of the development team will grab the tickets for the sprint based on the prioritized backlog by the product owners and assign them accordingly. At this point, any tickets that are groomed and available for planning will have all the details for the developers to work on. Since our sprint cycles are roughly two weeks, we are all on board to ensure that the tickets have sufficient information to be completed within a short development cycle of one week.&lt;/p&gt;

&lt;h3&gt;Development Management&lt;/h3&gt;

&lt;p&gt;No pull requests are created unless unit tests/functional tests are included and passing for the code changes. In order for the development team to achieve this, we have design reviews before work begins, coding style guides, a continuous integration system, and code review processes.&lt;/p&gt;

&lt;p&gt;Developers work from their individual branches and are responsible to create temporary builds from their branches to complete any verification before merging into the main branch. Verification includes any visual QA testing with the designers and functional testing with the responsible product owner.&lt;/p&gt;

&lt;p&gt;Other additional tasks that developers need to complete include experiment set up on the staging environment. One important key to note is that we have a blocked chunk of time to focus on development without any interruptions. Any meetings are scheduled before 12pm and after 4pm. So anything in between those times are dedicated for development.&lt;/p&gt;

&lt;h3&gt;Release Management&lt;/h3&gt;

&lt;p&gt;Our release cycle is every two weeks, so release meetings take place on a daily basis to triage any new defects and check on the status of the release. Folks involved in the meeting include QA team and developer leads. During this time, they also prioritize any critical bugs that need to be resolved. Anything that is raised that is out of scope including additional changes that product owners desire, they are put into the backlog for prioritization into future sprints.&lt;/p&gt;

&lt;p&gt;Our goal is to eventually bring the release cycle down to one week and as we are perfecting the processes above, we will be able to achieve this and publish to the app store more frequently. Our processes are predictable, provide some stability for developers to complete their work, and delivery on time and on schedule.&lt;/p&gt;

&lt;h3&gt;Where to go from here?&lt;/h3&gt;

&lt;p&gt;Have you experienced similar best practices in your teams? Are there others that you found valuable in delivering quality.&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://www.howtodoitinswift.com/blog/2018/10/13/best-development-practices-for-ios-development-ive-seen-is-atnbspgrubhub"&gt;How To Do It In Swift&lt;/a&gt;.&lt;/p&gt;


</description>
      <category>grubhub</category>
      <category>agile</category>
      <category>development</category>
      <category>iosappdevelopment</category>
    </item>
    <item>
      <title>Common Mistakes in a Coding Interview</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Fri, 05 Oct 2018 04:55:16 +0000</pubDate>
      <link>https://dev.to/tiptopgs/common-mistakes-in-an-interview-3k1a</link>
      <guid>https://dev.to/tiptopgs/common-mistakes-in-an-interview-3k1a</guid>
      <description>&lt;p&gt;I’ve been following the Tech Lead and love some of his raw advice on tech careers. He sometimes talks lots of sarcasm and I like it. It is about being human. This sketch is a summary of what he shared on his recent video on common mistakes in tech interviews. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F91a8721dbhxtvmpwg2y8.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F91a8721dbhxtvmpwg2y8.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think it’s pretty standard and generally good advice. Coding on the spot is something that always intimidates me due to lack of practice but I’m glad most folks out there share the same feeling. &lt;/p&gt;

&lt;p&gt;I generally feel more comfortable with companies that ask questions based on your work experiences like my current company. For college or university interviews, we generally ask more algorithms and data structure questions. It’s reasonable because they might lack the work experience. But what do you think? Is it better to do one approach over the other? Which one do you prefer?&lt;/p&gt;

&lt;p&gt;In terms of the topic, what other mistakes have you seen in coding interviews? &lt;/p&gt;

&lt;p&gt;YouTube video by the Tech Lead&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/pV7XIZnsbgM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>techinterviews</category>
    </item>
    <item>
      <title>Linked Lists in Swift</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Tue, 02 Oct 2018 05:21:48 +0000</pubDate>
      <link>https://dev.to/tiptopgs/linked-lists-in-swift-21mb</link>
      <guid>https://dev.to/tiptopgs/linked-lists-in-swift-21mb</guid>
      <description>

&lt;p&gt;What is data structure? It is a way of storing and organizing the data in memory. Different data structures (e.g., arrays, stacks, queues, etc.) organize data in different ways. You will look at linked lists today in terms of time and space complexity along with an example.&lt;/p&gt;

&lt;p&gt;Linked lists are a linear data structure or collection of values where they are all stored sequentially. They are more efficient compared to arrays when it comes to insertion and deletion O(1) vs O(n) time complexity. The inefficiency in arrays is from shifting the elements after an insertion or deletion, thus O(n). In terms of space complexity, the storage is occupied in memory for arrays regardless if they contain elements or not. When appending to the end of an array and the capacity is reached, space is doubled with a new array and values copied over from the existing array. For linked lists, the space complexity is also O(n) due to the fact that you have to keep track of additional pointers, which occupy space.&lt;/p&gt;

&lt;p&gt;Let’s look at some code now. To create a linked list data structure of integers, it can look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uKRSUQEP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A0zR8sRiSKaulppRQxFq1yw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uKRSUQEP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A0zR8sRiSKaulppRQxFq1yw.png" alt=""&gt;&lt;/a&gt;Example of a linked list&lt;/p&gt;

&lt;p&gt;In a linked list, you have a reference to the next node and a value for the current node.&lt;/p&gt;

&lt;p&gt;To insert data into the ListNode, you can do the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rWsyBWLH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AxXKnFpDd4M3u-A3fZLYDMw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rWsyBWLH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AxXKnFpDd4M3u-A3fZLYDMw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the example above, you are creating two lists: list1 and list2. It is a good idea to check if you have inserted the elements properly. So let’s do that. Recently, I learned a neat way to print out the values in the linked list from Kevin Lau and Vincent Ngo’s book on &lt;a href="https://store.raywenderlich.com/products/data-structures-and-algorithms-in-swift"&gt;Data Structures and Algorithms in Swift&lt;/a&gt;. Let’s jump into the code and then I’ll explain what we did after.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JNRyUvFk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AlaQvs5vSqXQPKlb7WPVC2A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JNRyUvFk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AlaQvs5vSqXQPKlb7WPVC2A.png" alt=""&gt;&lt;/a&gt;Using CustomStringConvertible&lt;/p&gt;

&lt;p&gt;In the code above, you first conform to the CustomStringCovertible protocol and second, implement the description. The description implementation uses string interpolation to print the node’s value and the next node’s value. So when you passListNode to String(describing:) initializer, the print(_:) function will use the value returned by the description. Looking at the example above, the lists are printed as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ptUj-IJt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AtZ-najXrlxmVFnDJISeerw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ptUj-IJt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AtZ-najXrlxmVFnDJISeerw.png" alt=""&gt;&lt;/a&gt;Printing the elements in the linked lists&lt;/p&gt;

&lt;p&gt;Let’s extend the example and merge the two lists into one sorted list. You can assume that each list is in sorted order. There are 3 cases that you will be handling:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Different number of elements in the two lists&lt;/li&gt;
&lt;li&gt;Same values in the lists&lt;/li&gt;
&lt;li&gt;Different values in the lists&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One solution can look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qvi38Lpr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ALFwfOtxIGvn9CHMGs-fs3Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qvi38Lpr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ALFwfOtxIGvn9CHMGs-fs3Q.png" alt=""&gt;&lt;/a&gt;Merging two sorted linked lists into one sorted linked list&lt;/p&gt;

&lt;p&gt;Here’s what’s going on:&lt;/p&gt;

&lt;p&gt;You will create temporary nodes to reference the two sorted lists and perform the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You will loop through the list as long as either of them contains a value or is non-nil.&lt;/li&gt;
&lt;li&gt;In case the node in the second list is nil, you will use insertNodefunction to insert the node from the first list into the resulting linked list headNode You will see how insertNode is implemented later. You will advance the temporary pointer to the next element in the first list.&lt;/li&gt;
&lt;li&gt;Repeat the similar check as step 2 but for the node in the first list and advance the temporary pointer to the next element in the second list.&lt;/li&gt;
&lt;li&gt;The else will check when both elements are non-nil&lt;/li&gt;
&lt;li&gt;If both values in the lists are equal to each other, then you insert both of them to the resulting linked list and advance both temporary pointers to the next node.&lt;/li&gt;
&lt;li&gt;If the node in the first list is less than the node in the second list, you insert the node from the first list and advance the temporary pointer to the next node.&lt;/li&gt;
&lt;li&gt;You do the opposite when the node in the second list is smaller instead.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The insertNode function is shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ku81GI9G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A2DonG-duAhVY8a9LL9L1bw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ku81GI9G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A2DonG-duAhVY8a9LL9L1bw.png" alt=""&gt;&lt;/a&gt;Inserting the node into the linked list&lt;/p&gt;

&lt;p&gt;There are two parts to the insertNode logic:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The headNode points to the head element of the resulting linked list. So if it is nil, you will create a new node with the given value to insert into the resulting linked list. currentNode will point to the current node as you are inserting each new node.&lt;/li&gt;
&lt;li&gt;If the headNode contains a node or is non-nil, a new node with the given value is created and inserted as the next node of the resulting linked list. You advance the currentNode reference to the next node.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Overall, the insertion is O(1) constant time. This is achieved by keeping track of the node that is recently inserted. Last but not least, here is the printed solution of the merged list:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AciICdaI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Ab3_zCjsGUEdZuzh4uSvEiA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AciICdaI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Ab3_zCjsGUEdZuzh4uSvEiA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Where to go from here?&lt;/h3&gt;

&lt;p&gt;Explore other topics in Kevin Lau and Vincent Ngo’s book on &lt;a href="https://store.raywenderlich.com/products/data-structures-and-algorithms-in-swift"&gt;Data Structures and Algorithms in Swift&lt;/a&gt;.&lt;/p&gt;


</description>
      <category>programming</category>
      <category>linkedlists</category>
      <category>algorithms</category>
      <category>datastructures</category>
    </item>
    <item>
      <title>Extracting Numbers from an Alphanumeric String Using String.UnicodeScalarView in Swift 4</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Sun, 16 Sep 2018 21:14:41 +0000</pubDate>
      <link>https://dev.to/tiptopgs/extracting-numbers-from-an-alphanumeric-string-using-stringunicodescalarview-in-swift-4-318p</link>
      <guid>https://dev.to/tiptopgs/extracting-numbers-from-an-alphanumeric-string-using-stringunicodescalarview-in-swift-4-318p</guid>
      <description>&lt;p&gt;How do you extract numbers from a string that is composed of random alphanumeric characters? I used the string’s view of the characters as a collection of Unicode scalar values to achieve this task. Each character in a string has a Unicode scalar value that you can grab from the string’s unicodeScalars property. Let’s look at the following example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_nR7AhHl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AskFokJjUGKQg8VQ4bzMCfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_nR7AhHl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AskFokJjUGKQg8VQ4bzMCfw.png" alt=""&gt;&lt;/a&gt;Accessing the Unicode scalar values from a string&lt;/p&gt;

&lt;p&gt;For the example above, we looped through each of the characters in the alphaNumericString variable and printed out the corresponding Unicode scalar value. Each of the value is a unique representation of the character.&lt;/p&gt;

&lt;p&gt;So for the digits, you can identify all the corresponding Unicode scalar values as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mdrUqtnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aijz29oR-fySe4QUt2XBdpQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mdrUqtnD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2Aijz29oR-fySe4QUt2XBdpQ.png" alt=""&gt;&lt;/a&gt;Printing all the Unicode scalar values for digits&lt;/p&gt;

&lt;p&gt;Note that digit is a Unicode.scalar type and from there you can access the Unicode value by accessing the valueproperty as shown in the example above.&lt;/p&gt;

&lt;p&gt;The Unicode scalar value is a UTF-32 bit representation. So you can create your own Unicode scalar instance given a value in UTF-32 bit representation like below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZnDM0oaY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A3OoO1TbT-07ta0gMpOGCNg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZnDM0oaY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2A3OoO1TbT-07ta0gMpOGCNg.png" alt=""&gt;&lt;/a&gt;Creating and using Unicode scalar values&lt;/p&gt;

&lt;p&gt;So what’s happening here? The first part creates two variables by explicitly specifying the type and assigning the string of 0 and 9. The second part uses the Unicode scalar value to create the numbers from 0 to 9.&lt;/p&gt;

&lt;h3&gt;
  
  
  Putting It All Together
&lt;/h3&gt;

&lt;p&gt;Since you have the range of Unicode scalar values that correspond to some digits, you can identify whether the character is a digit or something else:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1hrqAYnu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AfB9xndpjZ-r3-OcUg6Jt3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1hrqAYnu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AfB9xndpjZ-r3-OcUg6Jt3w.png" alt=""&gt;&lt;/a&gt;Checking if the character is a digit or something else&lt;/p&gt;

&lt;p&gt;The final step is to use the number in the string, so let’s extract the digits and convert it into something more usable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tbOhvb3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AKxjUUktU8i9Vzk4b5UAFAw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tbOhvb3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AKxjUUktU8i9Vzk4b5UAFAw.png" alt=""&gt;&lt;/a&gt;Extracting the numbers from a string&lt;/p&gt;

&lt;p&gt;So as we are going through the Unicode scalar in the string, you are checking if the value matches any digits in the range from 48 to 57. You grab each of the digits and store it into a variable and break out of the loop as soon as you find a non-numeric letter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where to go from here?
&lt;/h3&gt;

&lt;p&gt;Check out the Apple’s API documentation on the &lt;a href="https://developer.apple.com/documentation/swift/string/unicodescalarview#overview"&gt;String.UnicodeScalarView&lt;/a&gt; and the &lt;a href="https://developer.apple.com/documentation/swift/unicode/scalar"&gt;Unicode.Scalar&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want to have some fun, you can also attempt this &lt;a href="https://leetcode.com/problems/string-to-integer-atoi/description/"&gt;leetcode problem&lt;/a&gt; using what you have learned. Post your solutions below and we can compare our solutions.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>swift</category>
      <category>unicodescalars</category>
      <category>unicode</category>
    </item>
    <item>
      <title>Reverse Collection in Swift 4</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Mon, 10 Sep 2018 12:55:55 +0000</pubDate>
      <link>https://dev.to/tiptopgs/reverse-collection-in-swift-4-3ph</link>
      <guid>https://dev.to/tiptopgs/reverse-collection-in-swift-4-3ph</guid>
      <description>&lt;p&gt;Ever need to reverse the characters in a String or indices in a for loop? You can use &lt;strong&gt;ReversedCollection&lt;/strong&gt; for that.&lt;/p&gt;

&lt;p&gt;Here is a quick example for using reversed on a String.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AhMnXB1k2xXYrPKEdQ8f8qg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AhMnXB1k2xXYrPKEdQ8f8qg.png"&gt;&lt;/a&gt;Reversing a String&lt;/p&gt;

&lt;p&gt;You can also store the newly reversed String into another variable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A28xkT2rSXX0_YG1bSuaRnA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A28xkT2rSXX0_YG1bSuaRnA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looping through indices and their reversed indices is very easy as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A4JiozoKX-wqgeEwsg7ofFg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A4JiozoKX-wqgeEwsg7ofFg.png"&gt;&lt;/a&gt;Reversing indices&lt;/p&gt;

&lt;p&gt;The great thing about reversed is that you do not create new storage. You can also transform the reversed elements in a collection and get back a new array:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3IpwI21DxMDgOtgOwpm3gw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A3IpwI21DxMDgOtgOwpm3gw.png"&gt;&lt;/a&gt;Reversing numbers and transforming the results&lt;/p&gt;

&lt;p&gt;Here is one more example of enumerating the indices along with the reversed elements in an array:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ac2o9vtLNfiNm_E90VBqfMw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ac2o9vtLNfiNm_E90VBqfMw.png"&gt;&lt;/a&gt;Enumerating list in reverse order&lt;/p&gt;

&lt;p&gt;From Apple’s documentation:&lt;/p&gt;

&lt;p&gt;The reversed() method is always lazy when applied to a collection with bidirectional indices, but does not implicitly confer laziness on algorithms applied to its result. In other words, for ordinary collections c having bidirectional indices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;c.reversed() does not create new storage&lt;/li&gt;
&lt;li&gt;c.reversed().map(f) maps eagerly and returns a new array&lt;/li&gt;
&lt;li&gt;c.lazy.reversed().map(f) maps lazily and returns a LazyMapCollection&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Where to go from here?
&lt;/h3&gt;

&lt;p&gt;You can check out Apple’s API on &lt;a href="https://developer.apple.com/documentation/swift/reversedcollection" rel="noopener noreferrer"&gt;Reversed Collection&lt;/a&gt; for more information.&lt;/p&gt;

</description>
      <category>reversecollection</category>
      <category>example</category>
      <category>swift</category>
      <category>code</category>
    </item>
    <item>
      <title>String Manipulations in Swift 4</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Sun, 02 Sep 2018 17:54:20 +0000</pubDate>
      <link>https://dev.to/tiptopgs/string-manipulations-in-swift-4-2gc6</link>
      <guid>https://dev.to/tiptopgs/string-manipulations-in-swift-4-2gc6</guid>
      <description>&lt;p&gt;First thing first, Swift 4’s API for String has been beefed up with many powerful capabilities. Strings and String manipulations are essentials for any or most solutions. Swift language offers some powerful way to do this. So let’s review some of the language capabilities.&lt;/p&gt;

&lt;p&gt;To create a string, you can assign it to a property:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AfkQlOsljrPWLI73IKA18nQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AfkQlOsljrPWLI73IKA18nQ.png"&gt;&lt;/a&gt;Sample constant string&lt;/p&gt;

&lt;p&gt;What if you want to repeat a string multiple times? You can use the repeating feature:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AwxChOom0H5c5Zce5c7J94g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AwxChOom0H5c5Zce5c7J94g.png"&gt;&lt;/a&gt;Say my name, say my name…&lt;/p&gt;

&lt;p&gt;Sometimes you need to represent a multi-line string and this can be done easily with 3 opening quotes and 3 closing quotes. Each line in the multi-line string literal contains an end-of-line character \n.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ALSJ_rWKpYWbqOzTSWkdg2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ALSJ_rWKpYWbqOzTSWkdg2w.png"&gt;&lt;/a&gt;A multi-line String literal representation&lt;/p&gt;

&lt;p&gt;To parse through each character in a String, you can do the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AYh2YsbXBgjoYNJ-YkC8t7Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AYh2YsbXBgjoYNJ-YkC8t7Q.png"&gt;&lt;/a&gt;Loop through each of the character in a string&lt;/p&gt;

&lt;p&gt;There are several ways to get the string portion or content between the two paragraph tags.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AnXIXK46_7E2wKY4dKcjHxw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AnXIXK46_7E2wKY4dKcjHxw.png"&gt;&lt;/a&gt;Using indexes to extract parts of a string&lt;/p&gt;

&lt;p&gt;Let me explain what’s going on. The first approach above makes assumption that the &lt;/p&gt;
 tags exist. So we use a fixed offset from the start and end of the string to extract the middle portion. On the other hand, we can use the second approach to determine the index based on identifiable parts of the  tags. Because we may not find the matching index, we default to using the start and end index of the original string. Which way do you prefer? Is there a better way of doing the same? Feel free to share it in the comments below.

&lt;p&gt;Sometimes we may need to identify the position of the character in the string. How do we do this?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ay5Ba8iScocfk2AP1aqAg0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ay5Ba8iScocfk2AP1aqAg0g.png"&gt;&lt;/a&gt;Looping through each of the characters in the String by their respective index (or position)&lt;/p&gt;

&lt;p&gt;Note that we are advancing the offset by the position number from the String’s start index each time to retrieve the next character. Sometimes, you might only care about the position for “x” and “o” so you can use comparisons to only print those out. See the following example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AUTmpZyCvyuPFoGnVVC0Auw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AUTmpZyCvyuPFoGnVVC0Auw.png"&gt;&lt;/a&gt;Looping through the multi-line String literal to extract the position of the characters “x” and “o”&lt;/p&gt;

&lt;h3&gt;
  
  
  Where to go from here?
&lt;/h3&gt;

&lt;p&gt;String manipulations in Swift have come a long way. Check out the Apple documentation for more: &lt;a href="https://developer.apple.com/reference/swift/string" rel="noopener noreferrer"&gt;Swift Standard Library Reference — String&lt;/a&gt; and post some of your favorite String manipulations in the comments below.&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <item>
      <title>Why do Engineers Play Ping Pong?</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Wed, 01 Aug 2018 20:56:12 +0000</pubDate>
      <link>https://dev.to/tiptopgs/why-do-engineers-play-ping-pong-59p5</link>
      <guid>https://dev.to/tiptopgs/why-do-engineers-play-ping-pong-59p5</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2APIQ_CHn3wavCWQPjLuancQ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2APIQ_CHn3wavCWQPjLuancQ.jpeg"&gt;&lt;/a&gt;Unsplash&lt;/p&gt;

&lt;p&gt;When I first went to interview at GrubHub for the Senior iOS Engineer role, I noticed there was a ping pong table in the office. This seems to be very normal for start up companies. Why is that? Who decided that there needs to be a ping pong table in the office? Fast forward and I met another engineer there while playing ping pong. I am not good at ping pong but I always had an interest in playing it. I got curious why we had a table. My colleague named Peter pointed out that his previous company had 5 tables. I felt a bit bummed out that we only had one but I still appreciate that we even got one. Returning to my curiosity, why do we even have one? The table tennis table and the video game system give an impression of a complete game room at our start up office. So maybe that was the practical reason, for recruitment purposes. Peter, at last, offered his take on this. He said that ping pong is good for the brain. I dig further and found out it was true. In addition to benefits to the brain, these are 5 benefits of why I am hooked today:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ping pong is good for health.&lt;/li&gt;
&lt;li&gt;There is no agism in ping pong.&lt;/li&gt;
&lt;li&gt;Ping pong is strategic.&lt;/li&gt;
&lt;li&gt;Ping pong brings people together.&lt;/li&gt;
&lt;li&gt;Ping pong is active.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ping pong is good for health because it is good for the heart and the brain. Playing ping pong increases your heart rate. Engineers, like myself, spend a lot of time sitting in front of the computer. So this is a good break in disguise. I sweat a lot when I play so I usually bring an extra set of clothes and tennis shoes to change after I finish playing. Ping pong is good for strategizing and long term memory. You can read up more about the benefits for the brain here: &lt;a href="https://www.pongboss.com/tips/table-tennis-brain/" rel="noopener noreferrer"&gt;https://www.pongboss.com/tips/table-tennis-brain/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ak54yjd8BNpyRJi6xhS9Vag.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2Ak54yjd8BNpyRJi6xhS9Vag.jpeg"&gt;&lt;/a&gt;Team trophy for placing 3rd in the league&lt;/p&gt;

&lt;p&gt;When I first saw people playing ping pong at a gym, I saw mostly adults or seniors. They were very good because you can barely see the ball drop to the floor. Peter and I end up picking up balls half of the time. So my next goal is to buy a handy ping pong pick up tool to save our backs. But you can find people as young as 7 years old and as old as retired folks in their 70s playing ping pong 🏓 at various table tennis clubs.&lt;/p&gt;

&lt;p&gt;Ping pong is very social. I only met Peter because he was playing with an intern one summer. They sounded very professional while hitting the ping pong balls back and forth. And after awhile when his intern left, I saw that he stopped playing. I asked him if he wanted to play ping pong one day and that’s how we started. Ping pong is not only offer many good benefits but also keep you happy due to endorphins release from exercising. It is low impact so the risk of injury is lower. In conclusion, if I were to join another start up, the table tennis table is mandatory and it cannot be only an aesthetic piece. I like to rip off the benefits of balancing between productivity while in front of the computer and taking break while playing ping pong.&lt;/p&gt;

</description>
      <category>startup</category>
      <category>pingpong</category>
      <category>engineer</category>
      <category>longtermmemory</category>
    </item>
    <item>
      <title>File Structure and Organization Talk at Women in iOS Meetup</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Sat, 31 Mar 2018 22:07:23 +0000</pubDate>
      <link>https://dev.to/tiptopgs/file-structure-and-organization-talk-at-women-in-ios-meetup-5a27</link>
      <guid>https://dev.to/tiptopgs/file-structure-and-organization-talk-at-women-in-ios-meetup-5a27</guid>
      <description>

&lt;p&gt;Found my talk as I was cleaning up and backing up my old laptop before exchanging it for a new and faster one. This was my first time giving a talk at the Women in iOS Meetup in NYC. I had a lot of fun giving the talk and it felt great sharing how we organize our file structure so that new hires can understand how we work and become productive right away.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/tS_Rus_PuWg"&gt; &lt;/iframe&gt;&lt;/p&gt;


</description>
      <category>ios</category>
      <category>filestructure</category>
      <category>development</category>
      <category>fileorganization</category>
    </item>
    <item>
      <title>Summary of How to Idiot</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Mon, 12 Mar 2018 00:19:01 +0000</pubDate>
      <link>https://dev.to/tiptopgs/summary-of-how-to-idiot-1a7f</link>
      <guid>https://dev.to/tiptopgs/summary-of-how-to-idiot-1a7f</guid>
      <description>

&lt;p&gt;I will be attending #RWDevCon this year and I was reminded of an inspirational talk from last year, “I’m an Idiot” by Rich Turton. If you missed his talk, you can &lt;a href="https://youtu.be/GYgcxlZjpa8"&gt;check it out here&lt;/a&gt;. Idiots like him are folks that I enjoy working with. Below are my takeaways from his talk. My notes serve as a good reminder that a great goal in the Tech field is the pursuit of being an idiot and being OK with it. Like Rich Turton said, it is a great feeling to leave this world a better place for future idiots who will come across your code (including your future self).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qtZxGGUm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AHYXtvh9zu2d7LQMmkPBsZw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qtZxGGUm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AHYXtvh9zu2d7LQMmkPBsZw.png" alt=""&gt;&lt;/a&gt;Jenny Chang Ho’s Summary of &lt;strong&gt;How to Idiot&lt;/strong&gt; by Rich Turton&lt;/p&gt;

&lt;p&gt;In summary and in my own words, never ever leave a piece of code without fully understanding it. Take the time to rewrite it so that not only you but also the next idiot can understand it. The preference is clarity over brevity. And why do we do this? We do this to offer kindness to other idiots and most importantly to our idiot self.&lt;/p&gt;


</description>
      <category>developer</category>
      <category>howtoidiot</category>
      <category>lifelessons</category>
      <category>rwdevcon</category>
    </item>
    <item>
      <title>Importing Data From Google Spreadsheet into Firebase</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Sat, 03 Mar 2018 18:47:30 +0000</pubDate>
      <link>https://dev.to/tiptopgs/importing-data-from-google-spreadsheet-into-firebase-3ank</link>
      <guid>https://dev.to/tiptopgs/importing-data-from-google-spreadsheet-into-firebase-3ank</guid>
      <description>

&lt;p&gt;For a group project, we have decided to collect resources using a Google Form, which stores the data into a spreadsheet. In order to make this more useful for us, we decided to import the data into Firebase. The following are the steps used to import the data from the Google Spreadsheet into Firebase.&lt;/p&gt;

&lt;h4&gt;Spreadsheet Setup&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Make a copy of the spreadsheet&lt;/li&gt;
&lt;li&gt;On the Tools menu, select the &lt;em&gt;Script editor…&lt;/em&gt; option&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bcsdkIRf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ATqxHjaNyDHduIBhyThDsSg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bcsdkIRf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2ATqxHjaNyDHduIBhyThDsSg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once you are in the script editor, select Resources &amp;gt; Libraries…&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2579xm76--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/530/1%2AeUmJ7J9eUabiE2GuW3yVyw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2579xm76--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/530/1%2AeUmJ7J9eUabiE2GuW3yVyw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Follow the steps here to select the Firebase library: &lt;a href="https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase"&gt;https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zcSiYwYO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AbEo6nD6ZXMh5xeSz9OObQw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zcSiYwYO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AbEo6nD6ZXMh5xeSz9OObQw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Follow the steps here to start importing the data into Firebase: &lt;a href="https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase/tutorials/read-and-write-data-in-firebase-from-apps-script"&gt;https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase/tutorials/read-and-write-data-in-firebase-from-apps-script&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are following caveats when importing the spreadsheet data over to Firebase:&lt;/p&gt;

&lt;p&gt;You cannot have invalid characters for the Firebase key so take a look at the character set limitations below. The key is part of the URLs used to construct the Firebase references. Therefore as a workaround, encoding the email address as base64 will work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Character Set Limitations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Note that URLs used to construct Firebase references may contain any unicode characters except:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;. (period)&lt;/li&gt;
&lt;li&gt;$ (dollar sign)&lt;/li&gt;
&lt;li&gt;[ (left square bracket)&lt;/li&gt;
&lt;li&gt;] (right square bracket)&lt;/li&gt;
&lt;li&gt;# (hash or pound sign)&lt;/li&gt;
&lt;li&gt;/ (forward slash)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Permission must be provided before the app script can be run against the spreadsheet.&lt;/p&gt;

&lt;p&gt;Finally, the app script for importing our data from the spreadsheet to our Firebase looks something like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;Be sure to replace the spreadsheet URL (copy from the exact URL after opening your spreadsheet manually) and the Firebase URL (copied from the Firebase Dashboard). Updated the JSON format manually as needed before executing the script. However, even if you make a mistake, you can go to the Firebase Dashboard and delete all the data.&lt;/p&gt;

&lt;p&gt;For reference, to delete the data from the Firebase Dashboard, click on the X and confirm by clicking on the DELETE button as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rHrZGjG---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/934/1%2AwVtWP2KXbUOcKPmbPTRKGg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rHrZGjG---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/934/1%2AwVtWP2KXbUOcKPmbPTRKGg.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GEbRGePm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AHTFug3x69DVrJPOT-v2bwA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GEbRGePm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1024/1%2AHTFug3x69DVrJPOT-v2bwA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;


</description>
      <category>importdata</category>
      <category>firebase</category>
      <category>googlespreadsheets</category>
    </item>
    <item>
      <title>Google Code Jam to I/O Mental Preparation</title>
      <dc:creator>Jen Chang</dc:creator>
      <pubDate>Sun, 11 Feb 2018 23:03:23 +0000</pubDate>
      <link>https://dev.to/tiptopgs/google-code-jam-to-io-mental-preparation-4cn7</link>
      <guid>https://dev.to/tiptopgs/google-code-jam-to-io-mental-preparation-4cn7</guid>
      <description>&lt;p&gt;This is the first year that I will be attempting the &lt;a href="https://sites.google.com/site/codejamtoioforwomen/home"&gt;Code Jam to I/O for women&lt;/a&gt; programming contest. Google hosts an annual code jam challenge and this is the fifth year that they are targeting towards women specifically to help increase diversity in the online contest space and representation at the Google I/O developer’s conference. The easiest part was the registration and deciding what language I will be using during the contest. For reference, you can view the solutions and other statistics including the most popular languages used for &lt;a href="https://www.go-hero.net/jam/17"&gt;submission in the past years&lt;/a&gt;. You are allowed to use any programming language (including those not on the registration list). The hardest part comes next, which is getting myself mentally ready for the challenge and what follows are the things I am doing to prepare myself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preparation
&lt;/h3&gt;

&lt;p&gt;For preparation, I am reviewing problems from the past years. I study some of the solutions to see what libraries the developers used and how they parsed the input. I am imaging that these should be the same regardless of the problem set. I was also debating whether to use python or swift. I am familiar with swift and use it frequently at work but most recently I have been learning python, which is among the top programming languages used and very powerful for manipulating large dataset. Anyhow, I did not want to spend much time on deciding so I went with &lt;a href="https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=swift&amp;amp;lang2=python3"&gt;some performance benchmarks&lt;/a&gt;, and I tried my hands at some sample challenges to familiarize myself with the process so I could potentially compete more successfully.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tools
&lt;/h3&gt;

&lt;p&gt;I created a new Command Line Project in Xcode and reused it to tackle each sample challenge set. You need a main.swift file for the command line project so I made separate folders to contain the problem solution and sample input files. My folder structure look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CAtNH21f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/526/1%2A-Kiynu8xLKZ7MtZwZw1R7Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CAtNH21f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/526/1%2A-Kiynu8xLKZ7MtZwZw1R7Q.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that each exercise has their own main.swift and ParseInput.swift files. I only include one main.swift file in the actual Xcode project for the current problem I’m tackling so that Xcode doesn’t get confused. Parsing the content of the input files will probably be very similar for each of the challenge, so all the reusable reading methods are found in the ParseInput.swift file. As part of the submission process, I chose to read the content of the sample files via standard input. Therefore, I created a small shell script to compile/re-run my solution as often and as quickly as possible.&lt;/p&gt;

&lt;p&gt;My shell script looks like this:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;To run the script, you will pass the problem number and the name of the sample input without the file extension. Here is an example:&lt;br&gt;&lt;br&gt;
./re-run-code-jam.sh 2 B-small-practice&lt;/p&gt;

&lt;p&gt;If you are curious about how I parsed the lines via standard input using generics, take a look below:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  During the Contest
&lt;/h3&gt;

&lt;p&gt;These are the steps I will be taking to tackle each problem during the contest when the time comes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Spend some time to understand the problem. The problem tends to be very wordy but it gives you all the information you need. I often have to read the problem description couple of times before coding my solution. Understanding the problem correctly will save you a lot of time later.&lt;/li&gt;
&lt;li&gt;Come up with an approach to solve the problem on paper, test it against the sample input and compare your solution.&lt;/li&gt;
&lt;li&gt;Code up the solution if you think you got it.&lt;/li&gt;
&lt;li&gt;Test out your solution with a small subset of the problem and fix any obvious bugs in Xcode. I included extra print statements to ensure the content is read/or computed correctly.&lt;/li&gt;
&lt;li&gt;Download the small and large sample files to generate your expected output. Repeat the last step as needed.&lt;/li&gt;
&lt;li&gt;Do any last minute clean up and submit your output and source code!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Wish me luck! If you are also participating, good luck, too! Let’s have some fun. :)&lt;/p&gt;

</description>
      <category>contests</category>
      <category>codejam</category>
      <category>swift</category>
      <category>code</category>
    </item>
  </channel>
</rss>
