<?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: songthamtung</title>
    <description>The latest articles on DEV Community by songthamtung (@songthamtung).</description>
    <link>https://dev.to/songthamtung</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%2F239334%2F5fc2c33e-16d4-4e34-b0e2-8aeb4f7f5f4a.jpg</url>
      <title>DEV Community: songthamtung</title>
      <link>https://dev.to/songthamtung</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/songthamtung"/>
    <language>en</language>
    <item>
      <title>ProductHunt First Launch!</title>
      <dc:creator>songthamtung</dc:creator>
      <pubDate>Tue, 28 Apr 2020 07:03:52 +0000</pubDate>
      <link>https://dev.to/songthamtung/producthunt-first-launch-2mbl</link>
      <guid>https://dev.to/songthamtung/producthunt-first-launch-2mbl</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclaimer: There are no ads, no sign-ups, no pop-ups, no watermarks, no installs, no email newsletter, and everything is open-sourced and hosted on my GitHub.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hi Everyone,&lt;/p&gt;

&lt;p&gt;I just launched my first product on ProductHunt today and I'm really excited to share this news with the Dev community!&lt;/p&gt;

&lt;p&gt;In a nutshell -- Prioritize is a tool that helps you create, visualize, and arrange tasks on a drag and drop interface with different priority boards.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/prioritize"&gt;https://www.producthunt.com/posts/prioritize&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear your feedback!&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br&gt;
Songtham&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>github</category>
      <category>producthunt</category>
      <category>management</category>
    </item>
    <item>
      <title>5 Copy and Pasting Tips that Every Developer Should Know</title>
      <dc:creator>songthamtung</dc:creator>
      <pubDate>Mon, 07 Oct 2019 13:52:26 +0000</pubDate>
      <link>https://dev.to/songthamtung/5-copy-and-pasting-tips-that-every-developer-should-know-l06</link>
      <guid>https://dev.to/songthamtung/5-copy-and-pasting-tips-that-every-developer-should-know-l06</guid>
      <description>&lt;h2&gt;
  
  
  Work Smarter, Not Harder.
&lt;/h2&gt;

&lt;p&gt;If I knew about these coding tricks earlier in my career, it would have saved me sooo much time. Here are 5 advanced copy and pasting tips that you can use to work smarter and more efficiently.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can follow along with the sample dataset below, or better yet, try it with your own data. FYI— I’m using Mac and Visual Studio Code, but feel free to use other OS and text editors.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sample dataset
&lt;/h2&gt;


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


&lt;h2&gt;
  
  
  1. Vertical selection
&lt;/h2&gt;

&lt;p&gt;My objective is to add the &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; tag in front of every row. Instead of doing it the old fashion way of copy and pasting multiple times, I do it once with the help of vertical selection.&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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2Ah1JUkFG-BS_Mx01M.gif" 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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2Ah1JUkFG-BS_Mx01M.gif" alt="Vertical Selection"&gt;&lt;/a&gt;Vertical Selection Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hold shift + option + cmd + arrow direction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Adding value to the start of every row
&lt;/h2&gt;

&lt;p&gt;Another way to add value to the start of every row is by using regex &lt;code&gt;(.*)&lt;/code&gt;. This is built into most text editors and can be found in the find feature.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Regex or regular expression is a sequence of characters that define a search pattern. &lt;/p&gt;
&lt;/blockquote&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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2AKyfq_KP1EF8EP-Et.gif" 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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2AKyfq_KP1EF8EP-Et.gif" alt="Regex Start"&gt;&lt;/a&gt;Use regex to add value at the beginning of each row&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Open Find and Replace
2. Enable regex .*
3. Enter ^ in Find
4. Enter value in replace
5. Execute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Adding value to the end of every row
&lt;/h2&gt;

&lt;p&gt;What if I want to add the closing  tag at the end of every row? To do so, I would also use regex, but with a different search pattern.&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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2ANPNXV10AgpkVlEvm.gif" 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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2ANPNXV10AgpkVlEvm.gif" alt="Regex End"&gt;&lt;/a&gt;Use regex to add value at the end of each row&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Open Find and Replace
2. Enable regex .*
3. Enter $ in Find
4. Enter value in replace
5. Execute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Shifting rows without highlighting and dragging
&lt;/h2&gt;

&lt;p&gt;What happens if I want to quickly rearrange my data? Again, I can use the traditional cut and paste or highlighting and dragging with the mouse... but there is a faster way.&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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2AsEKbA1l-qpCl1j0k.gif" 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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2AsEKbA1l-qpCl1j0k.gif" alt="Rearrange Rows"&gt;&lt;/a&gt;Quickly rearrange your rows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hold option + arrow direction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Copy and pasting without copy and pasting
&lt;/h2&gt;

&lt;p&gt;This last tip is one of my favorites. Instead of copy and pasting and entering new lines in between, I can quickly duplicate the values with a simple shortcut key.&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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2AgtwOwiPzMj3HmpcO.gif" 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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2AgtwOwiPzMj3HmpcO.gif" alt="Copy and paste"&gt;&lt;/a&gt;Quickly duplicate your lines&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hold shift + option + arrow direction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Copy and pasting stuff is great. Regex and advanced keyboard shortcuts takes it to another level. Have another tip for coders to increase productivity? Leave a comment below.&lt;/p&gt;

&lt;p&gt;Remember folks: work smarter, not harder.&lt;/p&gt;

&lt;p&gt;Thanks for reading! Originally posted on &lt;a href="https://medium.com/swlh/5-advanced-copy-and-pasting-tips-ae099d763d6c" rel="noopener noreferrer"&gt;The Startup&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>vscode</category>
      <category>bestpractices</category>
      <category>career</category>
    </item>
    <item>
      <title>Why Technical Debt is not Bad Debt</title>
      <dc:creator>songthamtung</dc:creator>
      <pubDate>Thu, 03 Oct 2019 03:16:06 +0000</pubDate>
      <link>https://dev.to/songthamtung/why-technical-debt-is-not-bad-debt-26hg</link>
      <guid>https://dev.to/songthamtung/why-technical-debt-is-not-bad-debt-26hg</guid>
      <description>&lt;p&gt;&lt;em&gt;Release early, release often - just don't forget to refactor ;)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deliver Now
&lt;/h2&gt;

&lt;p&gt;As software engineers, our main objective is to deliver. Once our code works as expected, we commit it and then run it in the &lt;a href="https://medium.com/faun/ci-cd-with-angular-8-github-and-aws-codepipeline-b83d2b01e594" rel="noopener noreferrer"&gt;CI/CD pipeline&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While seemingly straightforward, it’s not as simple as it may seem. There exists a constant tension in the programming world that stems from shipping fast or slow at the cost of software maintainability aka technical debt.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Technical debt&lt;/strong&gt; is opting for the easy solution now instead of using a better approach that would take longer. More often than not, many agile teams choose the former than the later.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Deliver now and fix it later&lt;/em&gt; is a very popular approach because teams are able to reduce the time it takes to get product-to-market. It’s also great because software engineers don’t have to spend too much time developing something that might be used. For many companies, it’s a fair trade off. Nevertheless, in order to make this approach work, continuous refactoring must be done — else technical debt will accumulate.&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%2F1600%2F0%2A0F_2-sq18i85W6aJ.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%2F1600%2F0%2A0F_2-sq18i85W6aJ.png" alt="techdebt"&gt;&lt;/a&gt;&lt;br&gt;
The bigger the technical debt, the harder it is to add features.&lt;/p&gt;
&lt;h2&gt;
  
  
  Fix it Later
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;“Fixing it later” is synonymous with code refactoring.&lt;/em&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%2F1600%2F0%2ARgMtfM4bwE26R18S.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%2F1600%2F0%2ARgMtfM4bwE26R18S.png" alt="refactor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Code refactoring&lt;/strong&gt; is the process of clarifying and simplifying the design of existing code, without changing its behavior. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;From the business and end user perspective, this doesn’t affect them because the product doesn’t change. However, from the developers’ perspective, refactoring reduces technical debt and increases software stability.&lt;/p&gt;

&lt;p&gt;This makes a huge difference in larger projects.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code is Read More Often than it is Written
&lt;/h2&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%2F1600%2F0%2AzxuBJS5b62U4pjek" 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%2F1600%2F0%2AzxuBJS5b62U4pjek" alt="codereview"&gt;&lt;/a&gt;&lt;br&gt;
There are a variety of scenarios when one should refactor.&lt;/p&gt;

&lt;p&gt;The following is a general list of things to look for when identifying code that could use some refactoring:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy &amp;amp; paste (duplicate) code&lt;/li&gt;
&lt;li&gt;Ambiguous variable names&lt;/li&gt;
&lt;li&gt;Unused variables / methods / classes&lt;/li&gt;
&lt;li&gt;Suboptimal performance&lt;/li&gt;
&lt;li&gt;Your method’s code is longer than your screen&lt;/li&gt;
&lt;li&gt;Violation of DRY, KISS, YAGNI, SOLID and other software engineering principles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Feel free to suggest any other scenarios in the comments.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Example of Refactoring
&lt;/h2&gt;

&lt;p&gt;In this section, I will show a simple example of javascript code pre and post refactoring.&lt;/p&gt;
&lt;h3&gt;
  
  
  Pre Refactoring
&lt;/h3&gt;


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


&lt;h3&gt;
  
  
  Post Refactoring
&lt;/h3&gt;


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


&lt;h2&gt;
  
  
  Code Review
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Results&lt;/strong&gt;: both example produces the same outcome, which is to unset the users rank.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visually&lt;/strong&gt;: Pre-refactoring has a lot more code than post-refactoring.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Pre-refactoring makes up to 10000 roundtrips to the database, while post-refactoring makes 1 roundtrip to the database.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Imagine if more developers joined this project and stumbled upon this code. Do you think it would be easier for them to understand and contribute to pre or post refactoring?&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Just as the author would improve their writing to make it easier for the readers to understand, developers should also improve their code to make it easier for other developers to understand.&lt;/p&gt;

&lt;p&gt;My advice to those in a team where you’re constantly cranking out new features, consider setting aside a sprint or two for stability. Write some unit tests to increase your code coverage and refactor some code to make your apps more robust. I know it might seem like it’ll slow down development time, but it’ll actually increase your team’s efficiency and output in the long run.&lt;/p&gt;

&lt;p&gt;Thanks for reading! Originally posted on &lt;a href="https://medium.com/santora-nakama/refactoring-code-e61ff3f32f40" rel="noopener noreferrer"&gt;Santora Nakama&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>technicaldebt</category>
      <category>startup</category>
      <category>refactor</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Stop Console.Logging! This is How to Use Chrome to Debug JavaScript </title>
      <dc:creator>songthamtung</dc:creator>
      <pubDate>Thu, 03 Oct 2019 03:15:56 +0000</pubDate>
      <link>https://dev.to/songthamtung/stop-console-logging-this-is-how-to-use-chrome-to-debug-javascript-48nm</link>
      <guid>https://dev.to/songthamtung/stop-console-logging-this-is-how-to-use-chrome-to-debug-javascript-48nm</guid>
      <description>&lt;p&gt;If you console.log() when you debug, you’re doing it wrong. There’s an easier way and it’s right in the palm of your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sound familiar?
&lt;/h2&gt;

&lt;p&gt;Javascript is the most popular programming language according to StackOverflow’s 2019 survey. If you develop with Javascript, you’ve most likely came across a situation where you had to fix a bug or two.&lt;/p&gt;

&lt;p&gt;“No problem!” you say to your rubber ducky, let’s reproduce the bug and fix it with &lt;code&gt;console.log()&lt;/code&gt;. Now, what if I told you that this is not the best practice?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;At the end of this article, I included a TL;DR summary.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Console logging works, but there’s a better way.
&lt;/h2&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%2Fmiro.medium.com%2Fmax%2F1284%2F0%2Aj2xSdGh-CoSe0mck.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%2Fmiro.medium.com%2Fmax%2F1284%2F0%2Aj2xSdGh-CoSe0mck.jpg" alt="consolelog"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Instead of console.logging and restarting every time you want to debug, you can instead use Chrome DevTools (right click + inspect).&lt;/p&gt;

&lt;p&gt;Perhaps you’re already using it to view and modify HTML/CSS elements, monitor console logs, and measure network performance. But did you know that Chrome has a powerful built in debugging feature where you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;view source code&lt;/li&gt;
&lt;li&gt;set breakpoints&lt;/li&gt;
&lt;li&gt;step into, step over, and step out&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rest of the article is a step by step guide on how to use Chrome’s debugging feature with Angular — but feel free to follow along with your existing projects on any javascript frontend framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up your environment.
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;NOTE: If you already have an existing project, skip to the next section.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this section, we will quickly set up an Angular app using their official guide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;br&gt;
Node.js version 10.9.0 or later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1. Install Angular CLI&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;npm install -g @angular/cli&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create a workspace and initial application&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;ng new my-app&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Run the application&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;cd my-app&lt;br&gt;
ng serve --open&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will open your browser to the url localhost:4200&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F5112%2F1%2Ai4zrKrXodBww-bku1Y-1ig.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%2Fmiro.medium.com%2Fmax%2F5112%2F1%2Ai4zrKrXodBww-bku1Y-1ig.png" alt="Angularv8.2"&gt;&lt;/a&gt;Angular v8.2&lt;/p&gt;
&lt;h2&gt;
  
  
  Create the bug 🐛
&lt;/h2&gt;

&lt;p&gt;For the purposes of this demonstration, let’s create a bug and then debug it ;).&lt;/p&gt;

&lt;p&gt;Open your favorite text editor and navigate to &lt;code&gt;src/app/app.component.ts&lt;/code&gt;&lt;br&gt;
Replace the lines with the following and save.&lt;/p&gt;


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


&lt;p&gt;Look at the browser again and you should see a bug!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F2320%2F1%2AIYuf_CG-_x_wSORoFhA8Vg.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%2Fmiro.medium.com%2Fmax%2F2320%2F1%2AIYuf_CG-_x_wSORoFhA8Vg.png" alt="bug"&gt;&lt;/a&gt;&lt;br&gt;
[object Object] is simply the default return value when converting a POJO (plain old javascript object) to a string. This is not a desired outcome — so let’s fix it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Debug Mode 🔴
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Inspect the sources&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F2400%2F0%2Aey2hTBkRuJzU1bb7.gif" 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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2Aey2hTBkRuJzU1bb7.gif" alt="inspect"&gt;&lt;/a&gt;&lt;br&gt;
Using Chrome, &lt;code&gt;right click &amp;gt; inspect &amp;gt; sources &amp;gt; cmd + p &amp;gt; search file&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If done correctly, this will take you to the source code, where the bug lurks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Set breakpoints&lt;/strong&gt;&lt;br&gt;
Setting breakpoints is vital to debugging effectively. A breakpoint is an intentional pause in a program, which allows the developer to inspect the internal state of the application at that moment. You can use it to view variables and perform other debugging functions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A breakpoint is an intentional pause in a program, which allows the developer to inspect the internal state of the application at that moment.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To set a breakpoint, click the line number where you want the program to pause. In the example below, we set it at line 9.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F5112%2F1%2AfKzayBe8_Zoo8KKNY_S_jg.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%2Fmiro.medium.com%2Fmax%2F5112%2F1%2AfKzayBe8_Zoo8KKNY_S_jg.png" alt="breakpoint"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Refresh the browser and you should see “Paused in debugger”.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F2400%2F0%2AFZYrQcapj0RaeirX.gif" 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%2Fmiro.medium.com%2Fmax%2F2400%2F0%2AFZYrQcapj0RaeirX.gif" alt="pause"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hover your mouse over the variable author— it should be undefined. The reason that it’s undefined is because the program hasn’t reached this line yet. It finished executing line 8 and is about to reach line 9.&lt;/p&gt;

&lt;p&gt;Press ▶️ to continue execution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Step into, step over, and step out.&lt;/strong&gt;&lt;br&gt;
These basic 3 steps is the bread and butter for debugging.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Step into&lt;/em&gt; is when the debugger steps into or inside a function&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Step over&lt;/em&gt; is when the debugger steps to the next line&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Step out&lt;/em&gt; is when the debugger steps outside the current function&lt;/li&gt;
&lt;/ul&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%2Fmiro.medium.com%2Fmax%2F2400%2F1%2An-4jo-FOec2rlBB4tYcXfw.gif" 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%2Fmiro.medium.com%2Fmax%2F2400%2F1%2An-4jo-FOec2rlBB4tYcXfw.gif" alt="s3"&gt;&lt;/a&gt;&lt;/p&gt;
Step in, step over, and step across in action



&lt;p&gt;Refresh the browser again and once the debugger pauses at your breakpoint, step into the function using the panel on the right hand side. This will take you to the function &lt;code&gt;getAuthor()&lt;/code&gt;. Hover your mouse over obj and you will see undefined since we haven’t actually executed it yet. Step over to execute the line and hover your mouse over obj again. This time, you should see a POJO. Step out to return to the caller and now this time author is no longer undefined.&lt;/p&gt;

&lt;p&gt;Great — so we now know that author object has value. How do we fix it?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Fix the bug&lt;/strong&gt;&lt;br&gt;
Replace line 10 with the following and save.&lt;br&gt;
&lt;code&gt;title =&lt;/code&gt;my-app by ${this.author.name}&lt;code&gt;;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Deactivate breakpoints&lt;/strong&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%2Fmiro.medium.com%2Fmax%2F908%2F0%2A3IeQp6_SlrMg3fts.gif" 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%2Fmiro.medium.com%2Fmax%2F908%2F0%2A3IeQp6_SlrMg3fts.gif" alt="deactivate"&gt;&lt;/a&gt;&lt;br&gt;
Click &lt;em&gt;Deactivate breakpoints&lt;/em&gt;. It changes blue to indicate that it’s active. While this is set, DevTools ignores any breakpoints you’ve set.&lt;br&gt;
Refresh the page.&lt;/p&gt;

&lt;p&gt;Fixed!&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;Congratulations! You now know how to use Chrome DevTools to debug efficiently. While &lt;code&gt;console.log()&lt;/code&gt; does have a place in programming, it’s limited to modifying the source code, restarting the program, and nonstop execution. Chrome’s built in debugging tool addresses these disadvantages and offers you the ability to stop, inspect, and investigate what’s happening in the program at the specific point in time.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Open inspector, click the Sources tab, and &lt;code&gt;CMD + P&lt;/code&gt; to view your source code and set breakpoints.&lt;/p&gt;

&lt;p&gt;For more information, check out &lt;a href="https://developers.google.com/web/tools/chrome-devtools/javascript/" rel="noopener noreferrer"&gt;Google’s blog&lt;/a&gt; on this topic.&lt;/p&gt;

&lt;p&gt;Thanks for reading! Originally published on &lt;a href="https://medium.com/faun/how-to-use-chrome-to-debug-javascript-ad3c6900e8d5" rel="noopener noreferrer"&gt;Faun&lt;/a&gt;. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>debug</category>
      <category>chrome</category>
      <category>testing</category>
    </item>
    <item>
      <title>WTF is an API?</title>
      <dc:creator>songthamtung</dc:creator>
      <pubDate>Thu, 03 Oct 2019 03:15:46 +0000</pubDate>
      <link>https://dev.to/songthamtung/wtf-is-an-api-690</link>
      <guid>https://dev.to/songthamtung/wtf-is-an-api-690</guid>
      <description>&lt;p&gt;If you’re a working professional, you’ve probably heard your coworkers talk about &lt;em&gt;APIs&lt;/em&gt;, &lt;em&gt;Web Services&lt;/em&gt;, &lt;em&gt;endpoints&lt;/em&gt;, and other weird words like &lt;em&gt;200&lt;/em&gt; and &lt;em&gt;401&lt;/em&gt;. What the heck does it mean and what’s the difference between them?&lt;/p&gt;

&lt;h2&gt;
  
  
  What‘s an API?
&lt;/h2&gt;

&lt;p&gt;An &lt;strong&gt;API&lt;/strong&gt;, or application program interface, is something that enables different apps to communicate with each other. A &lt;strong&gt;Web Service&lt;/strong&gt; is a type of API that communicates over the internet.&lt;/p&gt;

&lt;p&gt;Generally, when apps communicate with each other, there is an exchange of request and response.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request is asking for something&lt;/li&gt;
&lt;li&gt;Response is the answer to a request&lt;/li&gt;
&lt;/ul&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%2Fmiro.medium.com%2Fmax%2F1422%2F1%2AIr06MoZ7aMMPM0Ca4pl98w.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%2Fmiro.medium.com%2Fmax%2F1422%2F1%2AIr06MoZ7aMMPM0Ca4pl98w.png" alt="api"&gt;&lt;/a&gt;&lt;/p&gt;
App A sends request to App B. App B sends response back to App A.



&lt;p&gt;Similar to requesting for something in real life, you may not get the response that you would like or expect. Sometimes you’re successful, and sometimes you’re not.&lt;/p&gt;

&lt;p&gt;An example of this would be Googling something. When you type something in the search engine and press enter, it performs an API request. Most of the time, Google returns a response back with millions of results, but sometimes it’s not able to find anything.&lt;/p&gt;

&lt;p&gt;As we will see in the following section, there are specific phrases that modern day techies use when they talk about APIs. Now you too, can be in the know!&lt;/p&gt;

&lt;h2&gt;
  
  
  Requests
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;“Make / Fire an API call”: make a request.&lt;/li&gt;
&lt;li&gt;“Make a GET request”: make a request to get data.&lt;/li&gt;
&lt;li&gt;“Make a POST request”: make a request to create data.&lt;/li&gt;
&lt;li&gt;“Make a PUT request”: make a request to update data.&lt;/li&gt;
&lt;li&gt;“Endpoint”: the url e.g. (&lt;a href="https://twitter.com/songthamtung" rel="noopener noreferrer"&gt;https://twitter.com/songthamtung&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;“Hit the endpoint”: perform a request at the specified url.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Response
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;“200”: The HTTP response code for Success.&lt;/li&gt;
&lt;li&gt;“301”: The HTTP response code for Redirect.&lt;/li&gt;
&lt;li&gt;“400”: The HTTP response code for Bad Request.&lt;/li&gt;
&lt;li&gt;“401”: The HTTP response code for Unauthorized.&lt;/li&gt;
&lt;li&gt;“403": The HTTP response code for Forbidden.&lt;/li&gt;
&lt;li&gt;“404”: The HTTP response code for Not Found.&lt;/li&gt;
&lt;li&gt;“500”: The HTTP response code for Internal Server Error.&lt;/li&gt;
&lt;li&gt;“504”: The HTTP response code for Timeout.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Authentication
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;“OAUTH”: a way for apps to grant permission with the use of tokens.&lt;/li&gt;
&lt;li&gt;“Token”: a form of authentication, similar to username/password.&lt;/li&gt;
&lt;li&gt;“Refresh the token”: tokens can and do expire. If you’re getting a 401, consider refreshing your API token.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  General
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;“Do they have an API?”: does their app have a way for our app to communicate with?&lt;/li&gt;
&lt;li&gt;“Open API”: available for public use.&lt;/li&gt;
&lt;li&gt;“Closed API”: not available for public use.&lt;/li&gt;
&lt;li&gt;“API limit”: some APIs have a limit on how many requests you can make within a certain period e.g. (1000 requests per day).&lt;/li&gt;
&lt;li&gt;“CRUD”: Create, Read, Update, and Delete.&lt;/li&gt;
&lt;li&gt;“Test it with Postman”: Postman is an awesome API development tool.&lt;/li&gt;
&lt;li&gt;“Header”: explains the type of data being sent.&lt;/li&gt;
&lt;li&gt;“Body”: the data being sent.&lt;/li&gt;
&lt;li&gt;“GUID”: Globally Unique Identifier that is used for distinctive records e.g. (e20f5d52–5490–4523–87c5-af46dadfe7c1).&lt;/li&gt;
&lt;li&gt;“JSON”: a type of data format characterized by {"key":"value"}&lt;/li&gt;
&lt;li&gt;“XML”: a type of data format characterized by value&lt;/li&gt;
&lt;li&gt;“REST(ful) API”: a type of API that uses REpresentational State Transfer constraints.&lt;/li&gt;
&lt;li&gt;“SOAP API”: a type of API that uses Simple Object Access Protocol and is XML-based.&lt;/li&gt;
&lt;li&gt;“GraphQL”: a query language for APIs.&lt;/li&gt;
&lt;li&gt;“Check their documentation”: most APIs have a reference page about getting started, authentication, and methods that it supports.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Tech people love using technical words. This is not done to confuse or exclude outsiders, but rather, to quickly and effectively communicate ideas, problems, and solutions.&lt;/p&gt;

&lt;p&gt;As with any languages, you can combine words to form meaningful sentences:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Yes! The API response returned a 200!”&lt;/li&gt;
&lt;li&gt;“Try creating a new user. Hit the user endpoint and make a POST request”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hopefully you are now able to understand the two sentences above. The vernacular of those in the tech field can seem daunting at first, but with time and practice, it will start to become second nature.&lt;/p&gt;

&lt;p&gt;If you have another way of communicating about APIs or you have any questions with examples above, just drop a comment below to let me know.&lt;/p&gt;

&lt;p&gt;Thanks for reading! Originally published on &lt;a href="https://read.acloud.guru/tech-talk-api-74075a21d1ef" rel="noopener noreferrer"&gt;A Cloud Guru&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>code</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Use AWS Textract with S3</title>
      <dc:creator>songthamtung</dc:creator>
      <pubDate>Wed, 02 Oct 2019 15:33:52 +0000</pubDate>
      <link>https://dev.to/songthamtung/how-to-use-aws-textract-with-s3-573p</link>
      <guid>https://dev.to/songthamtung/how-to-use-aws-textract-with-s3-573p</guid>
      <description>&lt;p&gt;This article demonstrates how to use AWS Textract to extract text from scanned documents in an S3 bucket.&lt;/p&gt;

&lt;p&gt;This goes beyond Amazon’s &lt;a href="https://docs.aws.amazon.com/textract/latest/dg/detecting-document-text.html"&gt;documentation&lt;/a&gt; — where they only use examples involving one image. Included in this blog is a sample code snippet using AWS Python SDK Boto3 to help you quickly get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Definitions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Textract&lt;/em&gt; is a service that automatically extracts text and data from scanned documents.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Simple Storage Service (Amazon S3)&lt;/em&gt; is an object storage service that offers industry-leading scalability, data availability, security, and performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


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


&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;Textract is an amazing OCR (optical character recognition) tool. It can save your team countless man hours by automating the tedious and error-prone task of manual data entry.&lt;/p&gt;

&lt;p&gt;Thanks for reading! Originally posted on &lt;a href="https://medium.com/hackernoon/how-to-use-aws-textract-to-extract-text-from-scanned-documents-in-s3-buckets-5f85e8ba0a37"&gt;Hacker Noon&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>aws</category>
      <category>textract</category>
      <category>ocr</category>
    </item>
    <item>
      <title>How to Web Scrape with Python Using 9 Lines of Code</title>
      <dc:creator>songthamtung</dc:creator>
      <pubDate>Wed, 02 Oct 2019 15:10:14 +0000</pubDate>
      <link>https://dev.to/songthamtung/how-to-web-scrape-with-python-using-9-lines-of-code-3ij7</link>
      <guid>https://dev.to/songthamtung/how-to-web-scrape-with-python-using-9-lines-of-code-3ij7</guid>
      <description>&lt;p&gt;Scraping is extracting data from websites. In this article, I will show you how to scrape links from a &lt;a href="https://www.webscraper.io/test-sites/e-commerce/allinone"&gt;test e-commerce&lt;/a&gt; site with Python 3.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;If you haven't done so already, install beautifulsoup4 and requests.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install beautifulsoup4&lt;br&gt;
pip install requests&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Start Scraping!
&lt;/h2&gt;


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


&lt;p&gt;Here is the full snippet that you can copy and paste directly to your terminal, favorite text editor, or jupyter notebook.&lt;/p&gt;

&lt;p&gt;To check if you did it correctly, the output for data should be something similar to:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{'MSI GL62VR 7RFX': '/test-sites/e-commerce/allinone/product/326', &lt;br&gt;
'Dell Vostro 15…': '/test-sites/e-commerce/allinone/product/283', &lt;br&gt;
'Dell Inspiron 17…': '/test-sites/e-commerce/allinone/product/296'}&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  That's it
&lt;/h2&gt;

&lt;p&gt;Web scraping is great and can save you plenty of time when you want to quickly extract data from websites. The examples above are used for you to quickly get started. Of course there's more to it than what I showed above e.g. (crawling, pagination, viewing the DOM, authentication, cookies, etc). This is only the tip of the iceberg 😉.&lt;/p&gt;

&lt;p&gt;Thanks for reading! Originally published on &lt;a href="https://medium.com/swlh/how-to-scrape-with-python-9784030dca67"&gt;The Startup&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>python</category>
      <category>scrape</category>
      <category>startup</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
