<?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: Ayush Pattnaik</title>
    <description>The latest articles on DEV Community by Ayush Pattnaik (@ayushpattnaik).</description>
    <link>https://dev.to/ayushpattnaik</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%2F482637%2F1b84ec53-c91a-4e08-b7fb-ded84ef01af8.png</url>
      <title>DEV Community: Ayush Pattnaik</title>
      <link>https://dev.to/ayushpattnaik</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ayushpattnaik"/>
    <language>en</language>
    <item>
      <title>Best low-key travel budget wired keyboard closest to Apple’s Magic Keyboard experience</title>
      <dc:creator>Ayush Pattnaik</dc:creator>
      <pubDate>Tue, 24 Mar 2026 16:48:20 +0000</pubDate>
      <link>https://dev.to/ayushpattnaik/best-low-ley-travel-budget-wired-keyboard-closest-to-apples-magic-keyboard-experience-4n99</link>
      <guid>https://dev.to/ayushpattnaik/best-low-ley-travel-budget-wired-keyboard-closest-to-apples-magic-keyboard-experience-4n99</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Scroll to bottom if you want to skip the story and see the results…&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With a lot of typing and coding lately, I faced a dilemma some time back between choosing an external keyboard for my day-to-day use. My foremost priority was getting a keyboard closest to Mac’s magic keyboard to increase my typing speed and accuracy, and avoiding the need to switch between two different kinds of keyboards back and forth.&lt;/p&gt;

&lt;p&gt;I tried my friend’s AULA mechanical keyboard and liked it. But little did I know about red/blue/brown switches or key travel back then. So there began my research into keyboards. I discovered many mechanical keyboards like Keychron, AntSports and Redragon, but the major conclusion which I derived was that it is not for me, and it will just slow me down or most mac users for that matter.&lt;/p&gt;

&lt;p&gt;Next, I knew I needed a low-key travel keyboard since I was already accustomed to Mac’s keyboard for the last 6 years. And then there came the two market winners.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx4b6x8svdka116e0908y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx4b6x8svdka116e0908y.png" alt="https://dal20402.net/keyboards-top.jpg" width="640" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was stuck between getting a Logitech MX keys S or an official Apple magic keyboard, both costing over $100. Again, I took a deeper dive into both the keyboards, and the clear winner for Mac users was Apple’s Magic keyboard for just one feature — its Touch ID. Other than that, everything was almost similar between the two. Mac users just wanted to pay extra bucks for that one touch ID because it is a lot helpful in filling passwords and keychain apps when your Mac lid is shut, and you are using an external monitor.&lt;/p&gt;

&lt;p&gt;And then one day, by accident at my workplace, I discovered this very generic &amp;amp; normal-looking keyboard called the Dell KB216 keyboard. It was just so satisfying to type, and exactly what I was looking for in a keyboard: low-key travel and the magic keyboard feel. I also got a similar typing speed. So without delay, I went ahead with ordering one. And the best part is I got $5.8. It would not cost under $10, depending on your country.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foebe4xqundxmw238bw1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foebe4xqundxmw238bw1v.png" alt="Dell KB216" width="640" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;center&gt;Dell KB216&lt;/center&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrakuefenm9dvlfpquci.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzrakuefenm9dvlfpquci.png" alt="Dell KB216 typing speed test)" width="640" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;center&gt;Dell KB216 typing speed test&lt;/center&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1j66kw9m3j9dwcmpa2vc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1j66kw9m3j9dwcmpa2vc.png" alt="Native Mac keyboard typing speed test" width="786" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;center&gt;Native Mac keyboard typing speed test&lt;/center&gt;




&lt;p&gt;I repeat, this is not the best keyboard comparison post, it is a best budget keyboard (Dell KB216 keyboard) you can get if you are a Mac user and don’t want to feel much of an alien with an external keyboard.&lt;/p&gt;

</description>
      <category>devjournal</category>
    </item>
    <item>
      <title>The nextLine() culprit in Java</title>
      <dc:creator>Ayush Pattnaik</dc:creator>
      <pubDate>Wed, 11 Mar 2026 10:19:32 +0000</pubDate>
      <link>https://dev.to/ayushpattnaik/the-nextline-culprit-in-java-cl5</link>
      <guid>https://dev.to/ayushpattnaik/the-nextline-culprit-in-java-cl5</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Scanner&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Scanner&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;in&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What do you do when you want to read an int in Java?  You would probably write &lt;strong&gt;sc.nextInt()&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And what about string? You would say &lt;strong&gt;sc.next()&lt;/strong&gt; or &lt;strong&gt;sc.nextLine()&lt;/strong&gt;;&lt;/p&gt;

&lt;p&gt;But if you are reading a line(series of strings) next, you would probably fall into a common pitfall where the line won't be read.  If you use nextInt() or next() before nextLine(), the newline remains in the buffer.&lt;/p&gt;

&lt;p&gt;Let me explain, suppose we read an integer and a line in the below format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5 
Hello World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You would probably write :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextInt&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextLine&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;//the problem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;String s&lt;/code&gt; here becomes empty because it actually reads the leftover &lt;code&gt;newline(\n)&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;You example input actually looks like this internally in the buffer :&lt;br&gt;
&lt;code&gt;['5', '\n', 'H', 'e', 'l', 'l', 'o', '\n']&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Since &lt;code&gt;nextLine()&lt;/code&gt; reads till &lt;code&gt;newline&lt;/code&gt;. So, what &lt;code&gt;nextLine()&lt;/code&gt;does here is just read the first &lt;code&gt;\n&lt;/code&gt;. So the string s becomes an empty string. &lt;br&gt;
&lt;code&gt;s = ""&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  What is the fix?
&lt;/h3&gt;

&lt;p&gt;You need to consume the leftover line after 5. So what you have to do is simply move the &lt;code&gt;nextLine()&lt;/code&gt; and read the line with &lt;code&gt;nextLine()&lt;/code&gt; again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextInt&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextLine&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;     &lt;span class="c1"&gt;// removes leftover '\n'&lt;/span&gt;
&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextLine&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;So basically&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;nextInt() → reads number, leaves newline&lt;br&gt;
next()    → reads word, leaves newline&lt;br&gt;
nextLine()→ reads everything until newline&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;That is why many programmers avoid Scanner entirely and use BufferedReader instead.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Is your database choking?</title>
      <dc:creator>Ayush Pattnaik</dc:creator>
      <pubDate>Mon, 17 Nov 2025 13:43:51 +0000</pubDate>
      <link>https://dev.to/ayushpattnaik/is-your-database-choking-hjh</link>
      <guid>https://dev.to/ayushpattnaik/is-your-database-choking-hjh</guid>
      <description>&lt;p&gt;Do you see a surge in user read requests and your database struggling to keep up with the demand?&lt;/p&gt;

&lt;p&gt;This is where you need to think about "read replicas".&lt;/p&gt;

&lt;p&gt;Imagine a chef who has to take orders and cook food. Can he handle all customers during rush hour?&lt;/p&gt;

&lt;p&gt;That’s why there are waiters. They take orders, relay them to the chef, and keep him free to focus on what he does best.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your primary database is the chef.&lt;br&gt;
Your read replicas are the waiters.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8s21c31dymu4uhkhdwg1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8s21c31dymu4uhkhdwg1.gif" alt="Read Replica" width="640" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Instead of letting the primary database struggle with both read and write requests, you offload the read-heavy traffic to a read replica : an exact copy of your primary database whose sole purpose is to serve read queries. It maintains an asynchronous link with the primary DB and is incredibly useful in dashboards, reporting modules, and analytical workloads.&lt;/p&gt;

&lt;p&gt;This small architectural shift makes a huge difference, especially in read-heavy applications or anything that constantly fetches data.&lt;/p&gt;

</description>
      <category>database</category>
      <category>performance</category>
    </item>
    <item>
      <title>How to run Adobe Flash content in 2023?</title>
      <dc:creator>Ayush Pattnaik</dc:creator>
      <pubDate>Wed, 20 Sep 2023 13:30:34 +0000</pubDate>
      <link>https://dev.to/ayushpattnaik/how-to-run-adobe-flash-content-in-2023-1468</link>
      <guid>https://dev.to/ayushpattnaik/how-to-run-adobe-flash-content-in-2023-1468</guid>
      <description>&lt;p&gt;Adobe Flash was discontinued in 2020, but I still stumble upon websites which contain content in Adobe Flash.&lt;/p&gt;

&lt;h2&gt;
  
  
  So is there a hack around for this?
&lt;/h2&gt;

&lt;p&gt;I tried this approach. Try these steps to run any flash media&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Mozila Firefox.&lt;/li&gt;
&lt;li&gt;Go to the website which has the flash media content.&lt;/li&gt;
&lt;li&gt;Right-click on the page and select View Page Info&lt;/li&gt;
&lt;li&gt;Under Media Tab select the file with .swf type and save it.&lt;/li&gt;
&lt;li&gt;Download Cleanflash from &lt;a href="https://dl.dropboxusercontent.com/s/jxobqr9nf2uext5/CleanFlash_34.0.0.192_Installer.exe" rel="noopener noreferrer"&gt;here&lt;/a&gt; .&lt;/li&gt;
&lt;li&gt;Install it&lt;/li&gt;
&lt;li&gt;You can see the Flash Player icon on desktop. Open it.&lt;/li&gt;
&lt;li&gt;Cick on File -&amp;gt; Open and set the path of the downloaded swf file.&lt;/li&gt;
&lt;li&gt;Done!!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Volla, a pretty easy hack for flash medias.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How fast is Golang?</title>
      <dc:creator>Ayush Pattnaik</dc:creator>
      <pubDate>Mon, 13 Feb 2023 20:48:31 +0000</pubDate>
      <link>https://dev.to/ayushpattnaik/how-fast-is-golang-385</link>
      <guid>https://dev.to/ayushpattnaik/how-fast-is-golang-385</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Golang is a compiled language, which means that it compiles down to machine code. Because Golang's syntax is similar to C, the compiled machine code is readable by humans and compilers. If you're using a Go compiler from the command line, you can use the -benchmark flag to measure performance. The benchmark program we ran was for a standard math function that takes three arguments and returns one result. We used time as the unit of measurement because it's easy to express in machine instructions per second (MIPS). There are many kinds of benchmarking tools, some good ones being SPECjvm98 and SPECfp99&lt;/p&gt;

&lt;h2&gt;
  
  
  Golang is a compiled language, which means that it compiles down to machine code.
&lt;/h2&gt;

&lt;p&gt;Golang is a compiled language, which means that it compiles down to machine code. This is because you can't change the source code once it's been written by the compiler. If you wanted to add new features or change how your program works, you'd have to re-compile everything again.&lt;/p&gt;

&lt;p&gt;Because of this, compiled languages are generally faster than interpreted ones like Python and JavaScript (which run on top of another language). In fact, some benchmarks show that Golang can be up to 30 times faster than C++!&lt;/p&gt;

&lt;h2&gt;
  
  
  Because Golang's syntax is similar to C, the compiled machine code is readable by humans and compilers.
&lt;/h2&gt;

&lt;p&gt;Because Golang's syntax is similar to C, the compiled machine code is readable by humans and compilers. Compiled languages have a readable machine code that can be read by humans, so it's easier for programmers to understand what their program does.&lt;/p&gt;

&lt;p&gt;Go's syntax is also easy for humans to read because it uses more English words rather than technical jargon (e.g., "stack"). This makes it easier for non-programmers like you or me who may not have any experience with programming languages before reading this article!&lt;/p&gt;

&lt;h2&gt;
  
  
  If you're using a Go compiler from the command line, you can use the &lt;code&gt;-benchmark&lt;/code&gt; flag to measure performance.
&lt;/h2&gt;

&lt;p&gt;If you're using a Go compiler from the command line, you can use the &lt;code&gt;-benchmark&lt;/code&gt; flag to measure performance.&lt;/p&gt;

&lt;p&gt;This flag tells your program that it should run a benchmark and output results before execution continues. For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ go run -gcflags="-gc panic" main.go&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;will run an unoptimized version of your code and then wait for another process to start up with full memory access rights (the "g" flag). Once it has been started, this new process will then be compared against your nonoptimized version of main(). This comparison will give us some indication of how long each execution took as well as which method was slower than others due to garbage collection pauses or other factors such as CPU saturation caused by running too many goroutines simultaneously on single core machines like laptops or phones!&lt;/p&gt;

&lt;h2&gt;
  
  
  The benchmark program we ran was for a standard math function that takes three arguments and returns one result.
&lt;/h2&gt;

&lt;p&gt;For our benchmark, we ran the program with the go command.&lt;/p&gt;

&lt;p&gt;The benchmark program was written in Go and compiled with the go command. It then ran on a Macbook Pro (1.8GHz Intel Core i5 processor) running at 1,024x768 resolution at 60fps rate in full screen mode.&lt;/p&gt;

&lt;h2&gt;
  
  
  We used time as the unit of measurement because it's easy to express in machine instructions per second (MIPS).
&lt;/h2&gt;

&lt;p&gt;We used time as the unit of measurement because it's easy to express in machine instructions per second (MIPS).&lt;/p&gt;

&lt;p&gt;You could, for example, use a measure like "$1 billion" or "$100 million", but these units are not as easy to communicate with computer programs. In contrast, you can easily say "two million milliseconds" or "one million seconds", which means that time always has this fixed relationship when talking about software performance: A program running at 1 MIPS will take twice as long to complete its task than one running at 2 MIPS or 3 MIPS and so on.&lt;/p&gt;

&lt;h2&gt;
  
  
  There are many kinds of benchmarking tools, some good ones being SPECjvm98 and SPECfp99.
&lt;/h2&gt;

&lt;p&gt;There are many kinds of benchmarking tools, some good ones being SPECjvm98 and SPECfp99.&lt;/p&gt;

&lt;p&gt;SPECjvm98 is a benchmark that measures the performance of Java Virtual Machines (JVMs). It was developed by IBM Research and maintains an archive with results dating back to 1998.&lt;/p&gt;

&lt;p&gt;SPECfp99 measures floating point operations per second on Intel processors while SPECcpu2006 measures general purpose processors as well as microprocessors and other devices such as graphics cards.&lt;/p&gt;

&lt;h2&gt;
  
  
  In terms of raw speed, C++ wins hands down over any other compiled language.
&lt;/h2&gt;

&lt;p&gt;The most important thing to know about C++ is that it's the fastest language. It has been proven time and time again to be the most efficient language in terms of raw speed, which means that any program written in it will run faster than any other compiled language. This is due to the fact that C++ compiles down into machine code, which means there are no parsing steps involved when interpreting your code.&lt;/p&gt;

&lt;p&gt;While this may seem like an advantage at first glance (since you're not dealing with a bunch of overhead), it can also lead to issues like memory leaks and resource exhaustion if your program isn't carefully constructed or managed properly by its developer(s). So while this could be seen as an advantage for those who aren't concerned about these things—or even understand what they mean—it's actually something worth looking out for when considering whether or not Golang is right for you!&lt;/p&gt;

&lt;h2&gt;
  
  
  Golang is fast but not as fast as C++
&lt;/h2&gt;

&lt;p&gt;Golang is fast but not as fast as C++.&lt;/p&gt;

&lt;p&gt;C++ is the fastest compiled language, which means it comes out ahead of Go in terms of performance. That said, Go does have some advantages over other languages like Java and C#: for example, it’s easier to write programs with concurrency (the ability to run multiple tasks at once). This can be especially important when writing web applications that may need multiple users or devices accessing them simultaneously.&lt;/p&gt;

&lt;p&gt;The good news is that there are some ways you can get around its limitations without sacrificing too much efficiency on your side!&lt;/p&gt;

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

&lt;p&gt;Golang is fast but not as fast as C++. Despite being a compiled language like C, most of the time spent in Golang programs is spent in the runtime system and libraries. As we've seen above, this can slow down your program significantly. For example, if you're benchmarking a math function that takes three arguments and returns one result (like we did), you'll find that Golang's performance is not quite as good as C++'s because it spends more time handling memory allocation and garbage collection than it does on compiling code into machine instructions.&lt;/p&gt;

</description>
      <category>vibecoding</category>
    </item>
    <item>
      <title>SSH - An article by ChatGPT</title>
      <dc:creator>Ayush Pattnaik</dc:creator>
      <pubDate>Mon, 13 Feb 2023 20:29:29 +0000</pubDate>
      <link>https://dev.to/ayushpattnaik/ssh-an-article-by-chatgpt-2dbn</link>
      <guid>https://dev.to/ayushpattnaik/ssh-an-article-by-chatgpt-2dbn</guid>
      <description>&lt;p&gt;Secure Shell (SSH) is a network protocol used for secure data communication, remote command-line login, remote command execution, and other secure network services between two networked computers. SSH provides a secure and encrypted connection between two systems, which is essential for protecting sensitive data from being intercepted by third parties.&lt;/p&gt;

&lt;p&gt;SSH was originally developed as a replacement for Telnet and other insecure remote shell protocols. Telnet sends data in clear text, which means that if someone were to intercept the data being sent, they would be able to read it without any difficulty. SSH, on the other hand, encrypts the data being sent, making it much more secure.&lt;/p&gt;

&lt;p&gt;The encryption used in SSH is based on public-key cryptography. The two systems that are communicating with each other each have a public and a private key. The public key is used to encrypt the data being sent, while the private key is used to decrypt it. This means that even if someone were to intercept the data being sent, they would not be able to read it without the private key.&lt;/p&gt;

&lt;p&gt;One of the key features of SSH is its ability to authenticate the two systems that are communicating with each other. This is done through the use of a password or a digital certificate. The digital certificate contains a public key and is issued by a trusted certificate authority. This provides an extra layer of security, as it ensures that the systems are communicating with each other and not with a third party.&lt;/p&gt;

&lt;p&gt;In addition to its security features, SSH also provides several other benefits. One of these benefits is the ability to remotely execute commands on a remote system. This can be useful for administering a server or performing other tasks on a remote system. Another benefit is the ability to forward network connections. This means that you can use SSH to securely connect to another system and then use that connection to access other systems on the network.&lt;/p&gt;

&lt;p&gt;To use SSH, you need to have an SSH client installed on your system. There are many different SSH clients available, including PuTTY for Windows and OpenSSH for Linux and macOS. Once you have an SSH client installed, you can connect to a remote system using its hostname or IP address. You will also need to provide your username and password (or your digital certificate) to authenticate yourself to the remote system.&lt;/p&gt;

&lt;p&gt;In conclusion, SSH is an essential tool for secure communication between two systems. It provides a secure and encrypted connection, as well as the ability to authenticate the systems that are communicating with each other. Whether you're administering a server or just need to securely access another system, SSH is a must-have tool for any network administrator.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to run C++ on Silicon Mac M1 / M2 / M3 / M4</title>
      <dc:creator>Ayush Pattnaik</dc:creator>
      <pubDate>Sun, 06 Jun 2021 19:41:32 +0000</pubDate>
      <link>https://dev.to/ayushpattnaik/running-c-17-on-mac-m1-47cp</link>
      <guid>https://dev.to/ayushpattnaik/running-c-17-on-mac-m1-47cp</guid>
      <description>&lt;h2&gt;
  
  
  Having problems using &lt;code&gt;STL&lt;/code&gt; functions_ of &lt;code&gt;C++14&lt;/code&gt; or &lt;code&gt;C++17&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;Wrote a piece of code in &lt;code&gt;C++&lt;/code&gt; and encountered that &lt;code&gt;STL&lt;/code&gt; functions are not supported by the default clang compiler on Mac? &lt;br&gt;
For example, this piece of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt;&lt;span class="cpf"&gt;&amp;lt;bits/stdc++.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;gcd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;cout&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compiling the code with &lt;code&gt;gnu&lt;/code&gt; or &lt;code&gt;clang&lt;/code&gt; compilers and getting this error?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;@User-MacBook-Air % clang++ test.cpp
test.cpp:5:11: error: use of undeclared identifier &lt;span class="s1"&gt;'gcd'&lt;/span&gt;
    int &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gcd&lt;span class="o"&gt;(&lt;/span&gt;2,3&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          ^
1 error generated.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  So what happened here?
&lt;/h2&gt;

&lt;p&gt;Let's check our &lt;code&gt;c++&lt;/code&gt; version.&lt;/p&gt;

&lt;p&gt;When you run &lt;code&gt;clang --version&lt;/code&gt;, you will get something like this and would be pretty confused even if your &lt;code&gt;clang/gnu&lt;/code&gt; is up-to-date but you still can't figure out your &lt;code&gt;c++&lt;/code&gt; version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   Apple clang version 12.0.5 &lt;span class="o"&gt;(&lt;/span&gt;clang-1205.0.22.9&lt;span class="o"&gt;)&lt;/span&gt;
   Target: arm64-apple-darwin20.4.0
   Thread model: posix
   InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  This happens because
&lt;/h3&gt;

&lt;p&gt;The gcd() function is a STL function from c++14 and above.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;But by default, Clang builds &lt;code&gt;C++&lt;/code&gt; code according to the &lt;code&gt;C++98&lt;/code&gt; standard, with many &lt;code&gt;C++11&lt;/code&gt; features accepted as extensions.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What to do?
&lt;/h3&gt;

&lt;p&gt;After going through many websites and resources, I was finally able to compile the correct methods to use c++17 on mac.&lt;br&gt;
So in order to use STL functions of &lt;code&gt;c++17&lt;/code&gt; or &lt;code&gt;c++14&lt;/code&gt; or upper versions, you need to specify the version of C++ to be used which goes like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nt"&gt;-std&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;c++&lt;span class="o"&gt;{&lt;/span&gt;version&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;filename&lt;span class="o"&gt;}&lt;/span&gt;.cpp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;appending the c++ version to -std option.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;For &lt;code&gt;clang&lt;/code&gt; compilers:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
 clang++ &lt;span class="nt"&gt;--std&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;c++17 &lt;span class="o"&gt;{&lt;/span&gt;filename&lt;span class="o"&gt;}&lt;/span&gt;.cpp

&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;For &lt;code&gt;gnu&lt;/code&gt; compilers:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
 g++ &lt;span class="nt"&gt;--std&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gnu++17 &lt;span class="o"&gt;{&lt;/span&gt;filename&lt;span class="o"&gt;}&lt;/span&gt;.cpp

&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;My &lt;strong&gt;Personal choice&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
 c++ &lt;span class="nt"&gt;--std&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;gnu++17 &lt;span class="o"&gt;{&lt;/span&gt;filename&lt;span class="o"&gt;}&lt;/span&gt;.cpp

&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;And that's it, you're done!&lt;/p&gt;

&lt;p&gt;Also free feel to share other ways in the comments!!!&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>codenewbie</category>
      <category>programming</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
