<?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: Farman Pirzada</title>
    <description>The latest articles on DEV Community by Farman Pirzada (@farmanp).</description>
    <link>https://dev.to/farmanp</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%2F158066%2Ff241f4aa-2ef8-4f68-85e6-7c9df1d9522a.jpg</url>
      <title>DEV Community: Farman Pirzada</title>
      <link>https://dev.to/farmanp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/farmanp"/>
    <language>en</language>
    <item>
      <title>JS Basics: Higher Order Functions</title>
      <dc:creator>Farman Pirzada</dc:creator>
      <pubDate>Mon, 17 Aug 2020 03:28:40 +0000</pubDate>
      <link>https://dev.to/farmanp/js-fundamentals-roundup-higher-order-functions-3fgj</link>
      <guid>https://dev.to/farmanp/js-fundamentals-roundup-higher-order-functions-3fgj</guid>
      <description>&lt;h2&gt;
  
  
  What is a higher order function?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Higher order functions&lt;/strong&gt; are functions that operate on other functions. This allows us to create functional abstractions and not just value abstractions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In JavaScript, there are three commonly used higher order functions you should know about: &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;reduce&lt;/code&gt;, and &lt;code&gt;filter&lt;/code&gt;. Let's look at each one with a real world example: &lt;/p&gt;

&lt;p&gt;&lt;em&gt;I want the names of employee's who's letter start with A&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;In order to do that, I will use the higher order function &lt;strong&gt;map&lt;/strong&gt;: &lt;/p&gt;

&lt;h3&gt;
  
  
  map
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const employees = [
  {name: "Doug", gender: "M", occupation: "Help Desk"},
  {name: "Alex", gender: "F", occupation: "CTO"},
  {name: "Ada", gender: "F", occupation: "Developer"},
  {name: "Sandra", gender: "F", occupation: "Developer"},
  {name: "Beatrice", gender: "F", occupation: "Designer"},
  ]

let employeeNamesWithA = []; 

employees.map((employee) =&amp;gt; {
  // Ternary opearator to check if an employee's name starts with A
  return employee.name.includes("A") ? employeeNamesWithA.push(employee.name) : employeeNamesWithA;
})

//[ 'Alex', 'Ada' ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But you can't just have an example and expect to understand, right? How is &lt;strong&gt;map&lt;/strong&gt; a higher order function exactly? It takes a map of employees with properties and returns an array. Map makes a copy of the data so it WILL NOT modify the original one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;employees.map((employee) =&amp;gt; {
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next we require another function for map, which is &lt;a href="https://www.w3schools.com/jsref/jsref_includes.asp#:~:text=The%20includes()%20method%20determines,()%20method%20is%20case%20sensitive."&gt;&lt;code&gt;includes()&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;includes()
  return employee.name.includes('A') ? employeeNamesWithA.push(employee.name) : employeeNamesWithA;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;map&lt;/code&gt; is used to programmatically iterate through a list&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  filter
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Let's say I want to create a filter function for my dropdown that gives me results by occupation, but this time I want the object as well&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const employees = [
  {name: "Doug", gender: "M", occupation: "Help Desk"},
  {name: "Alex", gender: "F", occupation: "CTO"},
  {name: "Ada", gender: "F", occupation: "Developer"},
  {name: "Sandra", gender: "F", occupation: "Developer"},
  {name: "Beatrice", gender: "F", occupation: "Designer"},
  ]

let employeesWhoAreDevelopers = employees.filter(employee =&amp;gt; employee.occupation.includes("Developer")); 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This method also &lt;strong&gt;WILL NOT&lt;/strong&gt; affect the original data. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;filter()&lt;/code&gt; method creates a new array with all elements that pass the test implemented by the provided function. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  reduce
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Now, let's say your team needs to determine where to allocate their resources next. Because they don't want to be bothered by manually counting each other (much simpler, but so much potential for human error! /s), they would rather a program tell them instead (time is $$$, there are more important things to worry about, like this MVP that needed to be done YESTERDAY!). So, the goal is to group by occupation count. This will determine who the next person will need to be on the team&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const employees = [
  {name: "Doug", gender: "M", occupation: "Help Desk"},
  {name: "Alex", gender: "F", occupation: "CTO"},
  {name: "Ada", gender: "F", occupation: "Developer"},
  {name: "Sandra", gender: "F", occupation: "Developer"},
  {name: "Beatrice", gender: "F", occupation: "Designer"},
  ]

const groupByEmployeeOccupation = employees.reduce((total, employee) =&amp;gt; {
  total[employee.occupation] = (total[employee.occupation] || 0) + 1; 
  return total; 
}, {})

//{ 'Help Desk': 1, CTO: 1, Developer: 2, Designer: 1 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Great! Now we have a decision to make. We ignore CTO, because there can only be one! And we find that after talking with Doug, he seems to be alright on his own right now. Beatrice on the other hand is swamped! We probably should've taken her point in retro for "Need to Improve: I need another designer", but now we at least have a program to tell us it's true!   &lt;/p&gt;

&lt;p&gt;So just what the heck is going on here? It looks more complex than &lt;code&gt;map&lt;/code&gt; and &lt;code&gt;filter&lt;/code&gt; right? How does reduce even work? &lt;/p&gt;

&lt;p&gt;Well it takes two arguments (it can take four total, but not in this example) that function as an &lt;code&gt;accumulator&lt;/code&gt; and the &lt;code&gt;currentValue&lt;/code&gt;. An &lt;code&gt;accumulator&lt;/code&gt; is what to do with each iteration throughout the data. The accumulator will ultimately have a final resulting value of all the data. The &lt;code&gt;currentValue&lt;/code&gt; is what the iteration is currently at. So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;total[employee.occupation] = (total[employee.occupation]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;total&lt;/code&gt; is representing the &lt;code&gt;accumulator&lt;/code&gt; and taking the &lt;code&gt;currentValue&lt;/code&gt;, which is the employee's occupation key and setting it a value of how many times that occupation comes up + 1. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;reduce&lt;/code&gt; executes a reducer function (that you provide) on each element of the array, resulting in single output value&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Summary: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Higher order functions take a function as an argument&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;map&lt;/code&gt;, &lt;code&gt;reduce&lt;/code&gt;, and &lt;code&gt;filter&lt;/code&gt; are the most common examples of higher order functions in JS &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sources and Further Reading: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.flashcardsfordevelopers.com/decks/5b945d730d9bd6cbc6e66349/cards"&gt;Flashcards for Developers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/jsref/jsref_map.asp#:~:text=Definition%20and%20Usage,for%20array%20elements%20without%20values."&gt;W3 School: Map&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce"&gt;Mozilla: Reduce&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter"&gt;Mozilla: Filter&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>basics</category>
      <category>javascript</category>
      <category>functional</category>
      <category>composition</category>
    </item>
    <item>
      <title>Security Champion</title>
      <dc:creator>Farman Pirzada</dc:creator>
      <pubDate>Mon, 08 Jul 2019 05:48:18 +0000</pubDate>
      <link>https://dev.to/farmanp/security-champion-1h6l</link>
      <guid>https://dev.to/farmanp/security-champion-1h6l</guid>
      <description>&lt;p&gt;Starting tomorrow 7/8/2019, I will be working along the Security Team to engage as a Security Champion! This is really exciting for me because it's the beginning of a path I've been hyping up for some time now among friends and families. Some people may already be aware, but I was unable to commit to the cybersecurity bootcamp I had enrolled in a few months back. It's been hard, but at least this doesn't mean the end! &lt;/p&gt;

&lt;p&gt;So what is a Security Champion and why does this matter? Well, let's briefly cover the definition: &lt;/p&gt;

&lt;p&gt;&lt;i&gt;A security champion is an individual at a company who helps and assists with the Security team as the liaison of cross-functional team.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;For me, it will be for our production support team. Security champions come from OWASP, the universal standard for Open Web Application Security Projects. For more information, here is a link to the responsibilities of a &lt;a href="https://www.owasp.org/index.php/Security_Champions"&gt;Security Champion&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, I'm going to be honest with you: I love being involved in everything and anything: UX design, 2D/3D animation, engineering drawings, data science, security, etc. I like to consider myself T-Shaped! What I hope to gain from being a generalist is being great with visual communications. For me, visual and written communication is my best medium, but I've always wanted to be purposeful with my creativity. I've searched far and wide, and have seen the most important opportunity to invest my skills and experience in to be with cybersecurity! It's one of the most important fields of our day and age.&lt;/p&gt;

&lt;p&gt;But I digress. Let's get back to security champions. Come as you are: analyst, developer, guard, manager, janitor, consumer, etc. This is a responsibility for everyone! Consider this as watchdog but for security: cybersecurity! We need more people out there as advocates. While security is held accountable to the security team, it is a responsibility for everyone and anyone to be a part of. That is wheere I consider it the most enticing! It's like being a cyber superhero. &lt;/p&gt;

&lt;p&gt;What I hope to cover in the next few months is: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;advocating as a public security champion &lt;/li&gt;
&lt;li&gt;educate the masses on security stories they should be aware of&lt;/li&gt;
&lt;li&gt;provide workshops with low barrier of entry &lt;/li&gt;
&lt;li&gt;improve cybersecurity literacy &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As I start this journey, I must ask to those who read and follow these posts: What would you like to learn about regarding cybersecurity? &lt;/p&gt;

</description>
      <category>securitychampion</category>
      <category>appsec</category>
      <category>infosec</category>
      <category>owasp</category>
    </item>
    <item>
      <title>The PATH to Cybersecurity</title>
      <dc:creator>Farman Pirzada</dc:creator>
      <pubDate>Fri, 19 Apr 2019 17:54:55 +0000</pubDate>
      <link>https://dev.to/farmanp/the-path-to-cybersecurity-2kmg</link>
      <guid>https://dev.to/farmanp/the-path-to-cybersecurity-2kmg</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%2Fwww.bwbacon.com%2Fwp-content%2Fuploads%2F2016%2F10%2Fsecureset-logo-300x142.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%2Fwww.bwbacon.com%2Fwp-content%2Fuploads%2F2016%2F10%2Fsecureset-logo-300x142.png" alt="Alt"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TL;DR - I will be enrolling at SecureSet's PATH program. Follow me and see what it's like to prepare and participate &lt;/p&gt;

&lt;p&gt;In just about 100 days (102 days to be exact), I will be attending a Cybersecurity Bootcamp called &lt;a href="https://secureset.com/programs/path-part-time-summer-2019-denver/" rel="noopener noreferrer"&gt;SecureSet&lt;/a&gt;, located in Denver, Colorado. The program is called PATH (hence the CAPS in the titel). My first experience in cybersecurity was a Capture the Flag (CTF) event hosted by SecureSet. It felt rewarding to investigate my way around file systems and find clues that would get me to the next level. For the last two years, I made serious considerations to jump into this market only after doing web design for about two weeks. At the time, I was getting frustrated with the job market as more and more bootcamps were churning out "engineers" left and right. It made me feel crowded in a saturated market.&lt;/p&gt;

&lt;p&gt;How could I stand a chance? Maybe I should just look into another field and give up! There's over a million developers and the growth is moving so &lt;a href="https://www.bls.gov/ooh/computer-and-information-technology/software-developers.htm" rel="noopener noreferrer"&gt;fast&lt;/a&gt;. But instead of throwing my money at SecureSet to solve my problems, I gave myself a couple more months to find a job. And I'm glad I did because I would have missed out on doing some awesome things I entered this market to do: be an advisor at Codecademy, work on software for a Health &amp;amp; Wellness startup, and now at my current job, be an Analyst at Staples! &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%2Fthumbs-prod.si-cdn.com%2FTSPyvrt6FoN1Z_ME9I1qKGL_Fl8%3D%2F800x600%2Ffilters%3Ano_upscale%28%29%2Fhttps%3A%2F%2Fpublic-media.si-cdn.com%2Ffiler%2Fe7%2F8d%2Fe78dc449-1c97-4c4d-ab2f-7c93851ecbb4%2Fschool.jpg" 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%2Fthumbs-prod.si-cdn.com%2FTSPyvrt6FoN1Z_ME9I1qKGL_Fl8%3D%2F800x600%2Ffilters%3Ano_upscale%28%29%2Fhttps%3A%2F%2Fpublic-media.si-cdn.com%2Ffiler%2Fe7%2F8d%2Fe78dc449-1c97-4c4d-ab2f-7c93851ecbb4%2Fschool.jpg" alt="Web Development Market"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Current State of Web Development Job Market&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Where I am now has led me to a lot of accomplishments that have improved both my technical skills and soft skills: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mentored over 100 students on various topics in computer science and web design online in languages like Python, Ruby, and Java&lt;/li&gt;
&lt;li&gt;assisted with front end design changes with Angular and Wordpress after system integrations for 200 customers&lt;/li&gt;
&lt;li&gt;onboarded and guided gyms on administrative products to prepare them for a new platform &lt;/li&gt;
&lt;li&gt;helped reduce manual work by 80% and increased delivery rate overtime with Splunk&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Working on these problems made me comfortable with what I was learning on the job. It was what I prepared for at a bootcamp I attended in Chicago called Dev Bootcamp. This was my dream and I was happy with the career path I chose and expected to be a UX designer as I had hoped to be by 2020.  &lt;/p&gt;

&lt;p&gt;But then on September 7, 2017, news broke out about insider trading secrets on a data breach at Equifax. Almost 145 million Americans were at risk of identity theft! It infuriated me how it was all handled, especially because I was on the lookout for a house to purchase. And things only got worse: hackers manipulated victims to go to a &lt;a href="https://www.theverge.com/2017/9/20/16339612/equifax-tweet-wrong-website-phishing-identity-monitoring" rel="noopener noreferrer"&gt;phishing site&lt;/a&gt; and enter more sensitive information to ensure they would be "protected", the government made little to not reprimands, and we're still looking for &lt;a href="http://fortune.com/2018/09/07/equifax-data-breach-one-year-anniversary/" rel="noopener noreferrer"&gt;questions to be answered&lt;/a&gt;. This added on to the fuel that would burn the flame in me to revisit the idea of entering the cybersecurity market. &lt;/p&gt;

&lt;p&gt;As I prepare for my education in this field, I want to provide a personal look into what it's like to enter the cybersecurity career. I'm hoping to provide some insight on what it takes, what the market needs are, and what sort of problems you can expect to solve. For me, I want to be an advocate for consumer security because I no longer believe we can expect someone else to protect us. My hopes are to tech readers about cyber self-defense through engineering and investigative reporting. &lt;/p&gt;

&lt;p&gt;While doing so, I created a &lt;a href="https://github.com/farmanp/cybersecurity-bootcamp" rel="noopener noreferrer"&gt;repo&lt;/a&gt; on GitHub to track my progress on the engineering side, while I use dev.to and &lt;a href="https://medium.com/watchdogs" rel="noopener noreferrer"&gt;Medium&lt;/a&gt; to reflect on what I've learned so far at a high level. Dev.To I'd like to use for in-depth and technical analysis. &lt;/p&gt;

&lt;p&gt;Let me know what y'all think and what might be interesting as you live vicariously through this encounter! Thanks for reading and best of luck to everyone. &lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>learning</category>
      <category>education</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
